このページは大阪弁化フィルタによって翻訳生成されたんですわ。

翻訳前ページへ


Scripting News: on main (flIncludeHistory=true, flBoxVisible=true, adrTemplate=@radio2Suite.data.homePageEditBox, flWaitForPublish=true, flFeedMenuScript=true, flHistoryEditInPopup=true)
The Wayback Machine - http://web.archive.org/web/20130425163531/http://changes.scripting.com/
Click here to show or hide the menubar.

Home >  Archive >  2010 >  September >  14

Previous / Next

on main (flIncludeHistory=true, flBoxVisible=true, adrTemplate=@radio2Suite.data.homePageEditBox, flWaitForPublish=true, flFeedMenuScript=true, flHistoryEditInPopup=true)
By Dave Winer on Tuesday, September 14, 2010 at 9:31 AM.
" permalink

t.titleLinkEnclosurePrompt = t.titleLinkEnclosurePrompt + ", " + string.lower (elementname) permalink

t.titleLinkEnclosurePrompt = t.titleLinkEnclosurePrompt + "." permalink

bundle //add the tweetbox permalink

local (s) permalink

t.lastTweetByThisUser = "" permalink

t.initialText = "" permalink

t.ctChars = sizeof (t.storyDescription) + sizeof (t.storyUrlShortened) //8/19/11 by DW permalink

t.prompt = "Post to \"" + adrfeed^.prefs.title + ":\"" permalink

bundle //xmlicon permalink

t.xmlIcon = "" permalink

t.twitterFeedIcon = "" permalink

if defined (adrfeed^.stats.feedUrl) permalink

if sizeof (adrfeed^.stats.feedUrl) > 0 permalink

local (url = radio2Suite.data.strings.xmlviewerUrl + adrfeed^.stats.feedUrl)  permalink

t.xmlIcon = "" + imgXmlMini + "" permalink

url = "pingTwitterFeed?url=" + string.urlencode (url) permalink

 permalink

local (myurl = "http://" + pta^.host + pta^.path) //3/28/11 by DW permalink

url = "http://" + adrdata^.prefs.domainRadioReallySimpleApp + "/dancewithtwitter?feed=" + string.urlencode (adrfeed^.stats.feedUrl) + "&returnto;=" + string.urlencode (myurl) permalink

 permalink

url = radio2Suite.utilities.getTwitterUrl (adruser, adrfeed) //4/20/11 by DW permalink

 permalink

local (confirmation = "Would you like to connect this feed to your Twitter account?") permalink

t.twitterFeedIcon = "" + imgTwitter + "" permalink

bundle //t.linkIcon, 3/11/11 by DW permalink

if sizeof (t.storyUrl) > 0 permalink

t.linkIcon = radio2Suite.utilities.getFavIconHtml (t.storyUrl) permalink

else permalink

t.linkIcon = "" permalink

bundle //t.podcastIcon, 3/11/11 by DW permalink

bundle //determine if the title/link boxes are visible initially, 3/11/11 by DW permalink

if sizeof (t.storytitle) > 0 //title/link boxes are visible initially, so the user can see the title permalink

t.titleLinkExpansionState = "" permalink

t.initialWedgeUrl = "http://scripting.com/images/2011/11/11/wedgeDown.gif" permalink

else permalink

t.titleLinkExpansionState = "none" permalink

t.initialWedgeUrl = "http://scripting.com/images/2011/11/11/wedgeRight.gif" permalink

t.historyText = historytext //12/24/10 by DW permalink

if t.storyUrlShortened == "" //2/18/11 by DW permalink

t.storyUrlShortened = t.storyUrl permalink

bundle //t.editBoxExpansionState, 3/22/11 by DW permalink

s = string.multiplereplaceall (string (adrTemplate^), @t, false, "<%", "%>") permalink

add (s) permalink

return (htmltext) permalink

local (pta = html.getpagetableaddress (), adrdata = radio2suite.init (), t, historytext = "", adrpost = nil, adrfeed, args, adruser, username) permalink

scratchpad.radio2params = pta^ //debugging permalink

local (imgXmlMini, imgEdit, imgDelete, imgTwitterFeed, imgTwitter, now = clock.now (), flPromptEnabled = true, flTitleLinkBoxesVisible = true, idHistoryHIghlight = 0) permalink

pta^.title = "Home" //3/8/11 by DW permalink

new (tabletype, @pta^.radio2) //8/15/11 by DW permalink

bundle //set images html permalink

imgXmlMini = string (radio2Suite.data.html.xml) permalink

imgEdit = string (radio2Suite.data.html.editIcon) permalink

imgDelete = string (radio2Suite.data.html.deleteIcon) permalink

imgTwitterFeed = string (radio2Suite.data.html.twitterFeedIcon) permalink

imgTwitter = string (radio2Suite.data.html.twitterIcon) permalink

if not radio2Suite.securityChallenge (@adruser) permalink

return ("") permalink

bundle //set args, based on method, 1/4/11 by DW permalink

new (tabletype, @args) permalink

case pta^.method permalink

"GET" permalink

webserver.parseargs (pta^.searchargs, @args) permalink

if defined (args.title) //we came in through the bookmarklet permalink

if adruser^.prefs.flTitleCleanup permalink

args.title = string.trimwhitespace (args.title) //1/19/11 by DW permalink

args.title = string.multiplereplaceall (args.title, @radio2Suite.data.titleNoise) //2/21/11 by DW permalink

if args.title contains "|" //2/23/11 by DW permalink

args.title = string.nthfield (args.title, "|", 1) permalink

args.title = string.addPeriodToSentence (args.title) //2/23/11 by DW permalink

args.description = string.trimwhitespace (args.description) permalink

if sizeof (args.description) == 0 permalink

args.description = args.title permalink

args.title = "" permalink

"POST" permalink

if not defined (pta^.postArgs) //4/13/12 by DW permalink

if string.lower (pta^.requestHeaders.["Content-type"]) beginsWith "multipart/form-data" permalink

mainResponder.parseMultipart (pta) //parse multipart form into adrparamtable^.postArgs permalink

else permalink

new (tabletype, @pta^.postArgs) permalink

webserver.parseArgs (pta^.requestBody, @pta^.postArgs) permalink

 permalink

args = pta^.postargs //3/1/11 by DW permalink

 permalink

if args.storyUrl == "" //2/18/11 by DW permalink

if args.storyUrlShortened != "" permalink

args.storyUrl = args.storyUrlShortened permalink

args.storyUrlShortened = "" permalink

else permalink

scripterror ("Can't process the request because the method is not GET or POST.") permalink

bundle //set adrfeed to default value permalink

on setadrfeed () permalink

try permalink

if defined (args.feedMenu) permalink

adrfeed = @adruser^.feeds.[args.feedMenu] //1/13/11 by DW permalink

if defined (adrfeed^) permalink

adruser^.stats.lastFeedSelected = args.feedMenu permalink

return permalink

adrfeed = @adruser^.feeds.[adruser^.stats.lastFeedSelected] permalink

if defined (adrfeed^) permalink

return permalink

adrfeed = @adruser^.feeds [1] permalink

if sizeof (adruser^.feeds) == 0 permalink

scripterror ("Can't edit a feed because none have been defined.") permalink

setadrfeed () permalink

on decode (s) permalink

return (string.multiplereplaceall (s, @xml.rss.data.replaceTable, false)) permalink

on encode (s) permalink

return (string.urlencode (s, true)) permalink

on cleanupfilename (fname) permalink

local (i, ch) permalink

for i = sizeof (fname) downto 1 permalink

fname = string.innerCaseName (fname) permalink

return (fname) permalink

 permalink

on getUploadType (fname, type) //7/5/11 by DW permalink

if string.lower (type) == "binary/octet-stream" permalink

local (extension = string.nthfield (fname, ".", string.countfields (fname, "."))) permalink

local (adrtype = @user.webserver.prefs.ext2MIME.[extension]) permalink

if defined (adrtype^) permalink

return (adrtype^) permalink

return (type) permalink

local (htmltext = "", indentlevel = 0) permalink

on add (s) permalink

htmltext = htmltext + string.filledstring ("\t", indentlevel) + s + "\r\n" permalink

bundle //init t permalink

new (tabletype, @t) permalink

t.storyTitle = "" permalink

t.storyUrl = "" permalink

t.storyUrlShortened = "" //2/18/11 by DW permalink

t.storyDescription = "" permalink

t.idPost = "" permalink

t.buttonTitle = "Post" permalink

t.username = username permalink

t.slogan = opmlEditor.viewSlogan (false) //11/15/11 by DW permalink

bundle //t.message permalink

if defined (args.message) permalink

t.message = args.message permalink

else permalink

t.message = "" permalink

bundle //t.newIcon, 3/11/11 by DW permalink

bundle //handle post permalink

if pta^.method == "POST" permalink

local (adr, i) permalink

if defined (args.tweetButton) //12/29/09 by DW permalink

local (adrpost, urlEnclosure = "", extradata) permalink

new (tabletype, @extradata) permalink

if defined (args.storyEnclosure) //3/1/11 by DW permalink

if (sizeof (args.storyEnclosure.filename) > 0) and (sizeof (args.storyEnclosure.data) > 0) permalink

local (fname = cleanupfilename (args.storyEnclosure.filename)) permalink

local (relpath = file.getdatepath ("/", now) + fname) permalink

local (type = getUploadType (fname, args.storyEnclosure.["Content-Type"])) //7/5/11 by DW permalink

urlEnclosure = radio2Suite.writeStaticFile (adruser, relpath, @args.storyEnclosure.data, type) permalink

bundle //process extra items, 3/13/11 by DW permalink

local (adrarg) permalink

for adrarg in @args permalink

if string.lower (nameof (adrarg^)) beginswith "extra." permalink

local (name = string.delete (nameof (adrarg^), 1, 6)) permalink

if typeof (adrarg^) == tabletype //it's a file to be uploaded permalink

if sizeof (adrarg^.data) > 0 permalink

local (fname = cleanupfilename (adrarg^.filename)) permalink

local (relpath = file.getdatepath ("/", now) + fname) permalink

local (type = getUploadType (fname, adrarg^.["Content-Type"])) //7/5/11 by DW permalink

extradata.[name] = radio2Suite.writeStaticFile (adruser, relpath, adrarg^.data, type) permalink

else permalink

extradata.[name] = string (adrarg^) permalink

if radio2Suite.findPost (adrfeed, args.idPost, @adrpost) permalink

radio2Suite.editPost (adrpost, args.storyTitle, args.storyUrl, args.storyDescription, urlEnclosure, @extradata) permalink

bundle //this happens if the user adds a link after editing, 3/17/11 by DW permalink

local (flnotshortened) permalink

bundle //set flnotshortened, 7/12/12 by DW permalink

if defined (adrpost^.linkShortened) permalink

flnotshortened = sizeof (adrpost^.linkShortened) == 0 permalink

else permalink

flnotshortened = true permalink

if (sizeof (adrpost^.link) > 0) and flnotshortened //(sizeof (adrpost^.linkShortened) == 0) permalink

if radio2Suite.shortener.enabled (adruser)  permalink

radio2Suite.shortenPostLink (adrpost, adruser) //3/9/12 by DW permalink

t.storyTitle = args.storyTitle permalink

t.storyUrl = args.storyUrl permalink

t.storyDescription = args.storyDescription permalink

t.idPost = args.idPost permalink

t.buttonTitle = "Save" permalink

idHistoryHIghlight = args.idPost //3/13/11 by DW permalink

else //2/22/11 by DW -- rewrite permalink

adrpost = radio2Suite.newPost (adrfeed, args.storyTitle, args.storyUrl, args.storyUrlShortened, args.storyDescription, urlEnclosure, @extradata) permalink

if adrpost != 0 permalink

if not defined (adrpost^.linkShortened) permalink

if radio2Suite.shortener.enabled (adruser)  permalink

radio2Suite.shortenPostLink (adrpost, adruser) //3/9/12 by DW permalink

adrpost^.guid = adrpost^.linkShortened //3/16/11 by DW permalink

if adruser^.prefs.flPublishEnabled permalink

if flWaitForPublish //8/19/11 by DW permalink

radio2Suite.publish (adruser, adrfeed) permalink

else permalink

thread.callscript (@radio2Suite.publish, {adruser, adrfeed}) permalink

pta^.radio2.flSubmitButton = true //8/15/11 by DW permalink

if defined (args.goButton) //12/25/10 by DW permalink

local (adrnewfeed = @adruser^.feeds.[args.feedMenu]) permalink

if adrnewfeed != adrfeed permalink

webserver.redirect (pta, "?feed=" + args.feedMenu + "&title;=" + encode (args.storyTitle) + "&link;=" + encode (args.storyUrl) + "&description;=" + encode (args.storyDescription)) permalink

return permalink

bundle //get args if it's GET permalink

if pta^.method == "GET" permalink

local (adr, i) permalink

if defined (args.feed) permalink

adrfeed = @adruser^.feeds.[args.feed] permalink

if not defined (adrfeed^) permalink

scripterror ("There is no feed with the name \"" + args.feed + "\".") permalink

adruser^.stats.lastFeedSelected = args.feed permalink

if defined (args.idPost) //we're editing an existing post permalink

if radio2Suite.findPost (adrfeed, args.idPost, @adrpost) permalink

t.storyTitle = adrpost^.title permalink

t.storyUrl = adrpost^.link permalink

bundle //shortened urls, 2/18/11 by DW permalink

if defined (adrpost^.linkShortened) permalink

t.storyUrlShortened = adrpost^.linkShortened permalink

else permalink

if radio2Suite.shortener.enabled (adruser)  permalink

t.storyUrlShortened = radio2suite.shortener.create (t.storyUrl, adruser) permalink

adrpost^.linkShortened = t.storyUrlShortened permalink

t.storyDescription = adrpost^.description permalink

t.idPost = args.idPost permalink

t.buttonTitle = "Save" permalink

idHistoryHIghlight = args.idPost //3/12/11 by DW permalink

else permalink

if defined (args.title) permalink

t.storyTitle = decode (args.title) permalink

if defined (args.link) permalink

t.storyUrl = decode (args.link) permalink

t.storyUrl = string.removeUrlGarbage (t.storyUrl)  permalink

if radio2Suite.shortener.enabled (adruser)  permalink

t.storyUrlShortened = radio2suite.shortener.create (t.storyUrl, adruser) permalink

if defined (args.description) permalink

t.storyDescription = decode (args.description) permalink

bundle //build history table permalink

if flIncludeHistory //3/21/11 by DW permalink

t.historyExpansionState = "" permalink

else permalink

t.historyExpansionState = "none" permalink

historytext = radio2Suite.viewHistory (adruser, adrfeed, idHistoryHIghlight, flHistoryEditInPopup) permalink

bundle //set t.homePagePrompt, 11/12/11 by DW permalink

if flPromptEnabled permalink

t.homePagePrompt = "" + adruser^.prefs.homePagePrompt + "" permalink

else permalink

t.homePagePrompt = "" permalink

bundle //build feeds menu permalink

t.feedsMenuOnly = "" //9/5/11 by DW permalink

if sizeof (adruser^.feeds) > 1 permalink

local (js) //2/25/11 by DW permalink

if flFeedMenuScript //10/6/11 by DW permalink

js = string (radio2Suite.data.feedMenuScript) permalink

else permalink

js = "" permalink

local (s = "" permalink

t.feedsMenuOnly = t.feedsMenu //9/5/11 by DW permalink

else permalink

if sizeof (adruser^.feeds) == 1 permalink

local (name = nameof (adruser^.feeds [1])) permalink

t.feedsMenu = "" permalink

t.feedsMenu = t.feedsMenu + t.homePagePrompt permalink

else permalink

t.feedsMenu = "" permalink

bundle //podcast button, 3/9/11 by DW permalink

bundle //extra elements, via callbacks, 3/13/11 by DW permalink

local (adrscript, elementname, elementhtml) permalink

t.extraElements = "" permalink

t.titleLinkEnclosurePrompt = "Title, link, enclosure" permalink

for adrscript in @adrdata^.callbacks.extraHtml permalink

while typeof (adrscript^) == addresstype permalink

adrscript = adrscript^ permalink

try permalink

if adrscript^ (@elementname, @elementhtml) permalink

t.extraElements = t.extraElements + "

" + elementname + ":" + elementhtml + "
RSS feed for Scripting News
This site contributes to the scripting.com community river.


© Copyright 1997-2012 Dave Winer. Last update: Friday, July 27, 2012 at 10:47 AM Eastern. Last build: 8/26/2012; 5:56:18 PM. "It's even worse than it appears."

RSS feed for Scripting News

Previous / Next