žàXNJ$¼¼   secretSubject testSubjectN‡FFFF000000060001001777AA000000000061000000001001710190490421800000‚‚600060035E200-1‚0Â20‚‚3‚5E273FFFF0‚‚10ÂE50000100000035000000010E540840‚‚3‚5E176E5028E0005135E300002000000EA00000000E5,MailEdit allows you to add and edit posts via email, meaning that you can use any email client, or a mobile device like a Blackberry or a Sidekick to maintain your weblog anywhere. A handy way to enter the world of moblogging! 000400000009000000020E7000050000000A0000000201E70000600000031000000010ÁB20‚‚ÁFFFF0‚800000 20ÂÁ ‚‚Á‚000700000035000000020‚10Â180‚Á‚Á‚FD0 ‚10Â180‚Á‚0008000000B10000000140,Verdana40,404E44000321‚0400080‚1010000900000015000000020‚8D1740‚8D174000A00000015000000023‚5E2733‚5E273000B00000005000000020Â000C0000000E00000001E50Â60‚000F0000005200000000400 10 ‚ÂÁÂÁ‚‚ÁÂ4,77A4,h4,bund4,4,˜4,0E4,Â200130000007E00000000DA91F8CE1C1D1E1F7F1B044,-.¶µ•µ¥¥.'"‘’“”…ƒFFFF0FFFF0FFFE000000060001001777AAº^¼º^#åɵf9‡ Vº\3ļ  "5 AM Y~ ƒ¼› £author David Brown authorEmailddb@namshub.org description² homePageUrl!http://radio.weblogs.com/0100039/nameMailEdit releaseDateversion1.1.0b5 ›Verdanaº\3ú\3Ã%ò]ºÛLANDÿÿÿÿÿÿwinThis script runs every hour. „›Verdanaº\3ú\3Ã%ò]ºÛLANDÿÿÿÿÿÿwinThis script runs every minute. „œVerdanaº\3ú\3Ã%ò]ºÛLANDÿÿÿÿÿÿwinThis script runs every night. „œ{w.º\3ú\3à  ". 9 everyHour] everyMinute everyNight­{ º\3ú\3à º\3ü—` º\3ú\3à nj.º\3ú\3à  ' ,fileMenu Üradio user 4np`œCVerdana92º]ÂÁ¼°æ(¦ÖLANDÿÿÿÿÿÿwinon checkMailCallback(adrmsg) callback method for the mail-to-weblog code 1/3/04; 11:28:09 PM by ddb fixed some possible bugs, added "category" as a synonym for a singular category, and added better email response to the publish directive. 11/8/03; 10:10:31 pm by ddb added "publish" directive 3/11/03; 5:57:36 PM by ddb fixed error in newDirectives -- didn't recognize end of string 2/27/03; 9:05:35 pm by ddb added preferences for confirmation emails and event logging. updated docs to reflect #upload directive 2/26/03; 8:16:28 PM by ddb #upload implemented, added logging 2/25/03; 5:55:13 PM by ddb improved directives parsing, now directives can be anywhere. 2/24/03; 11:01:37 PM by ddb forgot to add shortcut if the post was titled. 2/20/03; 5:49:54 PM by ddb directives parsing was broken because I was forgetting that mail comes with \r\n rather than just \r and was failing after two directives. 2/19/03; 8:21:59 PM by ddb added mimetype mapping framework and preference page. deactivate the tool if the subject is empty. 2/17/03; 12:02:34 PM by ddb fixed bugs introduced in last release, added debug log framework. 2/11/03; 6:52:05 PM by ddb cleaned up the category stuff, did a better job at picking image types and names, added sanity checking for image attachments fixed a typo in the docs removed fixReplyText, maybe add back later. We're getting close to 1.0... 1/30/03; 9:14:58 PM by ddb #directives that take a string argument must be double quoted, the list of categories must now be a UserTalk list. 1/29/03; 6:54:53 PM by ddb added category routing and flNotOnHomePage handling 1/29/03; 5:42:25 PM by ddb created Old Changes: Changes: 1/28/03; 6:48:14 PM by ddb created 1/28/03; 9:05:14 PM by ddb I think I have the preliminary working version. 1/29/03; 8:10:20 AM by ddb now returns the post in every reply, formatted for easy reply editting. local (startticks = clock.ticks()) local (timestamp = string(clock.now())) local (adrblog = radio.weblog.init ()) local (debug = mailEditData.flDebug) local (log = mailEditData.flLog) local (confirm = mailEditData.flConfirmEmail) local (imageAlign = "") local (debugLogEntry) mailEditSuite.init() bundle // deactivate the tool if the subject is empty -- prevents eating too many messages if mailEditData.secretSubject == "" delete(@weblogData.callbacks.weblogCheckMail.mailEditCallback) return (false) if adrmsg^.subject == string (mailEditData.secretSubject) on getDirectives(adrmsg) local (directives) local (text = "") local (ct = 1) new (tabletype, @directives) local (wpstring = string.trimwhitespace(string(adrmsg^.text))) wpstring = string.replaceAll(wpstring, "\n", "") local (limit = string.countFields(wpstring, "\r")) loop «process #directives if sizeof (wpstring) == 0 break local (line = string.trimwhitespace(string.nthField (wpstring, "\r", ct++))) if line beginsWith ">" line = string.trimwhitespace(string.mid(line, 2, sizeof(line))) if line beginsWith "#" local (name = string.nthField(line, " ", 1)) local (lineLen = string.length(line)) local (nameLen = string.length(name)) name = string.mid(name, 2, nameLen - 1) if nameLen != lineLen // if there's a value, grab it local (value = string.mid(line, nameLen + 1, string.length(line) - nameLen + 1)) try directives.[name] = evaluate(value) else directives.[name] = "" else text = text + line + "\r" if ct > limit break adrmsg^.text = string.trimwhitespace(text) return (directives) on newDirectives(adrmsg) text = string.replaceAll(string.trimwhitespace(string(adrmsg^.text)), "\n", "") local (directives) new (tabletype, @directives) local (adrtable = @directives) local (s = "") local (ix = 1) local (ch) on isWhite(ch) if ch == "" return false return not (string.isAlpha(ch) or string.isPunctuation(ch) or string.isNumeric(ch)) on nextChar() ch = string.nthChar(text, ix++) return ch on peekChar() ch = string.nthChar(text, ix) return ch on eatWhite() while isWhite(nextChar()) {} on getTerm() local (term = "") nextChar() while not isWhite(ch) if ch == "" break term = term + ch ch = nextChar() return term on endOfText() return ix > sizeOf(text) on getQuotedString() local (value = "") loop if endOfText() return value nextChar() if ch == '"' return value if ch == '\r' continue if ch == '\\' ch = '\\' + nextChar() value = value + ch on eatToEOL() local (s = "") while (ch) != '\r' if ch == "" break s = s + ch ch = nextChar() return s on getList() local (s = "") loop ch = nextChar() if (ch == '"') s = s + "\"" + getQuotedString() + "\"" else if ch == '\\' s = s + '\\' + nextChar() else if ch == '}' return "{" + s + "}" else s = s + ch on directiveRequiresArg(s) s = string.lower(s) if s == "title" return true if s == "id" return true if s == "category" return true if s == "categories" return true if s == "link" return true if s == "imagealign" return true return false loop ch = nextChar() if ch == '#' // process directive local (directive = getTerm()) local (value = "") if directiveRequiresArg(directive) eatWhite() else while isWhite(ch) and ch != '\r' ch = nextChar() if ch == '"' // parse quoted string value = getQuotedString() value = "\"" + value + "\"" else if (ch == '{') value = getList() else value = ch + getTerm() try value = evaluate(value) eatToEOL() adrTable^.[directive] = value else s = s + eatToEOL() + "\r" if endOfText() break adrmsg^.text = s return directives on cleanMailAddress (email) 10/31/97 at 6:53:16 AM by DW -- moved from toys.cleanMailAddress local (len = sizeof (email), ix, mailpart = "", commentpart = "", ch) if email beginswith "\"" ix = string.patternmatch ("<", email) if ix > 0 mailpart = string.mid (email, ix + 1, len - ix- 1) for i = 2 to len ch = email [i] if ch == "\"" break commentpart = commentpart + ch return (mailpart) if email contains "<" ix = string.patternmatch ("<", email) mailpart = string.mid (email, ix + 1, len - ix - 1) commentpart = string.mid (email, 1, ix - 2) return (mailpart) return (email) «no change, not a recognized format on getDestination(adrmsg) local (dest = adrmsg^.from) if defined(adrmsg^.["Reply-To"]) dest = adrmsg^.["Reply-To"] dest = cleanMailAddress(dest) if not defined(mailEditData.replyTable) new (tabletype, @mailEditData.replyTable) if not defined(mailEditData.replyTable.[dest]) mailEditData.replyTable.[dest] = 0 mailEditData.replyTable.[dest]++ return (dest) on getPostForMail(adrpost) local (s = "") if defined(adrpost^.title) s = s + "#title \"" + adrpost^.title + "\"\n" if defined(adrpost^.link) s = s + "#link \"" + adrpost^.link + "\"\n" if defined(adrpost^.imageAlign) s = s + "#imageAlign \"" + adrpost^.imageAlign + "\"\n" if defined(adrpost^.flNotOnHomePage) if adrpost^.flNotOnHomePage s = s + "#notOnHomePage\n" if defined(adrpost^.categories) if sizeOf(adrpost^.categories) > 0 local (cats = "") for cat in @adrpost^.categories cats = cats + "\"" + nameOf(cat^) + "\", " cats = string.mid(cats, 1, string.length(cats) - 2) s = s + "#categories {" + cats + "}\n" s = s + "#id " + number(nameOf(adrpost^)) + "\n" local (postText = string(adrpost^.text)) postText = string.replaceAll(postText, "\n", "") postText = string.replaceAll(postText, "\r", "\n") s = s + postText return (s) on newLogEntry() local (logAdr = @mailEditData.debugLog.[string.padwithzeros(mailEditData.debugLog.count++, 8)]) new (tabletype, logAdr) return (logAdr) on getExtensionForMimeType(s, adrExt) for mt in @mailEditData.mimeTypes.images if s contains nameOf(mt^) adrExt^ = mt^ return (true) return (false) on getNameFromContentType(s, adrName) local (nameLoc = string.patternMatch("name=\"", s)) if nameLoc != 0 local (ix = 0) local (sLen = string.length(s)) local (offset = nameLoc + 6) while string.nthchar(s, ix + offset) != "\"" and ix + offset <= sLen ix++ adrName^ = string.mid(s, offset, ix) return (true) return (false) on saveAttachments(adrmsg) local (attachments) new (tabletype, @attachments) if defined(adrmsg^.parts) local (ct = 0) if debug debugLogEntry^.parts = 0 for part in @adrmsg^.parts if debug debugLogEntry^.parts++ local (content = part^.["Content-Type"]) content = string.lower(content) if content contains "content-type" local (rawName = "", name = "", url = "") local (extension = "") getExtensionForMimeType(content, @extension) if debug debugLogEntry^.["extension" + string(debugLogEntry^.parts)] = extension if extension != "" bundle // make unique filename local (pc = file.getPathChar()) local (day, month, year, hour, minute, second, namePrefix, urlPrefix) date.get (clock.now (), @day, @month, @year, @hour, @minute, @second) namePrefix = string.padwithzeros(string(year), 4) + pc + string.padwithzeros(string(month), 2) + pc + string.padwithzeros(string(day), 2) + pc urlPrefix = string.padwithzeros(string(year), 4) + "/" + string.padwithzeros(string(month), 2) + "/" + string.padwithzeros(string(day), 2) + "/" if not getNameFromContentType(content, @rawName) rawName = "image" + string.padwithzeros(string(hour), 2) + string.padwithzeros(string(minute), 2) + string.padwithzeros(string(second), 2) + string.padwithzeros(string(ct), 2) + extension url = urlPrefix + rawName name = namePrefix + rawName ct++ local (fullName = radio.file.getSubFolder("images/mailEdit/") + name) file.sureFilePath(fullName) local (d = binary(base64.decode(part^.data))) if debug debugLogEntry^.["part" + string(debugLogEntry^.parts)] = fullName debugLogEntry^.["url" + string(debugLogEntry^.parts)] = url file.writeWholeFile(fullName, d) attachments.[rawName] = url else if debug debugLogEntry^.reason = "couldn't find content-type" scratchpad.attachments = attachments return (attachments) if debug debugLogEntry = newLogEntry() debugLogEntry^.time = timestamp debugLogEntry^.msg = adrmsg^ try if defined(adrmsg^.text) local (directives = newDirectives(adrmsg)) if defined(directives.get) // we want to fetch a posting local (adrpost = nil) if directives.get == "" or typeOf(directives.get) == booleanType // we want the latest posting adrpost = @adrblog^.posts[sizeof(adrblog^.posts)] else try local (id = number(directives.get)) adrpost = @adrblog^.posts.[string.padwithzeros(id, 8)] if not defined(adrpost^) adrpost = nil local (email = getDestination(adrmsg)) if adrpost != nil local (body = getPostForMail(adrpost)) local (subject = "Weblog Post Fetch") if debug debugLogEntry^.emailAddress = email debugLogEntry^.subject = subject debugLogEntry^.body = body tcp.sendMail(email, subject, body) if mailEditData.debugDestinationAddress != "" tcp.sendmail(mailEditData.debugDestinationAddress, "debug: " + subject, body) else local (body = "Cannot locate a weblog post of id " + string(directives.get)) local (subject = "Weblog Post Fetch Error") if debug debugLogEntry^.emailAddress = email debugLogEntry^.subject = subject debugLogEntry^.body = body tcp.sendMail(email, subject, body) if mailEditData.debugDestinationAddress != "" tcp.sendmail(mailEditData.debugDestinationAddress, "debug: " + subject, body) if log radio.log.add("mailEdit", "#get " + string(directives.get) + " from " + email, startticks) return (true) if defined(directives.upload) // we just want to stash some files local (adrtable = @adrblog^.shortcuts.personal) local (adrcopy = @mailEditData.shortcuts) local (atts = saveAttachments(adrmsg)) local (scuts = "") for url in @atts local (base = string.popSuffix(nameOf(url^))) scuts = scuts + base + "\n" + base + ".left\n" + base + ".right\n" adrtable^.[base] = mailEditSuite.imageRef("images/mailEdit/" + url^) adrtable^.[base + ".left"] = mailEditSuite.imageRef("images/mailEdit/" + url^, align:"left", hspace:15, vspace:5) adrtable^.[base + ".right"] = mailEditSuite.imageRef("images/mailEdit/" + url^, align:"right", hspace:15, vspace:5) adrcopy^.[base] = adrtable^.[base] adrcopy^.[base + ".left"] = adrtable^.[base + ".left"] adrcopy^.[base + ".right"] = adrtable^.[base + ".right"] radio.shortcuts.merge() bundle // send mail response local (email = getDestination(adrmsg)) local (body = "Upload complete. The following shortcuts have been defined:\n" + scuts) local (subject = "Image Upload Complete") if debug debugLogEntry^.emailAddress = email debugLogEntry^.subject = subject debugLogEntry^.body = body if confirm tcp.sendMail(email, subject, body) if mailEditData.debugDestinationAddress != "" if confirm tcp.sendmail(mailEditData.debugDestinationAddress, "debug: " + subject, body) if log radio.log.add("mailEdit", "#upload from " + email + "\n" + scuts, startticks) return (true) if defined(directives.publish) // we're just publishing pages local (publishMail = "Unknown Publishing Directive.") on publishHomePage() radio.weblog.publish () radio.weblog.publishRss () publishMail = "Your home page has been published." on publishThisMonth() radio.menuCommands.publishThisMonth () publishMail = "The current month of your weblog has been published." on publishWeblogPages() local (adrblog = radio.weblog.init ()) radio.weblog.publish (adrblog) radio.weblog.publishRss (adrblog) local (adrpost, ctposts = sizeOf (adrblog^.posts)) local (day, month, year, hour, minute, second) local (lastDay, lastMonth, lastYear) for i = ctposts downTo 1 adrpost = @adrblog^.posts[i] date.get (adrpost^.when, @day, @month, @year, @hour, @minute, @second) if not (lastDay == day and lastMonth == month and lastYear == year) radio.weblog.publish (adrblog, d:adrpost^.when) publishMail = "All weblog posts have been published." on publishCategoryHomes() local (adrblog = radio.weblog.init ()) for i = 1 to sizeOf (adrblog^.categories) adrblog^.categories[i].flDirty = true radio.weblog.publish (adrblog, nameOf (adrblog^.categories[i])) publishMail = "All of your category home pages have been published." on publishAllCategoryPages() local (adrblog = radio.weblog.init ()) local (catsTable); new (tableType, @catsTable) for i = 1 to sizeOf (adrblog^.categories) //create a date-list for each category, set flDirty for each category local (adrcat = @adrblog^.categories[i]) local (catname = nameOf (adrcat^)) catsTable.[catName] = {} adrcat^.flDirty = true radio.weblog.publish (adrblog, catname) local (adrpost) for adrpost in @adrblog^.posts //loop over posts, and determine which archive and category-archive days need to be published date.get (adrpost^.when, @day, @month, @year, @hour, @minute, @second) local (d = date.set (day, month, year, 0, 0, 0)) if defined (adrpost^.categories) for i = 1 to sizeOf (adrpost^.categories) if adrpost^.categories[i] local (catname = nameOf (adrpost^.categories[i])) if defined (catsTable.[catname]) //the category still exists catsTable.[catname] = catsTable.[catname] + d bundle //publish all of the category archive pages local (adrcatdates) for adrcatdates in @catsTable local (catname = nameOf (adrcatdates^)) local (d) for d in adrcatdates^ radio.weblog.publish (adrblog, catname, d) publishMail = "All of your category pages have been published." on publishAllWeblogAndCategories() local (adrblog = radio.weblog.init ()) local (catsTable); new (tableType, @catsTable) for i = 1 to sizeOf (adrblog^.categories) //create a date-list for each category, set flDirty for each category local (adrcat = @adrblog^.categories[i]) local (catname = nameOf (adrcat^)) catsTable.[catName] = {} adrcat^.flDirty = true local (datelist = {}) local (day, month, year, hour, minute, second) local (adrpost) for adrpost in @adrblog^.posts //loop over posts, and determine which archive and category-archive days need to be published date.get (adrpost^.when, @day, @month, @year, @hour, @minute, @second) local (d = date.set (day, month, year, 0, 0, 0)) if not (datelist contains d) datelist = datelist + d if defined (adrpost^.categories) for i = 1 to sizeOf (adrpost^.categories) if adrpost^.categories[i] local (catname = nameOf (adrpost^.categories[i])) if defined (catsTable.[catname]) //the category still exists catsTable.[catname] = catsTable.[catname] + d bundle //publish the weblog home page radio.weblog.publish (adrblog) bundle //publish the weblog RSS radio.weblog.publishRss (adrblog) bundle //publish the weblog archive pages local (d) for d in datelist radio.weblog.publish (adrblog, d:d) bundle //publish all of the category index pages for i = 1 to sizeOf (adrblog^.categories) radio.weblog.publish (adrblog, nameOf (adrblog^.categories[i])) bundle //publish all of the category archive pages local (adrcatdates) for adrcatdates in @catsTable local (catname = nameOf (adrcatdates^)) local (d) for d in adrcatdates^ radio.weblog.publish (adrblog, catname, d) publishMail = "All of your weblog and category pages have been published." on publishEverything() new (tableType, @user.radio.settings.files) //Clear the file-cache. This will re-publish everything. publishMail = "Your entire website has been published." bundle // do publishing if typeOf(directives.publish) == booleanType publishHomePage() directives.publish = "homePage" else if typeOf(directives.publish) == typeOf("") case directives.publish "homePage" publishHomePage() "month" publishThisMonth() "weblog" publishWeblogPages() "category" publishCategoryHomes() "allCategory" publishAllCategoryPages() "all" publishAllWeblogAndCategories() "everything" publishEverything() else publishHomePage() directives.publish = "homePage" bundle // send mail response local (email = getDestination(adrmsg)) local (body = publishMail + " It may be a few minutes before your weblog reflects the changes.") local (subject = "Publish has begun.") if debug debugLogEntry^.emailAddress = email debugLogEntry^.subject = subject debugLogEntry^.body = body if confirm tcp.sendMail(email, subject, body) if mailEditData.debugDestinationAddress != "" if confirm tcp.sendmail(mailEditData.debugDestinationAddress, "debug: " + subject, body) if log radio.log.add("mailEdit", "#publish " + directives.publish + " from " + email, startticks) bundle // default mailEdit processing -- post the message local (adrpost = nil) local (newpost = true) local (when = clock.now()) bundle // if id was specified, grab it if defined(directives.id) local (id = string.padwithzeros(number(directives.id), 8)) if defined(adrblog^.posts.[id]) adrpost = @adrblog^.posts.[id] newpost = false bundle // if imageAlign was specified, grab it if defined(directives.imageAlign) imageAlign = directives.imageAlign local (s = adrmsg^.text) bundle // massage message s = string.trimWhitespace (s) s = string.quotedPrintableDecode (s) s = string.replaceAll (s, "\r\n", "\r") s = radio.string.untaint (s) bundle // handle attachment local (imgs = "") local (atts = saveAttachments(adrmsg)) for url in @atts if imageAlign != "" imgs = imgs + mailEditSuite.imageRef("images/mailEdit/" + url^, align:imageAlign, hspace:15, vspace:5) + " " else imgs = imgs + mailEditSuite.imageRef("images/mailEdit/" + url^) + " " if imgs != "" if imageAlign != "" s = imgs + s else s = imgs + "\n\n" + s bundle // if flMailDate and newPost, set the date if newPost and mailEditData.flMailDate local (newDate = adrmsg^.["Date"]) local (offset = sizeof(newDate) - 4) local (zone = string.mid(newDate, offset, 5)) if debug debugLogEntry^.zone = zone if zone beginsWith "-" or zone beginsWith "+" newDate = date(string.mid(newDate, 1, offset)) when = newDate if debug debugLogEntry^.when = when bundle // post message adrpost = radio.weblog.post (s, adrblog, when:when, adrpost:adrpost) radio.weblog.initPost(adrpost) bundle // add title, link if defined(directives.title) adrpost^.title = directives.title radio.shortcuts.addTitledPost (adrpost, directives.title) if defined(directives.link) if directives.link != "http://" and directives.link != "" adrpost^.link = string.replaceAll(directives.link, " ", "") bundle // add categories if present if defined(directives.category) and typeOf(directives.category) == typeOf("") directives.categories = {directives.category} if defined(directives.categories) and typeOf(directives.categories) == listtype bundle // gather categories local (catList = directives.categories) for cat in directives.categories radio.weblog.addPostToCategory(adrpost, cat) bundle // on home page? if defined(directives.notOnHomePage) adrpost^.flNotOnHomePage = true bundle // save imageAlign, if present if imageAlign != "" adrpost^.imageAlign = imageAlign bundle // publish message radio.weblog.updatePagesForPost (adrpost) adrblog^.stats.ctMailToBlogPosts++ bundle // send confirmation email local (dest = getDestination(adrmsg)) local (idstring = string(number(nameOf(adrpost^)))) local (message = "Your edit has been saved (id " + idstring + ")\n\n") if newpost message = "Radio has posted the submission to your weblog. It has recieved the id of " + idstring + ".\n\nTo edit this post, send a message to your posting email address, using your secret subject, and a body of:\n\n#get " + idstring + "\n\nYour post will be returned, and you can then edit the text. Just resend the post to the posting email address (once again using the secret subject), and the edits will be saved.\n\n" local (body = message + getPostForMail(adrpost)) local (subject = "Weblog Post Completed") if debug debugLogEntry^.emailAddress = dest debugLogEntry^.subject = subject debugLogEntry^.body = body if confirm tcp.sendMail(dest, subject, body) if mailEditData.debugDestinationAddress != "" if confirm tcp.sendmail(mailEditData.debugDestinationAddress, "debug: " + subject, body) if log radio.log.add("mailEdit", "post from " + dest, startticks) bundle // final bit of debugging if debug debugLogEntry^.post = adrpost^ else try debugLogEntry^.error = tryError €„€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€$datatabl·öY·öY€€€pVxfVerdanaº` ºiö+'ñH¯µLANDÿÿÿÿÿÿwinChanges Created from installCodeFreshener script by AJF on 1/31/2003; 8:29:02 PM. 9/26/02; 12:23:22 AM by AJF Add new tool tables. 1/15/02; 5:21:20 PM by DW Runs on the user's machine, when refreshing. local (adrtable = @system.temp.mailEditSnapshot) mailEditData = adrtable^.data mailEditInfo = adrtable^.info mailEditSuite = adrtable^.suite mailEditWebsite = adrtable^.website filemenu.savemyroot (@mailEditSuite) local (x=string.parseAddress (@mailEditSuite), f = x[1]) frontier.tools.install (f) dialog.notify ("Thanks for updating to version " + mailEditInfo.version + " of mailEdit.root Tool!") „€€€€€€€€„€€€€€€€€€€VÆNVerdanaº‚%º‚%aFAâ—LANDÿÿÿÿÿÿwinChanges Created from installCodeFreshener script by AJF on 1/31/2003; 8:29:03 PM. 1/15/02; 5:18:06 PM by DW This is the Refresh menu command. local (url = "http://radio.weblogs.com/0100039/gems/mailEdit/betaCodeFreshener.fttb") local (urllist = string.urlsplit (url)) local (s = tcp.httpclient (server:urllist [2], path:urllist [3])) local (f=frontier.pathstring + "betaCodeFreshener.fttb") file.writewholefile (f, s) fatpages.importfatfile (f) thread.callscript (@system.temp.mailEditSnapshot.loader, {}) „€€€€€€€€€ÆÐN Verdana º‚%»ÓD#FA>µLANDÿÿÿÿÿÿwinChanges Created from installCodeFreshener script by AJF on 1/31/2003; 8:29:03 PM. 1/15/02; 5:18:06 PM by DW This is the Refresh menu command. local (url = "http://gromit.namshub.org:81/users/0000001/gems/mailEdit/betaCodeFreshener.fttb") local (urllist = string.urlsplit (url)) local (s = tcp.httpclient (server:urllist [2], path:urllist [3])) local (f=frontier.pathstring + "betaCodeFreshener.fttb") file.writewholefile (f, s) fatpages.importfatfile (f) thread.callscript (@system.temp.mailEditSnapshot.loader, {}) „€€€€€€€€€Ð¾NøVerdanaº`º`)Þ”ñLANDÿÿÿÿÿÿwinChanges Created from installCodeFreshener script by AJF on 1/31/2003; 8:29:03 PM. 1/15/02; 5:18:06 PM by DW This is the Refresh menu command. local (url = "http://radio.weblogs.com/0100039/gems/mailEdit/codeFreshener.fttb") local (urllist = string.urlsplit (url)) local (s = tcp.httpclient (server:urllist [2], path:urllist [3])) local (f=frontier.pathstring + "codeFreshener.fttb") file.writewholefile (f, s) fatpages.importfatfile (f) thread.callscript (@system.temp.mailEditSnapshot.loader, {}) „€€€€€€€€€€€€¾ÈNVerdana º`ºŠ h-vÍLANDÿÿÿÿÿÿwinChanges Created from installCodeFreshener script by AJF on 1/31/2003; 8:29:03 PM. 1/15/02; 5:18:06 PM by DW This is the Refresh menu command. local (url = "http://gromit.namshub.org:81/users/0000001/gems/mailEdit/codeFreshener.fttb") local (urllist = string.urlsplit (url)) local (s = tcp.httpclient (server:urllist [2], path:urllist [3])) local (f=frontier.pathstring + "codeFreshener.fttb") file.writewholefile (f, s) fatpages.importfatfile (f) thread.callscript (@system.temp.mailEditSnapshot.loader, {}) „€€€€€€€€€€€€Èñ mVerdanaº`º`&ïH¯¹LANDÿÿÿÿÿÿwinif dialog.confirm ("Get the newest code for mailEdit.root Tool?") mailEditSuite.codeFreshener.refreshCode() €€ñ»Æ}Verdana º© »ÒjE="¸LANDÿÿÿÿÿÿwinChanges Created from installCodeFreshener script by AJF on 1/31/2003; 8:29:03 PM. 1/15/02; 5:08:55 PM by DW Created. I run this on my machine to create a package for refreshCode to load. Talk about a Mobius Strip. It's really simple code, but it's fun to walk your mind through it. local (oldmailEditData) bundle //get mailEditData ready for ship oldmailEditData = mailEditData new (tabletype, @mailEditData) mailEditData.secretSubject = "" mailEditData.testSubject = "" mailEditInfo.releaseDate = clock.now() local (adrtable = @system.temp.mailEditSnapshot) new (tabletype, adrtable) adrtable^.data = mailEditData adrtable^.info = mailEditInfo adrtable^.suite = mailEditSuite adrtable^.website = mailEditWebsite adrtable^.loader = mailEditSuite.codeFreshener.loadNewCode local (f = radio.file.getSubFolder ("gems/mailEdit") + "betaCodeFreshener.fttb") file.surefilepath (f) export.sendobject (adrtable, f) f = radio.file.getSubFolder ("gems/mailEdit/beta") + "mailEdit.root" target.set (this) fileMenu.saveCopy (f) mailEditData = oldmailEditData dialog.alert (file.filefrompath (f) + " is " + string.megabytestring (file.size (f))) „€€€€€€€€€€„€€€€€€€€€€€€€€€€€»*ÞÔVerdana º`»ÒjŸ{»dà‚LANDÿÿÿÿÿÿwinChanges Created from installCodeFreshener script by AJF on 1/31/2003; 8:29:03 PM. 1/15/02; 5:08:55 PM by DW Created. I run this on my machine to create a package for refreshCode to load. Talk about a Mobius Strip. It's really simple code, but it's fun to walk your mind through it. local (oldmailEditData) bundle //get mailEditData ready for ship oldmailEditData = mailEditData new (tabletype, @mailEditData) mailEditData.secretSubject = "" mailEditData.testSubject = "" mailEditInfo.releaseDate = clock.now() local (adrtable = @system.temp.mailEditSnapshot) new (tabletype, adrtable) adrtable^.data = mailEditData adrtable^.info = mailEditInfo adrtable^.suite = mailEditSuite adrtable^.website = mailEditWebsite adrtable^.loader = mailEditSuite.codeFreshener.loadNewCode local (f = radio.file.getSubFolder ("gems/mailEdit") + "codeFreshener.fttb") file.surefilepath (f) export.sendobject (adrtable, f) f = radio.file.getSubFolder ("gems/mailEdit") + "mailEdit.root" target.set (this) fileMenu.saveCopy (f) f = radio.file.getSubFolder ("gems") + "mailEdit.root" target.set (this) fileMenu.saveCopy (f) mailEditData = oldmailEditData dialog.alert (file.filefrompath (f) + " is " + string.megabytestring (file.size (f))) „€€€€€€€€€€€€€€€„€€€€€€€€€€€€€€€€€€€€*NJ`º` ºŠ c  (4 LX dp „  ¬ ¿Ë Ú loadNewCodezúrefreshBetaCode~\refreshBetaCodeFromWork. refreshCode„ refreshCodeFromWork†ÔrefreshCodeMenu‰¨releaseNewBetaCodeŠ¥releaseNewCodelNŒ Verdana *º|ÿÞº‚©Ó&}é^—LANDÿÿÿÿÿÿwinon imageRef (imgpath, usemap="", align="", hspace="", vspace="", alt="", height="", width="") Changes: 12/27/02; 1:03:48 PM by JES Add a space and forward slash before closing the img tag. Fixes a validation problem for XHTML pages, and still validates for HTML 4.01 Transitional pages. 7/1/02; 2:30:49 AM by JES Always add the alt attribute, even if its value is the empty string. It's a required attribute in HTML 4.01. 1/30/02; 5:13:10 PM by JES Fixed a bug where the height and width attributes could end up with empty values. 1/30/02; 12:25:11 PM by JES Added optional height and width parameters. 1/28/02; 10:17:22 AM by DW Added optional alt parameter, if non-empty, add an alt attribute to the image that's generated. 11/25/01; 3:17:27 AM by JES Implemented a workaround for the character-case issue on Windows, since converting to a filespec doesn't fix the character-case of the filename. 11/22/01; 12:27:38 AM by JES Commented out some debugging code. 10/13/01; 3:56:07 AM by JES When generating image URLs, preserve the case of the files on disk: Clients don't care about case, but the static server does, so make sure that the case of the file path in the img tag matches the actual case of the file that's upstreamed. 7/26/01; 3:07:42 PM by JES Added a leading slash character to the non-file URL, so images will work on sub-pages when accessing the site remotely. 4/18/01; 4:10:59 PM by DW Moved from myUserLandSuite. if imgpath beginswith "/" imgpath = string.delete (imgpath, 1, 1) local (f = user.radio.prefs.wwwfolder + string.replaceall (imgpath, "/", file.getpathchar ())) if usemap != "" usemap = " usemap=\"#" + usemap + "\"" if align != "" align = " align=\"" + align + "\"" if hspace != "" hspace = " hspace=\"" + hspace + "\"" if vspace != "" vspace = " vspace=\"" + vspace + "\"" if true//alt != "" alt = " alt=\"" + alt + "\"" local (hw = "") bundle //set hw local (adrincache = @system.temp.radio.hwCache.[imgpath], hwlist) if defined (adrincache^) and (height == "" and width == "") hw = adrincache^ else local (extension = string.nthfield (imgpath, ".", string.countfields (imgpath, "."))) case string.lower (extension) "gif" hwlist = html.getGifHeightWidth (f) "jpeg" "jpg" hwlist = html.getJpegHeightWidth (f) try hw = " width=\"" + hwlist [2] + "\" height=\"" + hwlist [1] + "\"" adrincache^ = hw if height != "" or width != "" //height and/or width passed in if height != "" and width != "" hw = " width=\"" + width + "\" height=\"" + height + "\"" else if height != "" hw = " width=\"" + hwlist [2] + "\" height=\"" + height + "\"" if width != "" hw = " width=\"" + width + "\" height=\"" + hwlist [1] + "\"" else hw = "" local (url) url = user.radio.prefs.defaultCloudData.url + imgpath return ("") bundle // test dialog.notify(imageRef("images/mailEdit/2003/02/22/Photo 4.jpg")) €„„€€€€€€€€€€€€€„€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€„€QÆ Verdana ºv\ƒº„(®A~×LANDÿÿÿÿÿÿwinif not defined(mailEditData.flDebug) mailEditData.flDebug = false if not defined(mailEditData.debugLog) new (tabletype, @mailEditData.debugLog) if not defined(mailEditData.debugLog.count) mailEditData.debugLog.count = 0 if not defined(mailEditData.secretSubject) mailEditData.secretSubject = "Iowa+Washington" if not defined(mailEditData.testSubject) mailEditData.testSubject = "Washington+Iowa" if not defined(mailEditData.replyTable) new (tabletype, @mailEditData.replyTable) if not defined(mailEditData.debugDestinationAddress) mailEditData.debugDestinationAddress = "" if not defined(mailEditData.mimeTypes) new (tabletype, @mailEditData.mimeTypes) new (tabletype, @mailEditData.mimeTypes.images) new (tabletype, @mailEditData.mimeTypes.other) local (imagesAdr = @mailEditData.mimeTypes.images) local (otherAdr = @mailEditData.mimeTypes.other) bundle // fill mimetypes tables imagesAdr^.["image/jpeg"] = ".jpg" imagesAdr^.["image/gif"] = ".gif" imagesAdr^.["image/png"] = ".png" if not defined(mailEditData.flMailDate) mailEditData.flMailDate = true if not defined(mailEditData.shortcuts) new (tabletype, @mailEditData.shortcuts) if not defined(mailEditData.flLog) mailEditData.flLog = true if not defined(mailEditData.flConfirmEmail) mailEditData.flConfirmEmail = true €€€€€€€€€€€€€€QÔVVerdanaº`º`&çH¯ÉLANDÿÿÿÿÿÿwinif dialog.confirm ("Get the newest code?"){mailEditSuite.codeFreshener.refreshCode()} €Ô¨Verdanaº\3ú`)ò]ºÞLANDÿÿÿÿÿÿwinMailEdit Refresh Code... €€ ¬w¨p­Wø- áVerdanaœ!cp)0 Verdana ºŠ8rºŠ“íF_7÷þLANDÿÿÿÿÿÿwinon newDirectives(text, adr) text = string.replaceAll(text, "\n", "") local (directives) new (tabletype, @directives) local (adrtable = @directives) local (s = "") local (ix = 1) local (ch) on isWhite(ch) return not (string.isAlpha(ch) or string.isPunctuation(ch) or string.isNumeric(ch)) on nextChar() ch = string.nthChar(text, ix++) return ch on peekChar() ch = string.nthChar(text, ix) return ch on eatWhite() while isWhite(nextChar()) {} on getTerm() local (term = "") nextChar() while not isWhite(ch) term = term + ch ch = nextChar() return term on endOfText() return ix > sizeOf(text) on getQuotedString() local (value = "") loop if endOfText() return value nextChar() if ch == '"' return value if ch == '\r' continue if ch == '\\' ch = '\\' + nextChar() value = value + ch on eatToEOL() local (s = "") while (ch) != '\r' s = s + ch ch = nextChar() return s on getList() local (s = "") loop ch = nextChar() if (ch == '"') s = s + "\"" + getQuotedString() + "\"" else if ch == '\\' s = s + '\\' + nextChar() else if ch == '}' return "{" + s + "}" else s = s + ch on directiveRequiresArg(s) s = string.lower(s) if s == "title" return true if s == "id" return true if s == "category" return true if s == "categories" return true if s == "link" return true if s == "imagealign" return true return false loop ch = nextChar() if ch == '#' // process directive local (directive = getTerm()) local (value = "") if directiveRequiresArg(directive) eatWhite() else while isWhite(ch) and ch != '\r' ch = nextChar() if ch == '"' // parse quoted string value = getQuotedString() value = "\"" + value + "\"" else if (ch == '{') value = getList() else value = ch + getTerm() try value = evaluate(value) eatToEOL() adrTable^.[directive] = value else s = s + eatToEOL() + "\r" if ix > sizeof(text) break adr^ = s return directives on getDirectives(str) local (directives) local (text = "") local (ct = 1) new (tabletype, @directives) local (wpstring = string.trimwhitespace(string(str))) wpstring = string.replaceAll(wpstring, "\n", "") local (limit = string.countFields(wpstring, "\r")) loop «process #directives if sizeof (wpstring) == 0 break local (line = string.trimwhitespace(string.nthField (wpstring, "\r", ct++))) if line beginsWith ">" line = string.trimwhitespace(string.mid(line, 2, sizeof(line))) if line beginsWith "#" local (name = string.nthField(line, " ", 1)) local (lineLen = string.length(line)) local (nameLen = string.length(name)) name = string.mid(name, 2, nameLen - 1) if nameLen != lineLen // if there's a value, grab it local (value = string.mid(line, nameLen + 1, string.length(line) - nameLen + 1)) try directives.[name] = evaluate(value) else directives.[name] = "" else text = text + line + "\r" if ct > limit break scratchpad.s = string.trimwhitespace(text) return (directives) bundle scratchpad.result = getDirectives(string(scratchpad.text)) €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€)®$Verdanaº\3ú^i'ô]ºÔLANDÿÿÿÿÿÿwinThis script returns a string which appears in the Status Center on the Radio UserLand home page. local (callbackAdr = @weblogData.callbacks.weblogCheckMail.mailEditCallback) if defined(callbackAdr^) return ("MailEdit tool active.") else return ("MailEdit tool inactive.") „€€€€€®HDjº\3ÃºŠ’”  !- ?K Ye nz ‹ œ ª¶ Ê background U callbacks `checkMailCallback Ú codeFreshener–¢imageRef—üinit¦menu® newDirectives®‡statusCenterMessage¾¼HþtArial ¶Fû¶Fû1 2®LANDÿÿÿÿÿÿwinon finalFilter (pta) pta^.renderedText = string.replace (pta^.renderedText, "[[title]]", "") return (true) €�����€�����€��������þ���±�������� ���-���� MS Sans Serif��������������������� ��������������­ÂEu´`ÞQ���¾��� �2LANDÿÿÿÿÿÿ�������win������������on firstFilter (adrPageTable) return (true) €�����€��������±��ý��������*��[���� MS Sans Serif��������������������� ��������������­ÂEuµü7a���Ž���L�3*lLANDÿÿÿÿÿÿ�������win������������on pageFilter (pta) if typeOf (pta^.template) == outlineType or typeOf (pta^.template) == wpTextType table.assign (@pta^.template, string (pta^.template)) if typeOf (pta^.template) == stringType and not pta^.indirectTemplate pta^.template = string.replace (pta^.template, "<title>", "[[title]]") html.addPageToGlossary (pta) return (true) €�����€�����€�����€�����€�����€�����€�������ý���Ó�������y���.���­ÂE¼¶Fû�������� ���� ��� ����$���0 ����; finalFilter�������ÁÊ firstFilter�������ÂÔ pagefilter�������Ñ��V MS Sans Serif��������������������� ����������è�P�E��$Ï�������������������������Ó���D�������@������µü7¨º\3Ä�������� ����url���http://127.0.0.1/mailEdit/���D���`�������\���$���º_Q4º_Q4�������� ���� ���# ����(linetext���MailEdit Documentationpath���docs.wsf���`���›�������A����������º_Q4�������� ����MailEdit Documentation�������ÆÉ��VArial����������������������������� ������������������������������������������������›���±�������W����������´ž–������������space���/GIFfGIF89a��€��ÿÿÿ���!ù����,�������D�;��VArial����������������������������� ������������������������������������������������±���������Å���V�������´ž†�������� ������� �������"�������+ ����0���: ����C���L ����Q���[ ����aalink���008000bgcolor���FFFFFFflRenderlink���0000FFspaceGif���spacetext���000000vlink���800080��VArial����������������������������� ��������������������������������������������������n�����������������µü8>������VArial����������������������������� ������������������������������������������������n��Ÿ�������*��ý����Verdana��������������������������������L�������º_GR¼Þ���Ã���v�lWLANDÿÿÿÿÿÿ�������win������������#title "MailEdit Documentation" #renderWith "pikeRenderer" <rules> <rule> <outlineSpacing>1.5</outlineSpacing> </rule> <rule level="1" to="1"> <textStyle>bold</textStyle> </rule> <rule level="2" to="2"> <textStyle>bold</textStyle> </rule> <rule level="2" to="infinity"> <leftIndent>25</leftIndent> </rule> </rules> What does it do? Basic Idea Used in the most simple fashion, the MailEdit tool will work exactly like the Mail-To-Weblog functionality built into Radio. If you send a message with the correct subject to the email address that Radio is set up to monitor, it will be posted to your weblog. In addition, MailEdit will return an email confirmation of the posting, along with a copy of the post suitable for editting. Full Speed Ahead The real power of the MailEdit tool is when the directives are used. Directives can be used to specify post titles, post links, the categories that the post should be routed to, as well as specifying the identity of the post, in case you wish to correct an error that crept past your proofreading. It can also fetch a post for editting, if you don't have a local copy around. The theory is that if you wish to make a change to the most current post, you send a #get command to the Mail-To-Weblog address, using the secret subject that you've configured MailEdit to use. MailEdit will then format the post and send it back to you. You can make the changes you desire, and when you send the post back, the #id directive that was embedded in the post you editted will identify the new email message as the editted version of that post. Believe me, it's harder for me to explain than it is for you to use. Images If you attach images to your message, MailEdit will save the attachment in the proper place and alter your post to include an image refereance before the text. Personally, I use it to post images I've taken with the toy camera that comes with the SideKick. For an even more powerful and flexible way to handle images, there is an #upload directive that saves images and creates shortcuts for use in subsequent weblog posts. Why I wrote this becuase I do most of my weblog posting when I'm away from my Radio installation, like when I'm at work, or when I'm wandering around with only my SideKick. I was tired of posting an entry with a typo, and then having to wait until I got back home to correct it. I also didn't like that I couldn't add a title. I'm making it available in the hope that someone else will find it useful. Directives #title <quoted string> Specifies the title of the post. If not specified, no title is provided. #link <quoted string> Specifies the URL that the title, if provided, will point to. #imageAlign <quoted string> If specified, it should be one of "left" or "right", and will control how text wraps around any images that were attached to the message. #notOnHomePage Specifies that the post will not appear on the home page. Works exactly like clearing the "Home Page" checkbox on Radio's weblog posting form. #categories <list of quoted strings> Specifies a list of categories that this post should be routed to. #category <quoted string> Specifies a singular category for this post. A shortcut for #categories {"single category"} #id <post id> Specifies the post id of the post being processed. If the post exists, it will be copied over. If not, a new post will be created, although not necessarily using the number that was passed as an id. #get [<post id>] If <post id> is specified and exists, that post will be fetched and returned by an email reply, in a format suitable for editting. If it doesn't exist, an error will be returned. If no <post id> is specified, the most current post will be returned. #upload If specified, MailEdit will save the attached images and then create shortcuts for use in subsequent weblog posts. For an image "foo.jpg", three shortcuts will be created: "foo", "foo.left", and "foo.right". These shortcuts insert the image normally, or aligned to the left or the right, respectively. No post will be created, and the confirmation email that is returned contains a listing of the shortcuts that have been created. #publish Causes the home page of your weblog to be published. If, for some reason, the last past or last edit didn't take, the publish directive will force Radio to republish the page. Note that all subsequent publish directives correspond to the "Publish" menu commands in the "Radio" menu in the Radio Window. #publish homePage Like "#publish" without an argument, the #publish homePage directive forces the home page of your weblog to be republished. #publish month Causes the entire month of posts to be republished. #publish weblog Causes all posts in the weblog to be republished. #publish category Causes all category home pages to be republished. #publish allCategory Causes all category pages to be republished, not just category home pages. #publish all Causes all weblog and category pages to be republished. #publish everything Causes all pages in your website to be republished. Examples #title "This is my title" Sets the title of the post to "This is my title" #link "http://www.python.org" Makes the title point to the specified URL. #notOnHomePage Works like clearing the "Home Page" checkbox when posting an entry -- makes the entry only show up in categories, not on the main page. Any arguments passed to this directive will be ignored. #categories {"My Interests", "My Hobbies"} Routes the post to both the "My Interests" and the "My Hobbies" categories. #category "My Hobbies" Routes the post to the "My Hobbies" category. #imageAlign "right" Images will be linked to in a way that causes the image to be displayed on the right side of the page, with the text wrapping around the left. #id 219 Identifies the post as post #219, any edits will be saved over post #219. Used for editing posts. #get Without an argument, #get will cause the most recent post to be returned via email reply, suitable for editting. #get 219 With a post id as an argument, will return the specified post for editting. #upload If an image named "road.jpg" is attached to the message, the image will be saved, and three shortcuts -- 'road', 'road.left', and 'road.right' -- will be created. €�����€�����€����$datatabl����������º_LRº_LR���������$datatabl����������º_LRº_LR���������$datatabl����������º_LRº_LR���������$datatabl����������º_LRº_LR���������$datatabl����������º_LRº_LR���������$datatabl����������º_LRº_LR���������$datatabl����������º_LRº_LR���������������������������������������������$datatabl����������º_LRº_LR����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�������Ÿ��{�������¬��W����Verdana��������������������������� �����7��������º^sº„*¬���Â���7�ß ÚLANDÿÿÿÿÿÿ�������win������������mailEditSuite.init() local (pta = html.getPageTableAddress()) local (htmltext = "") on add(s) htmltext = htmltext + s + "\n" pta^.title = "MailEdit Tool Preferences" local (adr = radio.weblog.init()) local (callbackAdr = @weblogData.callbacks.weblogCheckMail.mailEditCallback) local (upstreamCallbackAdr = @user.radio.callbacks.upstreamFileRendered.mailEditCallback) local (dupSubject = false) bundle // handle empty secret subject if mailEditData.secretSubject == "" if defined(callbackAdr^) delete(callbackAdr) if defined(upstreamCallbackAdr^) delete(upstreamCallbackAdr) if pta^.method == "POST" local (postArgs = pta^.radioResponder.postArgs) bundle // process secret subject if postArgs.secretSubject == adr^.prefs.mailPosting.secretSubject dupSubject = true else mailEditData.secretSubject = postArgs.secretSubject bundle // process event log if defined(postArgs.eventLog) mailEditData.flLog = true else mailEditData.flLog = false bundle // process confirm email checkbox if defined(postArgs.confirmEmail) mailEditData.flConfirmEmail = true else mailEditData.flConfirmEmail = false bundle // process enable tool checkbox if defined(postArgs.enableTool) if not defined(callbackAdr^) callbackAdr^ = @mailEditSuite.checkMailCallback if not defined(upstreamCallbackAdr^) upstreamCallbackAdr^ = @mailEditSuite.upstreamCallback else if defined(callbackAdr^) delete(callbackAdr) if defined(upstreamCallbackAdr^) delete(upstreamCallbackAdr) bundle // process enable debug checkbox if defined(postArgs.enableDebug) mailEditData.flDebug = true else mailEditData.flDebug = false bundle // process debug email destination if defined(postArgs.debugEmail) mailEditData.debugDestinationAddress = postArgs.debugEmail bundle // handle error if the subject is the same as the m2w subject if dupSubject if defined(callbackAdr^) delete(callbackAdr) if defined(upstreamCallbackAdr^) delete(upstreamCallbackAdr) bundle // handle mailDate if defined(postArgs.mailDate) mailEditData.flMailDate = true else mailEditData.flMailDate = false add("<p>You may want to read the (sparse) <a href=\"/mailEdit/docs\">documentation</a>.</p>") add("<p>You may wish to <a href=\"/mailEdit/mimeTypes\">view or edit</a> the way MailEdit maps MIME Types to file extensions.</p>") add("<form method=\"POST\">") add("<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\" width=\"100%\">") add("<tr><td colspan=\"2\">The MailEdit Tool enables you to remotely maintain your weblog entries using email. It builds on top of the Mail-to-Weblog functionality already built into Radio, and will not work if the Mail-to-Weblog feature has not been enabled. You can enable it on the <a href=\"http://127.0.0.1:5335/system/pages/prefs?page=2.9\">Mail-to-Weblog Preference Page</a>. Make sure that you choose a different secret subject than the one used for Radio's Mail-to-Weblog, or strange unknown things will happen.<br><br></tr></td>") if dupSubject add("<tr><td colspan=\"2\"><b>WARNING: You picked a Secret Subject that is the same as the Mail-to-Weblog Secret Subject. This is bad, and I've disabled the MailEdit functionality as a result. Please choose a different Secret Subject for MailEdit.</b><br><br></tr></td>") if mailEditData.secretSubject == "" add("<tr><td colspan=\"2\"><b>WARNING: You picked a Secret Subject that is empty. This is bad, and I've disabled the MailEdit functionality as a result. Please choose a different Secret Subject for MailEdit.</b><br><br></tr></td>") if not adr^.prefs.mailPosting.enabled and defined(callbackAdr^) add("<tr><td colspan=\"2\"><b>NOTE: Mail-to-Weblog has not been enabled. MailEdit will not work unless it has been enabled. Go to the <a href=\"http://127.0.0.1:5335/system/pages/prefs?page=2.9\">Mail-to-Weblog Preference Page</a> to enable Mail-to-Weblog.</b><br><br></tr></td>") local (checked = "") bundle // enable tool checkbox if defined(callbackAdr^) checked = "CHECKED" add("<tr><td colspan=\"2\"><input type=\"checkbox\" name=\"enableTool\" " + checked + ">  Check this box to enable MailEdit processing.</td></tr>") add("<tr><td align=\"left\">Secret Subject:</td><td valign=\"top\" width=\"70%\"><input type=\"text\" name=\"secretSubject\" size=\"50\" maxlength=\"100\" value=\"" + mailEditData.secretSubject + "\"></td></tr>") bundle // log checkbox if (mailEditData.flLog) checked = "CHECKED" else checked = "" add("<tr><td colspan=\"2\"><input type=\"checkbox\" name=\"eventLog\" " + checked + ">  Check this box to record MailEdit events in the <a href=\"http://127.0.0.1:5335/system/pages/eventsLog\">event log</a>.</td></tr>") bundle // confirm email checkbox if (mailEditData.flConfirmEmail) checked = "CHECKED" else checked = "" add("<tr><td colspan=\"2\"><input type=\"checkbox\" name=\"confirmEmail\" " + checked + ">  Check this box to receive confirmation emails.</td></tr>") add("<tr><td colspan=\"2\"><br><br>This next feature is enabled by default. It sets the date of the new post to be the same as the date of the email that created the post. This allows you to shut down Radio, and then start it up later, with the posts reflecting the time and date they were sent, rather than when Radio got around to posting them.</td></tr>") bundle // mail date checkbox if (mailEditData.flMailDate) checked = "CHECKED" else checked = "" add("<tr><td colspan=\"2\"><input type=\"checkbox\" name=\"mailDate\" " + checked + ">  Check this box to set the date of a post to be the same as the date of the email.</td></tr>") add("<tr><td colspan=\"2\"><br><br>If debug logging is activated, an entry will be made in a table in the MailEdit tool's database. It is located at mailEditData.debugLog, and can be examined through the Radio UserLand GUI interface. If you are not familiar with the GUI interface, you can safely ignore this setting, leaving it disabled. But if you are technically oriented and familiar with the Radio environment, you can examine the log and see the details of what MailEdit is doing.<p>In addition, when debug logging is activated, you can supply an email address that will recieve a copy of all replies sent out by MailEdit. I found this to be useful, you may or may not.<br><br></td></tr>") bundle // debug checkbox if (mailEditData.flDebug) checked = "CHECKED" else checked = "" add("<tr><td colspan=\"2\"><input type=\"checkbox\" name=\"enableDebug\" " + checked + ">  Check this box to enable MailEdit debug logging.</td></tr>") add("<tr><td align=\"left\">Debugging email address:</td><td valign=\"top\" width=\"70%\"><input type=\"text\" name=\"debugEmail\" size=\"50\" maxlength=\"100\" value=\"" + mailEditData.debugDestinationAddress + "\"></td></tr>") add("<tr height=\"15\"><td colspan=\"2\"> </td></tr><tr><td colspan=\"2\"><input type=\"submit\" value=\"Submit\"></td></tr>") add("</table>") add("</form>") return (htmltext) €�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����������„�����������€�����€�����€�����������������������������€�����������������������������€�����������������������������€���������������������������������������������������������������€�����������������������������€�����������������€����������������������������������€�����������������������������€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����������������������€�����€�����������������������������������€�����������������������������������€�����€�����������������������������������€�����€�����������������������������������€�����€�����€�����€�����€�����€�������{�� ç��������Þ�� ‘����Verdana���������������������������������������ºyŽ>ºy˜ú���C���'�9ZæLANDÿÿÿÿÿÿ�������win������������mailEditSuite.init() local (pta = html.getPageTableAddress()) local (htmltext = "") on add(s) htmltext = htmltext + s + "\n" pta^.title = "MailEdit MIME Types" if pta^.method == "POST" local (postArgs = pta^.radioResponder.postArgs) if defined(postArgs.mimeType) if defined(postArgs.fileExtension) mailEditData.mimeTypes.images.[postArgs.mimeType] = postArgs.fileExtension if pta^.method == "GET" local (getArgs = pta^.radioResponder.getArgs) if defined(getArgs.remove) if defined(mailEditData.mimeTypes.images.[getArgs.remove]) delete(@mailEditData.mimeTypes.images.[getArgs.remove]) radio.webserver.redirect("/mailEdit/mimeTypes") add("<p>You can <a href=\"/mailEdit/\">return</a> to the front page of MailEdit's preferences.</p>") add("<form method=\"POST\">") add("<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\" width=\"100%\">") add("<tr><td colspan=\"3\">When processing attachments, MailEdit will choose the extension of the filename based on the MIME Type of the attachment. Here are the current settings, you may remove or add mappings below:<br><br></td></tr>") add("<tr><td><b>MIME Type</b></td><td><b>File Extension</b></td></tr>") for mt in @mailEditData.mimeTypes.images add("<tr><td>" + nameOf(mt^) + "</td><td>" + mt^ + "</td><td><a href=\"/mailEdit/mimeTypes?remove=" + string.urlencode(nameOf(mt^)) + "\">remove this mapping</a></td></tr>") add("<tr><td colspan=\"3\"><br><br>Note: At the moment this particular preference is not all that useful to change -- these are all the image types that will normally be encountered, and right now MailEdit assumes that all attachments are images. Play with it if you wish, but understand that deleting a mapping makes it so that MailEdit will ignore attachments of that type.</td></tr>") add("<tr><td colspan=\"3\"><br><br>You can add a MIME Type to File Extension mapping here:<br><br></td></tr>") add("<tr><td align=\"left\">MIME Type:</td><td colspan=\"2\" valign=\"top\" width=\"70%\"><input type=\"text\" name=\"mimeType\" size=\"50\" maxlength=\"100\" value=\"\"></td></tr>") add("<tr><td align=\"left\">File Extension:</td><td colspan=\"2\" valign=\"top\" width=\"70%\"><input type=\"text\" name=\"fileExtension\" size=\"50\" maxlength=\"100\" value=\"\"></td></tr>") add("<tr height=\"15\"><td colspan=\"2\"> </td></tr><tr><td colspan=\"2\"><input type=\"submit\" value=\"Submit\"></td></tr>") add("</table>") add("</form>") return (htmltext) €�����€�����€�����€�����������€�����€�����€�����€�����������������������������€�����€�����������������������������������€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€�����€������� ç��{������!���j���µü7ºyŽ>�������� ���� ��� �������* ����4���@ ����H���T ����[���g ����n���z �������‹ ����‘��� ����§#filters�������Åš#ftpSite�������Æy #glossary�������Ç5#images�������ÇÜ#prefs�������È™#tools�������ÉÄdocs��������Ê>index�������æé mimeTypes������p��VVerdana��������������������������� ����������·��B?8“ï������������������������{��¨�������¤���8���º\3ü�������� ���� ��� ����&���2 ����@���L ����\ mailEditData��������X mailEditInfo�������E mailEditSuite�������ÀvmailEditWebsite������c��V����������������������������������������������Ü�Ú�Z�´d)¢������������������������V��Ü���Verdana���������������������������������������º|÷ó¼þ��z���çA¯ÂLANDÿÿÿÿÿÿ�������win������������mailEditData mailEditInfo author authorEmail description homePageUrl name releaseDate version mailEditSuite background callbacks checkMailCallback codeFreshener loadNewCode refreshBetaCode refreshBetaCodeFromWork refreshCode refreshCodeFromWork refreshCodeMenu releaseNewBetaCode releaseNewCode imageRef init menu newDirectives statusCenterMessage mailEditWebsite #filters #ftpSite #glossary #images #prefs #tools docs index mimeTypes €�����(Ɉ‰É�������������€�����(Ɉ‰É�������������€������(Éð‰É��������������€������(Éð‰É��������������€������(Éð‰É��������������€������(Éð‰É��������������€������(Éð‰É��������������€������(Éð‰É��������������€������(Éð‰É��������������€�����(Ɉ‰É�������������€�����(É…É�������������€�����(É…É�������������€������(É…É��������������€�����(É…É�������������€������(ÉŽÉ��������������€������(ÉŽÉ��������������€������(ÉŽÉ��������������€������(ÉŽÉ��������������€������(ÉŽÉ��������������€������(ÉŽÉ��������������€������(ÉŽÉ��������������€������(ÉŽÉ��������������€������(É…É��������������€������(É…É��������������€������(É…É��������������€������(É…É��������������€������(É…É��������������€�����(Ɉ‰É�������������€�����(ɃÉ�������������€�����(ɃÉ�������������€�����(ɃÉ�������������€�����(ɃÉ�������������€�����(ɃÉ�������������€�����(ɃÉ�������������€������(ɃÉ��������������€������(ɃÉ��������������€������(ɃÉ����������������¨��º������ê �V¡æArial������������������������������ ����������������ÿÿÿÿÿÿÿÿ MS Sans Serif���������������������� �����������������"���ï‚Times New Roman������������������!�� ����������������)�[ƒáArial������������������������������ ����������������8�LtðArial������������������������������ ����������������ÿÿÿÿÿÿÿÿ MS Sans Serif���������������������� ����������������������ÿÿ����������������������������������������������������������º