Serves 6\n\n1/3 cup flour\n1 teaspoon salt\n1/4 teaspoon pepper\n1/2 teaspoon paprika\n2 pounds beef round steak, cut into 1/2" thick strips\n1 1/2 cups chopped onion\n1/4 teaspoon garlic powder\n1-14 oz can tomatoes with juice, broken up\n1/4 cup ketchup\n2 teaspoon beef bouillon granules\n2 tablespoons sherry\n2 cups fresh mushrooms, sliced\n1 cup light sour cream\n\nCombine flour, salt, pepper and paprika in plastic bag. Place a few strips of the steak in at a time. Shake to coat. Place in crockpot. Mix next 7 ingredients in bowl, pour over steak. Cook on Low for 7-9 hours or on High for 3 1/2 to 4 1/2 hours. Stir in sour cream in the last 30 minutes..\n\nServe alone or over noodles or rice.
stew beef, 1 1/2 to 2 1/2 pounds\n1 env. Lipton onion soup\n1 can golden mushroom soup\n1/2 c. red wine\n1 can mushrooms, drained \n\nMix all together in crockpot; cover and cook 8 to 10 hours on low setting. Serve over rice or noodles.
{{{\nversion.extensions.calendar = { major: 1, minor: 1, revision: 0, date: new Date(2005, 10, 02)};\n\n// --------------------------------------------------------------------\n// Calendar\n// --------------------------------------------------------------------\n\nconfig.macros.calendar = {holidays: []};\nconfig.macros.calendar.options = {\n // months as they appear in the calendar's title\n calendarMonths: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],\n // week day titles as they appear on the calendar\n calendarWeekDays: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],\n\n // day week starts from (normally 0-Su or 1-Mo)\n calendarWeekStart: 0,\n calendarToday: "Today",\n calendarHoliday: "Holiday: ",\n calendarLongDateFormat: "0DD/0MM/YYYY",\n calendarShortDateFormat: "0DD/0MM",\n calendarTag: "schedule"\n};\n\n/***************************************************************************\n** Internal functions\n***************************************************************************/\nconfig.macros.calendar.calendarIsHoliday = function(date) {\n var cm = config.macros.calendar;\n var longHoliday = date.formatString(cm.options.calendarLongDateFormat);\n var shortHoliday = date.formatString(cm.options.calendarShortDateFormat);\n for(var i = 0; i < cm.holidays.length; i++) {\n var holiday = cm.holidays[i].split(":");\n if(holiday[0] == longHoliday || holiday[0] == shortHoliday) {\n return holiday[1];\n }\n }\n return null;\n}\n\nconfig.macros.calendar.onClickOtherDay = function(e) {\n var day = this.getAttribute('tiddlylink');\n story.displayTiddler(null,day,DEFAULT_EDIT_TEMPLATE);\n story.setTiddlerTag(day, config.macros.calendar.options.calendarTag, 0);\n story.focusTiddler(day,"text");\n}\n\nconfig.macros.calendar.getPopupText = function(title) {\n var popup_entries = store.getTiddlerText(title).split("\sn");\n var popup = popup_entries[0];\n if(popup_entries.length>1) popup += " ...";\n return popup;\n}\n\nconfig.macros.calendar.findCalendar = function(child) {\n var parent;\n while (child && child.parentNode) {\n parent = child.parentNode;\n if (parent.id == "calendarWrapper") {\n return parent;\n }\n child = parent;\n }\n return null;\n}\n\nconfig.macros.calendar.selectDate = function(e) {\n if (!e) var e = window.event;\n var cm = config.macros.calendar;\n var calendar = cm.findCalendar(this);\n if (calendar) {\n var d = this.getAttribute("date");\n if (d != null) {\ncm.makeCalendar(calendar, new Date(new Number(d)));\n }\n }\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return false;\n}\n\nconfig.macros.calendar.makeCalendar = function(calendar, dt_current) {\n var cm = config.macros.calendar;\n var dt_today = new Date(new Number(calendar.getAttribute("today")));\n var currentDay = new Date(new Number(calendar.getAttribute("currentDay")));\n var setControls = calendar.getAttribute("setControls");\n calendar.setAttribute("date", dt_current.valueOf());\n\n while (calendar.hasChildNodes())\n calendar.removeChild(calendar.firstChild);\n\nif(setControls==1){\n // get same date in the previous year\n var dt_prev_year = new Date(dt_current);\n dt_prev_year.setFullYear(dt_prev_year.getFullYear() - 1);\n if (dt_prev_year.getDate() != dt_current.getDate())\n dt_prev_year.setDate(0);\n\n // get same date in the next year\n var dt_next_year = new Date(dt_current);\n dt_next_year.setFullYear(dt_next_year.getFullYear() + 1);\n if (dt_next_year.getDate() != dt_current.getDate())\n dt_next_year.setDate(0);\n\n // get same date in the previous month\n var dt_prev_month = new Date(dt_current);\n dt_prev_month.setMonth(dt_prev_month.getMonth() - 1);\n if (dt_prev_month.getDate() != dt_current.getDate())\n dt_prev_month.setDate(0);\n\n // get same date in the next month\n var dt_next_month = new Date(dt_current);\n dt_next_month.setMonth(dt_next_month.getMonth() + 1);\n if (dt_next_month.getDate() != dt_current.getDate())\n dt_next_month.setDate(0);\n}\n\n // get first day to display in the grid for current month\n var dt_firstday = new Date(dt_current);\n dt_firstday.setDate(1);\n dt_firstday.setDate(1 - (7 + dt_firstday.getDay() - cm.options.calendarWeekStart) % 7);\n\n var area, header, table;\n var line, cell, i;\n\n // 1 - calendar header table\n // 2 - print weekdays titles\n // 3 - calendar days table \ncalendar.cellPadding = 0;\ncalendar.cellSpacing = 0;\narea = createTiddlyElement(calendar, "tbody");\n\n // 1 - calendar header table\n header = createTiddlyElement(area,"tr", "calendarHeader");\n header.cellPadding = 0;\n header.cellSpacing = 0;\n\nif(setControls==1){ \nvar headerValues = [\n [ "<<", "selectYear", dt_prev_year.valueOf() ],\n [ "<", "selectMonth", dt_prev_month.valueOf() ],\n [ cm.options.calendarMonths[dt_current.getMonth()] + ' ' + dt_current.getFullYear(),\n "selectToday", dt_today.valueOf() ],\n [ ">", "selectMonth", dt_next_month.valueOf() ],\n [ ">>", "selectYear", dt_next_year.valueOf() ]\n ];\n\n for (i = 0; i < headerValues.length; ++i) {\n var link = createTiddlyElement(header,"td", null, null, headerValues[i][0]);\n if(i==2) link.colSpan=3;\n link.onclick = cm.selectDate;\n link.setAttribute("date", headerValues[i][2]);\n }\n} else {\n var link = createTiddlyElement(header,"td", null, null, cm.options.calendarMonths[dt_current.getMonth()] + ' ' + dt_current.getFullYear());\nlink.colSpan=7;\n}\n\n // 2 - print weekdays titles\n line = createTiddlyElement(area, "tr", "weekNames");\n for (var n = 0; n < 7; ++n) {\n createTiddlyElement(line, "td", null, null, cm.options.calendarWeekDays[(cm.options.calendarWeekStart + n)%7]);\n }\n\n // 3 - calendar days table\n var dt_current_day = new Date(dt_firstday);\n var day_class;\n var title;\n var holiday_name;\n var popup;\n var clickHandler;\n//alert(dt_firstday);\n while (dt_current_day.getMonth() == dt_current.getMonth() ||\n dt_current_day.getMonth() == dt_firstday.getMonth()) {\n\n // print row header\n line = createTiddlyElement(area, "tr", "calendarLine", null, null);\n for (var n_current_wday = 0; n_current_wday < 7; ++n_current_wday) {\n title = dt_current_day.formatString(cm.options.calendarLongDateFormat);\n clickHandler = cm.onClickOtherDay;\n popup = null;\n holiday_name = cm.calendarIsHoliday(dt_current_day);\n\n if (holiday_name != null) {\n // holidays\n day_class = "holiDay";\n popup = cm.options.calendarHoliday + holiday_name;\n } else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6) {\n // weekend days\n day_class = "weekDay";\n } else {\n // print working days of current month\n day_class = "workingDay";\n }\n\n if (currentDay.valueOf() == dt_current_day.valueOf()) {\n // print current date\n if (store.tiddlerExists(title)) {\n // day has a tiddler associated with it\n day_class += " currentscheduledDay";\n clickHandler = onClickTiddlerLink;\n popup = cm.options.calendarToday + ": "+ cm.getPopupText(title);\n } else {\n day_class += " currentDay";\n popup = cm.options.calendarToday;\n}\n}\n\n if (store.tiddlerExists(title) && dt_current_day.valueOf() != dt_today.valueOf()) {\n // day has a tiddler associated with it\n day_class += " scheduledDay";\n clickHandler = onClickTiddlerLink;\n popup = cm.getPopupText(title);\n }\n\n // extra formatting for days of previous or next month\n if (dt_current_day.getMonth() != dt_current.getMonth()) {\n day_class += " otherMonthDay";\n }\n\n var text = dt_current_day.getDate();\n var cell = createTiddlyElement(line, "td", null, day_class, text);\n cell.onclick=clickHandler;\n cell.setAttribute("date", dt_current_day.valueOf());\n cell.setAttribute("tiddlyLink", title);\n if(popup) cell.setAttribute("title", popup);\n\n dt_current_day.setDate(dt_current_day.getDate()+1);\n }\n }\n}\n\nconfig.macros.calendar.handler = function(place, macroName, params) {\n var start_date = new Array();\n var date;\n var n_rows = 1;\n var n_cols = 1;\n var n_months = 1;\n var setControls = 1;\n switch(params.length){\n case 0:\n date = new Date();\n // filter time values off\n start_date[0] = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n break;\n case 1:\n for(var i = 0; i < 12; i++){\n start_date[i] = new Date(params[0], i, 1);\n }\n n_rows = 4;\n n_cols = 3;\n n_months = 12;\n break;\n case 2:\n start_date[0] = new Date(params[0], params[1]-1, 1);\n break;\n case 3:\n n_cols = 3;\n n_months = params[2];\n for(var i = 0; i < n_months; i++){\n start_date[i] = new Date(params[0], params[1]-1+i, 1);\n }\n n_rows = Math.max(1,Math.ceil(n_months/n_cols));\n n_cols = Math.min(n_cols,n_months);\n break;\n case 4:\n n_months = params[2];\n n_cols = params[3];\n for(var i = 0; i < n_months; i++){\n start_date[i] = new Date(params[0], params[1]-1+i, 1);\n }\n n_rows = Math.max(1,Math.ceil(n_months/n_cols));\n n_cols = Math.min(n_cols,n_months);\n break;\n }\n if(n_months>1) setControls = 0;\n var currentDay = new Date();\n currentDay = new Date(currentDay.getFullYear(), currentDay.getMonth(), currentDay.getDate());\n var holder = createTiddlyElement(place, "table", null,"calendarHolder");\n var holderTable = createTiddlyElement(holder, "tbody");\n for(var i = 0; i < n_rows; i++){\n var holderLine = createTiddlyElement(holderTable, "tr");\n for(var j = 0; j < n_cols; j++){\n var holderCell = createTiddlyElement(holderLine, "td");\n if(n_cols*i+j+1<=n_months){\n calendar = createTiddlyElement(holderCell, "table", "calendarWrapper");\n calendar.setAttribute("name", "calendarWrapper");\n calendar.setAttribute("setControls", setControls);\n calendar.setAttribute("today", start_date[n_cols*i+j].valueOf());\n calendar.setAttribute("currentDay", currentDay.valueOf());\n config.macros.calendar.makeCalendar(calendar, start_date[n_cols*i+j]);\n }\n }\n }\n}\n\nfunction refreshCalendars(hint) {\n var calendars = document.getElementsByName("calendarWrapper");\n var i, c;\n for (i = 0; i < calendars.length; ++i) {\n c = calendars.item(i);\n if (c.id == "calendarWrapper") {\n config.macros.calendar.makeCalendar(c, new Date(new Number(c.getAttribute("date"))));\n }\n }\n}\n\nstore.addNotification(null, refreshCalendars);\n}}}
2 pounds boneless, skinless chicken breasts\n2 cans condensed cream of chicken soup\n1 can condensed cheddar cheese soup\n1/4 teaspoon garlic powder\n\nPlace chicken breasts in crockpot. Mix the undiluted soups together with the garlic powder and pour over chicken. Cover and cook on low 6 to 8 hours, until chicken is tender.\n\nRemove chicken, pour sauce over cooked pasta or rice.
Serving Size : 6\n\n6 boneless chicken breasts\n16 ounces sour cream\n1 can cream of Mushroom soup\n1 package Lipton’s Onion Soup mix\n\nMix all together and put into crockpot. Cook on low for 4 -6 hours. Or until chicken is tender. Serve over cooked noodles or rice.\n\n\n
1 lb. leftover turkey or chicken, cubed (deboned)\n1 sm. onion, chopped\n3 carrots, sliced\n3 celery stalks, sliced\n1 c. brown rice, cooked\n1 c. regular rice, cooked or uncooked Minute Rice\n2 chicken bouillon cubes\n1/4 c. butter or margarine\n2 tsp. parsley flakes\n\nCombine all ingredients in large crockpot and cook on high 4 hours or low overnight.
<<twupdate>>\n[[ConfigurationMap-2column]]\n[[myLayoutStyle]]\n[[myColorStyle]]
\n[[PageTemplate]]\n|>|>|[[SiteTitle]] - [[SiteSubtitle]]|\n|[[MainMenu]]|[[DefaultTiddlers]] <html><br><br><br><br></html>[[ViewTemplate]] <html><br><br></html> [[EditTemplate]]|[[SideBarOptions]]|\n|~|~|[[OptionsPanel]]|\n|~|~|[[AdvancedOptions]]|\n|~|~|[[SideBarTabs]]|\n\n''~SideBarTabs:'' [[TabAll]] - [[TabMore]] - [[TabMoreMissing]] - [[TabMoreOrphans]] - [[TabMoreShadow]] - [[TabTags]] - [[TabTimeline]]\n''~StyleSheet:'' ''[[StyleSheet]]'' - [[StyleSheetColors]] - [[StyleSheetLayout]] - [[StyleSheetPrint]]\n\n[[SiteUrl]]
[[PageTemplate]]\n|>|>|[[SiteTitle]] - [[SiteSubtitle]]|\n|>|>|[[MainMenu]]|\n|[[DefaultTiddlers]] <html><br><br><br><br></html>[[ViewTemplate]] <html><br><br></html> [[EditTemplate]]|[[SideBarOptions]]|\n|~|[[OptionsPanel]]|\n|~|[[AdvancedOptions]]|\n|~|[[SideBarTabs]]|\n\n''~SideBarTabs:''\n[[TabTimeline]] - [[TabAll]] - [[TabTags]] - [[TabMore]] - [[TabMoreMissing]] - [[TabMoreOrphans]] - [[TabMoreShadowed]]\n\n''~StyleSheet:'' \n''[[StyleSheet]]'' - [[StyleSheetColors]] - [[StyleSheetLayout]] - [[StyleSheetPrint]]\n\n[[SiteUrl]]
[[Cheesy Chicken]]\n[[Chicken Stroganoff]]\n[[Italian Chicken and Potatoes]]\n[[Beef Stroganoff]]\n[[Teriyaki Steak]]\n[[Chicken and Rice Soup]]\n[[Beef Tips]]\n\n
<<calendar 2006 1 12 3>>
/***\n''HTML Formatting Plugin for TiddlyWiki version 1.2.x and 2.0''\n^^author: Eric Shulman - ELS Design Studios\nsource: http://www.elsdesign.com/tiddlywiki/#HTMLFormattingPlugin\nlicense: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^\n\nThe shorthand Wiki-style formatting syntax of ~TiddlyWiki is very convenient and enables most content to be reasonably well presented. However, there are times when tried-and-true HTML formatting syntax allows more more precise control of the content display.\n\nWhen HTML formatting syntax is embedded within a tiddler (in between {{{<}}}{{{html>}}} and {{{<}}}{{{/html>}}} markers) TiddlyWiki passes this content to the browser for processing as 'native' HTML. However, TiddlyWiki does not also process the HTML source content for any embedded wiki-formatting syntax it may contain. This means that while you can use HTML formatted content, you cannot mix wiki-formatted content within the HTML formatting.\n!!!!!Usage\n<<<\nThe ~HTMLFormatting plugin allows you to freely ''mix wiki-style formatting syntax within HTML formatted content'' by extending the action of the standard TiddlyWiki formatting handler.\n\nWhen a tiddler is about to be displayed, ~TiddlyWiki looks for tiddler content contained within ''<{{{html}}}>'' and ''<{{{/html}}}>'' HTML tags. This content (if any) is passed directly to the browser's internal "rendering engine" to process as ~HTML-formatted content. Once the HTML formatting has been processed, all the pieces of text occuring in between the HTML formatting are then processed by the ~TiddlyWiki rendering engine, one piece at a time, so that normal wiki-style formatting can be applied to the individual text pieces.\n<<<\n!!!!!Line breaks\n<<<\nOne major difference between Wiki formatting and HTML formatting is how "line breaks" are processed. Wiki formatting treats all line breaks as literal content to be displayed //as-is//. However, because HTML normally ignores line breaks and actually processes them as simple "word separators" instead, many people who write HTML include extra line breaks in their documents, just to make the "source code" easier to read.\n\nEven though you can use HTML tags within your tiddler content, the default treatment for line breaks still follows the Wiki-style rule (i.e., all new lines are displayed as-is). When adding HTML content to a tiddler (especially if you cut-and-paste it from another web page), you should take care to avoid adding extra line breaks to the text.\n\nIf removing all the extra line breaks from your HTML content would be a big hassle, you can quickly //override the default Wiki-style line break rule// so that the line breaks use the standard HTML rules instead. Placing a ''<{{{hide linebreaks}}}>'' tag within the tiddler's HTML content changes all line breaks to spaces before rendering the content, so that the literal line breaks will be processed as simple word-breaks instead.\n\nNote: this does //not// alter the actual tiddler content that is stored in the document, just the manner in which it is displayed. Any line breaks contained in the tiddler will still be there when you edit its content. Also, to include a literal line break when the ''<{{{hide linebreaks}}}>'' tag is present, you will need to use a ''<{{{br}}}>'' or ''<{{{p}}}>'' HTML tag instead of simply typing a line break.\n<<<\n!!!!!Installation\n<<<\nimport (or copy/paste) the following tiddlers into your document:\n''HTMLFormattingPlugin'' (tagged with <<tag systemConfig>>)\n^^documentation and javascript for HTMLFormatting handling^^\n<<<\n!!!!!Revision History\n<<<\n''2005.12.01 [2.1.0]''\ndon't wikify #TEXT nodes inside SELECT and TEXTAREA elements\n''2005.11.06 [2.0.1]''\ncode cleanup\n''2005.10.31 [2.0.0]''\nreplaced hijack wikify() with hijack config.formatters["html"] and simplified recursive WikifyTextNodes() code\n''2005.10.09 [1.0.2]''\ncombined documentation and code into a single tiddler\n''2005.08.05 [1.0.1]''\nmoved HTML and CSS definitions into plugin code instead of using separate tiddlers\n''2005.07.26 [1.0.1]''\nRe-released as a plugin.\nAdded <{{{html}}}>...</{{{nohtml}}}> and <{{{hide newlines}}}> handling\n''2005.07.20 [1.0.0]''\nInitial Release (as code adaptation)\n<<<\n!!!!!Credits\n<<<\nThis feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]\n<<<\n!!!!!Code\n***/\n//{{{\nversion.extensions.HTMLFormatting = {major: 2, minor: 1, revision: 0, date: new Date(2005,12,1)};\n\n// find the formatter for HTML and replace the handler\nfor (var i=0; i<config.formatters.length && config.formatters[i].name!="html"; i++);\nif (i<config.formatters.length) config.formatters[i].handler=function(w)\n{\n var lookaheadRegExp = new RegExp(this.lookahead,"mg");\n lookaheadRegExp.lastIndex = w.matchStart;\n var lookaheadMatch = lookaheadRegExp.exec(w.source)\n if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {\n var html=lookaheadMatch[1];\n // optionally suppress wiki-style literal handling of newlines\n // strip any carriage returns added by Internet Explorer's textarea edit field\n // encode newlines as \sn so Internet Explorer's HTML parser won't eat them\n // encode macro brackets (<< and >>) so HTML parser won't eat them\n if (html.indexOf('<hide linebreaks>')!=-1) html=html.replace(regexpNewLine,' ');\n html=html.replace(regexpCarriageReturn,'');\n html=html.replace(regexpNewLine,'\s\sn');\n html=html.replace(/<</g,'%%(').replace(/>>/g,')%%');\n // create span to hold HTML\n // parse HTML and normalize the results\n // walk node tree and call wikify() on each text node\n var e = createTiddlyElement(w.output,"span");\n e.innerHTML=html;\n e.normalize(); \n wikifyTextNodes(e);\n // advance to next parse position\n w.nextMatch=lookaheadMatch.index + lookaheadMatch[0].length;\n }\n}\n\n// wikify text nodes remaining after HTML content is processed (pre-order recursion)\nfunction wikifyTextNodes(theNode)\n{\n for (var i=0;i<theNode.childNodes.length;i++) {\n var theChild=theNode.childNodes.item(i);\n if (theChild.nodeName.toLowerCase()=='option') continue;\n if (theChild.nodeName.toLowerCase()=='select') continue;\n wikifyTextNodes(theChild);\n if (theChild.nodeName=='#text') {\n var txt=theChild.nodeValue;\n // decode macro brackets and newlines\n txt=txt.replace(/\s%%\s(/g,'<<').replace(/\s)\s%%/g,'>>').replace(regexpBackSlashEn,'\sn');\n // replace text node with wikified() span\n var newNode=createTiddlyElement(null,"span");\n wikify(txt,newNode);\n theNode.replaceChild(newNode,theChild);\n }\n }\n}\n//}}}\n
<<slideShow slidePause:3000>>\n<<photoShow pics/pic*.jpg 1 2>>
<<slideShow slidePause:3000>>\n<<photoShow pics/pic*.jpg 1 2>>
/***\n''Import Tiddlers Plugin for TiddlyWiki version 1.2.x and 2.0''\n^^author: Eric Shulman - ELS Design Studios\nsource: http://www.TiddlyTools.com/#ImportTiddlersPlugin\nlicense: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^\n\nWhen many people share and edit copies of the same TiddlyWiki document, the ability to quickly collect all these changes back into a single, updated document that can then be redistributed to the entire group is very important. This plugin lets you selectively combine tiddlers from any two TiddlyWiki documents. It can also be very useful when moving your own tiddlers from document to document (e.g., when upgrading to the latest version of TiddlyWiki, or 'pre-loading' your favorite stylesheets into a new 'empty' TiddlyWiki document.)\n\n!!!!!Inline interface (live)\n<<<\n<<importTiddlers inline>>\n<<<\n!!!!!Macro Syntax\n<<<\n{{{<<importTiddlers>>}}}\ncreates "import tiddlers" link. click to show/hide import control panel\n\n{{{<<importTiddlers inline>>}}}\ncreates import control panel directly in tiddler content\n\n{{{<<importTiddlers filter source quiet ask>>}}}\nnon-interactive 'automatic' import.\n''filter'' determines which tiddlers will be automatically selected for importing. Use one of the following keywords:\n>''"new"'' retrieves only tiddlers that are found in the import source document, but do not yet exist in the destination document\n>''"changes"'' retrieves only tiddlers that exist in both documents for which the import source tiddler is newer than the existing tiddler\n>''"updates"'' retrieves both ''new'' and ''changed'' tiddlers (this is the default action when none is specified)\n>''"all"'' retrieves ALL tiddlers from the import source document, even if they have not been changed.\n''source'' is the location of the imported document. It can be either a local document or an URL:\n>filename is any local path/file, in whatever format your system requires\n>URL is any remote web location that starts with "http://" or "https://"\n''"quiet"'' (optional)\n>supresses all status message during the import processing (e.g., "opening local file...", "found NN tiddlers..." etc). Note that if ANY tiddlers are actualy imported, a final information message will still be displayed (along with the ImportedTiddlers report), even when 'quiet' is specified. This ensures that changes to your document cannot occur without any visible indication at all.\n''"ask"'' (optional)\n>adds interactive confirmation. A browser message box (OK/Cancel) is displayed for each tiddler that will be imported, so that you can manually bypass any tiddlers that you do not want to import.\n\n''Special tag values: importReplace and importPublic''\n\nBy adding these special tags to an existing tiddler, you can precisely control whether or not to allow updates to that tiddler as well as decide which tiddlers in your document can be automatically imported by others.\n*''For maximum safety, the default action is to prevent existing tiddlers from being unintentionally overwritten by incoming tiddlers.'' To allow an existing tiddler to be overwritten by an imported tiddler, you must tag the existing tiddler with ''<<tag importReplace>>''\n*''For maximum privacy, the default action for //outgoing// tiddlers is to NOT automatically share your tiddlers with others.'' To allow a tiddler in your document to be shared via auto-import actions by others, you must tag it with ''<<tag importPublic>>''\n//Note: these tags are only applied when using the auto-import processing. When using the interactive control panel, all tiddlers in the imported document are available in the listbox, regardless of their tag values.//\n<<<\n!!!!!Interactive Usage\n<<<\nWhen used interactively, a control panel is displayed consisting of an "import source document" filename input (text field plus a ''[Browse...]'' button), a listbox of available tiddlers, a "differences only" checkbox, an "add tags" input field and four push buttons: ''[open]'', ''[select all]'', ''[import]'' and ''[close]''.\n\nPress ''[browse]'' to select a TiddlyWiki document file to import. You can also type in the path/filename or a remote document URL (starting with http://)and press ''[open]''. //Note: There may be some delay to permit the browser time to access and load the document before updating the listbox with the titles of all tiddlers that are available to be imported.//\n\nSelect one or more titles from the listbox (hold CTRL or SHIFT while clicking to add/remove the highlight from individual list items). You can press ''[select all]'' to quickly highlight all tiddler titles in the list. Use the ''[-]'', ''[+]'', or ''[=]'' links to adjust the listbox size so you can view more (or less) tiddler titles at one time. When you have chosen the tiddlers you want to import and entered any extra tags, press ''[import]'' to begin copying them to the current TiddlyWiki document.\n\n''select: all, new, changes, or differences''\n\nYou can click on ''all'', ''new'', ''changes'', or ''differences'' to automatically select a subset of tiddlers from the list. This makes it very quick and easy to find and import just the updated tiddlers you are interested in:\n>''"all"'' selects ALL tiddlers from the import source document, even if they have not been changed.\n>''"new"'' selects only tiddlers that are found in the import source document, but do not yet exist in the destination document\n>''"changes"'' selects only tiddlers that exist in both documents but that are newer in the source document\n>''"differences"'' selects all new and existing tiddlers that are different from the destination document (even if destination tiddler is newer)\n\n''Import Tagging:''\n\nTiddlers that have been imported can be automatically tagged, so they will be easier to find later on, after they have been added to your document. New tags are entered into the "add tags" input field, and then //added// to the existing tags for each tiddler as it is imported.\n\n''Skip, Rename, Merge, or Replace:''\n\nWhen importing a tiddler whose title is identical to one that already exists, the import process pauses and the tiddler title is displayed in an input field, along with four push buttons: ''[skip]'', ''[rename]'', ''[merge]'' and ''[replace]''.\n\nTo bypass importing this tiddler, press ''[skip]''. To import the tiddler with a different name (so that both the tiddlers will exist when the import is done), enter a new title in the input field and then press ''[rename]''. Press ''[merge]'' to combine the content from both tiddlers into a single tiddler. Press ''[replace]'' to overwrite the existing tiddler with the imported one, discarding the previous tiddler content.\n\n//Note: if both the title ''and'' modification date/////time match, the imported tiddler is assumed to be identical to the existing one, and will be automatically skipped (i.e., not imported) without asking.//\n\n''Import Report History''\n\nWhen tiddlers are imported, a report is generated into ImportedTiddlers, indicating when the latest import was performed, the number of tiddlers successfully imported, from what location, and by whom. It also includes a list with the title, date and author of each tiddler that was imported.\n\nWhen the import process is completed, the ImportedTiddlers report is automatically displayed for your review. If more tiddlers are subsequently imported, a new report is //added// to ImportedTiddlers, above the previous report (i.e., at the top of the tiddler), so that a reverse-chronological history of imports is maintained.\n\nIf a cumulative record is not desired, the ImportedTiddlers report may be deleted at any time. A new ImportedTiddlers report will be created the next time tiddlers are imported.\n\nNote: You can prevent the ImportedTiddlers report from being generated for any given import activity by clearing the "create a report" checkbox before beginning the import processing.\n\n<<<\n!!!!!Installation\n<<<\ncopy/paste the following tiddlers into your document:\n''ImportTiddlersPlugin'' (tagged with <<tag systemConfig>>)\n\ncreate/edit ''SideBarOptions'': (sidebar menu items) \n^^Add "< < ImportTiddlers > >" macro^^\n\n''Quick Installation Tip #1:''\nIf you are using an unmodified version of TiddlyWiki (core release version <<version>>), you can get a new, empty TiddlyWiki with the Import Tiddlers plugin pre-installed (''[[download from here|TW+ImportExport.html]]''), and then simply import all your content from your old document into this new, empty document.\n<<<\n!!!!!Revision History\n<<<\n''2006.02.21 [2.7.1]''\nClean up layout problems with IE. (Use tables for alignment instead of SPANs styled with float:left and float:right)\n''2006.02.21 [2.7.0]''\nAdded "local file" and "web server" radio buttons for selecting dynamic import source controls in ImportPanel. Default file control is replaced with URL text input field when "web server" is selected. Default remote document URL is defined in SiteURL tiddler. Also, added option for prepending SiteProxy URL as prefix to remote URL to mask cross-domain document access (requires compatible server-side script)\n''2006.02.17 [2.6.0]''\nRemoved "differences only" listbox display mode, replaced with selection filter 'presets': all/new/changes/differences. Also fixed initialization handling for "add new tags" so that checkbox state is correctly tracked when panel is first displayed.\n''2006.02.16 [2.5.4]''\nadded checkbox options to control "import remote tags" and "keep existing tags" behavior, in addition to existing "add new tags" functionality.\n''2006.02.14 [2.5.3]''\nFF1501 corrected unintended global 't' (loop index) in importReport() and autoImportTiddlers()\n''2006.02.10 [2.5.2]''\ncorrected unintended global variable in importReport().\n''2006.02.05 [2.5.1]''\nmoved globals from window.* to config.macros.importTiddlers.* to avoid FireFox 1.5.0.1 crash bug when referencing globals\n''2006.01.18 [2.5.0]''\nadded checkbox for "create a report". Default is to create/update the ImportedTiddlers report. Clear the checkbox to skip this step.\n''2006.01.15 [2.4.1]''\nadded "importPublic" tag and inverted default so that auto sharing is NOT done unless tagged with importPublic\n''2006.01.15 [2.4.0]''\nAdded support for tagging individual tiddlers with importSkip, importReplace, and/or importPrivate to control which tiddlers can be overwritten or shared with others when using auto-import macro syntax. Defaults are to SKIP overwriting existing tiddlers with imported tiddlers, and ALLOW your tiddlers to be auto-imported by others.\n''2006.01.15 [2.3.2]''\nAdded "ask" parameter to confirm each tiddler before importing (for use with auto-importing)\n''2006.01.15 [2.3.1]''\nStrip TW core scripts from import source content and load just the storeArea into the hidden IFRAME. Makes loading more efficient by reducing the document size and by preventing the import document from executing its TW initialization (including plugins). Seems to resolve the "Found 0 tiddlers" problem. Also, when importing local documents, use convertUTF8ToUnicode() to convert the file contents so support international characters sets.\n''2006.01.12 [2.3.0]''\nReorganized code to use callback function for loading import files to support event-driven I/O via an ASYNCHRONOUS XMLHttpRequest. Let's processing continue while waiting for remote hosts to respond to URL requests. Added non-interactive 'batch' macro mode, using parameters to specify which tiddlers to import, and from what document source. Improved error messages and diagnostics, plus an optional 'quiet' switch for batch mode to eliminate //most// feedback.\n''2006.01.11 [2.2.0]''\nAdded "[by tags]" to list of tiddlers, based on code submitted by BradleyMeck\n''2006.01.09 [2.1.1]''\nWhen a URL is typed in, and then the "open" button is pressed, it generates both an onChange event for the file input and a click event for open button. This results in multiple XMLHttpRequest()'s which seem to jam things up quite a bit. I removed the onChange handling for file input field. To open a file (local or URL), you must now explicitly press the "open" button in the control panel.\n''2006.01.08 [2.1.0]''\nIMPORT FROM ANYWHERE!!! re-write getImportedTiddlers() logic to either read a local file (using local I/O), OR... read a remote file, using a combination of XML and an iframe to permit cross-domain reading of DOM elements. Adapted from example code and techniques courtesy of Jonny LeRoy.\n''2006.01.06 [2.0.2]''\nWhen refreshing list contents, fixed check for tiddlerExists() when "show differences only" is selected, so that imported tiddlers that don't exist in the current file will be recognized as differences and included in the list.\n''2006.01.04 [2.0.1]''\nWhen "show differences only" is NOT checked, import all tiddlers that have been selected even when they have a matching title and date.\n''2005.12.27 [2.0.0]''\nUpdate for TW2.0\nDefer initial panel creation and only register a notification function when panel first is created\n''2005.12.22 [1.3.1]''\ntweak formatting in importReport() and add 'discard report' link to output\n''2005.12.03 [1.3.0]''\nDynamically create/remove importPanel as needed to ensure only one instance of interface elements exists, even if there are multiple instances of macro embedding. Also, dynamically create/recreate importFrame each time an external TW document is loaded for importation (reduces DOM overhead and ensures a 'fresh' frame for each document)\n''2005.11.29 [1.2.1]''\nfixed formatting of 'detail info' in importReport()\n''2005.11.11 [1.2.0]''\nadded 'inline' param to embed controls in a tiddler\n''2005.11.09 [1.1.0]''\nonly load HTML and CSS the first time the macro handler is called. Allows for redundant placement of the macro without creating multiple instances of controls with the same ID's.\n''2005.10.25 [1.0.5]''\nfixed typo in importReport() that prevented reports from being generated\n''2005.10.09 [1.0.4]''\ncombined documentation with plugin code instead of using separate tiddlers\n''2005.08.05 [1.0.3]''\nmoved CSS and HTML definitions into plugin code instead of using separate tiddlers\n''2005.07.27 [1.0.2]''\ncore update 1.2.29: custom overlayStyleSheet() replaced with new core setStylesheet()\n''2005.07.23 [1.0.1]''\nadded parameter checks and corrected addNotification() usage\n''2005.07.20 [1.0.0]''\nInitial Release\n<<<\n!!!!!Credits\n<<<\nThis feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]\n<<<\n!!!!!Code\n***/\n\n// // Version\n//{{{\nversion.extensions.importTiddlers = {major: 2, minor: 7, revision: 1, date: new Date(2006,2,21)};\n//}}}\n\n// // 1.2.x compatibility\n//{{{\nif (!window.story) window.story=window;\nif (!store.getTiddler) store.getTiddler=function(title){return store.tiddlers[title]}\nif (!store.addTiddler) store.addTiddler=function(tiddler){store.tiddlers[tiddler.title]=tiddler}\nif (!store.deleteTiddler) store.deleteTiddler=function(title){delete store.tiddlers[title]}\n//}}}\n\n// // IE needs explicit global scoping for functions/vars called from browser events\n//{{{\nwindow.onClickImportButton=onClickImportButton;\nwindow.loadImportFile=loadImportFile;\nwindow.refreshImportList=refreshImportList;\n//}}}\n\n// // default cookie/option values\n//{{{\nif (!config.options.chkImportReport) config.options.chkImportReport=true;\n//}}}\n\n\n// // ''MACRO DEFINITION''\n\n//{{{\nconfig.macros.importTiddlers = { };\nconfig.macros.importTiddlers = {\n label: "import tiddlers",\n prompt: "Copy tiddlers from another document",\n countMsg: "%0 tiddlers selected for import",\n src: "", // path/filename or URL of document to import (retrieved from SiteUrl tiddler)\n proxy: "", // URL for remote proxy script (retrieved from SiteProxy tiddler)\n useProxy: false, // use specific proxy script in front of remote URL\n inbound: null, // hash-indexed array of tiddlers from other document\n newTags: "", // text of tags added to imported tiddlers\n addTags: true, // add new tags to imported tiddlers\n listsize: 8, // # of lines to show in imported tiddler list\n importTags: true, // include tags from remote source document when importing a tiddler\n keepTags: true, // retain existing tags when replacing a tiddler\n index: 0, // current processing index in import list\n sort: "" // sort order for imported tiddler listbox\n};\n\nconfig.macros.importTiddlers.handler = function(place,macroName,params) {\n // LINK WITH FLOATING PANEL\n if (!params[0]) {\n createTiddlyButton(place,this.label,this.prompt,onClickImportMenu);\n return;\n }\n // INLINE TIDDLER CONTENT\n if (params[0]=="inline") {\n createImportPanel(place);\n document.getElementById("importPanel").style.position="static";\n document.getElementById("importPanel").style.display="block";\n return;\n }\n // NON-INTERACTIVE BATCH MODE\n switch (params[0]) {\n case 'all':\n case 'new':\n case 'changes':\n case 'updates':\n var filter=params.shift();\n break;\n default:\n var filter="updates";\n break;\n } \n if (!params[0]||!params[0].length) return; // filename is required\n config.macros.importTiddlers.src=params.shift();\n var quiet=(params[0]=="quiet"); if (quiet) params.shift();\n var ask=(params[0]=="ask"); if (ask) params.shift();\n config.macros.importTiddlers.inbound=null; // clear the imported tiddler buffer\n // load storeArea from a hidden IFRAME, then apply import rules and add/replace tiddlers\n loadImportFile(config.macros.importTiddlers.src,filter,quiet,ask,autoImportTiddlers);\n}\n//}}}\n\n// // ''READ TIDDLERS FROM ANOTHER DOCUMENT''\n\n//{{{\nfunction loadImportFile(src,filter,quiet,ask,callback) {\n if (!quiet) clearMessage();\n // LOCAL FILE\n if ((src.substr(0,7)!="http://")&&(src.substr(0,8)!="https://")) {\n if (!quiet) displayMessage("Opening local document: "+ src);\n var txt=loadFile(src);\n if(!txt) { if (!quiet) displayMessage("Could not open local document: "+src); }\n else {\n var s="<html><body>"+txt.substr(txt.indexOf('<div id="storeArea">'));\n if (!quiet) displayMessage(txt.length+" bytes in document. ("+s.length+" bytes used for tiddler storage)");\n config.macros.importTiddlers.inbound = readImportedTiddlers(convertUTF8ToUnicode(s));\n var count=config.macros.importTiddlers.inbound?config.macros.importTiddlers.inbound.length:0;\n if (!quiet) displayMessage("Found "+count+" tiddlers in "+src);\n if (callback) callback(src,filter,quiet,ask);\n }\n return;\n }\n // REMOTE FILE\n var x; // XML object\n try {x = new XMLHttpRequest()}\n catch(e) {\n try {x = new ActiveXObject("Msxml2.XMLHTTP")}\n catch (e) {\n try {x = new ActiveXObject("Microsoft.XMLHTTP")}\n catch (e) { return }\n }\n }\n x.onreadystatechange = function() {\n if (x.readyState == 4) {\n if (x.status == 200) {\n var sa="<html><body>"+x.responseText.substr(x.responseText.indexOf('<div id="storeArea">'));\n if (!quiet) displayMessage(x.responseText.length+" bytes in document. ("+sa.length+" bytes used for tiddler storage)");\n config.macros.importTiddlers.inbound = readImportedTiddlers(sa);\n var count=config.macros.importTiddlers.inbound?config.macros.importTiddlers.inbound.length:0;\n if (!quiet) displayMessage("Found "+count+" tiddlers in "+src);\n if (callback) callback(src,filter,quiet,ask);\n }\n else\n if (!quiet) displayMessage("Could not open remote document:"+ src+" (error="+x.status+")");\n }\n }\n if (document.location.protocol=="file:") { // UniversalBrowserRead only works from a local file context\n try {netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead')}\n catch (e) { if (!quiet) displayMessage(e.description?e.description:e.toString()); }\n }\n if (config.macros.importTiddlers.useProxy) src=config.macros.importTiddlers.proxy+src;\n if (!quiet) displayMessage("Opening remote document: "+ src);\n try {\n var url=src+(src.indexOf('?')<0?'?':'&')+'nocache='+Math.random();\n x.open("GET",url,true);\n x.overrideMimeType('text/html');\n x.send(null);\n }\n catch (e) {\n if (!quiet) {\n displayMessage("Could not open remote document: "+src);\n displayMessage(e.description?e.description:e.toString());\n }\n }\n}\n\nfunction readImportedTiddlers(txt)\n{\n var importedTiddlers = [];\n // create frame\n var f=document.getElementById("importFrame");\n if (f) document.body.removeChild(f);\n f=document.createElement("iframe");\n f.id="importFrame";\n f.style.width="0px"; f.style.height="0px"; f.style.border="0px";\n document.body.appendChild(f);\n // get document\n var d=f.document;\n if (f.contentDocument) d=f.contentDocument; // For NS6\n else if (f.contentWindow) d=f.contentWindow.document; // For IE5.5 and IE6\n // load source into document\n d.open(); d.writeln(txt); d.close();\n // read tiddler DIVs from storeArea DOM element \n var importStore = [];\n var importStoreArea = d.getElementById("storeArea");\n if (!importStoreArea || !(importStore=importStoreArea.childNodes) || (importStore.length==0)) { return null; }\n importStoreArea.normalize();\n for(var t = 0; t < importStore.length; t++) {\n var e = importStore[t];\n var title = null;\n if(e.getAttribute)\n title = e.getAttribute("tiddler");\n if(!title && e.id && (e.id.substr(0,5) == "store"))\n title = e.id.substr(5);\n if(title && title != "") {\n var theImported = new Tiddler();\n theImported.loadFromDiv(e,title);\n importedTiddlers.push(theImported);\n }\n }\n return importedTiddlers;\n}\n//}}}\n\n// // ''NON-INTERACTIVE IMPORT''\n\n// // import all/new/changed tiddlers into store, replacing or adding tiddlers as needed\n//{{{\nfunction autoImportTiddlers(src,filter,quiet,ask)\n{\n var count=0;\n if (config.macros.importTiddlers.inbound) for (var t=0;t<config.macros.importTiddlers.inbound.length;t++) {\n var theImported = config.macros.importTiddlers.inbound[t];\n var theExisting = store.getTiddler(theImported.title);\n\n // only import tiddlers if tagged with "importPublic"\n if (theImported.tags && theImported.tags.find("importPublic")==null)\n { config.macros.importTiddlers.inbound[t].status=""; continue; } // status=="" means don't show in report\n\n // never import the "ImportedTiddlers" history from the other document...\n if (theImported.title=='ImportedTiddlers')\n { config.macros.importTiddlers.inbound[t].status=""; continue; } // status=="" means don't show in report\n\n // check existing tiddler for importReplace, or systemConfig tags\n config.macros.importTiddlers.inbound[t].status="added"; // default - add any tiddlers not filtered out\n if (store.tiddlerExists(theImported.title)) {\n config.macros.importTiddlers.inbound[t].status="replaced";\n if (!theExisting.tags||(theExisting.tags.find("importReplace")==null))\n { config.macros.importTiddlers.inbound[t].status="not imported - tiddler already exists (use importReplace to allow changes)"; continue; }\n if ((theExisting.tags.find("systemConfig")!=null)||(theImported.tags.find("systemConfig")!=null))\n config.macros.importTiddlers.inbound[t].status+=" - WARNING: an active systemConfig plugin has been added or updated";\n }\n\n // apply the all/new/changes/updates filter \n if (filter!="all") {\n if ((filter=="new") && store.tiddlerExists(theImported.title))\n { config.macros.importTiddlers.inbound[t].status="not imported - tiddler already exists"; continue; }\n if ((filter=="changes") && !store.tiddlerExists(theImported.title))\n { config.macros.importTiddlers.inbound[t].status="not imported - new tiddler"; continue; }\n if (store.tiddlerExists(theImported.title) && ((theExisting.modified.getTime()-theImported.modified.getTime())>=0))\n { config.macros.importTiddlers.inbound[t].status="not imported - tiddler is unchanged"; continue; }\n }\n\n // get confirmation if required\n if (ask && !confirm("Import "+(theExisting?"updated":"new")+" tiddler '"+theImported.title+"'\snfrom "+src))\n { config.macros.importTiddlers.inbound[t].status="skipped - cancelled by user"; continue; }\n\n // DO THE IMPORT!!\n store.addTiddler(theImported); count++;\n }\n importReport(quiet); // generate a report (as needed) and display it if not 'quiet'\n if (count) store.setDirty(true); \n // always show final message when tiddlers were actually imported\n if (!quiet||count) displayMessage("Imported "+count+" tiddler"+(count!=1?"s":"")+" from "+src);\n}\n//}}}\n\n// // ''REPORT GENERATOR''\n\n//{{{\nfunction importReport(quiet)\n{\n if (!config.macros.importTiddlers.inbound) return;\n // DEBUG alert('importReport: start');\n\n // if import was not completed, the Ask panel will still be open... close it now.\n var askpanel=document.getElementById('importAskPanel'); if (askpanel) askpanel.style.display='none'; \n // get the alphasorted list of tiddlers\n var tiddlers = config.macros.importTiddlers.inbound;\n tiddlers.sort(function (a,b) {if(a['title'] == b['title']) return(0); else return (a['title'] < b['title']) ? -1 : +1; });\n // gather the statistics\n var count=tiddlers.length;\n var added=0; var replaced=0; var renamed=0; var skipped=0; var merged=0;\n for (var t=0; t<count; t++)\n if (tiddlers[t].status)\n {\n if (tiddlers[t].status=='added') added++;\n if (tiddlers[t].status.substr(0,7)=='skipped') skipped++;\n if (tiddlers[t].status.substr(0,6)=='rename') renamed++;\n if (tiddlers[t].status.substr(0,7)=='replace') replaced++;\n if (tiddlers[t].status.substr(0,6)=='merged') merged++;\n }\n var omitted=count-(added+replaced+renamed+skipped+merged);\n // DEBUG alert('stats done: '+count+' total, '+added+' added, '+skipped+' skipped, '+renamed+' renamed, '+replaced+' replaced, '+merged+' merged');\n // skip the report if nothing was imported\n if (added+replaced+renamed+merged==0) return;\n // skip the report if not desired by user\n if (!config.options.chkImportReport) {\n // reset status flags\n for (var t=0; t<count; t++) config.macros.importTiddlers.inbound[t].status="";\n // refresh display since tiddlers have been imported\n store.notifyAll();\n // quick message area summary report\n var msg=(added+replaced+renamed+merged)+' of '+count+' tiddler'+((count!=1)?'s':"");\n msg+=' imported from '+config.macros.importTiddlers.src.replace(/\s\s/g,'/')\n displayMessage(msg);\n return;\n }\n // create the report tiddler (if not already present)\n var tiddler = store.getTiddler('ImportedTiddlers');\n if (!tiddler) // create new report tiddler if it doesn't exist\n {\n tiddler = new Tiddler();\n tiddler.title = 'ImportedTiddlers';\n tiddler.text = "";\n }\n // format the report header\n var now = new Date();\n var newText = "";\n newText += "On "+now.toLocaleString()+", "+config.options.txtUserName+" imported tiddlers from\sn";\n newText += "[["+config.macros.importTiddlers.src+"|"+config.macros.importTiddlers.src+"]]:\sn";\n newText += "<"+"<"+"<\sn";\n newText += "Out of "+count+" tiddler"+((count!=1)?"s ":" ")+" in {{{"+config.macros.importTiddlers.src.replace(/\s\s/g,'/')+"}}}:\sn";\n if (added+renamed>0)\n newText += (added+renamed)+" new tiddler"+(((added+renamed)!=1)?"s were":" was")+" added to your document.\sn";\n if (merged>0)\n newText += merged+" tiddler"+((merged!=1)?"s were":" was")+" merged with "+((merged!=1)?"":"an ")+"existing tiddler"+((merged!=1)?"s":"")+".\sn"; \n if (replaced>0)\n newText += replaced+" existing tiddler"+((replaced!=1)?"s were":" was")+" replaced.\sn"; \n if (skipped>0)\n newText += skipped+" tiddler"+((skipped!=1)?"s were":" was")+" skipped after asking.\sn"; \n if (omitted>0)\n newText += omitted+" tiddler"+((omitted!=1)?"s":"")+((omitted!=1)?" were":" was")+" not imported.\sn";\n if (config.macros.importTiddlers.addTags && config.macros.importTiddlers.newTags.trim().length)\n newText += "imported tiddlers were tagged with: \s""+config.macros.importTiddlers.newTags+"\s"\sn";\n // output the tiddler detail and reset status flags\n for (var t=0; t<count; t++)\n if (tiddlers[t].status!="")\n {\n newText += "#["+"["+tiddlers[t].title+"]"+"]";\n newText += ((tiddlers[t].status!="added")?("^^\sn"+tiddlers[t].status+"^^"):"")+"\sn";\n config.macros.importTiddlers.inbound[t].status="";\n }\n newText += "<"+"<"+"<\sn";\n // output 'discard report' link\n newText += "<html><input type=\s"button\s" href=\s"javascript:;\s" ";\n newText += "onclick=\s"story.closeTiddler('"+tiddler.title+"'); store.deleteTiddler('"+tiddler.title+"');\s" ";\n newText += "value=\s"discard report\s"></html>";\n // update the ImportedTiddlers content and show the tiddler\n tiddler.text = newText+((tiddler.text!="")?'\sn----\sn':"")+tiddler.text;\n tiddler.modifier = config.options.txtUserName;\n tiddler.modified = new Date();\n store.addTiddler(tiddler);\n if (!quiet) story.displayTiddler(null,"ImportedTiddlers",1,null,null,false);\n story.refreshTiddler("ImportedTiddlers",1,true);\n // refresh the display\n store.notifyAll();\n}\n//}}}\n\n// // ''INTERFACE DEFINITION''\n\n// // Handle link click to create/show/hide control panel\n//{{{\nfunction onClickImportMenu(e)\n{\n if (!e) var e = window.event;\n var parent=resolveTarget(e).parentNode;\n var panel = document.getElementById("importPanel");\n if (panel==undefined || panel.parentNode!=parent)\n panel=createImportPanel(parent);\n var isOpen = panel.style.display=="block";\n if(config.options.chkAnimate)\n anim.startAnimating(new Slider(panel,!isOpen,e.shiftKey || e.altKey,"none"));\n else\n panel.style.display = isOpen ? "none" : "block" ;\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false);\n}\n//}}}\n\n// // Create control panel: HTML, CSS, register for notification\n//{{{\nfunction createImportPanel(place) {\n var panel=document.getElementById("importPanel");\n if (panel) { panel.parentNode.removeChild(panel); }\n setStylesheet(config.macros.importTiddlers.css,"importTiddlers");\n panel=createTiddlyElement(place,"span","importPanel",null,null)\n panel.innerHTML=config.macros.importTiddlers.html;\n store.addNotification(null,refreshImportList); // refresh listbox after every tiddler change\n refreshImportList();\n var siteURL=store.getTiddlerText("SiteUrl"); if (!siteURL) siteURL="";\n document.getElementById("importSourceURL").value=siteURL;\n config.macros.importTiddlers.src=siteURL;\n var siteProxy=store.getTiddlerText("SiteProxy"); if (!siteProxy) siteProxy="SiteProxy";\n document.getElementById("importSiteProxy").value=siteProxy;\n config.macros.importTiddlers.proxy=siteProxy;\n return panel;\n}\n//}}}\n\n// // CSS\n//{{{\nconfig.macros.importTiddlers.css = '\s\n#importPanel {\s\n display: none; position:absolute; z-index:11; width:35em; right:105%; top:3em;\s\n background-color: #eee; color:#000; font-size: 8pt; line-height:110%;\s\n border:1px solid black; border-bottom-width: 3px; border-right-width: 3px;\s\n padding: 0.5em; margin:0em; -moz-border-radius:1em;\s\n}\s\n#importPanel a, #importPanel td a { color:#009; display:inline; margin:0px; padding:1px; }\s\n#importPanel table { width:100%; border:0px; padding:0px; margin:0px; font-size:8pt; line-height:110%; background:transparent; }\s\n#importPanel tr { border:0px;padding:0px;margin:0px; background:transparent; }\s\n#importPanel td { color:#000; border:0px;padding:0px;margin:0px; background:transparent; }\s\n#importPanel select { width:98%;margin:0px;font-size:8pt;line-height:110%;}\s\n#importPanel input { width:98%;padding:0px;margin:0px;font-size:8pt;line-height:110%}\s\n#importPanel .box { border:1px solid black; padding:3px; margin-bottom:5px; background:#f8f8f8; -moz-border-radius:5px;}\s\n#importPanel .topline { border-top:2px solid black; padding-top:3px; margin-bottom:5px; }\s\n#importPanel .rad { width:auto; }\s\n#importPanel .chk { width:auto; margin:1px; }\s\n#importPanel .btn { width:auto; }\s\n#importPanel .btn1 { width:98%; }\s\n#importPanel .btn2 { width:48%; }\s\n#importPanel .btn3 { width:32%; }\s\n#importPanel .btn4 { width:24%; }\s\n#importPanel .btn5 { width:19%; }\s\n#importPanel .importButton { padding: 0em; margin: 0px; font-size:8pt; }\s\n#importPanel .importListButton { padding:0em 0.25em 0em 0.25em; color: #000000; display:inline }\s\n#importAskPanel { display:none; margin:0.5em 0em 0em 0em; }\s\n';\n//}}}\n\n// // HTML \n//{{{\nconfig.macros.importTiddlers.html = '\s\n<!-- source and report -->\s\n<table><tr><td align=left>\s\n import from\s\n <input type="radio" class="rad" name="importFrom" value="file" CHECKED\s\n onClick="document.getElementById(\s'importLocalPanel\s').style.display=this.checked?\s'block\s':\s'none\s';\s\n document.getElementById(\s'importHTTPPanel\s').style.display=!this.checked?\s'block\s':\s'none\s'"> local file\s\n <input type="radio" class="rad" name="importFrom" value="http"\s\n onClick="document.getElementById(\s'importLocalPanel\s').style.display=!this.checked?\s'block\s':\s'none\s';\s\n document.getElementById(\s'importHTTPPanel\s').style.display=this.checked?\s'block\s':\s'none\s'"> web server\s\n</td><td align=right>\s\n <input type=checkbox class="chk" id="chkImportReport" checked\s\n onClick="config.options[\s'chkImportReport\s']=this.checked;"> create a report\s\n</td></tr></table>\s\n<!-- import from local file -->\s\n<div id="importLocalPanel" style="display:block;margin-bottom:5px;margin-top:5px;padding-top:3px;border-top:1px solid #999">\s\nlocal document path/filename:<br>\s\n<input type="file" id="fileImportSource" size=57 style="width:100%"\s\n onKeyUp="config.macros.importTiddlers.src=this.value"\s\n onChange="config.macros.importTiddlers.src=this.value;">\s\n</div><!--panel-->\s\n\s\n<!-- import from http server -->\s\n<div id="importHTTPPanel" style="display:none;margin-bottom:5px;margin-top:5px;padding-top:3px;border-top:1px solid #999">\s\n<table><tr><td align=left>\s\n remote document URL:<br>\s\n</td><td align=right>\s\n <input type="checkbox" class="chk" id="importUseProxy"\s\n onClick="config.macros.importTiddlers.useProxy=this.checked;\s\n document.getElementById(\s'importSiteProxy\s').style.display=this.checked?\s'block\s':\s'none\s'"> use a proxy script\s\n</td></tr></table>\s\n<input type="text" id="importSiteProxy" style="display:none;margin-bottom:1px" onfocus="this.select()" value="SiteProxy"\s\n onKeyUp="config.macros.importTiddlers.proxy=this.value"\s\n onChange="config.macros.importTiddlers.proxy=this.value;">\s\n<input type="text" id="importSourceURL" onfocus="this.select()" value="SiteUrl"\s\n onKeyUp="config.macros.importTiddlers.src=this.value"\s\n onChange="config.macros.importTiddlers.src=this.value;">\s\n</div><!--panel-->\s\n\s\n<table><tr><td align=left>\s\n select:\s\n <a href="JavaScript:;" id="importSelectAll"\s\n onclick="onClickImportButton(this)" title="select all tiddlers">\s\n &nbsp;all&nbsp;</a>\s\n <a href="JavaScript:;" id="importSelectNew"\s\n onclick="onClickImportButton(this)" title="select tiddlers not already in destination document">\s\n &nbsp;added&nbsp;</a> \s\n <a href="JavaScript:;" id="importSelectChanges"\s\n onclick="onClickImportButton(this)" title="select tiddlers that have been updated in source document">\s\n &nbsp;changes&nbsp;</a> \s\n <a href="JavaScript:;" id="importSelectDifferences"\s\n onclick="onClickImportButton(this)" title="select tiddlers that have been added or are different from existing tiddlers">\s\n &nbsp;differences&nbsp;</a> \s\n <a href="JavaScript:;" id="importToggleFilter"\s\n onclick="onClickImportButton(this)" title="show/hide selection filter">\s\n &nbsp;filter&nbsp;</a> \s\n</td><td align=right>\s\n <a href="JavaScript:;" id="importListSmaller"\s\n onclick="onClickImportButton(this)" title="reduce list size">\s\n &nbsp;&#150;&nbsp;</a>\s\n <a href="JavaScript:;" id="importListLarger"\s\n onclick="onClickImportButton(this)" title="increase list size">\s\n &nbsp;+&nbsp;</a>\s\n <a href="JavaScript:;" id="importListMaximize"\s\n onclick="onClickImportButton(this)" title="maximize/restore list size">\s\n &nbsp;=&nbsp;</a>\s\n</td></tr></table>\s\n<select id="importList" size=8 multiple\s\n onchange="setTimeout(\s'refreshImportList(\s'+this.selectedIndex+\s')\s',1)">\s\n <!-- NOTE: delay refresh so list is updated AFTER onchange event is handled -->\s\n</select>\s\n<input type=checkbox class="chk" id="chkAddTags" checked\s\n onClick="config.macros.importTiddlers.addTags=this.checked;">add new tags &nbsp;\s\n<input type=checkbox class="chk" id="chkImportTags" checked\s\n onClick="config.macros.importTiddlers.importTags=this.checked;">import source tags &nbsp;\s\n<input type=checkbox class="chk" id="chkKeepTags" checked\s\n onClick="config.macros.importTiddlers.keepTags=this.checked;">keep existing tags<br>\s\n<input type=text id="txtNewTags" size=15 onKeyUp="config.macros.importTiddlers.newTags=this.value" autocomplete=off>\s\n<div align=center>\s\n <input type=button id="importOpen" class="importButton" style="width:32%" value="open"\s\n onclick="onClickImportButton(this)">\s\n <input type=button id="importStart" class="importButton" style="width:32%" value="import"\s\n onclick="onClickImportButton(this)">\s\n <input type=button id="importClose" class="importButton" style="width:32%" value="close"\s\n onclick="onClickImportButton(this)">\s\n</div>\s\n<div id="importAskPanel">\s\n tiddler already exists:\s\n <input type=text id="importNewTitle" size=15 autocomplete=off">\s\n <div align=center>\s\n <input type=button id="importSkip" class="importButton" style="width:23%" value="skip"\s\n onclick="onClickImportButton(this)">\s\n <input type=button id="importRename" class="importButton" style="width:23%" value="rename"\s\n onclick="onClickImportButton(this)">\s\n <input type=button id="importMerge" class="importButton" style="width:23%" value="merge"\s\n onclick="onClickImportButton(this)">\s\n <input type=button id="importReplace" class="importButton" style="width:23%" value="replace"\s\n onclick="onClickImportButton(this)">\s\n </div>\s\n</div>\s\n';\n//}}}\n\n// // refresh listbox\n//{{{\nfunction refreshImportList(selectedIndex)\n{\n var theList = document.getElementById("importList");\n if (!theList) return;\n // if nothing to show, reset list content and size\n if (!config.macros.importTiddlers.inbound) \n {\n while (theList.length > 0) { theList.options[0] = null; }\n theList.options[0]=new Option('please open a document...',"",false,false);\n theList.size=config.macros.importTiddlers.listsize;\n return;\n }\n // get the sort order\n if (!selectedIndex) selectedIndex=0;\n if (selectedIndex==0) config.macros.importTiddlers.sort='title'; // heading\n if (selectedIndex==1) config.macros.importTiddlers.sort='title';\n if (selectedIndex==2) config.macros.importTiddlers.sort='modified';\n if (selectedIndex==3) config.macros.importTiddlers.sort='tags';\n if (selectedIndex>3) {\n // display selected tiddler count\n for (var t=0,count=0; t < theList.options.length; t++) count+=(theList.options[t].selected&&theList.options[t].value!="")?1:0;\n clearMessage(); displayMessage(config.macros.importTiddlers.countMsg.format([count]));\n return; // no refresh needed\n }\n\n // get the alphasorted list of tiddlers (optionally, filter out unchanged tiddlers)\n var tiddlers=config.macros.importTiddlers.inbound;\n tiddlers.sort(function (a,b) {if(a['title'] == b['title']) return(0); else return (a['title'] < b['title']) ? -1 : +1; });\n // clear current list contents\n while (theList.length > 0) { theList.options[0] = null; }\n // add heading and control items to list\n var i=0;\n var indent=String.fromCharCode(160)+String.fromCharCode(160);\n theList.options[i++]=new Option(tiddlers.length+' tiddler'+((tiddlers.length!=1)?'s are':' is')+' in the document',"",false,false);\n theList.options[i++]=new Option(((config.macros.importTiddlers.sort=="title" )?">":indent)+' [by title]',"",false,false);\n theList.options[i++]=new Option(((config.macros.importTiddlers.sort=="modified")?">":indent)+' [by date]',"",false,false);\n theList.options[i++]=new Option(((config.macros.importTiddlers.sort=="tags")?">":indent)+' [by tags]',"",false,false);\n // output the tiddler list\n switch(config.macros.importTiddlers.sort)\n {\n case "title":\n for(var t = 0; t < tiddlers.length; t++)\n theList.options[i++] = new Option(tiddlers[t].title,tiddlers[t].title,false,false);\n break;\n case "modified":\n // sort descending for newest date first\n tiddlers.sort(function (a,b) {if(a['modified'] == b['modified']) return(0); else return (a['modified'] > b['modified']) ? -1 : +1; });\n var lastSection = "";\n for(var t = 0; t < tiddlers.length; t++) {\n var tiddler = tiddlers[t];\n var theSection = tiddler.modified.toLocaleDateString();\n if (theSection != lastSection) {\n theList.options[i++] = new Option(theSection,"",false,false);\n lastSection = theSection;\n }\n theList.options[i++] = new Option(indent+indent+tiddler.title,tiddler.title,false,false);\n }\n break;\n case "tags":\n var theTitles = {}; // all tiddler titles, hash indexed by tag value\n var theTags = new Array();\n for(var t=0; t<tiddlers.length; t++) {\n var title=tiddlers[t].title;\n var tags=tiddlers[t].tags;\n for(var s=0; s<tags.length; s++) {\n if (theTitles[tags[s]]==undefined) { theTags.push(tags[s]); theTitles[tags[s]]=new Array(); }\n theTitles[tags[s]].push(title);\n }\n }\n theTags.sort();\n for(var tagindex=0; tagindex<theTags.length; tagindex++) {\n var theTag=theTags[tagindex];\n theList.options[i++]=new Option(theTag,"",false,false);\n for(var t=0; t<theTitles[theTag].length; t++)\n theList.options[i++]=new Option(indent+indent+theTitles[theTag][t],theTitles[theTag][t],false,false);\n }\n break;\n }\n theList.selectedIndex=selectedIndex; // select current control item\n if (theList.size<config.macros.importTiddlers.listsize) theList.size=config.macros.importTiddlers.listsize;\n if (theList.size>theList.options.length) theList.size=theList.options.length;\n}\n//}}}\n\n// // Control interactions\n//{{{\nfunction onClickImportButton(which)\n{\n // DEBUG alert(which.id);\n var theList = document.getElementById('importList');\n if (!theList) return;\n var thePanel = document.getElementById('importPanel');\n var theAskPanel = document.getElementById('importAskPanel');\n var theNewTitle = document.getElementById('importNewTitle');\n var count=0;\n switch (which.id)\n {\n case 'fileImportSource':\n case 'importOpen': // load import source into hidden frame\n importReport(); // if an import was in progress, generate a report\n config.macros.importTiddlers.inbound=null; // clear the imported tiddler buffer\n refreshImportList(); // reset/resize the listbox\n if (config.macros.importTiddlers.src=="") break;\n // Load document into hidden iframe so we can read it's DOM and fill the list\n loadImportFile(config.macros.importTiddlers.src,"all",null,null,function(src,filter,quiet,ask){window.refreshImportList(0);});\n break;\n case 'importSelectAll': // select all tiddler list items (i.e., not headings)\n importReport(); // if an import was in progress, generate a report\n for (var t=0,count=0; t < theList.options.length; t++) {\n if (theList.options[t].value=="") continue;\n theList.options[t].selected=true;\n count++;\n }\n clearMessage(); displayMessage(config.macros.importTiddlers.countMsg.format([count]));\n break;\n case 'importSelectNew': // select tiddlers not in current document\n importReport(); // if an import was in progress, generate a report\n for (var t=0,count=0; t < theList.options.length; t++) {\n theList.options[t].selected=false;\n if (theList.options[t].value=="") continue;\n theList.options[t].selected=!store.tiddlerExists(theList.options[t].value);\n count+=theList.options[t].selected?1:0;\n }\n clearMessage(); displayMessage(config.macros.importTiddlers.countMsg.format([count]));\n break;\n case 'importSelectChanges': // select tiddlers that are updated from existing tiddlers\n importReport(); // if an import was in progress, generate a report\n for (var t=0,count=0; t < theList.options.length; t++) {\n theList.options[t].selected=false;\n if (theList.options[t].value==""||!store.tiddlerExists(theList.options[t].value)) continue;\n for (var i=0; i<config.macros.importTiddlers.inbound.length; i++) // find matching inbound tiddler\n { var inbound=config.macros.importTiddlers.inbound[i]; if (inbound.title==theList.options[t].value) break; }\n theList.options[t].selected=(inbound.modified-store.getTiddler(theList.options[t].value).modified>0); // updated tiddler\n count+=theList.options[t].selected?1:0;\n }\n clearMessage(); displayMessage(config.macros.importTiddlers.countMsg.format([count]));\n break;\n case 'importSelectDifferences': // select tiddlers that are new or different from existing tiddlers\n importReport(); // if an import was in progress, generate a report\n for (var t=0,count=0; t < theList.options.length; t++) {\n theList.options[t].selected=false;\n if (theList.options[t].value=="") continue;\n if (!store.tiddlerExists(theList.options[t].value)) { theList.options[t].selected=true; count++; continue; }\n for (var i=0; i<config.macros.importTiddlers.inbound.length; i++) // find matching inbound tiddler\n { var inbound=config.macros.importTiddlers.inbound[i]; if (inbound.title==theList.options[t].value) break; }\n theList.options[t].selected=(inbound.modified-store.getTiddler(theList.options[t].value).modified!=0); // changed tiddler\n count+=theList.options[t].selected?1:0;\n }\n clearMessage(); displayMessage(config.macros.importTiddlers.countMsg.format([count]));\n break;\n case 'importToggleFilter': // show/hide filter\n case 'importFilter': // apply filter\n alert("coming soon!");\n break;\n case 'importStart': // initiate the import processing\n importReport(); // if an import was in progress, generate a report\n config.macros.importTiddlers.index=0;\n config.macros.importTiddlers.index=importTiddlers(0);\n importStopped();\n break;\n case 'importClose': // unload imported tiddlers or hide the import control panel\n // if imported tiddlers not loaded, close the import control panel\n if (!config.macros.importTiddlers.inbound) { thePanel.style.display='none'; break; }\n importReport(); // if an import was in progress, generate a report\n config.macros.importTiddlers.inbound=null; // clear the imported tiddler buffer\n refreshImportList(); // reset/resize the listbox\n break;\n case 'importSkip': // don't import the tiddler\n var theItem = theList.options[config.macros.importTiddlers.index];\n for (var j=0;j<config.macros.importTiddlers.inbound.length;j++)\n if (config.macros.importTiddlers.inbound[j].title==theItem.value) break;\n var theImported = config.macros.importTiddlers.inbound[j];\n theImported.status='skipped after asking'; // mark item as skipped\n theAskPanel.style.display='none';\n config.macros.importTiddlers.index=importTiddlers(config.macros.importTiddlers.index+1); // resume with NEXT item\n importStopped();\n break;\n case 'importRename': // change name of imported tiddler\n var theItem = theList.options[config.macros.importTiddlers.index];\n for (var j=0;j<config.macros.importTiddlers.inbound.length;j++)\n if (config.macros.importTiddlers.inbound[j].title==theItem.value) break;\n var theImported = config.macros.importTiddlers.inbound[j];\n theImported.status = 'renamed from '+theImported.title; // mark item as renamed\n theImported.set(theNewTitle.value,null,null,null,null); // change the tiddler title\n theItem.value = theNewTitle.value; // change the listbox item text\n theItem.text = theNewTitle.value; // change the listbox item text\n theAskPanel.style.display='none';\n config.macros.importTiddlers.index=importTiddlers(config.macros.importTiddlers.index); // resume with THIS item\n importStopped();\n break;\n case 'importMerge': // join existing and imported tiddler content\n var theItem = theList.options[config.macros.importTiddlers.index];\n for (var j=0;j<config.macros.importTiddlers.inbound.length;j++)\n if (config.macros.importTiddlers.inbound[j].title==theItem.value) break;\n var theImported = config.macros.importTiddlers.inbound[j];\n var theExisting = store.getTiddler(theItem.value);\n var theText = theExisting.text+'\sn----\sn^^merged from: [['+config.macros.importTiddlers.src+'#'+theItem.value+'|'+config.macros.importTiddlers.src+'#'+theItem.value+']]^^\sn^^'+theImported.modified.toLocaleString()+' by '+theImported.modifier+'^^\sn'+theImported.text;\n var theDate = new Date();\n var theTags = theExisting.getTags()+' '+theImported.getTags();\n theImported.set(null,theText,null,theDate,theTags);\n theImported.status = 'merged with '+theExisting.title; // mark item as merged\n theImported.status += ' - '+theExisting.modified.formatString("MM/DD/YYYY hh:mm:ss");\n theImported.status += ' by '+theExisting.modifier;\n theAskPanel.style.display='none';\n config.macros.importTiddlers.index=importTiddlers(config.macros.importTiddlers.index); // resume with this item\n importStopped();\n break;\n case 'importReplace': // substitute imported tiddler for existing tiddler\n var theItem = theList.options[config.macros.importTiddlers.index];\n for (var j=0;j<config.macros.importTiddlers.inbound.length;j++)\n if (config.macros.importTiddlers.inbound[j].title==theItem.value) break;\n var theImported = config.macros.importTiddlers.inbound[j];\n var theExisting = store.getTiddler(theItem.value);\n theImported.status = 'replaces '+theExisting.title; // mark item for replace\n theImported.status += ' - '+theExisting.modified.formatString("MM/DD/YYYY hh:mm:ss");\n theImported.status += ' by '+theExisting.modifier;\n theAskPanel.style.display='none';\n config.macros.importTiddlers.index=importTiddlers(config.macros.importTiddlers.index); // resume with THIS item\n importStopped();\n break;\n case 'importListSmaller': // decrease current listbox size, minimum=5\n if (theList.options.length==1) break;\n theList.size-=(theList.size>5)?1:0;\n config.macros.importTiddlers.listsize=theList.size;\n break;\n case 'importListLarger': // increase current listbox size, maximum=number of items in list\n if (theList.options.length==1) break;\n theList.size+=(theList.size<theList.options.length)?1:0;\n config.macros.importTiddlers.listsize=theList.size;\n break;\n case 'importListMaximize': // toggle listbox size between current and maximum\n if (theList.options.length==1) break;\n theList.size=(theList.size==theList.options.length)?config.macros.importTiddlers.listsize:theList.options.length;\n break;\n }\n}\n//}}}\n\n// // re-entrant processing for handling import with interactive collision prompting\n//{{{\nfunction importTiddlers(startIndex)\n{\n if (!config.macros.importTiddlers.inbound) return -1;\n\n var theList = document.getElementById('importList');\n if (!theList) return;\n var t;\n // if starting new import, reset import status flags\n if (startIndex==0)\n for (var t=0;t<config.macros.importTiddlers.inbound.length;t++)\n config.macros.importTiddlers.inbound[t].status="";\n for (var i=startIndex; i<theList.options.length; i++)\n {\n // if list item is not selected or is a heading (i.e., has no value), skip it\n if ((!theList.options[i].selected) || ((t=theList.options[i].value)==""))\n continue;\n for (var j=0;j<config.macros.importTiddlers.inbound.length;j++)\n if (config.macros.importTiddlers.inbound[j].title==t) break;\n var theImported = config.macros.importTiddlers.inbound[j];\n var theExisting = store.getTiddler(theImported.title);\n // avoid redundant import for tiddlers that are listed multiple times (when 'by tags')\n if (theImported.status=="added")\n continue;\n // don't import the "ImportedTiddlers" history from the other document...\n if (theImported.title=='ImportedTiddlers')\n continue;\n // if tiddler exists and import not marked for replace or merge, stop importing\n if (theExisting && (theImported.status.substr(0,7)!="replace") && (theImported.status.substr(0,5)!="merge"))\n return i;\n // assemble tags (remote + existing + added)\n var newTags = "";\n if (config.macros.importTiddlers.importTags)\n newTags+=theImported.getTags() // import remote tags\n if (config.macros.importTiddlers.keepTags && theExisting)\n newTags+=" "+theExisting.getTags(); // keep existing tags\n if (config.macros.importTiddlers.addTags && config.macros.importTiddlers.newTags.trim().length)\n newTags+=" "+config.macros.importTiddlers.newTags; // add new tags\n theImported.set(null,null,null,null,newTags.trim());\n // set the status to 'added' (if not already set by the 'ask the user' UI)\n theImported.status=(theImported.status=="")?'added':theImported.status;\n // do the import!\n store.addTiddler(theImported);\n store.setDirty(true);\n }\n return(-1); // signals that we really finished the entire list\n}\n//}}}\n\n//{{{\nfunction importStopped()\n{\n var theList = document.getElementById('importList');\n var theNewTitle = document.getElementById('importNewTitle');\n if (!theList) return;\n if (config.macros.importTiddlers.index==-1)\n importReport(); // import finished... generate the report\n else\n {\n // DEBUG alert('import stopped at: '+config.macros.importTiddlers.index);\n // import collision... show the ask panel and set the title edit field\n document.getElementById('importAskPanel').style.display='block';\n theNewTitle.value=theList.options[config.macros.importTiddlers.index].value;\n }\n}\n//}}}\n
/***\n''InlineJavascriptPlugin for ~TiddlyWiki version 1.2.x and 2.0''\n^^author: Eric Shulman - ELS Design Studios\nsource: http://www.elsdesign.com/tiddlywiki/#InlineJavascriptPlugin\nlicense: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^\n\nInsert Javascript executable code directly into your tiddler content. Lets you ''call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.\n!!!!!Usage\n<<<\nWhen installed, this plugin adds new wiki syntax for surrounding tiddler content with {{{<script>}}} and {{{</script>}}} markers, so that it can be treated as embedded javascript and executed each time the tiddler is rendered.\n\n''Deferred execution from an 'onClick' link''\nBy including a label="..." parameter in the initial {{{<script>}}} marker, the plugin will create a link to an 'onclick' script that will only be executed when that specific link is clicked, rather than running the script each time the tiddler is rendered.\n\n''External script source files:''\nYou can also load javascript from an external source URL, by including a src="..." parameter in the initial {{{<script>}}} marker (e.g., {{{<script src="demo.js"></script>}}}). This is particularly useful when incorporating third-party javascript libraries for use in custom extensions and plugins. The 'foreign' javascript code remains isolated in a separate file that can be easily replaced whenever an updated library file becomes available.\n\n''Defining javascript functions and libraries:''\nAlthough the external javascript file is loaded while the tiddler content is being rendered, any functions it defines will not be available for use until //after// the rendering has been completed. Thus, you cannot load a library and //immediately// use it's functions within the same tiddler. However, once that tiddler has been loaded, the library functions can be freely used in any tiddler (even the one in which it was initially loaded).\n\nTo ensure that your javascript functions are always available when needed, you should load the libraries from a tiddler that will be rendered as soon as your TiddlyWiki document is opened. For example, you could put your {{{<script src="..."></script>}}} syntax into a tiddler called LoadScripts, and then add {{{<<tiddler LoadScripts>>}}} in your MainMenu tiddler.\n\nSince the MainMenu is always rendered immediately upon opening your document, the library will always be loaded before any other tiddlers that rely upon the functions it defines. Loading an external javascript library does not produce any direct output in the tiddler, so these definitions should have no impact on the appearance of your MainMenu.\n\n''Creating dynamic tiddler content''\nAn important difference between this implementation of embedded scripting and conventional embedded javascript techniques for web pages is the method used to produce output that is dynamically inserted into the document:\n* In a typical web document, you use the document.write() function to output text sequences (often containing HTML tags) that are then rendered when the entire document is first loaded into the browser window.\n* However, in a ~TiddlyWiki document, tiddlers (and other DOM elements) are created, deleted, and rendered "on-the-fly", so writing directly to the global 'document' object does not produce the results you want (i.e., replacing the embedded script within the tiddler content), and completely replaces the entire ~TiddlyWiki document in your browser window.\n* To allow these scripts to work unmodified, the plugin automatically converts all occurences of document.write() so that the output is inserted into the tiddler content instead of replacing the entire ~TiddlyWiki document.\n\nIf your script does not use document.write() to create dynamically embedded content within a tiddler, your javascript can, as an alternative, explicitly return a text value that the plugin can then pass through the wikify() rendering engine to insert into the tiddler display. For example, using {{{return "thistext"}}} will produce the same output as {{{document.write("thistext")}}}.\n\n//Note: your script code is automatically 'wrapped' inside a function, {{{_out()}}}, so that any return value you provide can be correctly handled by the plugin and inserted into the tiddler. To avoid unpredictable results (and possibly fatal execution errors), this function should never be redefined or called from ''within'' your script code.//\n\n''Accessing the ~TiddlyWiki DOM''\nThe plugin provides one pre-defined variable, 'place', that is passed in to your javascript code so that it can have direct access to the containing DOM element into which the tiddler output is currently being rendered.\n\nAccess to this DOM element allows you to create scripts that can:\n* vary their actions based upon the specific location in which they are embedded\n* access 'tiddler-relative' information (use findContainingTiddler(place))\n* perform direct DOM manipulations (when returning wikified text is not enough)\n<<<\n!!!!!Examples\n<<<\nan "alert" message box:\n{{{\n<script>alert('InlineJavascriptPlugin: this is a demonstration message');</script>\n}}}\n<script>alert('InlineJavascriptPlugin: this is a demonstration message');</script>\n\ndynamic output:\n{{{\n<script>return (new Date()).toString();</script>\n}}}\n<script>return (new Date()).toString();</script>\n\nwikified dynamic output:\n{{{\n<script>return "link to current user: [["+config.options.txtUserName+"]]";</script>\n}}}\n<script>return "link to current user: [["+config.options.txtUserName+"]]";</script>\n\ndynamic output using 'place' to get size information for current tiddler\n{{{\n<script>\n if (!window.story) window.story=window;\n var title=story.findContainingTiddler(place).id.substr(7);\n return title+" is using "+store.getTiddlerText(title).length+" bytes";\n</script>\n}}}\n<script>\n if (!window.story) window.story=window;\n var title=story.findContainingTiddler(place).id.substr(7);\n return title+" is using "+store.getTiddlerText(title).length+" bytes";\n</script>\n\ncreating an 'onclick' button/link that runs a script\n{{{\n<script label="click here">\n if (!window.story) window.story=window;\n alert("Hello World!\snlinktext='"+place.firstChild.data+"'\sntiddler='"+story.findContainingTiddler(place).id.substr(7)+"'");\n</script>\n}}}\n<script label="click here">\n if (!window.story) window.story=window;\n alert("Hello World!\snlinktext='"+place.firstChild.data+"'\sntiddler='"+story.findContainingTiddler(place).id.substr(7)+"'");\n</script>\n\nloading a script from a source url\n{{{\n<script src="demo.js">return "loading demo.js..."</script>\n<script>return window.demo()</script>\n}}}\nwhere http://www.elsdesign.com/tiddlywiki/demo.js contains:\n>^^window.demo = function()^^\n>^^ { return 'this output is from demo(), defined in demo.js'; }^^\n>^^alert('InlineJavascriptPlugin: demo.js has been loaded');^^\n<script src="demo.js">return "loading demo.js..."</script>\n<script>return demo()</script>\n<<<\n!!!!!Installation\n<<<\nimport (or copy/paste) the following tiddlers into your document:\n''InlineJavascriptPlugin'' (tagged with <<tag systemConfig>>)\n<<<\n!!!!!Revision History\n<<<\n''2006.01.05 [1.4.0]''\nadded support 'onclick' scripts. When label="..." param is present, a button/link is created using the indicated label text, and the script is only executed when the button/link is clicked. 'place' value is set to match the clicked button/link element.\n''2005.12.13 [1.3.1]''\nwhen catching eval error in IE, e.description contains the error text, instead of e.toString(). Fixed error reporting so IE shows the correct response text. Based on a suggestion by UdoBorkowski\n''2005.11.09 [1.3.0]''\nfor 'inline' scripts (i.e., not scripts loaded with src="..."), automatically replace calls to 'document.write()' with 'place.innerHTML+=' so script output is directed into tiddler content\nBased on a suggestion by BradleyMeck\n''2005.11.08 [1.2.0]''\nhandle loading of javascript from an external URL via src="..." syntax\n''2005.11.08 [1.1.0]''\npass 'place' param into scripts to provide direct DOM access \n''2005.11.08 [1.0.0]''\ninitial release\n<<<\n!!!!!Credits\n<<<\nThis feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]]\n<<<\n!!!!!Code\n***/\n//{{{\nversion.extensions.inlineJavascript= {major: 1, minor: 4, revision: 0, date: new Date(2006,1,5)};\n\nconfig.formatters.push( {\n name: "inlineJavascript",\n match: "\s\s<script",\n lookahead: "\s\s<script(?: src=\s\s\s"((?:.|\s\sn)*?)\s\s\s")?(?: label=\s\s\s"((?:.|\s\sn)*?)\s\s\s")?\s\s>((?:.|\s\sn)*?)\s\s</script\s\s>",\n\n handler: function(w) {\n var lookaheadRegExp = new RegExp(this.lookahead,"mg");\n lookaheadRegExp.lastIndex = w.matchStart;\n var lookaheadMatch = lookaheadRegExp.exec(w.source)\n if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {\n if (lookaheadMatch[1]) { // load a script library\n // make script tag, set src, add to body to execute, then remove for cleanup\n var script = document.createElement("script"); script.src = lookaheadMatch[1];\n document.body.appendChild(script); document.body.removeChild(script);\n }\n if (lookaheadMatch[2] && lookaheadMatch[3]) { // create a link to an 'onclick' script\n // add a link, define click handler, save code in link (pass 'place'), set link attributes\n var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",lookaheadMatch[2]);\n link.onclick=function(){try{return(eval(this.code))}catch(e){alert(e.description?e.description:e.toString())}}\n link.code="function _out(place){"+lookaheadMatch[3]+"};_out(this);"\n link.setAttribute("href","javascript:;"); link.setAttribute("title",""); link.style.cursor="pointer";\n }\n else if (lookaheadMatch[3]) { // run inline script code\n var code="function _out(place){"+lookaheadMatch[3]+"};_out(w.output);"\n code=code.replace(/document.write\s(/gi,'place.innerHTML+=(');\n try { var out = eval(code); } catch(e) { out = e.description?e.description:e.toString(); }\n if (out && out.length) wikify(out,w.output);\n }\n w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;\n }\n }\n} )\n//}}}\n
2 boneless, skinless chicken breasts\n1/2 cup Italian salad dressing\n1 teaspoon Italian seasoning (or mix basil, oregano,\ncrushed red pepper and garlic powder to equal same)\n1/2 cup grated Parmesan or Romano cheese\n4 potatoes, peeled and cut into wedges\n\nPlace chicken in bottom of crockpot. Sprinkle with half of the Italian dressing, spices and the grated cheese. Put the potatoes on top or around the chicken. Sprinkle with the rest of the dressing,\nspices and cheese. Cook on low for about 6 to 8 hours, or until the chicken and potatoes are tender. .
<<nstweak on>>+++^*[About]\n[[TiddlyWiki]]\n===\n+++^*[Pictures|Picture Galleries]\n[[House]]\n[[Wedding]]\n[[Honeymoon]]\n===\n+++^*[Gaming|Gaming Area]\n[[RPG's]]\n[[Other Games]]\n===\n+++^*[Stuff|Misc Stuff]\n[[Calendar|This Month]]\n[[Quotes]]\n[[Recipes]]\n===\n+++^*[Links|Links to other stuff]\n[[MyLinks]]\n[[Tech Support Forum|http://bobeverson.net/drupal/]]\n[[OtherLinks]]\n===\n<<nstweak off>>
[[d20 Character Sheet Wiki|http://mysite.verizon.net/avatar00/d20%20Character%20Wiki.htm]]\n[[Iron Heroes Campaign Wiki|http://mysite.verizon.net/avatar00/IHwiki.htm]]\n[[my blank TiddlyWiki|http://mysite.verizon.net/avatar00/blankTiddlywiki2.htm]]
/***\n''NestedSlidersPlugin for TiddlyWiki version 1.2.x and 2.0''\n^^author: Eric Shulman\nsource: http://www.elsdesign.com/tiddlywiki/#NestedSlidersPlugin\nlicense: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^\n\nQuickly make any tiddler content into an expandable 'slider' panel, without needing to create a separate tiddler to contain the slider content. Optional syntax allows ''default to open'', ''custom button label/tooltip'' and ''automatic blockquote formatting.''\n\nYou can also 'nest' these sliders as deep as you like (see complex nesting example below), so that expandable 'tree-like' hierarchical displays can be created. This is most useful when converting existing in-line text content to create in-line annotations, footnotes, context-sensitive help, or other subordinate information displays.\n\nFor more details, please click on a section headline below:\n++++!!!!![Configuration]>\nDebugging messages for 'lazy sliders' deferred rendering:\n<<option chkDebugLazySliderDefer>> show debugging alert when deferring slider rendering\n<<option chkDebugLazySliderRender>> show debugging alert when deferred slider is actually rendered\n===\n++++!!!!![Usage]>\nWhen installed, this plugin adds new wiki syntax for embedding 'slider' panels directly into tiddler content. Use {{{+++}}} and {{{===}}} to delimit the slider content. Additional optional syntax elements let you specify\n*default to open\n*cookiename\n*heading level\n*floater\n*rollover\n*custom label/tooltip\n*automatic blockquote\n*deferred rendering\nThe complete syntax, using all options, is:\n//{{{\n++++(cookiename)!!!!!^*[label|tooltip]>...\ncontent goes here\n===\n//}}}\nwhere:\n* {{{+++}}} (or {{{++++}}}) and {{{===}}}^^\nmarks the start and end of the slider definition, respectively. When the extra {{{+}}} is used, the slider will be open when initially displayed.^^\n* {{{(cookiename)}}}^^\nsaves the slider opened/closed state, and restores this state whenever the slider is re-rendered.^^\n* {{{!}}} through {{{!!!!!}}}^^\ndisplays the slider label using a formatted headline (Hn) style instead of a button/link style^^\n* {{{"^"}}} //(without the quotes)//^^\nmakes the slider 'float' on top of other content rather than shifting that content downward^^\n* {{{"*"}}} //(without the quotes)//^^\nautomatically opens/closes slider on "rollover" as well as when clicked^^\n* {{{[label]}}} or {{{[label|tooltip]}}}^^\nuses custom label/tooltip. (defaults are: ">" (more) and "<" (less)^^\n* {{{">"}}} //(without the quotes)//^^\nautomatically adds blockquote formatting to slider content^^\n* {{{"..."}}} //(without the quotes)//^^\ndefers rendering of closed sliders until the first time they are opened. //Note: deferred rendering may produce unexpected results in some cases. Use with care.//^^\n\n//Note: to make slider definitions easier to read and recognize when editing a tiddler, newlines immediately following the {{{+++}}} 'start slider' or preceding the {{{===}}} 'end slider' sequence are automatically supressed so that excess whitespace is eliminated from the output.//\n===\n++++!!!!![Examples]>\nsimple in-line slider: \n{{{\n+++\n content\n===\n}}}\n+++\n content\n===\n----\nuse a custom label and tooltip: \n{{{\n+++[label|tooltip]\n content\n===\n}}}\n+++[label|tooltip]\n content\n===\n----\ncontent automatically blockquoted: \n{{{\n+++>\n content\n===\n}}}\n+++>\n content\n===\n----\nall options combined //(default open, cookie, heading, floater, rollover, label/tooltip, blockquoted, deferred)//\n{{{\n++++(testcookie)!!!^*[label|tooltip]>...\n content\n===\n}}}\n++++(testcookie)!!!^*[label|tooltip]>...\n content\n===\n----\ncomplex nesting example:\n{{{\n+++^[get info...|click for information]\n put some general information here, plus a floating slider with more specific info:\n +++^[view details...|click for details]\n put some detail here, which could include a rollover with a +++^*[glossary definition]explaining technical terms===\n ===\n===\n}}}\n+++^[get info...|click for information]\n put some general information here, plus a floating slider with more specific info:\n +++^[view details...|click for details]\n put some detail here, which could include a rollover with a +++^*[glossary definition]explaining technical terms===\n ===\n===\n----\nnested floaters\n>menu: <<tiddler NestedSlidersExample>>\n(see [[NestedSlidersExample]] for definition)\n----\n===\n+++!!!!![Installation]>\nimport (or copy/paste) the following tiddlers into your document:\n''NestedSlidersPlugin'' (tagged with <<tag systemConfig>>)\n===\n+++!!!!![Revision History]>\n\n++++[2006.01.16 - 1.7.3]\nadded adjustSliderPos(place,btn,panel,panelClass) function to permit specialized logic for placement of floating panels. While it provides improved placement for many uses of floating panels, it exhibits a relative offset positioning error when used within *nested* floating panels. Short-term workaround is to only adjust the position for 'top-level' floaters.\n===\n\n++++[2006.01.16 - 1.7.2]\nadded button property to slider panel elements so that slider panel can tell which button it belongs to. Also, re-activated and corrected animation handling so that nested sliders aren't clipped by hijacking Slider.prototype.stop so that "overflow:hidden" can be reset to "overflow:visible" after animation ends\n===\n\n++++[2006.01.14 - 1.7.1]\nadded optional "^" syntax for floating panels. Defines new CSS class, ".floatingPanel", as an alternative for standard in-line ".sliderPanel" styles.\n===\n\n++++[2006.01.14 - 1.7.0]\nadded optional "*" syntax for rollover handling to show/hide slider without requiring a click (Based on a suggestion by tw4efl)\n===\n\n+++[2006.01.03 - 1.6.2]\nWhen using optional "!" heading style, instead of creating a clickable "Hn" element, create an "A" element inside the "Hn" element. (allows click-through in SlideShowPlugin, which captures nearly all click events, except for hyperlinks)\n===\n\n+++[2005.12.15 - 1.6.1]\nadded optional "..." syntax to invoke deferred ('lazy') rendering for initially hidden sliders\nremoved checkbox option for 'global' application of lazy sliders\n===\n\n+++[2005.11.25 - 1.6.0]\nadded optional handling for 'lazy sliders' (deferred rendering for initially hidden sliders)\n===\n\n+++[2005.11.21 - 1.5.1]\nrevised regular expressions: if present, a single newline //preceding// and/or //following// a slider definition will be suppressed so start/end syntax can be place on separate lines in the tiddler 'source' for improved readability. Similarly, any whitespace (newlines, tabs, spaces, etc.) trailing the 'start slider' syntax or preceding the 'end slider' syntax is also suppressed.\n===\n\n+++[2005.11.20 - 1.5.0]\n added (cookiename) syntax for optional tracking and restoring of slider open/close state\n===\n\n+++[2005.11.11 - 1.4.0]\n added !!!!! syntax to render slider label as a header (Hn) style instead of a button/link style\n===\n\n+++[2005.11.07 - 1.3.0]\n removed alternative syntax {{{(((}}} and {{{)))}}} (so they can be used by other\n formatting extensions) and simplified/improved regular expressions to trim multiple excess newlines\n===\n\n+++[2005.11.05 - 1.2.1]\n changed name to NestedSlidersPlugin\n more documentation\n===\n\n+++[2005.11.04 - 1.2.0]\n added alternative character-mode syntax {{{(((}}} and {{{)))}}}\n tweaked "eat newlines" logic for line-mode {{{+++}}} and {{{===}}} syntax\n===\n\n+++[2005.11.03 - 1.1.1]\n fixed toggling of default tooltips ("more..." and "less...") when a non-default button label is used\n code cleanup, added documentation\n===\n\n+++[2005.11.03 - 1.1.0]\n changed delimiter syntax from {{{(((}}} and {{{)))}}} to {{{+++}}} and {{{===}}}\n changed name to EasySlidersPlugin\n===\n\n+++[2005.11.03 - 1.0.0]\n initial public release\n===\n\n===\n+++!!!!![Credits]>\nThis feature was implemented by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]] with research, programming and suggestions from RodneyGomes, GeoffSlocock, and PaulPetterson\n===\n***/\n// //+++!!!!![Code]\n//{{{\nversion.extensions.nestedSliders = {major: 1, minor: 7, revision: 3, date: new Date(2006,1,16)};\n//}}}\n\n//{{{\n// options for deferred rendering of sliders that are not initially displayed\nif (config.options.chkDebugLazySliderDefer==undefined) config.options.chkDebugLazySliderDefer=false;\nif (config.options.chkDebugLazySliderRender==undefined) config.options.chkDebugLazySliderRender=false;\n\n// default styles for 'floating' class\nsetStylesheet(".floatingPanel { position:absolute; z-index:10; padding:0.5em; margin:0em; \s\n background-color:#eee; color:#000; border:1px solid #000; text-align:left; }","floatingPanelStylesheet");\n//}}}\n\n//{{{\nconfig.formatters.push( {\n name: "nestedSliders",\n match: "\s\sn?\s\s+{3}",\n terminator: "\s\ss*\s\s={3}\s\sn?",\n lookahead: "\s\sn?\s\s+{3}(\s\s+)?(\s\s([^\s\s)]*\s\s))?(\s\s!*)?(\s\s^)?(\s\s*)?(\s\s[[^\s\s]]*\s\s])?(\s\s>)?(\s\s.\s\s.\s\s.)?\s\ss*",\n handler: function(w)\n {\n var lookaheadRegExp = new RegExp(this.lookahead,"mg");\n lookaheadRegExp.lastIndex = w.matchStart;\n var lookaheadMatch = lookaheadRegExp.exec(w.source)\n if(lookaheadMatch && lookaheadMatch.index == w.matchStart)\n {\n // location for rendering button and panel\n var place=w.output;\n\n // default to closed, no cookie\n var show="none"; var title=">"; var tooltip="show"; var cookie="";\n\n // extra "+", default to open\n if (lookaheadMatch[1])\n { show="block"; title="<"; tooltip="hide"; }\n\n // cookie, use saved open/closed state\n if (lookaheadMatch[2]) {\n cookie=lookaheadMatch[2].trim().substr(1,lookaheadMatch[2].length-2);\n cookie="chkSlider"+cookie;\n if (config.options[cookie]==undefined)\n { config.options[cookie] = (show=="block") }\n if (config.options[cookie])\n { show="block"; title="<"; tooltip="hide"; }\n else\n { show="none"; title=">"; tooltip="show"; }\n }\n\n // custom label/tooltip\n if (lookaheadMatch[6]) {\n title = lookaheadMatch[6].trim().substr(1,lookaheadMatch[6].length-2);\n if ((pos=title.indexOf("|")) != -1)\n { tooltip = title.substr(pos+1,title.length); title = title.substr(0,pos); }\n else\n { tooltip += " "+title; }\n }\n\n // create the button\n if (lookaheadMatch[3]) { // use "Hn" header format instead of button/link\n var lvl=(lookaheadMatch[3].length>6)?6:lookaheadMatch[3].length;\n var btn = createTiddlyElement(createTiddlyElement(place,"h"+lvl,null,null,null),"a",null,null,title);\n btn.onclick=onClickNestedSlider;\n btn.setAttribute("href","javascript:;");\n btn.setAttribute("title",tooltip);\n }\n else\n var btn = createTiddlyButton(place,title,tooltip,onClickNestedSlider);\n btn.sliderCookie = cookie; // save the cookiename (if any) in the button object\n\n // "non-click" MouseOver open/close slider\n if (lookaheadMatch[5]) btn.onmouseover=onClickNestedSlider;\n\n // create slider panel\n var panelClass=lookaheadMatch[4]?"floatingPanel":"sliderPanel";\n var panel=createTiddlyElement(place,"div",null,panelClass,null);\n panel.style.display = show;\n panel.button = btn; // so the slider panel know which button it belongs to\n btn.sliderPanel=panel;\n\n // render slider (or defer until shown) \n w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;\n if (lookaheadMatch[1]||!lookaheadMatch[8]) {\n // render now if "++++" (init open) or NOT "..." (deferred render)\n w.subWikify(lookaheadMatch[7]?createTiddlyElement(panel,"blockquote"):panel,this.terminator);\n // align slider/floater position with button\n adjustSliderPos(place,btn,panel,panelClass);\n }\n else {\n var src = w.source.substr(w.nextMatch);\n var endpos=findMatchingDelimiter(src,"+++","===");\n panel.setAttribute("raw",src.substr(0,endpos));\n panel.setAttribute("blockquote",lookaheadMatch[7]?"true":"false");\n panel.setAttribute("rendered","false");\n w.nextMatch += endpos+3;\n if (w.source.substr(w.nextMatch,1)=="\sn") w.nextMatch++;\n if (config.options.chkDebugLazySliderDefer) alert("deferred '"+title+"':\sn\sn"+panel.getAttribute("raw"));\n }\n }\n }\n }\n)\n\n// TBD: ignore 'quoted' delimiters (e.g., "{{{+++foo===}}}" isn't really a slider)\nfunction findMatchingDelimiter(src,starttext,endtext) {\n var startpos = 0;\n var endpos = src.indexOf(endtext);\n // check for nested delimiters\n while (src.substring(startpos,endpos-1).indexOf(starttext)!=-1) {\n // count number of nested 'starts'\n var startcount=0;\n var temp = src.substring(startpos,endpos-1);\n var pos=temp.indexOf(starttext);\n while (pos!=-1) { startcount++; pos=temp.indexOf(starttext,pos+starttext.length); }\n // set up to check for additional 'starts' after adjusting endpos\n startpos=endpos+endtext.length;\n // find endpos for corresponding number of matching 'ends'\n while (startcount && endpos!=-1) {\n endpos = src.indexOf(endtext,endpos+endtext.length);\n startcount--;\n }\n }\n return (endpos==-1)?src.length:endpos;\n}\n//}}}\n\n//{{{\nfunction onClickNestedSlider(e)\n{\n if (!e) var e = window.event;\n var theTarget = resolveTarget(e);\n var theLabel = theTarget.firstChild.data;\n var theSlider = theTarget.sliderPanel\n var isOpen = theSlider.style.display!="none";\n // if using default button labels, toggle labels\n if (theLabel==">") theTarget.firstChild.data = "<";\n else if (theLabel=="<") theTarget.firstChild.data = ">";\n // if using default tooltips, toggle tooltips\n if (theTarget.getAttribute("title")=="show")\n theTarget.setAttribute("title","hide");\n else if (theTarget.getAttribute("title")=="hide")\n theTarget.setAttribute("title","show");\n if (theTarget.getAttribute("title")=="show "+theLabel)\n theTarget.setAttribute("title","hide "+theLabel);\n else if (theTarget.getAttribute("title")=="hide "+theLabel)\n theTarget.setAttribute("title","show "+theLabel);\n // deferred rendering (if needed)\n if (theSlider.getAttribute("rendered")=="false") {\n if (config.options.chkDebugLazySliderRender)\n alert("rendering '"+theLabel+"':\sn\sn"+theSlider.getAttribute("raw"));\n var place=theSlider;\n if (theSlider.getAttribute("blockquote")=="true")\n place=createTiddlyElement(place,"blockquote");\n wikify(theSlider.getAttribute("raw"),place);\n theSlider.setAttribute("rendered","true");\n }\n // show/hide the slider\n if(config.options.chkAnimate)\n anim.startAnimating(new Slider(theSlider,!isOpen,e.shiftKey || e.altKey,"none"));\n else\n theSlider.style.display = isOpen ? "none" : "block";\n if (this.sliderCookie && this.sliderCookie.length)\n { config.options[this.sliderCookie]=!isOpen; saveOptionCookie(this.sliderCookie); }\n // align slider/floater position with target button\n adjustSliderPos(theSlider.parentNode,theTarget,theSlider,theSlider.className);\n return false;\n}\n\n// hijack animation handler 'stop' handler so overflow is visible after animation has completed\nSlider.prototype.coreStop = Slider.prototype.stop;\nSlider.prototype.stop = function() { this.coreStop(); this.element.style.overflow = "visible"; }\n\n// adjust panel position based on button position\nfunction adjustSliderPos(place,btn,panel,panelClass) {\n ///////////////////////////////////////////////////////////////////////////////\n /// EXPERIMENTAL HACK - WORKS IN SOME CASES, NOT IN OTHERS\n ///////////////////////////////////////////////////////////////////////////////\n // "if this panel is floating and the parent is not also a floating panel"...\n if (panelClass=="floatingPanel" && place.className!="floatingPanel") {\n var left=0; var top=btn.offsetHeight;\n if (place.style.position!="relative") { left+=findPosX(btn); top+=findPosY(btn); }\n panel.style.left=left+"px"; panel.style.top=top+"px";\n }\n}\n//}}}\n// //===
/***\n|''Name:''|NestedSlidersTweaks|\n|''Version:''|0.4 (20-Jan-2006)|\n|''Source:''|http://rodney.gotdns.com|\n|''Author:''|[[RodneyGomes]]|\n|''Type:''|PluginTweak+Macro|\n\n!Dependencies\nThis is a plugin tweak and it requires NestedSlidersPlugins\n\n!Description\nThis tweak allows you to define nicer looking popup menus... (more description to come soon)\n\n!Usage\nMore information soon.\n\n!Revision History\n* v0.4\n** fixed the buttons to now refresh on click so that even if the tiddler moves\n the next time you click on the button of the slider will make it open in the \n right place.\n* v0.3.1\n** fixed issue with some browsers complaining about "missing formal parameter". Was associated with the use of the name class as a paramter to some functions.\n* v0.3.0\n** now with macro support!\n* v0.2.0\n** fixed issue with making the onmouseover work for all floatingPanels\n* v0.1.0\n** initial release. \n\n!Code\n***/\n//{{{\n\nfunction clickingOnNestedSliderOrButton(e,obj) {\n var res = false;\n \n if (clickingOn(e,obj) || ("button" in obj && clickingOn(e,obj.button)))\n return true;\n \n var children = obj.childNodes; \n \n for(var i = 0; i < children.length; i++) {\n res = res || clickingOnNestedSliderOrButton(e,children[i]);\n }\n \n return res;\n}\n\nold_main_onClick = document.onclick;\ndocument.onclick = function mainOnClick(e) {\n floatPanels = document.getElementsByTagName("div");\n \n for(i = 0; i < floatPanels.length; i++) {\n if (floatPanels[i].getAttribute) {\n var panel = floatPanels[i];\n if (panel.getAttribute('clickclass') == 'clickingclass') {\n if (!clickingOnNestedSliderOrButton(e,panel)) {\n if (panel.style.display != 'none') {\n closeFloatPanel(floatPanels[i]);\n }\n }\n }\n }\n }\n\n if (old_main_onClick){\n old_main_onClick(e);\n } \n}\n\nfunction getElementPosition(obj) {\n var offsetTrail = obj;\n var offsetLeft = 0;\n var offsetTop = 0;\n while (offsetTrail) {\n offsetLeft += offsetTrail.offsetLeft;\n offsetTop += offsetTrail.offsetTop;\n offsetTrail = offsetTrail.offsetParent;\n }\n if (navigator.userAgent.indexOf("Mac") != -1 && \n typeof document.body.leftMargin != "undefined") {\n offsetLeft += document.body.leftMargin;\n offsetTop += document.body.topMargin;\n }\n return {left:offsetLeft, top:offsetTop};\n}\n\nfunction clickingOn(e,obj) {\n posObj = getElementPosition(obj);\n return ((posObj.left < e.pageX) && (posObj.left + obj.offsetWidth > e.pageX) &&\n (posObj.top < e.pageY) && (posObj.top + obj.offsetHeight > e.pageY));\n}\n\nfunction closeFloatPanel(panel) { \n if (panel.getAttribute && (panel.getAttribute('clickclass') == 'clickingclass')) {\n panel.style.display = 'none';\n }\n}\n\nfunction closeAllSlidersOfClass(_class,place) {\n var elements = place.getElementsByTagName("div");\n \n for( i = 0; i < elements.length; i++ ) {\n if (elements[i].getAttribute) \n if (elements[i].getAttribute('clickclass') == _class)\n elements[i].style.display = 'none';\n } \n}\n\nfunction allPanelsClosed(_class) {\n elements = document.getElementsByTagName("div");\n res = true;\n \n for( i = 0; i < elements.length;i++ ) { \n if (elements[i].getAttribute)\n if (elements[i].getAttribute("clickclass") == _class)\n res = res && (elements[i].style.display == "none");\n } \n return res;\n}\n\nconfig.macros.nstweak = {};\nconfig.macros.nstweak.state = false;\n\nconfig.macros.nstweak.buttonpopupclass = "buttonpopup";\nconfig.macros.nstweak.sliderpopupclass = "sliderpopup";\nconfig.macros.nstweak.nestedbuttonpopupclass = "nestedbuttonpopup";\nconfig.macros.nstweak.nestedsliderpopupclass = "nestedsliderpopup";\n\nconfig.macros.nstweak.handler = function(place,macroName,params) {\n if (params[1]) this.buttonpopupclass = params[1];\n if (params[2]) this.sliderpopupclass = params[2];\n if (params[3]) this.nestedbuttonpopupclass = params[3];\n if (params[4]) this.nestedsliderpopupclass = params[4];\n \n if (params[0].toLowerCase() == 'on')\n this.state = true;\n else\n this.state = false; \n}\n\nvar enabled_floating_panel = {};\n\n// hijack NestedSlidersPlugin hook :)\nfunction adjustSliderPos(place,btn,panel,panelClass) {\n if (config.macros.nstweak.state) {\n var _panelClass = panelClass; \n \n if ( panelClass == "floatingPanel") {\n var _clickclass = "clickingclass";\n \n enabled_floating_panel[_clickclass] = false;\n \n var onMouseOver = function(e) {\n if (!e) var e = window.event;\n var theTarget = resolveTarget(e);\n \n // Small trick for when everything is closed because it's basically lost\n // focus and therefore we reset the enabled back to false.\n if (allPanelsClosed(_clickclass)) {\n enabled_floating_panel[_clickclass] = false;\n return;\n }\n \n // only click if this panelclass is the same as the enabled one and if it is not already shown!\n if (enabled_floating_panel[_clickclass] && theTarget.sliderPanel.style.display == "none") {\n closeAllSlidersOfClass(_clickclass,place);\n onMouseClick(e); \n }\n }\n \n var old_onMouseClick = btn.onclick;\n var onMouseClick = function(e) { \n \n if (!e) var e = window.event;\n var theTarget = resolveTarget(e);\n var theSlider = theTarget.sliderPanel\n \n if (theSlider.getAttribute("sliderclass") == "base") {\n var left=0; \n var top=theSlider.button.offsetHeight;\n if (theSlider.style.position!="relative") { \n left+=findPosX(theSlider.button); \n top+=findPosY(theSlider.button); \n }\n theSlider.style.left=left+"px"; \n theSlider.style.top=top+"px";\n }\n \n if (old_onMouseClick) \n old_onMouseClick(e); \n \n enabled_floating_panel[_clickclass] = true; \n }\n \n panel.setAttribute("clickclass",_clickclass);\n \n btn.onmouseover = onMouseOver;\n btn.onclick = onMouseClick;\n \n if (place.className=="floatingPanel") {\n panel.setAttribute("class",config.macros.nstweak.nestedsliderpopupclass);\n btn.setAttribute("class",config.macros.nstweak.nestedbuttonpopupclass); \n panel.setAttribute("sliderclass","nested");\n } else { \n panel.setAttribute("class",config.macros.nstweak.sliderpopupclass);\n btn.setAttribute("class",config.macros.nstweak.buttonpopupclass); \n panel.setAttribute("sliderclass","base"); \n }\n }\n } else {\n ///////////////////////////////////////////////////////////////////////////////\n /// EXPERIMENTAL HACK - WORKS IN SOME CASES, NOT IN OTHERS\n ///////////////////////////////////////////////////////////////////////////////\n // "if this panel is floating and the parent is not also a floating panel"...\n if (panelClass=="floatingPanel" && place.className!="floatingPanel") {\n var left=0; var top=btn.offsetHeight;\n if (place.style.position!="relative") { left+=findPosX(btn); top+=findPosY(btn); }\n panel.style.left=left+"px"; panel.style.top=top+"px";\n }\n }\n}\n\n//}}}\n
<div class='header' macro='gradient vert #04b #001'>\n<div class='headerShadow'>\n<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;\n<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>\n</div>\n<div class='headerForeground'>\n<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;\n<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>\n</div>\n</div>\n<div class='menuLine'>\n<span class='topMenu' refresh='content' tiddler='MainMenu'></span>&nbsp;\n<span class='rightMenu' refresh='content' tiddler='sidebarMenu'></span>\n</div>\n<div id='sidebar'>\n<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>\n</div>\n<div id='displayArea'>\n<div id='messageArea'></div>\n<div id='tiddlerDisplay'></div>\n</div>
/***\n\n\n----\nPasswordTweak implements the PasswordOption\n----\n\n\n***/\n\n/***\n|''Name:''|PasswordTweak|\n|''Type:''|tweak|\n|''Version:''|1.0.0 (14/02/2006)|\n|''Source:''|[[TiddlyWiki.BidiX.info/#PasswordTweak|http://tiddlywiki.BidiX.info/#PasswordTweak]]|\n|''Author:''|BidiX[at]BidiX.info|\n|''Compatibility:''|TW1.2 & TW2 & FF1.5.0.1|\n!Description : \n*a password option has {{{pas}}} as prefix\n*in a tiddler the {{{<<option pasXXXX>>}}} provide a password input field a checkbox and a text ("Save this password on this computer")\n*when the password field changes ''or'' the checkbox changes the password is saved in a cookie, but only when the associated checkbox is checked\n*config.options.pasPassword is defined for general use. Put it in OptionsPanel\n''Password : '' <<option pasPassword>>\n\n***/\n/***\n!Configs\n***/\n//{{{\nconfig.messages.savePasswordCheckboxLabel = "Save this password on this computer";\nconfig.macros.option.passwordType = "password"; // password | text\n//}}}\n/***\n!option macro\n***/\n//{{{\nversion.extensions.PasswordTweak = {major: 1, minor: 0, revision: 0, date: new Date(2006,2,14)};\nconfig.macros.option.onChangeOption = function(e)\n{\n var opt = this.getAttribute("option");\n var elementType,valueField;\n if(opt) {\n switch(opt.substr(0,3)) {\n case "txt":\n elementType = "input";\n valueField = "value";\n break;\n case "pas":\n elementType = "input";\n valueField = "value";\n break;\n case "chk":\n elementType = "input";\n valueField = "checked";\n break;\n }\n config.options[opt] = this[valueField];\n saveOptionCookie(opt);\n var nodes = document.getElementsByTagName(elementType);\n for(var t=0; t<nodes.length; t++) {\n var optNode = nodes[t].getAttribute("option");\n if(opt == optNode)\n nodes[t][valueField] = this[valueField];\n }\n }\n return(true);\n}\n\nconfig.macros.option.handler = function(place,macroName,params)\n{\n var opt = params[0];\n if(config.options[opt] == undefined)\n return;\n var c;\n switch(opt.substr(0,3)) {\n case "txt":\n c = document.createElement("input");\n c.onkeyup = this.onChangeOption;\n c.setAttribute ("option",opt);\n c.size = 15;\n c.value = config.options[opt];\n place.appendChild(c);\n break;\n case "pas":\n // input password\n c = document.createElement ("input");\n c.setAttribute("type",config.macros.option.passwordType);\n c.onkeyup = this.onChangeOption;\n c.setAttribute("option",opt);\n c.size = 15;\n c.value = config.options[opt];\n place.appendChild(c);\n // checkbox link with this password "save this password on this computer"\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option","chk"+opt);\n place.appendChild(c);\n c.checked = config.options["chk"+opt];\n // text savePasswordCheckboxLabel\n place.appendChild(document.createTextNode(config.messages.savePasswordCheckboxLabel));\n break;\n case "chk":\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option",opt);\n place.appendChild(c);\n c.checked = config.options[opt];\n break;\n }\n}\n//}}}\n/***\n! Options cookie stuff\n***/\n//{{{\nwindow.loadOptionsCookie = function()\n{\n var cookies = document.cookie.split(";");\n for(var c=0; c<cookies.length; c++) {\n var p = cookies[c].indexOf("=");\n if(p != -1) {\n var name = cookies[c].substr(0,p).trim();\n var value = cookies[c].substr(p+1).trim();\n switch(name.substr(0,3)) {\n case "txt":\n config.options[name] = unescape(value);\n break;\n case "pas":\n config.options[name] = unescape(value);\n break;\n case "chk":\n config.options[name] = value == "true";\n break;\n }\n }\n }\n}\n\nwindow.saveOptionCookie = function(name)\n{\n var c = name + "=";\n switch(name.substr(0,3)) {\n case "txt":\n c += escape(config.options[name].toString());\n break;\n case "chk":\n c += config.options[name] ? "true" : "false";\n // is there an option link with this chk ?\n if (config.options[name.substr(3)]) {\n saveOptionCookie(name.substr(3));\n }\n break;\n case "pas":\n if (config.options["chk"+name]) {\n c += escape(config.options[name].toString());\n } else {\n c += "";\n }\n break;\n }\n c += "; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/";\n document.cookie = c;\n}\n//}}}\n/***\n! config.options.pasPassword \n***/\n//{{{\nconfig.options.pasPassword = 'password';\nwindow.loadOptionsCookie();\n//}}}\n
/***\n|!Name:|PhotoShowPlugin |\n|!Version:|1.0.0 - 07/01/2006|\n|!Source:|http://www.math.ist.utl.pt/~psoares/addons.html |\n|!Authors:|[[Paulo Soares|mailto:psoares@math.ist.utl.pt]]|\n|!Type:|Macro |\n|!Requires:|TiddlyWiki >= 2.0.0 |\n!Description\nThis plugin is a small companion to the SlideShowPlugin. It automates the creation of a gallery of numbered pictures from a directory that will be ready for a slide show.\n\nThis plugin has been tested in Firefox. Let me know if something seems broken.\n!Usage\nTo use this plugin you //must// be using TiddlyWiki 2.0.0. Install this tiddler and drop {{{<<photoShow directory/file-*.jpg a b>>}}} at the beginning of the tiddler. This will fill your tiddler with the pictures file-a.jpg to file-b.jpg taken from the given directory.\nCheck this [[PhotoShowExample]].\n!Revision history\nv1.0.0 - 07/01/2006 - initial release\n!Code\n***/\n//{{{\nconfig.macros.photoShow = {};\nconfig.macros.photoShow.handler= function(place,macroName,params,wikifier,paramString,tiddler) {\n if (params.length<3) return;\n title = tiddler.title;\n var url = params[0];\n var first = params[1];\n var last = params[2];\n var pos = url.indexOf('*');\n\n // Grab the 'viewer' element\n var tiddlerElements = document.getElementById("tiddler"+title).childNodes;\n var viewer;\n for (var i = 0; i < tiddlerElements.length; i++){\n if (tiddlerElements[i].className == "viewer"){\n viewer = tiddlerElements[i];\n break;\n }\n }\n\n var pictureHolder;\n for(i=first; i<=last; i++){\n viewer.appendChild(document.createElement('H1'));\n pictureHolder = document.createElement('CENTER');\n pictureHolder.appendChild(document.createElement('IMG'));\n pictureHolder.lastChild.src = url.substring(0,pos)+i+url.substring(pos+1);\n viewer.appendChild(pictureHolder);\n }\n}\n//}}}
History does not always repeat itself. Sometimes it just yells "Can't you remember anything I told you?" and lets fly with a club.\n--John W.Campbell\n\nPeople don't understand this: Ideas are important, but they're not essential. What's essential and important is the execution of the idea. Everyone has had the experience of seeing a movie and saying, "Hey! That was my idea!" Well, it doesn't mean anything that you had that idea. There's no such thing as an original concept. What's original is the way you re-use ancient concepts.\n--John Landis\n\n"What Clinton Portis wanted to do was gain as many yards as he could, so when you punt the ball you want to take that Buc offense as far back as possible."\n-Joe Theisman\n\n"It's tough to play football, it's even tougher to play without a hand."\n-John Madden, regarding a football player trying to tackle with a cast on his hand\n\n"I've never played poker, but if it's anything like Dungeons and Dragons, I'll be up to my baldric in +1 scimitars before you can say Cure Light Wounds." - Stephen Colbert\n\n"Sure --- our pirate crew always keeps a spare ninja in the bilge." - author unknown\n\n"And should thou darest to rise...the enchanted Uru hammer of Thor shall smite thee down, again and again, AND AGAIN if needs be!" - Thor, after kicking the crap out of Thanos (//Thor//, vol2 #25)\n\n"Give me some Sunday-go-to-killin' music!" - Me, during combat in our Iron Heroes game.\n\nQ: What is best in life?\nA: To crush the PC's, see their character sheets piled before you, and to hear the lamentations of the players. - author unknown\n\n"What's that big glowing thing in the sky called again? Oh yeah, the Sun. I hate that thing." - author unknown\n\n"Crash the temple, free the virgin sacrifice, invalidate her qualifications, steal the giant ruby eyes off the demon god's statue, fight the seven foot tall skeletons, run off, and then spend the rubies on one lump purchase." - Iron Heroes ezboard member Narmio, during a discussion of character rewards.\n\n"My Jedi was so wounded that he was down to being just an eyeball, and even that had conjunctivitis.\nOnly JD is cruel enough as a GM to give a character's only remaining body part an infectious disease." --Marc Schmalz, Web Manager, The Game Mechanics, Inc.\n\n"Go find the kid whose taking a dirt nap with Baby Jesus - we need a hood ornament." -- Malcom Reynolds, from the outtakes of //Serenity//
[[Crockpot]]
<<slider chkConfigPanel Config 'config »' 'Configuration Settings'>><<importTiddlers>><<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<slider chkUploadOptions UploadOptions 'upload »' 'Change TiddlyWiki Upload Options'>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>><<slider chkSliderTabsPanel SideBarTabs 'more »' 'Show SideBarTabs'>>
using TiddlyWiki <<version>>
What About Bob?
/***\n|!Name:|SlideShowPlugin |\n|!Version:|1.2.0 - 07/01/2006|\n|!Source:|http://www.math.ist.utl.pt/~psoares/addons.html |\n|!Authors:|[[Paulo Soares|mailto:psoares@math.ist.utl.pt]] and [[Clint Checketts|http://www.checkettsweb.com]] |\n|!Type:|Macro |\n|!Requires:|TiddlyWiki >= 2.0.0 |\n!Description\nThis plugin turns a TiddlyWiki tiddler into a simple slide show type display. You can have looping, timed or themed slide shows. It should work in a way that does not interfere with TiddlyWiki. When you close the slide show you get back to your good old TW. \n\nThis plugin has been tested in Firefox, Internet Explorer, Safari, and Opera. Let us know if something seems broken.\n!Usage\nTo use this plugin you //must// be using TiddlyWiki 2.0. Install this tiddler and drop {{{<<slideShow>>}}} at the beginning of the tiddler. Use ! to start each slide with or without a title. Mark the end of your slides with a rule (- - - -). Everything that appears before the first header or after the closing rule is not shown in the slide show. \nThere are also a few navigation buttons and a table of contents that shows up if you click the slide number.\nSee other options in this [[SlideShowExample]].\n!Revision history\nv1.0.0 - 12/11/2005 - initial release\nv1.1.0 Beta 12/12/2005 - added support for IE, added key listeners\nv1.1.5 Beta 12/14/2005 - added mouse support and cleaned up navbar generation\nv1.2.0 07/01/2006 - added a resume feature and themes support\n!Todo\n*Incremental advancement within a slide\n*Cross fade effects\n!Code\n***/\n//{{{\nconfig.macros.slideShow = {label: "slide show", maxTOCLength: 30};\nconfig.views.wikified.slideShow = {text: "slide show", tooltip: "Start/stop slide show"};\nconfig.views.wikified.slideShow.quit = {text: "end", tooltip: "Quit the slide show"};\nconfig.views.wikified.slideShow.firstSlide = {text: "<<", tooltip: "first slide"};\nconfig.views.wikified.slideShow.previousSlide = {text: "<", tooltip: "previous slide"};\nconfig.views.wikified.slideShow.nextSlide = {text: ">", tooltip: "next slide"};\nconfig.views.wikified.slideShow.lastSlide = {text: ">>", tooltip: "last slide"};\n\nfunction changeStyleSheet(tiddlerName) {\n setStylesheet(store.getTiddlerText("StyleSheetColors"),"StyleSheetColors");\n setStylesheet(store.getTiddlerText("StyleSheetLayout"),"StyleSheetLayout");\n var theCSS = store.getRecursiveTiddlerText(tiddlerName,"");\n setStylesheet(theCSS,"StyleSheet");\n}\n\n//Excellent (and versatile) reparser created by Paul Petterson for parsing the paramString in a macro\nfunction reparse( params ) {\n var re = /([^:\ss]+)(?:\s:((?:\sd+)|(?:["'](?:[^"']+)["']))|\ss|$)/g;\n var ret = new Array() ;\n var m ;\n while( (m = re.exec( params )) != null ) ret[ m[1] ] = m[2]?m[2]:true ;\n \n return ret ;\n}\n\n//This is a very useful function that I will be using in incremental displays and other places\nfunction getElementsByClass(searchClass,node,tag) {\n var classElements = new Array();\n if ( node == null )\n node = document;\n if ( tag == null )\n tag = '*';\n var els = node.getElementsByTagName(tag);\n var elsLen = els.length;\n var pattern = new RegExp("(^|\s\ss)"+searchClass+"(\s\ss|$)");\n for (i = 0, j = 0; i < elsLen; i++) {\n if ( pattern.test(els[i].className) ) {\n classElements[j] = els[i];\n j++;\n }\n }\n return classElements;\n}\n\n// 'keys' code adapted from S5 which in turn was adapted from MozPoint (http://mozpoint.mozdev.org/)\nfunction keys(key) {\n if (!key) {\n key = event;\n key.which = key.keyCode;\n }\n if (document.getElementById('contentWrapper').className == "slideShowMode"){\n switch (key.which) {\n case 32: // spacebar\n case 34: // page down\n case 39: // rightkey\n case 40: // downkey\n GoToSlide(1);\n break;\n case 33: // page up\n case 37: // leftkey\n case 38: // upkey\n GoToSlide(-1);\n break;\n case 36: // home\n GoToSlide("f");\n break;\n case 35: // end\n GoToSlide("l");\n break;\n case 27: // escape\n endSlideShow();\n //config.macros.slideShow.onClickSlideShow();\n break;\n }\n\n }\n return false;\n}\n\nfunction clicker(e) {\n var target;\n if (window.event) {\n target = window.event.srcElement;\n e = window.event;\n } else target = e.target;\n //Whenever something is clicked that won't advance the slide make sure that the table of contents gets hidden\n if (target.getAttribute('href') != null || isParentOrSelf(target, 'toc') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object') || isParentOrSelf(target, 'pageFooter') || isParentOrSelf(target, 'navigator')){\n //Don't hide the TOC if the indexNumbers (which trigger the index) is clicked\n if(isParentOrSelf(target,'indexNumbers') || isParentOrSelf(target,'jumpInput')){\n return true;\n }\n showHideTOC('none');\n return true;\n }\n \n //Advance a slide if the TOC is visible otherwise make sure that the TOC gets hidden\n if ((!e.which && e.button == 1) || e.which == 1) {\n if (document.getElementById('toc').style.display != 'block'){\n GoToSlide(1);\n } else {\n showHideTOC('none');\n }\n }\n \n if ((!e.which && e.button == 2) || e.which == 3) {\n if (document.getElementById('toc').style.display != 'block'){\n GoToSlide(-1);\n } else {\n showHideTOC('none');\n }\n return false;\n }\n}\n\nfunction isParentOrSelf(element, id) {\n if (element == null || element.nodeName=='BODY') return false;\n else if (element.id == id) return true;\n else return isParentOrSelf(element.parentNode, id);\n}\n\n\nfunction currentSlide(){\n var slideHolder = document.getElementById('slideContainer');\n \n var numberSlides = slideHolder.getElementsByTagName("div").length-1;\n for(i=0; i<numberSlides; i++) {\n if(slideHolder.childNodes[i].style.display =='block') \n {break;}\n }\n return i;\n}\n\nfunction GoToSlide(step) {\n var new_pos;\n var slideHolder = document.getElementById('slideContainer');\n //The parse float ensures that the attribute is returned as a number and not a string.\n var cur_pos = parseFloat(slideHolder.getAttribute('currentslide'));\n var numberSlides = slideHolder.getElementsByTagName("div").length;\n switch (step) {\n case "f":\n new_pos=0;\n break;\n case "l":\n new_pos=numberSlides-1;\n break;\n default:\n new_pos=cur_pos+step;\n }\n \n if(slideShowCircularMode && new_pos == numberSlides) new_pos=0;\n if(slideShowCircularMode && new_pos<0) new_pos=(numberSlides - 1);\n if(step!=0 && new_pos>=0 && new_pos<numberSlides) {\n slideHolder.childNodes[cur_pos].style.display='none';\n slideHolder.childNodes[new_pos].style.display='block';\n slideHolder.setAttribute('currentslide',new_pos);\n new_pos++;\n var indexNumbers = getElementsByClass("indexNumbers")\n indexNumbers[0].firstChild.data = new_pos+'/'+numberSlides;\n if((new_pos==numberSlides) && !slideShowCircularMode && autoAdvance) clearInterval(autoAdvance);\n return true;\n }\n return false;\n}\n\nfunction tocShowSlide(e) {\n var target;\n if (!e)\n var e = window.event;\n if (e.target)\n target = e.target;\n else if (e.srcElement)\n target = e.srcElement;\n\n //Work around Safari bug which grabs the click and assigns it to the \n if (target.nodeType == 3)\n target = target.parentNode;\n \n var slide = target.getAttribute('slideNumber');\n var cur_pos = document.getElementById('slideContainer').getAttribute('currentslide');\n var step = slide-cur_pos;\n if(step!=0) GoToSlide(step);\n showHideTOC('none');\n return;\n}\n\n//Toggle the display of the table of contents\nfunction showHideTOC(display){\n var toc = document.getElementById('toc');\n //Reset the input box\n document.getElementById('jumpInput').value = "";\n\n if (display == null || display.length == null){\n if (toc.style.display == 'none' || toc.style.display == ''){\n toc.style.display = 'block';\n document.getElementById('jumpInput').focus();\n } else {\n toc.style.display = 'none';\n }\n } else {\n toc.style.display = display;\n if (display == 'block')\n document.getElementById('jumpInput').focus();\n }\n}\n\nfunction makeSignature(title,params){\n var signature = title+store.getTiddler(title).modified;\n if(params['style']) signature += params['style'];\n if(params['repeat']) signature += "repeat";\n if(params['slidePause'] > 0) signature += params['slidePause'];\n if(params['tocLabel']) signature += params['tocLabel'];\n if(params['autostart']) signature += "autostart";\n return signature;\n}\n\nvar title;\nvar place;\nvar autoAdvance=null;\nvar time = 0;\nvar slideShowCircularMode;\nvar slideShowStyleSheet;\nvar slideShowParams;\n\nconfig.macros.slideShow.handler = function(aPlace,macroName,params,wikifier,paramString,tiddler){\n if(tiddler instanceof Tiddler){\n var lingo = config.views.wikified.slideShow;\n if (!e) var e = window.event;\n \n place = aPlace;\n title = tiddler.title;\n params = reparse(paramString);\n var onclick = function(){config.macros.slideShow.onClickSlideShow(params);};\n createTiddlyButton(aPlace,lingo.text,lingo.tooltip,onclick);\n \n var tiddler = document.getElementById("tiddler"+title);\n if(params['autostart'] && tiddler.getAttribute('autoStartAgain') == null){\n\n tiddler.setAttribute('autoStartAgain',false)\n slideShowParams = params;\n setTimeout("config.macros.slideShow.onClickSlideShow(slideShowParams);",10);\n \n }\n }\n}\n\nvar disableFunction = function(e){return false;}\nvar enableFunction = function(e){}\n\nconfig.macros.slideShow.onClickSlideShow = function(newParams) {\ndocument.oncontextmenu = disableFunction;\n slideShowCircularMode = false;\n time = 0;\n slideShowStyleSheet = null;\n if(newParams['style']){\n slideShowStyleSheet = eval(newParams['style']);\n } \n if(newParams['repeat']){\n slideShowCircularMode = true;\n }\n if(newParams['slidePause'] > 0){\n time = newParams['slidePause'];\n }\n \n var contentWrapper = document.getElementById('contentWrapper');\n if (contentWrapper.className != "slideShowMode"){\n clearMessage();\n //Attach the key and mouse listeners\n document.onkeyup = keys;\n document.onmouseup = clicker;\n \n var slideShowHolder = document.getElementById('slideShowWrapper');\n //If no show exist previously, create it\n if(slideShowHolder == null){\n createSlides(newParams);\n //If there was once waiting in the background and it matches the one we just started, resume it\n } else if (slideShowHolder.getAttribute('showSignature') == makeSignature(title,newParams)){\n //alert('Resume Show');\n \n //Remove dblClick on edit function\n var theTiddler = document.getElementById("tiddler"+title);\n theTiddler.ondblclick = function() {};\n\n // Grab the 'viewer' element and give it a signature so the show can be resumed if stopped\n var tiddlerElements = theTiddler.childNodes;\n var viewer;\n for (var i = 0; i < tiddlerElements.length; i++){\n if (tiddlerElements[i].className == "viewer") viewer = tiddlerElements[i];\n }\n theTiddler.insertBefore(slideShowHolder,viewer);\n theTiddler.removeChild(viewer);\n slideShowHolder.style.display = 'block';\n document.getElementById("pageFooter").className = "pageFooterOff";\n \n //If the show we started it totally new than the resumable one, create the new one and kill the resumable one\n } else {\n slideShowHolder.parentNode.removeChild(slideShowHolder);\n createSlides(newParams);\n }\n \n if(time>0) autoAdvance=setInterval("GoToSlide(1)", time); \n story.closeAllTiddlers(title);\n toggleSlideStyles();\n } else {\n endSlideShow();\n }\n return ;\n \n}\n\nfunction endSlideShow(){\n //Set aside show so it can be resumed later\n var showHolder = document.getElementById('slideShowWrapper');\n showHolder.style.display = 'none';\n document.getElementById('contentWrapper').parentNode.appendChild(showHolder);\n \n document.oncontextmenu = enableFunction;\n if(autoAdvance) clearInterval(autoAdvance);\n story.refreshTiddler(title,null,true);\n document.onmouseup = function(){};\n toggleSlideStyles();\n}\n\n\nfunction isInteger(s){\n var i;\n for (i = 0; i < s.length; i++){\n // Check that current character is number.\n var c = s.charAt(i);\n if (((c < "0") || (c > "9"))) return false;\n }\n // All characters are numbers.\n return true;\n}\n\nfunction jumpInputToSlide(e){\n if (!e) {\n e = window.event;\n e.which = e.keyCode;\n }\n if(e.which==13){\n var jumpInput= document.getElementById("jumpInput").value;\n if(isInteger(jumpInput)){\n var step=jumpInput-document.getElementById('slideContainer').getAttribute('currentslide')-1;\n if (GoToSlide(step)){\n showHideTOC('none'); \n }\n }\n }\n return;\n}\n\n//Used to shorten the TOC fields\nfunction abbreviateLabel(label){\n var maxTOCLength = config.macros.slideShow.maxTOCLength;\n if(label.length>maxTOCLength) {\n var temp = new Array();\n temp = label.split(' ');\n label = temp[0];\n for(j=1; j<temp.length; j++){\n if((label.length+temp[j].length)<=maxTOCLength){\n label += " " + temp[j];\n } else {\n label += " ...";\n break;\n }\n }\n }\n return label;\n}\n\ncreateSlides = function(newParams){\n var lingo = config.views.wikified.slideShow;\n\n //Remove dblClick on edit function\n var theTiddler = document.getElementById("tiddler"+title);\n theTiddler.ondblclick = function() {};\n\n // Grab the 'viewer' element and give it a signature so the show can be resumed if stopped\n var tiddlerElements = theTiddler.childNodes;\n var viewer;\n for (var i = 0; i < tiddlerElements.length; i++){\n if (tiddlerElements[i].className == "viewer") viewer = tiddlerElements[i];\n }\n viewer.id = 'slideShowWrapper';\n viewer.setAttribute("showSignature",makeSignature(title,newParams));\n\n //Hide the text that comes before the first H1 element (I think I may put this into a cover page type thing)\n while(viewer.childNodes.length > 0 && viewer.firstChild.nodeName.toUpperCase() != "H1") {\n viewer.removeChild(viewer.firstChild);\n }\n \n //Cycle through the content an each time you hit an H1 begin a new slide div\n var slideNumber = 0;\n var slideHolder = document.createElement('DIV');\n slideHolder.id = "slideContainer";\n \n while(viewer.childNodes.length > 0){\n //Create a new slide a append it to the slide holder\n if (viewer.firstChild.nodeName == "H1"){\n slideNumber++;\n var slide = document.createElement('DIV');\n slide.id = "slideNumber"+slideNumber;\n slide.className = "slide";\n if (slideNumber > 1) {\n slideHolder.setAttribute('currentslide',0);\n slide.style.display='none';\n } else {\n slide.style.display='block';\n }\n slideHolder.appendChild(slide); \n }\n\n //Grab the first thing in the viewer and check to see if its an H1, if so put it in a slide, it will shift everything else forward\n slide.appendChild(viewer.firstChild);\n\n //If you hit a horizontal rule (HR) remove the remaining elements until you hit an H1\n if(viewer.childNodes.length > 0 && viewer.firstChild.nodeName=="HR") {\n while(viewer.childNodes.length > 0 && viewer.firstChild.nodeName != "H1") {\n viewer.removeChild(viewer.firstChild);\n }\n }\n }\n \n //Stick the slides back into the viewer\n viewer.appendChild(slideHolder);\n\n \n //Create the navigation bar\n var pagefooter = createTiddlyElement(viewer,"DIV","pageFooter","pageFooterOff")\n var navigator = createTiddlyElement(pagefooter,"SPAN","navigator")\n\n //Make it so that when the footer is hovered over the class will change to make it visible\n pagefooter.onmouseover = function () {pagefooter.className = "pageFooterOn"};\n pagefooter.onmouseout = function () {pagefooter.className = "pageFooterOff"};\n\n //Create the control button for the navigation \n var onClickQuit = function(){endSlideShow();};\n createTiddlyButton(navigator,lingo.quit.text,lingo.quit.tooltip,onClickQuit);\n createTiddlyButton(navigator,lingo.firstSlide.text,lingo.firstSlide.tooltip,first_slide);\n createTiddlyButton(navigator,lingo.previousSlide.text,lingo.previousSlide.tooltip,previous_slide);\n createTiddlyButton(navigator,lingo.nextSlide.text,lingo.nextSlide.tooltip,next_slide);\n createTiddlyButton(navigator,lingo.lastSlide.text,lingo.lastSlide.tooltip,last_slide); \n\n var indexNumbers = createTiddlyElement(pagefooter,"SPAN","indexNumbers","indexNumbers","1/"+slideNumber)\n indexNumbers.onclick = showHideTOC;\n\n var toc = createTiddlyElement(pagefooter,"UL","toc");\n\n \n for (var i=0;i<slideHolder.childNodes.length;i++) {\n //Loop through each slide and check the header's content\n var tocLabel = null;\n if(slideHolder.childNodes[i].firstChild.hasChildNodes()){\n tocLabel = abbreviateLabel(slideHolder.childNodes[i].firstChild.firstChild.data);\n } else if (newParams['tocLabel'] != null){\n j=i+1;\n tocLabel = eval(newParams['tocLabel'])+" "+j;\n }\n \n //If the slide doesn't have a title (explicit or generated) don't include it in the table of contents\n if (tocLabel != null){\n var tocItem = createTiddlyElement(toc,"LI",null,"tocLevel1");\n var tocLink = createTiddlyElement(tocItem,"A",null,"tocItem",tocLabel);\n tocLink.setAttribute("slideNumber",i);\n tocLink.onclick=tocShowSlide; \n }\n \n\n for (var j=1;j<slideHolder.childNodes[i].childNodes.length;j++) {\n var node = slideHolder.childNodes[i].childNodes[j];\n if(node.nodeName=="H2" || node.nodeName=="H3" || node.nodeName=="H4") {\n tocLabel = abbreviateLabel(node.firstChild.data);\n switch (node.nodeName) {\n case "H2":\n var tocItem = createTiddlyElement(toc,"LI",null,"tocLevel2");\n break;\n case "H3":\n var tocItem = createTiddlyElement(toc,"LI",null,"tocLevel3");\n break;\n case "H4":\n var tocItem = createTiddlyElement(toc,"LI",null,"tocLevel4");\n }\n var tocLink = createTiddlyElement(tocItem,"A",null,"tocItem",tocLabel);\n tocLink.setAttribute("slideNumber",i);\n tocLink.onclick=tocShowSlide;\n }\n }\n }\n \n\n //Input box to jump to s specific slide\n var tocItem = createTiddlyElement(toc,"LI",null,"tocJumpItem","Go to slide: ");\n var tocJumpInput = createTiddlyElement(tocItem,"INPUT","jumpInput");\n tocJumpInput.type="text";\n tocJumpInput.onkeyup=jumpInputToSlide;\n}\n\nvar next_slide= function(e){GoToSlide(1);}\nvar first_slide= function(e){GoToSlide("f");}\nvar previous_slide= function(e){GoToSlide(-1);}\nvar last_slide= function(e){GoToSlide("l");}\n\nfunction toggleSlideStyles(){\n var contentWrapper = document.getElementById('contentWrapper');\n if (contentWrapper.className == "slideShowMode"){\n contentWrapper.className = "";\n if(slideShowStyleSheet) changeStyleSheet();\n } else{\n contentWrapper.className = "slideShowMode";\n if(slideShowStyleSheet) changeStyleSheet(slideShowStyleSheet);\n }\n}\n\nsetStylesheet("/***\sn!Slide Mode Styles\sn***/\sn/*{{{*/\sn#contentWrapper.slideShowMode #slideContainer{\sn display: block;\sn}\sn\sn#jump{\sn text-align: right;\sn}\sn\sn.pageFooterOff #navigator{\sn visibility: hidden;\sn}\sn\sn.pageFooterOn #navigator{\sn visibility: visible;\sn}\sn\sn#contentWrapper.slideShowMode,\sn #contentWrapper.slideShowMode #displayArea{\sn width: 100%;\sn font-size: 1.5em;\sn margin: 0;\sn padding: 0;\sn}\sn\sn#slideContainer{\sn display: none;\sn}\sn\sn#contentWrapper.slideShowMode #sidebar,\sn#contentWrapper.slideShowMode #mainMenu,\sn#contentWrapper.slideShowMode .header,\sn#contentWrapper.slideShowMode #displayArea .toolbar,\sn#contentWrapper.slideShowMode #displayArea .footer,\sn#contentWrapper.slideShowMode #displayArea .subtitle,\sn#contentWrapper.slideShowMode #displayArea .tagged,\sn#contentWrapper.slideShowMode #displayArea .tagging\sn{\sn display:none;\sn}\sn\sn.indexNumbers{\sn cursor: pointer;\sn}\sn\sn#navigator{\sn visibility: hidden;\sn bottom: 0;\sn}\sn\sn#toc{\sn display: none;\sn position: absolute;\sn font-size: .75em;\sn bottom: 2em;\sn right: 0;\sn background: #fff;\sn border: 1px solid #000;\sn text-align: left;\sn}\sn\snul#toc, #toc li{\sn margin: 0;\sn padding: 0;\sn list-style: none;\sn line-height: 1em;\sn}\sn\sn.tocJumpItem{\sn margin-right: 2em;\sn}\sn\sn.tocJumpItem input{\snmargin-right: 1em;\sn border: 0;\sn}\sn\sn#toc a,\sn#toc a.button{\sn display: block;\sn padding: .1em;\sn}\sn\sn#toc .tocLevel1{\snfont-size: .8em;\sn}\sn\sn#toc .tocLevel2{\sn margin-left: 1em;\sn font-size: .75em;\sn}\sn\sn#toc .tocLevel3{\sn margin-left: 2em;\snfont-size: .75em;\sn}\sn\sn#toc .tocLevel4{\sn margin-left: 3em;\snfont-size: .65em;\sn}\sn\sn#toc a{\sn cursor: pointer;\sn}\sn\snh1{\sn min-height: 1em;\sn}\sn\sn.slide h1{\sn min-height: 0;\sn}\sn\sn/* The '&gt;' selector is ignored by IE6 and earlier so the proper rules are given */\sn#pageFooter{\sn position: fixed;\sn bottom: 0;\sn right: 20px;\sn width: 100%;\sn text-align: right;\sn}\sn\sn/* This is a hack to trick IE6 and earlier to put the navbar on the bottom of the page */\sn* html #pageFooter {\sn position: absolute;\sn width: 100%;\sn text-align: right;\sn right: auto; bottom: auto;\sn left: expression( ( -20 - pageFooter.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );\sn top: expression( ( -10 - pageFooter.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );\sn}\sn\sn\sn\sn/*}}}*/","slideShowStyles");\n//}}}
[[myLayoutStyle]]\n[[myColorStyle]]
/***\n|''Name:''|TWMacro|\n|''Version:''||\n|''Source:''|[[AiddlyWiki|http://aiddlywiki.sourceforge.net]]|\n|''Author:''|[[Arphen Lin|mailto:arphenlin@gmail.com]]|\n|''Type:''|WikiBar addon|\n|''Required:''|WikiBar 2.0.0+|\n!Description\nsupport TiddlyWiki macro syntaxes\n!Installation\n#install WikiBar at first\n#create your addon as a tiddler with tag 'wikibarAddons'\n!Code\n***/\n//{{{\n\n//----------------------------------------------------------------------------\n// addon install function: this is a must\n//----------------------------------------------------------------------------\nfunction wikibar_addonInstall(unused){\n\n // register tools\n wikibarStore.macro = {\n TYPE: 'MENU',\n TOOLTIP: 'system macros',\n systemInfo:{\n TYPE: 'MENU',\n CAPTION:'system information',\n allTags:{\n TOOLTIP:'display all TiddlyWiki tags',\n syntax: '<<allTags>>',\n HANDLER: wikibar_editFormatByWord\n },\n tag:{\n TOOLTIP:'display specified tag',\n syntax: '<<tag %1>>',\n HANDLER: wikibar_getMacroParam,\n doMore: wikibar_editFormatByWord,\n param: 'tagName(ex: systemConfig)'\n },\n message:{\n TOOLTIP:'get system message',\n syntax:'<<message %1>>',\n HANDLER: wikibar_getMacroParam,\n doMore: wikibar_editFormatByWord,\n param: 'customConfigError'\n },\n option:{\n TOOLTIP:'display specified option',\n syntax: '<<option %1>>[%2]\sn',\n HANDLER: wikibar_getMacroParam,\n doMore: wikibar_editFormatByWord,\n param: 'chkOpenInNewWindow \s"Open link in new window\s"'\n },\n saveChanges:{\n TOOLTIP:'save changes',\n syntax: '<<saveChanges>>',\n HANDLER: wikibar_editFormatByWord\n },\n search:{\n TOOLTIP:'display search button and input box',\n syntax: '<<search>>',\n HANDLER: wikibar_editFormatByWord\n },\n timeline:{\n TYPE:'MENU',\n TOOLTIP:'list tiddlers in date order',\n modified:{\n TOOLTIP:'list tiddlers in modified date order',\n syntax: '<<timeline>>',\n HANDLER: wikibar_editFormatByWord\n },\n created:{\n TOOLTIP:'list tiddlers in created date order',\n syntax: '<<timeline created>>',\n HANDLER: wikibar_editFormatByWord\n }\n },\n version:{\n TOOLTIP:'display TiddlyWiki version',\n syntax: '<<version>>',\n HANDLER: wikibar_editFormatByWord\n },\n list:{\n TYPE: 'MENU',\n list:{\n TOOLTIP:'list all tiddlers in alphabetical order',\n syntax: '<<list>>',\n HANDLER: wikibar_editFormatByWord\n },\n listMissing:{\n CAPTION:'list missing',\n TOOLTIP:'list all undefined tiddlers',\n syntax: '<<list missing>>',\n HANDLER: wikibar_editFormatByWord\n },\n listOrphans:{\n CAPTION:'list orphans',\n TOOLTIP:'tiddlers that are not linked to from any other tiddlers',\n syntax: '<<list orphans>>',\n HANDLER: wikibar_editFormatByWord\n }\n }\n }, // systemInfo\n tiddlerOperate:{\n TYPE: 'MENU',\n CAPTION:'tiddler operation',\n newJournal:{\n TOOLTIP:'create a new tiddler from current date and time',\n syntax: '<<newJournal %1>>',\n HANDLER: wikibar_getMacroParam,\n doMore: wikibar_editFormatByWord,\n param: '\s"journal title\s"'\n },\n newTiddler:{\n TOOLTIP:'create new tiddler',\n syntax: '<<newTiddler>>',\n HANDLER: wikibar_editFormatByWord\n },\n closeAll:{\n TOOLTIP:'close all tiddlers',\n syntax: '<<closeAll>>',\n HANDLER: wikibar_editFormatByWord\n }\n }, // tiddlerOperate\n tiddlerInfo:{\n TYPE: 'MENU',\n CAPTION:'tiddler information',\n tiddler:{\n TOOLTIP:'display specified tiddler text',\n syntax: '<<tiddler %1>>',\n HANDLER: wikibar_getMacroParam,\n doMore: wikibar_editFormatByWord,\n param: 'tiddlerTitle'\n }\n }, // tiddlerInfo\n template:{\n TYPE:'MENU',\n CAPTION:'template only',\n toolbar:{\n TYPE:'MENU',\n TOOLTIP:'toolbar macro command',\n closeTiddler:{\n TOOLTIP: 'close current tiddler',\n syntax: 'closeTiddler',\n HANDLER: wikibar_editFormatByWord\n },\n closeOthers:{\n TOOLTIP: 'close other opened tiddlers',\n syntax: 'closeOthers',\n HANDLER: wikibar_editFormatByWord\n },\n editTiddler:{\n TOOLTIP: 'edit current tiddler',\n syntax: 'editTiddler',\n HANDLER: wikibar_editFormatByWord\n },\n saveTiddler:{\n TOOLTIP: 'save current tiddler',\n syntax: 'saveTiddler',\n HANDLER: wikibar_editFormatByWord\n },\n cancelTiddler:{\n TOOLTIP: 'cancel current tiddler',\n syntax: 'cancelTiddler',\n HANDLER: wikibar_editFormatByWord\n },\n deleteTiddler:{\n TOOLTIP: 'delete current tiddler',\n syntax: 'deleteTiddler',\n HANDLER: wikibar_editFormatByWord\n },\n permalink:{\n TOOLTIP:'display current tiddler link',\n syntax: 'permalink',\n HANDLER: wikibar_editFormatByWord\n },\n references:{\n TOOLTIP:'current tiddler references',\n syntax: 'references',\n HANDLER: wikibar_editFormatByWord\n },\n jump:{\n TOOLTIP:'jump to other opened tiddler',\n syntax: 'jump',\n HANDLER: wikibar_editFormatByWord\n },\n tagChooser:{\n TOOLTIP:'add tag(s) to current tiddler',\n syntax: 'tagChooser',\n HANDLER: wikibar_editFormatByWord\n }\n },\n edit:{\n TYPE:'MENU',\n editTitle:{\n CAPTION:'edit title',\n TOOLTIP:'display title input box',\n syntax: "macro='edit title'",\n HANDLER: wikibar_editFormatByWord\n },\n editTags:{\n CAPTION:'edit tags',\n TOOLTIP:'display tags input box',\n syntax: "macro='edit tags'",\n HANDLER: wikibar_editFormatByWord\n },\n editText:{\n CAPTION:'edit text',\n TOOLTIP:'display tiddler text edit box',\n syntax: "macro='edit text'",\n HANDLER: wikibar_editFormatByWord\n }\n },\n view:{\n TYPE:'MENU',\n viewTitle:{\n CAPTION:'view title',\n TOOLTIP:'display title',\n syntax: "macro='view title'",\n HANDLER: wikibar_editFormatByWord\n },\n viewTags:{\n CAPTION:'view tags',\n TOOLTIP:'display tags',\n syntax: "macro='view tags'",\n HANDLER: wikibar_editFormatByWord\n },\n viewText:{\n CAPTION:'view text',\n TOOLTIP:'display tiddler text',\n syntax: "macro='view text'",\n HANDLER: wikibar_editFormatByWord\n }\n }\n },\n misc:{\n TYPE: 'MENU',\n gradient:{\n TOOLTIP: 'gradient',\n syntax: '<<gradient vert %1 #ffffff %1>>user_text\sn>>',\n HANDLER: wikibar_getColorCode,\n doMore: wikibar_editFormatByWord\n },\n slider:{\n TOOLTIP: 'slider',\n syntax: '<<slider %1 %2 %3>>',\n HANDLER: wikibar_getMacroParam,\n doMore: wikibar_editFormatByWord,\n param: 'sliderID sliderTiddler sliderLabel'\n },\n sparkline:{\n TOOLTIP: 'sparkline',\n syntax: '<<sparkline %N>>',\n HANDLER: wikibar_getMacroParam,\n doMore: wikibar_editFormatByWord,\n param: 'number_list(ex: 100 123 ...)'\n },\n tabs:{\n TOOLTIP: 'tabs',\n syntax: '<<tabs [%N]>>',\n HANDLER: wikibar_getMacroParam,\n doMore: wikibar_editFormatByWord,\n param: 'indentifier tabLabel tabName Tiddler'\n },\n today:{\n TOOLTIP: 'today',\n syntax: '<<today [%1]>>',\n HANDLER: wikibar_getMacroParam,\n doMore: wikibar_editFormatByWord,\n param: '"YYYY/MM/DD hh:mm:ss"'\n }\n } // misc\n }; // macro\n\n}\n\n//}}}\n//{{{\n// for debugging: you can turn it off in final release ----------------------\nwikibar_addonInstall();\n//}}}
/***\n|''Name:''|Templater|\n|''Version:''||\n|''Source:''|[[AiddlyWiki|http://aiddlywiki.sourceforge.net]]|\n|''Author:''|[[Arphen Lin|mailto:arphenlin@gmail.com]]|\n|''Type:''|WikiBarPlugin addon|\n|''Required:''|WikiBarPlugin 1.0.0+|\n!Description\nLoad a tiddler template.\n!Installation\n#install WikiBar at first\n#create your addon as a tiddler with tag 'wikibarAddons'\n!Code\n***/\n//{{{\n\n//----------------------------------------------------------------------------\n// addon install function: this is a must\n//----------------------------------------------------------------------------\nfunction wikibar_addonInstall(unused){\n\n // define tools\n var loadTemplate={\n TYPE:'MENU',\n CAPTION:'template',\n options:{\n TYPE:'MENU',\n DYNAITEM: loadTemplate_genOptions\n },\n SEPERATOR: {/*---------------------------*/},\n DYNAITEM: loadTemplate_genTemplates\n };\n\n // register tools\n wikibarStore.addon.loadTemplate = loadTemplate;\n\n // init\n loadTemplate_init();\n}\n\nfunction loadTemplate_init(){\n\n // set default value\n var cookies = [\n {name: 'chkLoadTemplateReplaceTitle', value: false},\n {name: 'chkLoadTemplateAppendTag', value: true},\n {name: 'chkLoadTemplateReplaceText', value: false}\n ];\n\n for(var i=0; i<cookies.length; i++){\n if(config.options[cookies[i].name]==null){\n config.options[cookies[i].name]=cookies[i].value;\n saveOptionCookie(cookies[i].name);\n }\n }\n\n}\n\nfunction loadTemplate_selectTemplate(param){\n\n var title = param.button.tiddlerTitle;\n var tiddlerWrapper = document.getElementById('tiddler'+title);\n var theTitle = wikibar_resolveEditItem(tiddlerWrapper, 'title');\n var theTag = wikibar_resolveEditItem(tiddlerWrapper, 'tags');\n var editor = param.button.editor;\n\n // get tiddler data\n var tiddler = store.getTiddler(this.title);\n\n if(config.options['chkLoadTemplateReplaceTitle']){\n theTitle.value = tiddler.title;\n }\n\n if(config.options['chkLoadTemplateAppendTag']){\n theTag.value = tiddler.getTags();\n }\n\n if(config.options['chkLoadTemplateReplaceText']){\n editor.value = tiddler.text;\n wikibar_editSelectAll(param);\n }else{ // inset current cursor\n param.params = tiddler.text;\n wikibar_editFormatByCursor(param);\n }\n\n}\n\nfunction loadTemplate_genOptions(){\n var toolset={};\n\n toolset.replaceTitle = {\n CAPTION:'replace title',\n TOOLTIP:'current title will be replaced',\n SELECTED: config.options['chkLoadTemplateReplaceTitle'],\n HANDLER:function(param){\n config.options['chkLoadTemplateReplaceTitle'] = !config.options['chkLoadTemplateReplaceTitle'];\n saveOptionCookie('chkLoadTemplateReplaceTitle');\n }\n };\n\n toolset.appendTag = {\n CAPTION:'append tags',\n TOOLTIP:'template tags will be appended',\n SELECTED: config.options['chkLoadTemplateAppendTag'],\n HANDLER:function(param){\n config.options['chkLoadTemplateAppendTag'] = !config.options['chkLoadTemplateAppendTag'];\n saveOptionCookie('chkLoadTemplateAppendTag');\n }\n };\n\n toolset.replaceText = {\n CAPTION:'replace text',\n TOOLTIP:'current text will be replaced',\n SELECTED: config.options['chkLoadTemplateReplaceText'],\n HANDLER:function(param){\n config.options['chkLoadTemplateReplaceText'] = !config.options['chkLoadTemplateReplaceText'];\n saveOptionCookie('chkLoadTemplateReplaceText');\n }\n };\n\n return toolset;\n}\n\nfunction loadTemplate_genTemplates(){\n\n try{\n\n var tiddlers = store.getTaggedTiddlers('TiddlerTemplates');\n if(!tiddlers) {\n displayMessage('Template not found! You can create a new tiddler and add \s"TiddlerTemplates\s" tag');\n return;\n }\n\n var toolset={};\n// toolset.TYPE='MENU';\n\n for(i=0; i<tiddlers.length; i++){\n var title = tiddlers[i].title.trim();\n toolset[title] = {\n title: title,\n HANDLER: loadTemplate_selectTemplate\n };\n }\n\n return toolset;\n\n }catch(ex){alert(ex);}\n\n}\n\n//}}}\n\n//{{{\n// for debugging: you can turn it off in final release ----------------------\nwikibar_addonInstall();\n//}}}\n\n
2 to 2 1/2 lbs. boneless steak, cut up in small pieces\n1 tsp. ginger\n1 tbsp. sugar\n2 tbsp. oil\n1/2 c. soy sauce\n1 garlic clove, crushed\nCombine all ingredients and pour over steak. Cook on low 4 to 6 hours in crockpot. Serve over rice.
<<calendar>>\n\n[[Full Year]]
This site is based on TiddlyWiki, a free MicroContent WikiWikiWeb by JeremyRuston. It's written in HTML, CSS and JavaScript to run on any modern browser without needing any ServerSide logic. It allows anyone to create personal SelfContained hypertext documents that can be posted to any WebServer, sent by email or kept on a USB thumb drive to make a WikiOnAStick. This is revision <<version>> of TiddlyWiki, and is published under an OpenSourceLicense.
/***\n\n''Based on code by Barnaby''\n(http://barny.qoob.org/pub/tw/empty.html)\n\n|Name|ToggleSideBarMacro|\n|Created by|SaqImtiaz|\n|Location|http://lewcid.googlepages.com/lewcid.html#ToggleSideBarMacro|\n|Version|0.1 alpha|\n|Requires|~TW2.x|\n!Description:\nSets sidebar hidden by default, and the macro provides a button for toggling it.\n\n!Demo\n*Click on » in the toolbar for this tiddler\n*or click on SideBar » in the MainMenu\n\n!Usage:\n{{{<<toggleSideBar>>}}} <<toggleSideBar>>\n{{{<<toggleSideBar customlabel>>}}} <<toggleSideBar customlabel>>\n{{{<<toggleSideBar customlabel customtooltip>>}}} <<toggleSideBar customlabel customtooltip>>\n\nYou can add it to your tiddler toolbar, your MainMenu, or where you like really.\nIf you are using a horizontal MainMenu and want the button to be right aligned, put the following in your StyleSheet:\n{{{ .HideSideBarButton {float:right;} }}}\n\n!Current Issues:\n*some issues with custom stylesheets and not expanding to fit screen\n**will work on them!\n\n!To do\n*rewrite as a command for easier addition to toolbar.\n\n!History\n*27-04-06: version 0.1: working.\n\n!Code\n***/\n//{{{\nwindow.onToggleSideBar = function(){\n if(document.getElementById('sidebar').style.display == 'block')\n { document.getElementById('sidebar').style.display = 'none';\n document.getElementById('displayArea').style.marginRight = '1em';\n this.firstChild.data= (this.firstChild.data).replace('«','»'); }\n else\n { document.getElementById('sidebar').style.display = 'block';\n document.getElementById('displayArea').style.marginRight = '16em'; \n this.firstChild.data=(this.firstChild.data).replace('»','«');}\n return false;\n }\n\nconfig.macros.toggleSideBar={};\nconfig.macros.toggleSideBar.handler=function (place,macroName,params,wikifier,paramString,tiddler){\n\n var label= (params[0]&&params[0]!='.')?params[0]+'»':'»';\n var tooltip= params[1]||'toggle Side Bar';\n\n var sp = createTiddlyElement(place,"span",null,"HideSideBarButton");\n var theBtn = createTiddlyButton(sp,label,tooltip,onToggleSideBar);\n};\n\nsetStylesheet(\n"#sidebar { display: none;}\sn"+\n"#displayArea { margin-right: 1em;}\sn"+\n//".HideSideBarButton {float:right;}\sn"+\n "",\n"ToggleSideBarStyles");\n//}}}
/***\n''ToolkitPlugin for TiddlyWiki version 1.2.x and 2.0''\n^^author: Eric Shulman - ELS Design Studios\nsource: http://www.elsdesign.com/tiddlywiki/#ToolkitPlugin\nlicense: [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]^^\n\nTiddlyWiki uses many different options, messages, shadow tiddlers, styles, notification functions and macro handlers to control a variety of program behaviors and appearances. While many of these values are normally hidden from the TW user, it can be helpful to know this information when diagnosing the behavior of macros that may be interacting with core functions and can even modify or dynamically add to the internal values currently being used.\n\n!!!!!Usage\n<<<\n''{{{<<sysInfo options|messages|shadows|styles|notify|macros>>}}}''\n\nThe ''sysInfo'' macro lets you view many key program values, so you can quickly determine the internal state of the TW core functions and the effect of any macros that may have modified or extended the TW program operating environment. Key values that sysInfo can display includes:\n*''options'' include default values hard-coded into TW, persistent local options stored in cookies, and plugin configuration options defined in systemConfig tiddlers.\n*''messages'' include built-in error text and custom-defined messages from plugins.\n*''shadows'' includes all built-in 'shadow tiddlers'.\n*''styles'' include default hard-coded CSS definitions, custom StyleSheet tiddlers, and plugin-defined styles.\n*''notify'' lists built-in or plugin-defined functions that are triggered whenever changes to tiddlers are made.\n*''macros'' include built-in and plugin-defined handlers for program functions that can be embedded and displayed within tiddler content.\n\n''{{{<<sysConfig options|messages>>}}}''\n\nThe ''sysConfig'' macro generates a form that lets you manually create or update browser cookies that can override ANY of the values currently defined in the config.options[...] array, even if those settings are not normally made visible to the TW user. sysConfig can also be used to display a list of all message text definitions, using a simple "id=text" format.\n\n''{{{<<DOMViewer rows:nn indent:xxxx inline path elementID|tiddlertitle>>}}}''\n\nWhenever TiddlyWiki renders a given tiddler, it creates a 'tree' of DOM (Document Object Model) elements that represent the information that is displayed by the browser. You can use the ''DOMViewer'' macro to examine the internal DOM elements that are produced by TiddlyWiki's formatter (the 'wikifier'), or elements directly produced by embedded macros that create custom formatted output. This can be particularly helpful when trying to fine tune the layout and appearance of your tiddler content.\n\nDOMViewer creates a textarea control and reports the DOM tree for the current 'insertion point' where the DOMViewer macro is being placed. ''inline'' flag uses TiddlyWiki rendering instead of textarea control. ''path'' shows the relative location of each child element in the DOM tree, using subscript notation, ''[elementID or tiddlertitle]'' displays DOM elements starting from the node with the specified ID. If that ID is not found in the DOM tree, the macro attempts to open a tiddler with that title and then displays the "tiddler"+title DOM elements that were rendered.\n<<<\n!!!!!Examples\n<<<\nTiddlyWiki current operating values, styles, and function definitions:\n<<sysInfo options messages shadows styles notify macros>>\n''[[ToolkitExample:DOMViewer]]''\n<<<\n!!!!!Installation\n<<<\nimport (or copy/paste) the following tiddlers into your document\n(each tagged with <<tag systemConfig>>):\n''[[ToolkitPlugin]]''\n^^documentation and javascript for Toolkit macro handling^^\n<<<\n!!!!!Revision History\n<<<\n''2006.01.01 [2.0.0]''\nupdate for TW2.0\n''2005.10.09 [1.0.2]''\ndocumentation and code cleanup only.\n''2005.09.29 [1.0.1]''\ndocumentation and code cleanup only.\nmerged separate Toolkit:* code tiddlers into one tiddler for easier distribution\n''2005.09.27 [1.0.0]''\nInitial Release\n<<<\n!!!!!Credits\n<<<\nThis feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]].\n<<<\n!!!!!Code\n***/\n// // 1.2.x compatibility\n//{{{\nif (!window.story) window.story=window;\nif (!store.getTiddler) store.getTiddler=function(title){return store.tiddlers[title]}\nif (!store.addTiddler) store.addTiddler=function(tiddler){store.tiddlers[tiddler.title]=tiddler}\nif (!store.deleteTiddler) store.deleteTiddler=function(title){delete store.tiddlers[title]}\n//}}}\n\n// // ''{{{<<sysInfo options|messages|shadows|styles|notify|macros>>}}}''\n//{{{\nversion.extensions.sysInfo = {major: 2, minor: 0, revision: 0, date: new Date(2006,1,1)};\n\nconfig.macros.sysInfo = { };\nconfig.macros.sysInfo.handler = function(place,macroName,params) {\n // OPTIONS\n if (!params[0]||(params.find("options")!=null)) {\n var theOptList=createTiddlyElement(place,"select");\n var c=0;\n theOptList.options[c++]=new Option("options...","",false,false);\n var cookies = { };\n if (document.cookie != "") {\n var p = document.cookie.split("; ");\n for (var i=0; i < p.length; i++) {\n var pos=p[i].indexOf("=")\n if (pos==-1)\n cookies[p[i]]="";\n else\n cookies[p[i].substr(0,pos)]=unescape(p[i].slice(pos+1));\n }\n }\n var opt=new Array(); for (var i in config.options) opt.push(i); opt.sort();\n for(var i=0; i < opt.length; i++) {\n var txt = opt[i];\n var val = "config.options."+txt+"\sn"+config.options[opt[i]];\n if (cookies[opt[i]]) txt += " [cookie]";\n theOptList.options[c++]=new Option(txt,val,false,false);\n }\n }\n // MESSAGES\n if (!params[0]||(params.find("messages")!=null)) {\n var theMsgList=createTiddlyElement(place,"select");\n var c=0;\n theMsgList.options[c++]=new Option("messages...","",false,false);\n var msgs=new Array(); for (var i in config.messages) msgs.push(i); msgs.sort();\n for(var i=0; i < msgs.length; i++) {\n var txt = msgs[i];\n var val = "config.messages."+txt+"\sn"+config.messages[msgs[i]];\n theMsgList.options[c++]=new Option(txt,val,false,false);\n }\n }\n // SHADOWS\n if (!params[0]||(params.find("shadows")!=null)) {\n var theShadowList=createTiddlyElement(place,"select");\n var c=0;\n theShadowList.options[c++]=new Option("shadows...","",false,false);\n var shadows=new Array(); for (var i in config.shadowTiddlers) shadows.push(i); shadows.sort();\n for(var i=0; i < shadows.length; i++) {\n var txt = shadows[i];\n var val = "config.shadowTiddlers."+txt+"\sn"+config.shadowTiddlers[shadows[i]];\n theShadowList.options[c++]=new Option(txt,val,false,false);\n }\n }\n // STYLES\n if (!params[0]||(params.find("styles")!=null)) {\n var theStyleList=createTiddlyElement(place,"select");\n var c=0;\n theStyleList.options[c++]=new Option("stylesheets...","",false,false);\n var styles=document.getElementsByTagName("style");\n for(var i=0; i < styles.length; i++) {\n var id=styles[i].getAttribute("id"); if (!id) id="(default)";\n var txt=id;\n var val="/* stylesheet:"+txt+" */\sn"+styles[i].innerHTML;\n theStyleList.options[c++]=new Option(txt,val,false,false);\n }\n }\n // NOTIFY\n if (!params[0]||(params.find("notify")!=null)) {\n var theNotifyList=createTiddlyElement(place,"select");\n var c=0;\n theNotifyList.options[c++]=new Option("notifications...","",false,false);\n for (var i=0; i<store.namedNotifications.length; i++) {\n var n = store.namedNotifications[i];\n var fn = n.notify.toString();\n fn = fn.substring(fn.indexOf("function ")+9,fn.indexOf("{")-1);\n var txt=(n.name?n.name:"any change")+"="+fn;\n var val="/* notify: "+txt+" */"+n.notify.toString();\n theNotifyList.options[c++]=new Option(txt,val,false,false);\n }\n }\n // MACROS\n if (!params[0]||(params.find("macros")!=null)) {\n var theMacroList=createTiddlyElement(place,"select");\n var c=0;\n theMacroList.options[c++]=new Option("macro handlers...","",false,false);\n var macros=new Array();\n for (var m in config.macros) macros.push(m);\n macros.sort();\n for(var i=0; i < macros.length; i++) {\n if (config.macros[macros[i]].handler) {\n var txt=macros[i];\n var val="/* macro:"+txt+" */"+config.macros[macros[i]].handler.toString();\n theMacroList.options[c++]=new Option(txt,val,false,false);\n }\n }\n }\n // TEXTAREA DISPLAY\n theTextArea=createTiddlyElement(place,"textarea");\n theTextArea.rows=10;\n theTextArea.cols=60;\n theTextArea.style.width="100%";\n theTextArea.style.fontSize="8pt";\n var num=!params[0]?6:params.length; var pct=100/num+"%";\n if (theOptList) {\n theOptList.textarea=theTextArea;\n theOptList.onchange=function() { this.textarea.value=this.value; }\n theOptList.style.fontSize="8pt"; theOptList.style.width=pct;\n }\n if (theMsgList) {\n theMsgList.textarea=theTextArea;\n theMsgList.onchange=function() { this.textarea.value=this.value; }\n theMsgList.style.fontSize="8pt"; theMsgList.style.width=pct;\n }\n if (theShadowList) {\n theShadowList.textarea=theTextArea;\n theShadowList.onchange=function() { this.textarea.value=this.value; }\n theShadowList.style.fontSize="8pt"; theShadowList.style.width=pct;\n }\n if (theStyleList) {\n theStyleList.textarea=theTextArea;\n theStyleList.onchange=function() { this.textarea.value=this.value; }\n theStyleList.style.fontSize="8pt"; theStyleList.style.width=pct;\n }\n if (theNotifyList) {\n theNotifyList.textarea=theTextArea;\n theNotifyList.onchange=function() { this.textarea.value=this.value; }\n theNotifyList.style.fontSize="8pt"; theNotifyList.style.width=pct;\n }\n if (theMacroList) {\n theMacroList.textarea=theTextArea;\n theMacroList.onchange=function() { this.textarea.value=this.value; }\n theMacroList.style.fontSize="8pt"; theMacroList.style.width=pct;\n }\n}\n//}}}\n// // ''{{{<<sysConfig options|messages>>}}}''\n//{{{\nversion.extensions.sysConfig= {major: 2, minor: 0, revision: 0, date: new Date(2006,1,1)};\nconfig.macros.sysConfig = { };\nconfig.macros.sysConfig.handler = function(place,macroName,params) {\n // OPTIONS\n if (!params[0]||(params.find("options")!=null)) {\n var out="";\n var options=new Array(); for (var i in config.options) options.push(i); options.sort();\n for(var i=0; i < options.length; i++)\n if ((options[i].substr(0,3)=="txt")||(options[i].substr(0,3)=="chk"))\n out += "<<option "+options[i]+">> "+options[i]+"\sn";\n else\n out += options[i]+"="+config.options[options[i]]+"\sn";\n }\n // MESSAGES\n if (!params[0]||(params.find("messages")!=null)) {\n var out="";\n var msgs=new Array(); for (var i in config.messages) msgs.push(i); msgs.sort();\n for(var i=0; i < msgs.length; i++)\n out += msgs[i]+"="+config.messages[msgs[i]]+"\sn";\n }\n if (out.length>0) wikify(out,place);\n}\n//}}}\n// // ''{{{<<DOMViewer rows:nn indent:xxxx inline path elementID|tiddlertitle>>}}}''\n//{{{\nversion.extensions.DOMViewer = {major: 2, minor: 0, revision: 0, date: new Date(2006,1,1)};\nconfig.macros.DOMViewer = { };\nconfig.macros.DOMViewer.handler = function(place,macroName,params) {\n // set default params\n var inline=false;\n var theRows=15;\n var theIndent="| ";\n var showPath=false;\n var theTarget=place;\n // unpack options parameters\n if (params[0]=='inline') { inline=true; theIndent=">"; params.shift(); } \n if (params[0]&&(params[0].substr(0,7)=="indent:")) { theIndent=params[0].substr(7); params.shift(); } \n if (params[0]&&(params[0].substr(0,5)=="rows:")) { theRows=params[0].substr(5); params.shift(); } \n if (params[0]=='path') { showPath=true; params.shift(); } \n if (params[0]) {\n theTarget=document.getElementById(params[0]);\n if (!theTarget)\n if (store.getTiddler(params[0])!=undefined) {\n theTarget=document.getElementById("tiddler"+params[0]);\n if (!theTarget && confirm("DOMViewer asks:\sn\snIs it OK to open tiddler '"+params[0]+"' now?")) { \n story.displayTiddler(null,params[0],1,null,null,false);\n theTarget=document.getElementById("tiddler"+params[0]);\n }\n }\n params.shift();\n }\n // generate and display DOM tree\n if (inline) {\n var out=getNodeTree(theTarget,theIndent,showPath,inline);\n wikify(out,place);\n }\n else {\n var out=getNodeTree(theTarget,theIndent,showPath,inline);\n var css=".DOMViewer{width:100%;font-size:8pt;color:inherit;background:transparent;border:0px;}";\n setStylesheet(css,"DOMViewerPlugin");\n theTextArea=createTiddlyElement(place,"textarea",null,"DOMViewer",out);\n theTextArea.rows=theRows;\n theTextArea.cols=60;\n theTextArea.wrap="off";\n theTextArea.theTarget=theTarget;\n theTextArea.theIndent=theIndent;\n theTextArea.showPath=showPath;\n }\n}\nfunction getNodeTree(theNode,theIndent,showPath,inline,thePrefix,thePath)\n{\n if (!theNode) return "";\n if (!thePrefix) thePrefix="";\n if (!thePath) thePath="";\n var mquote='"'+(inline?"{{{":"");\n var endmquote=(inline?"}}}":"")+'"';\n // generate output for this node\n var out = thePrefix;\n if (showPath && thePath.length)\n out += (inline?"//":"")+thePath.substr(1)+":"+(inline?"//":"")+"\sr\sn"+thePrefix;\n if (theNode.className=="DOMViewer")\n return out+'[DOMViewer]\sr\sn'; // avoid self-referential recursion\n out += (inline?"''":"")+theNode.nodeName.toUpperCase()+(inline?"''":"");\n if (theNode.nodeName=="#text")\n out += ' '+mquote+theNode.nodeValue.replace(/\sn/g,'\s\sn')+endmquote;\n if (theNode.className)\n out += ' class='+mquote+theNode.className+endmquote;\n if (theNode.type)\n out += ' type='+mquote+theNode.type+endmquote;\n if (theNode.id)\n out += ' id='+mquote+theNode.id+endmquote;\n if (theNode.name)\n out += " "+theNode.name+(theNode.value?"="+mquote+theNode.value+endmquote:"");\n if (theNode.href)\n out += ' href='+mquote+theNode.href+endmquote;\n if (theNode.src)\n out += ' src='+mquote+theNode.src+endmquote;\n if (theNode.attributes && theNode.getAttribute("tiddlyLink")!=undefined)\n out += ' tiddler='+mquote+theNode.getAttribute("tiddlyLink")+endmquote;\n out += "\sr\sn";\n // recursively generate output for child nodes\n thePath=thePath+"."+theNode.nodeName.toLowerCase();\n thePrefix=theIndent+thePrefix;\n for (var i=0;i<theNode.childNodes.length;i++)\n {\n var thisChild=theNode.childNodes.item(i);\n var theNum=(inline?"~~":"(")+(i+1)+(inline?"~~":")");\n out += getNodeTree(thisChild,theIndent,showPath,inline,thePrefix,thePath+theNum);\n }\n return out;\n}\n//}}}\n
This form is provided for uploading any file with the store.php script describe in UploadPlugin\n----\n<html><center>\n<form enctype="multipart/form-data" action="http://web.bidix.info/TiddlyWiki/store2.php" method="post">\n <input type="hidden" name="MAX_FILE_SIZE" value="3000000" />\nThis file : <input name="userfile" type="file" /><p>\nOptions* : <input type="text" name="UploadPlugin" size=70 value="backupDir=backupDir;user=UPLOAD_USER;password=UPLOAD_PASSWORD;" /><p>\n <input type="submit" value="Upload" />\n</form></center>\n</html>\n----\n * Don't save your real username and password in any tiddler
|!Date|!url|!toFilename|!backupDir|!user|!status|\n| 13/2/2006 18:3:13 | [[|http://www.bobeverson.net/]] | [[index.html|http://www.bobeverson.net/index.html]] | bkup | BobEverson |\n| 13/2/2006 18:9:6 | [[|http://www.bobeverson.net/]] | [[index.html|http://www.bobeverson.net/index.html]] | bkup | BobEverson |\n| 17/2/2006 9:30:51 | [[|http://www.bobeverson.net/]] | [[index.html|http://www.bobeverson.net/index.html]] | bkup | BobEverson |\n| 25/2/2006 20:31:38 | [[|http://www.bobeverson.net/]] | [[index.html|http://www.bobeverson.net/index.html]] | bkup | BobEverson |
!Options used by UploadPlugin\nUsername: <<option txtUploadUserName>>\nPassword: <<option pasUploadPassword>>\n\nUrl of the [[store.php]] script^^(1)^^: <<option txtUploadStoreUrl 50>>\nRelative Directory to store the file^^(2)^^: <<option txtUploadDir 50>>\nFilename of the uploaded file^^(3)^^: <<option txtUploadFilename 40>>\nDirectory to backup file on webserver^^(4)^^: <<option txtUploadBackupDir>>\n\n^^(1)^^Mandatory either in UploadOptions or in MacroParameter\n^^(2)^^If empty stores in the [[store.php]] directory\n^^(3)^^If empty takes the actual filename\n^^(4)^^If empty existing the file with same name on webserver will be overwriten\n\n!Upload\n{{{<<upload [[UploadStoreUrl]}}}^^(1)^^{{{ [UploadFilename] [UploadBackupDir]]>>}}}\n\n<<upload>>
/***\n\n\n----\nUploadPlugin, with [[store.php]], provides @@upload@@ and @@save to web@@ functions. See [[HowToUpload|http://TiddlyWiki.bidix.info/#HowToUpload]].\nUploadPlugin uses Username and Password from UploadOptions stored in cookies to authenticate itself to [[store.php]].\nThe french translation available as a separate tiddler UploadPluginMsgFR\n----\n\n\n***/\n\n/***\n|''Name:''|UploadPlugin|\n|''Type:''|Plugin|\n|''Version:''|3.2.3 (25/02/2006)|\n|''Source:''|[[TiddlyWiki.BidiX.info/#UploadPlugin|http://tiddlywiki.BidiX.info/#UploadPlugin]]|\n|''Author:''|BidiX[at]BidiX.info|\n|''Compatibility:''|TW1.2 & TW2 & FF1.5.0.1|\n!Usage : \n{{{\n<<upload>>\n uses UploadOptions saved in cookies :\n txtUploadUserName: username\n pasUploadPassword : password\n txtUploadStoreUrl : store script\n txtUploadDir : upload directory\n txtUploadFilename : upload filename\n txtUploadBackupDir : backup directory\n\n<<upload [storeUrl [toFilename [backupDir]]]>>\n overwrite UploadOptions\n storeUrl : the url of the store.php to upload the TiddlyWiki\n toFilename : the filename in the storeUrl directory\n backupDir : if present backup the previous toFilename file\n to the backupDir directory\n}}}\n\nInstall the {{{<<upload ... >>}}} macro in SideBarOptions just below {{{<<saveChanges>>}}} macro.\n\n!Description\n!!UploadPlugin\n*If the TiddlyWiki is viewed from @@local disk@@ :\n**{{{<<saveChanges>>}}} \n***display as ''save to disk''\n***work as usual\n**{{{<<upload>>}}}\n***display as ''upload''\n***after saving to disk, upload in the storeUrl directory.\n*If the TiddlyWiki is viewed from @@website@@ :\n**{{{<<saveChanges>>}}} \n***print nothing\n***has been disabled\n**{{{<<upload>>}}}\n***display as '''save to web''\n***save in the storeUrl directory.\n*If GenerateAnRssFeed in AdvancedOptions is set :\n**generate the content of the RSSFeed \n**upload the RssFile in the same directory\n**Caution : use the SiteUrl tiddler to specify the right url of the TiddlyWiki in the generated RssFile\n*DisplayMessage\n*Log upload action in UploadLog\nhint : if UploadLog is the first tiddler in the Timeline Tab, no tiddler has been updated since last upload.\n\n!![[store.php]]\n*UserVariables to set :\n//{{{\n$AUTHENTICATE_USER = true; // true | false\n$USERS = array(\n 'UserName1'=>'Password1', \n 'UserName2'=>'Password2', \n 'UserName3'=>'Password3'); // set usernames and strong passwords\n$DEBUG = false; // true | false\n//}}}\n*method GET\n**display an information page\n*method POST\n**if $~AUTHENTICATE_USER is ''true''\n***presence and value of user and password are checked with $USER and $PASSWORD \n**if toFilename already exists and backDir parameter specified\n***rename toFilename to backupDir/toFilename.AAAAMMDD.HHSS.html\n**copy temporaryUploadedFile to toFilename\n** return status\n\n!User manual\nSee HowToUpload\n\n!Installation :\n*Install the UploadPlugin as usual\n*Upload the [[store.php]] file on your php aware webserver in your TiddlyWiki directory\n*Protect against malicious upload. Two approaches :\n**set $~AUTHENTICATE_USER to true in the [[store.php]] script\n***configure $USER and $PASSWORD in the [[store.php]] script on your webserver\n***set UploadOptions in conformity with [[store.php]]\n**Use server protection :\n***for Apache web server ([[for detail see Apache documentation|http://httpd.apache.org/docs/1.3/howto/htaccess.html]]) : \n****configure and upload the [[.htaccess]] [[.passwd]]\n***for other web servers see the appropriate documentation\n*Configure an upload button, for example in the SideBarOptions\n!Suppported Browser\n*Firefox : tested Ok\n*Internet Explorer : tested Ok\n*Safari : reported ok on OS X\n*Others : Not tested, please report status.\n\n!Revision history\n*V3.2.3 (25/02/2006)\n**Rename getLocalPath in config.macros.upload.getLocalPath\n*V3.2.2 (25/02/2006)\n**Use PasswordTweak 1.0.1\n**uploaddir is a relative path\n**backupdir is a relative path\n+++!![previous versions]\n*V3.2.1 (13/02/2006)\n**name and password added to open.request (Thanks to TedPavlic)\n*V3.2.0 (14/02/2006)\n**Use PassworDTweak (http://tiddlyWiki.bidix.info/#PasswordTweak) for password\n*V3.1.0 (12/02/2006)\n**UploadOptions in Cookies\n**Username and password from UploadOptions pass to store.php script for authentification check\n*V3.0.3 (03/02/2006)\n**Firefox 1.5.0.1 crashes due to global var fixed\n*V3.0.2 (25-Jan-2006)\n**HTTPS compatible\n*V3.0.1 (18-Jan-2006)\n**UTF8toUnicode conversion problem in Firefox\n*V3.0.0 (15-Jan-2006)\n**Asynchronous upload\n**Synchronous upload before unload of the page\n**All strings extracted in macro config\n**Compatibility checked with TW 2.0.2 & TW 1.2.39 for both FF 1.5 and IE 6\n*V2.0.2 (8-Jan-2006)\n**conversion of SiteTitle and SiteSubtitle in web page Title\n*V2.0.1 (8-Jan-2006)\n**Compatibilty with TiddlyWiki 2.0.1\n*V2.0.0 (3-Jan-2006)\n**Save to web\n**Compatibilty with TiddlyWiki 1.2.39 and TiddlyWiki 2.0.0 Beta 6\n*v1.1.0 (27-Dec-2005)\n**Upload RSS File\n*v1.0.3 (26-Dec-2005)\n**UploadLog tiddler\n*v1.0.2 (24-Dec-2005)\n**Optional parameter toFilename\n**Optional parameter backupDir\n*v1.0.1 (23-Dec-2005)\n**reformatting code\n* v1.0.0 (17-Dec-2005)\n** first public working version\n===\n\n\n!Code\n***/\n//{{{\nversion.extensions.UploadPlugin = {major: 3, minor: 2, revision: 3, date: new Date(2006,2,25)};\n//}}}\n/***\n!! Macro definition\n***/\n//{{{\nconfig.macros.upload = {\n accessKey: "U",\n formName: "UploadPlugin",\n contentType: "text/html;charset=UTF-8",\n defaultStoreScript: "store.php"\n};\n\n// only this two configs need to be translated\nconfig.macros.upload.messages = {\n aboutToUpload: "About to upload TiddlyWiki to %0",\n errorDownloading: "Error downloading",\n errorUploadingContent: "Error uploading content",\n fileNotFound: "file to upload not found",\n fileNotUploaded: "File %0 NOT uploaded",\n mainFileUploaded: "Main TiddlyWiki file uploaded to %0",\n urlParamMissing: "url param missing",\n rssFileNotUploaded: "RssFile %0 NOT uploaded",\n rssFileUploaded: "Rss File uploaded to %0"\n};\n\nconfig.macros.upload.label = {\n promptOption: "Save and Upload this TiddlyWiki with UploadOptions",\n promptParamMacro: "Save and Upload this TiddlyWiki in %0",\n saveLabel: "save to web", \n saveToDisk: "save to disk",\n uploadLabel: "upload" \n};\n\nconfig.macros.upload.handler = function(place,macroName,params){\n var storeUrl;\n if (params[0]) {\n storeUrl = params[0];\n this.defaultStoreScript = basename(storeUrl);\n }\n var toFilename=params[1];\n var backupDir=params[2];\n var label;\n if (document.location.toString().substr(0,4) == "http")\n label = this.label.saveLabel;\n else\n label = this.label.uploadLabel;\n var prompt;\n if (storeUrl) {\n prompt = this.label.promptParamMacro.toString().format([dirname(storeUrl)]);\n }\n else {\n prompt = this.label.promptOption;\n }\n createTiddlyButton(place, label, prompt, \n function () {upload(storeUrl, toFilename, backupDir, true); return false;}, \n null, null, this.accessKey);\n};\n//}}}\n/***\n!! UploadOPtions stored in cookies\n***/\n//{{{\nconfig.options.txtUploadStoreUrl = 'UploadStoreUrl';\nconfig.options.txtUploadFilename = 'UploadFilename ';\nconfig.options.txtUploadDir = '';\nconfig.options.txtUploadBackupDir = 'UploadBackupDir ';\nconfig.options.txtUploadUserName = config.options.txtUserName;\nconfig.options.pasUploadPassword = 'UploadPassword ';\n//We have to reload Cookies because options are loaded before systemConfigs\nloadOptionsCookie();\n//}}}\n/***\n!!Core tweaks\n***/\n//{{{\n// overwrite the saveChanges handler \n// configure no Macro instead of saveChanges Macro in case of http: access\nconfig.macros.saveChanges.label = config.macros.upload.label.saveToDisk;\nconfig.macros.saveChanges.handler = function(place,macroName,params)\n{\n if(!readOnly) {\n if (document.location.toString().substr(0,4) != "http") \n createTiddlyButton(place,this.label,this.prompt,function () {saveChanges(); return false;},null,null,this.accessKey);\n // else no TiddlyButton\n }\n};\n\n// Check if there is any unsaved changes before exiting\n// if unsaved changes : saveOrUpload\n//function checkUnsavedChanges()\ncheckUnsavedChanges = function ()\n{\n if(store && store.dirty) {\n if(confirm(config.messages.unsavedChangesWarning))\n saveOrUpload(false); // Because called by <body onunload=... Upload must be synchronous\n }\n};\n\n// saveOrUpload\nfunction saveOrUpload(asynchronous) {\n if (document.location.toString().substr(0,4) == "http") {\n // try a default synchronous upload\n var url = dirname(document.location.toString())+"/"+ config.macros.upload.defaultStoreScript;\n upload(url, null, null, asynchronous);\n }\n else \n saveChanges();\n}\n\n//}}}\n/***\n!!Utility functions \n***/\n//{{{\nfunction dirname(filePath)\n{\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(0, lastpos);\n }\n else\n return filePath.substring(0, filePath.lastIndexOf("\s\s"));\n}\n\nfunction basename(filePath)\n{\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("#")) != -1) \n filePath = filePath.substring(0, lastpos);\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(lastpos + 1);\n }\n else\n return filePath.substring(filePath.lastIndexOf("\s\s")+1);\n}\n\n// TiddlyWiki utilities\n\n config.macros.upload.getLocalPath = function() {\n //extract from the Jeremy's SaveFile \n var originalPath = document.location.toString();\n // Check we were loaded from a file URL\n if(originalPath.substr(0,5) != "file:")\n {\n alert(config.messages.notFileUrlError);\n displayTiddler(null,"SaveChanges",0,null,null,false,false);\n return;\n }\n // Remove any location part of the URL\n var hashPos = originalPath.indexOf("#");\n if(hashPos != -1)\n originalPath = originalPath.substr(0,hashPos);\n // Convert to a native file format assuming\n // "file:///x:/path/path/path..." - pc local file --> "x:\spath\spath\spath..."\n // "file://///server/share/path/path/path..." - FireFox pc network file --> "\s\sserver\sshare\spath\spath\spath..."\n // "file:///path/path/path..." - mac/unix local file --> "/path/path/path..."\n // "file://server/share/path/path/path..." - pc network file --> "\s\sserver\sshare\spath\spath\spath..."\n var localPath;\n if(originalPath.charAt(9) == ":") // pc local file\n localPath = unescape(originalPath.substr(8)).replace(new RegExp("/","g"),"\s\s");\n else if(originalPath.indexOf("file://///") === 0) // FireFox pc network file\n localPath = "\s\s\s\s" + unescape(originalPath.substr(10)).replace(new RegExp("/","g"),"\s\s");\n else if(originalPath.indexOf("file:///") === 0) // mac/unix local file\n localPath = unescape(originalPath.substr(7));\n else if(originalPath.indexOf("file:/") === 0) // mac/unix local file\n localPath = unescape(originalPath.substr(5));\n else // pc network file\n localPath = "\s\s\s\s" + unescape(originalPath.substr(7)).replace(new RegExp("/","g"),"\s\s");\n return localPath;\n}\n\n//}}}\n/***\n!! UploadLog \n***/\n//{{{\n\nfunction getUploadLogTiddler() {\n var tiddler;\n if (version.major < 2)\n tiddler = store.tiddlers['UploadLog'];\n else\n tiddler = store.getTiddler("UploadLog");\n if (!tiddler) \n {\n tiddler = new Tiddler();\n tiddler.title = 'UploadLog';\n tiddler.text = "|!Date|!url|!toFilename|!backupDir|!user|!status|";\n if (version.major < 2)\n store.tiddlers['UploadLog'] = tiddler;\n else\n store.addTiddler(tiddler);\n }\n return tiddler;\n}\n\nfunction uploadLog(url, toFilename, backupDir) \n{\n var tiddler = getUploadLogTiddler();\n var now = new Date();\n var newText = "| ";\n //newText += now.toLocaleString() + " | ";\n \n newText += now.getDate()+"/"+(now.getMonth()+1)+"/"+now.getFullYear() + " ";\n newText += now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" | ";\n newText += "[["+basename(url)+"|"+url + "]] | ";\n if (config.options.txtUploadDir) {\n toFilename = config.options.txtUploadDir + "/" + basename(toFilename);\n } else {\n toFilename = basename(toFilename);\n }\n newText += "[[" + basename(toFilename) + "|" + dirname(url)+ "/" + toFilename + "]] | ";\n newText += backupDir + " | ";\n newText += config.options.txtUserName + " |";\n\n tiddler.text = tiddler.text + "\sn" + newText;\n tiddler.modifier = config.options.txtUserName;\n tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers['UploadLog'] = tiddler;\n else\n store.addTiddler(tiddler);\n //displayTiddler(document.getElementById('sidebar'),"UploadLog",1,null,null,false);\n if (version.major < 2)\n store.notifyAll();\n}\n\nfunction uploadLogStatusOk() \n{\n var tiddler = getUploadLogTiddler();\n var newText = " ok |";\n tiddler.text = tiddler.text + newText;\n tiddler.modifier = config.options.txtUserName;\n tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers['UploadLog'] = tiddler;\n else\n store.addTiddler(tiddler);\n //displayTiddler(document.getElementById('sidebar'),"UploadLog",1,null,null,false);\n if (version.major < 2)\n store.notifyAll();\n store.notify('UploadLog',true);\n}\n\n//}}}\n\n/***\n!! download file before uploading it\n***/\n//{{{\n\nfunction download(uploadUrl, uploadToFilename, uploadBackupDir, asynchronous) {\n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n try {\n if (uploadUrl.substr(0,4) == "http") {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");\n }\n else {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n }\n } catch (e) { }\n\n request.open("GET",document.location.toString(), asynchronous, config.options.txtUploadUserName,\nconfig.options.pasUploadPassword);\n if (asynchronous) {\n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if(request.status == 200) {\n uploadChangesFrom(uploadUrl, uploadToFilename, uploadBackupDir, request.responseText, asynchronous);\n }\n else\n alert(config.macros.upload.messages.errorDownloading.format([document.location.toString()]));\n }\n };\n }\n request.send(null);\n if (! asynchronous) {\n if(request.status == 200) {\n uploadChangesFrom(uploadUrl, uploadToFilename, uploadBackupDir, request.responseText, asynchronous);\n }\n else\n alert(config.macros.upload.messages.errorDownloading.format([document.location.toString()]));\n }\n\n}\n\n//}}}\n\n/***\n!! Upload functions\n***/\n//{{{\n\nfunction upload(url, toFilename, backupDir, asynchronous)\n{\n clearMessage();\n // only for forcing the message to display\n if (version.major < 2)\n store.notifyAll();\n // determine good url\n if (!url) {\n url = config.options.txtUploadStoreUrl;\n }\n if ((!url) && (document.location.toString().substr(0,4) == "http")) {\n url = basename(document.location.toString())+"/"+config.macros.upload.defaultStoreScript;\n }\n if (!url) {\n alert(config.macros.upload.messages.urlParamMissing);\n return;\n }\n // backupdir\n if (!backupDir) {\n backupDir = config.options.txtUploadBackupDir;\n }\n if (!backupDir) {\n backupDir = '';\n }\n \n // UploadFilename\n var toPath;\n if (toFilename)\n toPath = toFilename;\n else {\n if (config.options.txtUploadFilename) {\n toPath = config.options.txtUploadFilename;\n }\n else {\n toPath = basename(document.location.toString());\n }\n }\n \n uploadLog(url, toPath, backupDir);\n if (document.location.toString().substr(0,5) == "file:") {\n saveChanges();\n }\n displayMessage(config.macros.upload.messages.aboutToUpload.format([dirname(url)]), dirname(url));\n uploadChanges(url, toPath, backupDir, asynchronous);\n if(config.options.chkGenerateAnRssFeed) {\n //var rssContent = convertUnicodeToUTF8(generateRss());\n var rssContent = generateRss();\n var rssPath = toPath.substr(0,toPath.lastIndexOf(".")) + ".xml";\n uploadContent(url, rssContent, rssPath, '', asynchronous, function (responseText) {\n if (responseText.substring(0,1) != 0) {\n alert(responseText);\n displayMessage(config.macros.upload.messages.rssFileNotUploaded.format([rssPath]));\n }\n else {\n if (config.options.txtUploadDir) {\n rssPath = config.options.txtUploadDir + "/" + basename(rssPath);\n } else {\n rssPath = basename(rssPath);\n }\n displayMessage(config.macros.upload.messages.rssFileUploaded.format([dirname(url)+"/"+rssPath]), dirname(url)+"/"+rssPath);\n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n }\n );\n }\n return;\n}\n\nfunction uploadChanges(url, toFilename, backupDir, asynchronous)\n{\n var original;\n if (document.location.toString().substr(0,4) == "http") {\n original = download(url, toFilename, backupDir, asynchronous);\n return;\n }\n else {\n // standard way : Local file\n original = loadFile(config.macros.upload.getLocalPath());\n if(window.Components)\n // it's a mozilla browser\n try {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]\n .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);\n converter.charset = /* The character encoding you want, using UTF-8 here */ "UTF-8";\n original = converter.ConvertToUnicode(original);\n }\n catch(e) {\n }\n }\n //DEBUG alert(original);\n uploadChangesFrom(url, toFilename, backupDir, original, asynchronous);\n}\n\nfunction uploadChangesFrom(url, toFilename, backupDir, original, asynchronous)\n{\n\n var startSaveArea = '<div id="' + 'storeArea">'; // Split up into two so that indexOf() of this source doesn't find it\n var endSaveArea = '</d' + 'iv>';\n // Locate the storeArea div's\n var posOpeningDiv = original.indexOf(startSaveArea);\n var posClosingDiv = original.lastIndexOf(endSaveArea);\n if((posOpeningDiv == -1) || (posClosingDiv == -1))\n {\n alert(config.messages.invalidFileError.format([document.location.toString()]));\n return;\n }\n // I think conversion is automatically done\n //var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + \n // convertUnicodeToUTF8(allTiddlersAsHtml()) + "\sn\st\st" +\n // original.substr(posClosingDiv);\n \n var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + \n allTiddlersAsHtml() + "\sn\st\st" +\n original.substr(posClosingDiv);\n\n // I think conversion is automatically done\n // var newSiteTitle = convertUnicodeToUTF8((getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode());\n var newSiteTitle;\n if(version.major < 2){ //version is set in core TW code\n newSiteTitle = (getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode();\n } else {\n newSiteTitle = (wikifyPlain ("SiteTitle") + " - " + wikifyPlain ("SiteSubtitle")).htmlEncode();\n }\n revised = revised.replace(new RegExp("<title>[^<]*</title>", "im"),"<title>"+ newSiteTitle +"</title>");\n var response = uploadContent(url, revised, toFilename, backupDir, asynchronous, function (responseText) {\n if (responseText.substring(0,1) != 0) {\n alert(responseText);\n displayMessage(config.macros.upload.messages.fileNotUploaded.format([config.macros.upload.getLocalPath()]));\n }\n else {\n if (config.options.txtUploadDir) {\n toFilename = config.options.txtUploadDir + "/" + basename(toFilename);\n } else {\n toFilename = basename(toFilename);\n }\n displayMessage(config.macros.upload.messages.mainFileUploaded.format([dirname(url)+"/"+toFilename]), dirname(url)+"/"+toFilename);\n uploadLogStatusOk();\n store.setDirty(false);\n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n }\n );\n}\n\nfunction uploadContent(url, content, toPath, backupDir, asynchronous, callbackFn) {\n var boundary = "---------------------------"+"AaB03x";\n //Create XMLHttpRequest Object\n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n try {\n // Needed for Mozilla if local file tries to access an http URL\n if (document.location.toString().substr(0,4) == "http") {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");\n }\n else {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\n }\n } catch (e) { }\n \n //DEBUG alert("user["+config.options.txtUploadUserName+"] password[" + config.options.pasUploadPassword + "]");\n // compose headers data\n var sheader = "\sr\sn";\n sheader += "--" + boundary + "\sr\snContent-disposition: form-data;name=\s"" + config.macros.upload.formName +"\s"\sr\sn\sr\sn";\n sheader += "backupDir="+backupDir\n +";user=" + config.options.txtUploadUserName \n +";password=" + config.options.pasUploadPassword\n +";uploaddir=" + config.options.txtUploadDir\n + ";;\sr\sn"; \n sheader += "\sr\sn" + "--" + boundary + "\sr\sn";\n sheader += "Content-disposition: form-data;name=\s"userfile\s";filename=\s""+toPath+"\s"\sr\sn";\n sheader += "Content-Type: " + config.macros.upload.contentType + "\sr\sn";\n sheader += "Content-Length: " + content.length + "\sr\sn\sr\sn";\n // compose trailer data\n var strailer = new String();\n strailer = "\sr\sn--" + boundary + "--\sr\sn";\n var data;\n data = sheader + content + strailer;\n request.open("POST",url,asynchronous, config.options.txtUploadUserName, config.options.pasUploadPassword);\n if (asynchronous) {\n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if(request.status == 200)\n callbackFn(request.responseText);\n else\n alert(config.macros.upload.messages.errorUploadingContent);\n }\n };\n }\n request.setRequestHeader("Content-Length",data.length);\n request.setRequestHeader("Content-Type","multipart/form-data; boundary="+boundary);\n request.send(data); \n if (! asynchronous) {\n if(request.status == 200)\n callbackFn(request.responseText);\n else\n alert(config.macros.upload.messages.errorUploadingContent);\n }\n\n}\n\n//}}}\n\n/***\n\n\n----\nPasswordTweak implements the PasswordOption\n----\n\n\n***/\n/***\n|''Name:''|PasswordTweak|\n|''Type:''|tweak|\n|''Version:''|1.0.1 (22/02/2006)|\n|''Source:''|[[TiddlyWiki.BidiX.info/#PasswordTweak|http://tiddlywiki.BidiX.info/#PasswordTweak]]|\n|''Author:''|BidiX[at]BidiX.info|\n|''Compatibility:''|TW1.2 & TW2 & FF1.5.0.1|\n!Description\n*a password option has {{{pas}}} as prefix\n*in a tiddler the {{{<<option pasXXXX>>}}} provide a password input field a checkbox and a text ("Save this password on this computer")\n*when the password field changes ''or'' the checkbox changes the password is saved in a cookie, but only when the associated checkbox is checked\n*config.options.pasPassword is defined for general use. You could put it in OptionsPanel\n*add an optional size parameter for a txt or a pas option (size in characters) .\n!Exemple\n''Password : '' <<option pasPassword>>\n\n!Usage \n{{{\n<<option <prefix><Rest> [size]>>\n*prefix : \n** txt : texte option type\n**pas : password option type\n**chk : checkbox option type\n*Rest : rest of the name of the option\n*size : optional size of the txt or password input field in character\n}}}\n\n!Revision history\n*V1.0.1 (22/02/2006)\n**add size parameters for txt and pas options\n*V1.0.0 (14/02/2006)\n**Initial release\n\n***/\n/***\n!Configs\n***/\n//{{{\nconfig.messages.savePasswordCheckboxLabel = "Save this password on this computer";\nconfig.macros.option.passwordType = "password"; // password | text\n//}}}\n/***\n!option macro\n***/\n//{{{\nversion.extensions.PasswordTweak = {major: 1, minor: 0, revision: 0, date: new Date(2006,2,14)};\nconfig.macros.option.onChangeOption = function(e)\n{\n var opt = this.getAttribute("option");\n var elementType,valueField;\n if(opt) {\n switch(opt.substr(0,3)) {\n case "txt":\n elementType = "input";\n valueField = "value";\n break;\n case "pas":\n elementType = "input";\n valueField = "value";\n break;\n case "chk":\n elementType = "input";\n valueField = "checked";\n break;\n }\n config.options[opt] = this[valueField];\n saveOptionCookie(opt);\n var nodes = document.getElementsByTagName(elementType);\n for(var t=0; t<nodes.length; t++) {\n var optNode = nodes[t].getAttribute("option");\n if(opt == optNode)\n nodes[t][valueField] = this[valueField];\n }\n }\n return(true);\n}\n\nconfig.macros.option.handler = function(place,macroName,params)\n{\n var opt = params[0];\n var size = 15;\n if (params[1])\n size = params[1];\n if(config.options[opt] == undefined)\n return;\n var c;\n switch(opt.substr(0,3)) {\n case "txt":\n c = document.createElement("input");\n c.onkeyup = this.onChangeOption;\n c.setAttribute ("option",opt);\n c.size = size;\n c.value = config.options[opt];\n place.appendChild(c);\n break;\n case "pas":\n // input password\n c = document.createElement ("input");\n c.setAttribute("type",config.macros.option.passwordType);\n c.onkeyup = this.onChangeOption;\n c.setAttribute("option",opt);\n c.size = size;\n c.value = config.options[opt];\n place.appendChild(c);\n // checkbox link with this password "save this password on this computer"\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option","chk"+opt);\n place.appendChild(c);\n c.checked = config.options["chk"+opt];\n // text savePasswordCheckboxLabel\n place.appendChild(document.createTextNode(config.messages.savePasswordCheckboxLabel));\n break;\n case "chk":\n c = document.createElement("input");\n c.setAttribute("type","checkbox");\n c.onclick = this.onChangeOption;\n c.setAttribute("option",opt);\n place.appendChild(c);\n c.checked = config.options[opt];\n break;\n }\n}\n//}}}\n/***\n! Option cookie stuff\n***/\n//{{{\nwindow.loadOptionsCookie = function()\n{\n var cookies = document.cookie.split(";");\n for(var c=0; c<cookies.length; c++) {\n var p = cookies[c].indexOf("=");\n if(p != -1) {\n var name = cookies[c].substr(0,p).trim();\n var value = cookies[c].substr(p+1).trim();\n switch(name.substr(0,3)) {\n case "txt":\n config.options[name] = unescape(value);\n break;\n case "pas":\n config.options[name] = unescape(value);\n break;\n case "chk":\n config.options[name] = value == "true";\n break;\n }\n }\n }\n}\n\nwindow.saveOptionCookie = function(name)\n{\n var c = name + "=";\n switch(name.substr(0,3)) {\n case "txt":\n c += escape(config.options[name].toString());\n break;\n case "chk":\n c += config.options[name] ? "true" : "false";\n // is there an option link with this chk ?\n if (config.options[name.substr(3)]) {\n saveOptionCookie(name.substr(3));\n }\n break;\n case "pas":\n if (config.options["chk"+name]) {\n c += escape(config.options[name].toString());\n } else {\n c += "";\n }\n break;\n }\n c += "; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/";\n document.cookie = c;\n}\n//}}}\n/***\n! config.options.pasPassword \n***/\n//{{{\nconfig.options.pasPassword = 'defaultPassword';\nwindow.loadOptionsCookie();\n//}}}\n
<?php\n//{{{\n/** \n * store.php - upload a file in this directory\n * version : 1.1 - 23/12/2005 - BidiX\n * \n * see : http://tiddlywiki.bidi.info/#UploadPlugin for usage\n * see : http://www.php.net/manual/en/features.file-upload.php for détails on uploading files\n * usage : POST UploadPlugin[backupDir=<backupdir>] userfile <file>\n *\n * Revision history\n * v 1.0 - 12/12/2005 : POST userfile <file>\n * v 1.1 - 23/12/2005 : POST UploadPlugin[backupDir=<backupdir>] userfile <file>\n *\n * Copyright (c) BidiX@BidiX.info 2005\n */\nif ($_SERVER['REQUEST_METHOD'] == 'GET') {\n?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n<html>\n <head>\n <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >\n <title>BidiX.info - TiddlyWiki UploadPlugin - Store script</title>\n </head>\n <body>\n <p>&nbsp;</p>\n <p>&nbsp;</p>\n <p>&nbsp;</p>\n <p align="center">This page is designed to upload a <a href="http://www.tiddlywiki.com/">TiddlyWiki<a>.</p>\n <p align="center">for details see : <a href="http://www.bidix.info/TiddlyWiki/BidiXTW.html#HowToUpload">www.bidix.info/TiddlyWiki/BidiXTW.html#HowToUpload<a>.</p> \n </body>\n</html>\n<?php\n}\nelse {\n $uploaddir = './';\n $backuperror = false;\n $optionStr = $_POST['UploadPlugin'];\n $optionArr=explode(';',$optionStr);\n $options = array();\n $backupFilename = '';\n foreach($optionArr as $o) {\n list($key, $value) = split('=', $o);\n $options[$key] = $value;\n }\n if (file_exists($uploaddir . $_FILES['userfile']['name']) && ($options['backupDir'] != '')) {\n if (! file_exists($options['backupDir'])) {\n mkdir($options['backupDir']) or ($backuperror = "mkdir error");\n }\n $filename = $_FILES['userfile']['name'];\n $backupFilename = $options['backupDir'].'/'.substr($filename, 0, strpos($filename, '.')).date('.Ymd.His').substr($filename,strpos($filename,'.'));\n rename($filename, $backupFilename) or ($backuperror = "rename error");\n }\n if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir . $_FILES['userfile']['name'])) {\n if (!$backuperror) {\n echo "0 - File successfully loaded in " .$uploaddir . $_FILES['userfile']['name']. "\sn";\n if ($backupFilename)\n echo "backupFile=$backupFilename;\sn";\n } else {\n echo "BackupError : $backuperror - File successfully loaded in " .$uploaddir . $_FILES['userfile']['name']. "\sn";\n }\n } \n else {\n echo "Error : " . $_FILES['error']." - File NOT uploaded !\sn";\n }\n echo 'Here is some more debugging info : ';\n echo "<pre>";\n print ("\s$_FILES : \sn");\n print_r($_FILES);\n print ("\s$options : \sn");\n print_r($options);\n echo "</pre>";\n}\n//}}}\n?>
<<slideShow slidePause:3000>>\n<<photoShow pics/pic*.jpg 1 2>>
/***\n|''Name:''|WikiBar|\n|''Version:''|2.0.0 beta3|\n|''Source:''|[[AiddlyWiki|http://aiddlywiki.sourceforge.net]]|\n|''Author:''|[[Arphen Lin|mailto:arphenlin@gmail.com]]|\n|''Type:''|toolbar macro command extension|\n|''Required:''|TiddlyWiki 2.0.0 beta6|\n!Description\nWikiBar is a toolbar that gives access to most of TiddlyWiki's formatting features with a few clicks. It's a handy tool for people who are not familiar with TiddlyWiki syntax.\nBesides, with WikiBar-addons, users can extend the power of WikiBar.\n!Support browser\n*Firefox 1.5\n!Revision history\n*v2.0.0 beta3 (2005/12/30)\n** remove macros (replaced by TWMacro addon)\n** add wikibar command in toolbar automatically\n** rename DOIT to HANDLER\n** rename TIP to TOOLTIP\n*v2.0.0 beta2 (2005/12/21)\n** re-design Wikibar addon framework\n*v2.0.0 beta1 (2005/12/14)\n** Note:\n*** WikiBarPlugin is renamed to WikiBar\n** New Features:\n*** support TiddlyWiki 2.0.0 template mechanism\n*** new wikibar data structure\n*** new wikibar-addon framework for developers\n**** support dynamic popup menu generator\n*** support most new macros added in TiddlyWiki 2.0.0\n*** multi-level popup menu\n*** fix wikibar tab stop\n*** remove paletteSelector\n** Known Bugs:\n*** popup-menu and color-picker can't be closed correctly\n*** some macros can't be displayed correctly in previewer\n*** text in previewer will be displayed italic\n*v1.2.0 (2005/11/21)\n**New Features:\n***User defined color palettes supported\n####Get color palettes from [[ColorZilla Palettes|http://www.iosart.com/firefox/colorzilla/palettes.html]].\n####Save the palette file(*.gpl) as a new tiddler and tag it with 'ColorPalettes', then you can use it in WikiBar.\n***WikiBar style sheet supported\n***Click on document to close current colorPicker, paletteSelector or aboutWikibar\n*v1.1.1 (2005/11/03)\n**Bugs fixed:\n***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'\n*v1.1.0 (2005/11/01)\n**Bugs fixed:\n***WikiBar overruns (reported by by GeoffS <gslocock@yahoo.co.uk>)\n**New features:\n***Insert a color code at the cursor. (Thanks to RunningUtes <RunningUtes@gmail.com>)\n***Enable gradient macro. (Thanks to RunningUtes <RunningUtes@gmail.com>)\n***Insert tiddler comment tags {{{/% ... %/}}}. (new feature supported by TiddlyWiki 1.2.37)\n***Insert DateFormatString for {{{<<today>>}}} macro. (new feature supported by TiddlyWiki 1.2.37)\n**Enhanced:\n***Allow optional parameters in syntax.\n**Bugs:\n***'Not enough parameters!' message is displayed when the parameter includes '%+number', ex: 'hello%20world!'\n*v1.0.0 (2005/10/30)\n**Initial release\n!Code\n***/\n//{{{\nconfig.macros.wikibar = {major: 2, minor: 0, revision: 0, beta: 3, date: new Date(2005,12,30)};\nconfig.macros.wikibar.handler = function(place,macroName,params,wikifier,paramString,tiddler){\n if(!(tiddler instanceof Tiddler)) {return;}\n story.setDirty(tiddler.title,true);\n place.id = 'wikibar'+tiddler.title;\n place.className = 'toolbar wikibar';\n};\nfunction wikibar_install(){\n config.commands.wikibar = {\n text: 'wikibar',\n tooltip: 'wikibar on/off',\n handler: function(e,src,title) {\n if(!e){ e = window.event; }\n var theButton = resolveTarget(e);\n theButton.id = 'wikibarButton'+title;\n wikibarPopup.remove();\n wikibar_installAddons(theButton, title);\n wikibar_createWikibar(title);\n return(false);\n }\n };\n config.shadowTiddlers['EditTemplate'] = wikibar_addWikibarCommand(config.shadowTiddlers['EditTemplate']);\n var tiddler = store.getTiddler('EditTemplate');\n if(tiddler){\n tiddler.text = wikibar_addWikibarCommand(tiddler.text);\n }\n}\nfunction wikibar_installAddons(theButton, title){\n var tiddlers = store.getTaggedTiddlers('wikibarAddons');\n if(!tiddlers) { return; }\n theButton.addons=[];\n for(var i=0; i<tiddlers.length; i++){\n try{\n eval(tiddlers[i].text);\n try{\n wikibar_addonInstall(title);\n wikibar_addonInstall = null;\n theButton.addons.push({ok:true, name:tiddlers[i].title});\n }catch(ex){\n theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});\n }\n }catch(ex){\n theButton.addons.push({ok:false, name:tiddlers[i].title, error:ex});\n }\n }\n}\nfunction wikibar_addWikibarCommand(tiddlerText){\n var div = document.createElement('div');\n div.style.display = 'none';\n div.innerHTML = tiddlerText;\n for(var i=0; i<div.childNodes.length; i++){\n var o=div.childNodes[i];\n if(o.tagName==='DIV'){\n if(o.className=='toolbar'){\n var macroText = o.getAttribute('macro').trim();\n if(macroText.search('wikibar')<=0){\n macroText += ' wikibar';\n o.setAttribute('macro', macroText);\n }\n break;\n }\n }\n }\n return div.innerHTML.replace(/\s"/g, "\s'");\n}\nfunction wikibar_processSyntaxParams(theSyntax, params){\n try{\n var pcr = 'AplWikibarPcr';\n var rx=null;\n var allParams=null;\n if(params){\n if(typeof(params)=='object'){\n for(var i=0; i<params.length; i++){\n if(params[i]){\n params[i] = params[i].replace(new RegExp('%','g'), pcr).trim();\n rx = '(\s\s[%'+(i+1)+'\s\s])' + '|' + '(%'+(i+1)+')';\n theSyntax = theSyntax.replace(new RegExp(rx,'g'), params[i] );\n }\n }\n allParams = params.join(' ').trim();\n }else{\n allParams = params.replace(new RegExp('%','g'), pcr).trim();\n rx = /(\s[%1{1}\s])|(%1{1})/g;\n theSyntax = theSyntax.replace(rx, allParams);\n }\n }\n if(allParams){\n theSyntax = theSyntax.replace(new RegExp('%N{1}','g'), allParams);\n }\n rx=/\s[%(([1-9]{1,}[0-9]{0,})|(N{1}))\s]/g;\n theSyntax = theSyntax.replace(rx, '');\n rx=/%(([1-9]{1,}[0-9]{0,})|(N{1}))/g;\n if( theSyntax.match(rx) ){\n throw 'Not enough parameters! ' + theSyntax;\n }\n theSyntax=theSyntax.replace(new RegExp(pcr,'g'), '%');\n return theSyntax;\n } catch(ex){\n return null;\n }\n}\nfunction wikibar_resolveEditItem(tiddlerWrapper, itemName){\n if(tiddlerWrapper.hasChildNodes()){\n var c=tiddlerWrapper.childNodes;\n for(var i=0; i<c.length; i++){\n var txt=wikibar_resolveEditItem(c[i], itemName);\n if(!txt){\n continue;\n }else{\n return txt;\n }\n }\n }\n return ((tiddlerWrapper.getAttribute && tiddlerWrapper.getAttribute('edit')==itemName)? tiddlerWrapper : null);\n}\nfunction wikibar_resolveEditItemValue(tiddlerWrapper, itemName){\n var o = wikibar_resolveEditItem(tiddlerWrapper, itemName);\n return (o? o.value.replace(/\sr/mg,'') : null);\n}\nfunction wikibar_resolveTiddlerEditorWrapper(obj){\n if(obj.id=='tiddlerDisplay'){return null;}\n if((obj.getAttribute && obj.getAttribute('macro')=='edit text')){return obj;}\n return wikibar_resolveTiddlerEditorWrapper(obj.parentNode);\n}\nfunction wikibar_resolveTiddlerEditor(obj){\n if(obj.hasChildNodes()){\n var c = obj.childNodes;\n for(var i=0; i<c.length; i++){\n var o=wikibar_resolveTiddlerEditor(c[i]);\n if(o){ return o;}\n }\n }\n return ((obj.getAttribute && obj.getAttribute('edit')=='text')? obj : null);\n}\nfunction wikibar_resolveTargetButton(obj){\n if(obj.id && obj.id.substring(0,7)=='wikibar'){ return null; }\n if(obj.tiddlerTitle){\n return obj;\n }else{\n return wikibar_resolveTargetButton(obj.parentNode);\n }\n}\nfunction wikibar_isValidMenuItem(tool){\n if(!tool){ return false; }\n if(tool.TYPE=='MENU' || tool.TYPE=='MAIN_MENU'){\n for(var key in tool){\n if(key.substring(0,8)=='DYNAITEM'){ return true; }\n if(wikibar_isValidMenuItem(tool[key])){ return true; }\n }\n return false;\n }else{\n return (tool.HANDLER? true : false);\n }\n}\nfunction wikibar_editFormat(param){\n var editor = param.button.editor;\n var params = param.params;\n clearMessage();\n if(!editor){ return; }\n var repText = wikibar_processSyntaxParams(this.syntax, params);\n if(repText===null){ return; }\n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n var frontText= '';\n var endText = '';\n var fullText = editor.value;\n if(se>ss && ss>=0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n }\n else if(ss===0 && (se===0 || se == fullText.length) ){\n endText = fullText;\n }\n else if(se==ss && ss>0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n }\n if(repText.indexOf('user_text')>=0 && this.hint){\n repText = repText.replace('user_text', this.hint);\n }\n editor.value = frontText + repText + endText;\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n editor.focus();\n}\nfunction wikibar_editFormatByWord(param){\n var editor = param.button.editor;\n var params = param.params;\n clearMessage();\n if(!editor){return;}\n var repText = wikibar_processSyntaxParams(this.syntax, params);\n if(repText===null){ return; }\n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n var frontText= '';\n var selText = '';\n var endText = '';\n var fullText = editor.value;\n if(se>ss && ss>=0){\n frontText = fullText.substring(0, ss);\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se, fullText.length);\n }\n else if(ss===0 && (se===0 || se == fullText.length) ){\n endText = fullText;\n }\n else if(se==ss && ss>0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n if(!( fullText.charAt(ss-1).match(/\sW/gi) || fullText.charAt(ss).match(/\sW/gi) )){\n var m = frontText.match(/\sW/gi);\n if(m){\n ss = frontText.lastIndexOf(m[m.length-1])+1;\n }\n else{\n ss = 0;\n }\n m = endText.match(/\sW/gi);\n if(m){\n se += endText.indexOf(m[0]);\n }\n else{\n se = fullText.length;\n }\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n selText = fullText.substring(ss,se);\n }\n }\n if(selText.length>0){\n repText = repText.replace('user_text', selText);\n }\n if(repText.indexOf('user_text')>=0 && this.hint){\n repText = repText.replace('user_text', this.hint);\n }\n editor.value = frontText + repText + endText;\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n editor.focus();\n}\nfunction wikibar_editFormatByCursor(param){\n var editor = param.button.editor;\n var params = param.params;\n clearMessage();\n if(!editor){ return; }\n var repText = wikibar_processSyntaxParams(this.syntax, params);\n if(repText===null){ return; }\n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n var frontText= '';\n var endText = '';\n var fullText = editor.value;\n if(se>ss && ss>=0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n }\n else if(ss===0 && (se===0 || se == fullText.length) ){\n endText = fullText;\n }\n else if(se==ss && ss>0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n }\n if(repText.indexOf('user_text')>=0 && this.hint){\n repText = repText.replace('user_text', this.hint);\n }\n editor.value = frontText + repText + endText;\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n editor.focus();\n}\nfunction wikibar_editFormatByLine(param){\n var editor = param.button.editor;\n var params = param.params;\n clearMessage();\n if(!editor){ return; }\n var repText = wikibar_processSyntaxParams(this.syntax, params);\n if(repText===null){ return; }\n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n var frontText= '';\n var selText = '';\n var endText = '';\n var fullText = editor.value;\n if(se>ss && ss>=0){\n if(this.byBlock){\n frontText = fullText.substring(0, ss);\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se, fullText.length);\n }\n else{\n se = ss;\n }\n }\n if(ss===0 && (se===0 || se == fullText.length) ){\n var m=fullText.match(/(\sn|\sr)/g);\n if(m){\n se = fullText.indexOf(m[0]);\n }else{\n se = fullText.length;\n }\n selText = fullText.substring(0, se);\n endText = fullText.substring(se, fullText.length);\n }\n else if(se==ss && ss>0){\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n m = frontText.match(/(\sn|\sr)/g);\n if(m){\n ss = frontText.lastIndexOf(m[m.length-1])+1;\n }\n else{\n ss = 0;\n }\n m = endText.match(/(\sn|\sr)/g);\n if(m){\n se += endText.indexOf(m[0]);\n }\n else{\n se = fullText.length;\n }\n frontText = fullText.substring(0, ss);\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se, fullText.length);\n }\n if(selText.length>0){\n repText = repText.replace('user_text', selText);\n }\n if(repText.indexOf('user_text')>=0 && this.hint){\n repText = repText.replace('user_text', this.hint);\n }\n if(this.byBlock){\n if( (frontText.charAt(frontText.length-1)!='\sn') && ss>0 ){\n repText = '\sn' + repText;\n }\n if( (endText.charAt(0)!='\sn') || se==fullText.length){\n repText += '\sn';\n }\n }\n editor.value = frontText + repText + endText;\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n editor.focus();\n}\nfunction wikibar_editFormatByTableCell(param){\n var editor = param.button.editor;\n var params = param.params;\n clearMessage();\n if(!editor){ return; }\n var repText = wikibar_processSyntaxParams(this.syntax, params);\n if(repText===null){ return; }\n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n var frontText= '';\n var selText = '';\n var endText = '';\n var fullText = editor.value;\n if(ss===0 || ss==fullText.length){\n throw 'not valid cell!';\n }\n se=ss;\n frontText = fullText.substring(0, ss);\n endText = fullText.substring(se, fullText.length);\n i=frontText.lastIndexOf('\sn');\n j=frontText.lastIndexOf('|');\n if(i>j || j<0){\n throw 'not valid cell!';\n }\n ss = j+1;\n i=endText.indexOf('\sn');\n j=endText.indexOf('|');\n if(i<j || j<0){\n throw 'not valid cell!';\n }\n se += j;\n frontText = fullText.substring(0, ss-1);\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se+1, fullText.length);\n if(this.key.substring(0,5)=='align'){\n selText = selText.trim();\n if( selText=='>' || selText=='~' || selText.substring(0,8)=='bgcolor(') {return; }\n }\n if(selText.length>0){\n repText = repText.replace('user_text', selText);\n }\n if(repText.indexOf('user_text')>=0 && this.hint){\n repText = repText.replace('user_text', this.hint);\n }\n editor.value = frontText + repText + endText;\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length - 2;\n editor.scrollTop = st;\n editor.focus();\n}\nfunction wikibar_editSelectAll(param){\n var editor = param.button.editor;\n editor.selectionStart = 0;\n editor.selectionEnd = editor.value.length;\n editor.scrollTop = 0;\n editor.focus();\n}\nfunction wikibar_doPreview(param){\n var theButton = param.button;\n var editor = param.button.editor;\n var wikibar = theButton.parentNode;\n if(!wikibar) { return; }\n title = theButton.tiddlerTitle;\n var editorWrapper = wikibar_resolveTiddlerEditorWrapper(editor);\n var tiddlerWrapper = editorWrapper.parentNode;\n var previewer = document.getElementById('previewer'+title);\n if(previewer){\n previewer.parentNode.removeChild(previewer);\n editorWrapper.style.display = 'block';\n visible=true;\n }else{\n previewer = document.createElement('div');\n previewer.id = 'previewer'+title;\n previewer.className = 'viewer previewer';\n previewer.style.height = (editor.offsetHeight) + 'px';\n wikify(editor.value, previewer);\n tiddlerWrapper.insertBefore(previewer, editorWrapper);\n editorWrapper.style.display = 'none';\n visible=false;\n }\n var pv=null;\n for(var i=0; i<wikibar.childNodes.length; i++){\n try{\n var btn = wikibar.childNodes[i];\n if(btn.toolItem.key == 'preview'){ pv=btn; }\n if(btn.toolItem.key != 'preview'){\n btn.style.display = visible ? '': 'none';\n }\n }catch(ex){}\n }\n if(!pv) { return; }\n if(visible){\n pv.innerHTML = '<font face=\s"verdana\s">&infin;</font>';\n pv.title = 'preview current tiddler';\n }\n else{\n pv.innerHTML = '<font face=\s"verdana\s">&larr;</font>';\n pv.title = 'back to editor';\n }\n}\nfunction wikibar_doListAddons(param){\n clearMessage();\n var title = param.button.tiddlerTitle;\n var wikibarButton = document.getElementById('wikibarButton'+title);\n var ok=0, fail=0;\n for(var i=0; i<wikibarButton.addons.length; i++){\n var addon=wikibarButton.addons[i];\n if(addon.ok){\n displayMessage('[ o ] '+addon.name);\n ok++;\n }\n else{\n displayMessage('[ x ] '+addon.name + ': ' + addon.error);\n fail++;\n }\n }\n displayMessage('---------------------------------');\n displayMessage(ok + ' ok ; ' + fail + ' failed');\n}\nfunction wikibar_getColorCode(param){\n var cbOnPickColor = function(colorCode, param){\n param.params = colorCode;\n param.button.toolItem.doMore(param);\n };\n wikibarColorTool.openColorPicker(param.button, cbOnPickColor, param);\n}\nfunction wikibar_getLinkUrl(param){\n var url= prompt('Please enter the link target', (this.param? this.param : ''));\n if (url && url.trim().length>0){\n param.params = url;\n this.doMore(param);\n }\n}\nfunction wikibar_getTableRowCol(param){\n var rc= prompt('Please enter (rows x cols) of the table', '2 x 3');\n if (!rc || (rc.trim()).length<=0){ return; }\n var arr = rc.toUpperCase().split('X');\n if(arr.length != 2) { return; }\n for(var i=0; i<arr.length; i++){\n if(isNaN(arr[i].trim())) { return; }\n }\n var rows = parseInt(arr[0].trim(), 10);\n var cols = parseInt(arr[1].trim(), 10);\n var txtTable='';\n for(var r=0; r<rows; r++){\n for(var c=0; c<=cols; c++){\n if(c===0){\n txtTable += '|';\n }else{\n txtTable += ' |';\n }\n }\n txtTable += '\sn';\n }\n if(txtTable.trim().length>0){\n param.params = txtTable.trim();\n this.doMore(param);\n }\n}\nfunction wikibar_getMacroParam(param){\n var p = prompt('Please enter the parameters of macro \s"' + this.key + '\s":' +\n '\snSyntax: ' + this.syntax +\n '\sn\snNote: '+\n '\sn%1,%2,... - parameter needed'+\n '\sn[%1] - optional parameter'+\n '\sn%N - more than one parameter(1~n)'+\n '\sn[%N] - any number of parameters(0~n)'+\n '\sn\snPS:'+\n '\sn1. Parameters should be seperated with space character'+\n '\sn2. Use \s" to wrap the parameter that includes space character, ex: \s"hello world\s"'+\n '\sn3. Input the word(null) for the optional parameter ignored',\n (this.param? this.param : '') );\n if(!p) { return; }\n p=p.readMacroParams();\n for(var i=0; i<p.length; i++){\n var s=p[i].trim();\n if(s.indexOf(' ')>0){ p[i]="'"+s+"'"; }\n if(s.toLowerCase()=='null'){ p[i]=null; }\n }\n param.params = p;\n this.doMore(param);\n}\nfunction wikibar_getMorePalette(unused){\n clearMessage();\n displayMessage('Get more color palettes(*.gpl) from ColorZilla Palettes site', 'http:\s/\s/www.iosart.com/firefox/colorzilla/palettes.html');\n displayMessage('Save it as a new tiddler with \s"ColorPalettes\s" tag');\n}\nfunction wikibar_createWikibar(title){\n var theWikibar = document.getElementById('wikibar' + title);\n if(theWikibar){\n if(theWikibar.hasChildNodes()){\n theWikibar.style.display = (theWikibar.style.display=='block'? 'none':'block');\n return;\n }\n }\n var tiddlerWrapper = document.getElementById('tiddler'+title);\n var theTextarea = wikibar_resolveTiddlerEditor(tiddlerWrapper);\n if(!theTextarea){\n clearMessage();\n displayMessage('WikiBar only works in tiddler edit mode now');\n return;\n }else{\n if(!theTextarea.id){ theTextarea.id = 'editor'+title; }\n if(!theTextarea.parentNode.id){ theTextarea.parentNode.id='editorWrapper'+title; }\n }\n if(theWikibar){\n theWikibar = document.getElementById('wikibar'+title);\n }else{\n var editorWrapper = wikibar_resolveTiddlerEditorWrapper(theTextarea);\n theWikibar = createTiddlyElement(tiddlerWrapper, 'div', 'wikibar'+title, 'toolbar');\n addClass(theWikibar, 'wikibar');\n var previewer = document.getElementById('previewer'+title);\n if(previewer){\n tiddlerWrapper.insertBefore(theWikibar, previewer);\n }else{\n tiddlerWrapper.insertBefore(theWikibar, editorWrapper);\n }\n }\n wikibar_createMenu(theWikibar,wikibarStore,title,theTextarea);\n if(config.options['chkWikibarSetEditorHeight'] && config.options['txtWikibarEditorRows']){\n theTextarea.rows = config.options['txtWikibarEditorRows'];\n }\n setStylesheet(\n '.wikibar{text-align:left;visibility:visible;margin:2px;padding:1px;}.previewer{overflow:auto;display:block;border:1px solid;}#colorPicker{position:absolute;display:none;z-index:10;margin:0px;padding:0px;}#colorPicker table{margin:0px;padding:0px;border:2px solid #000;border-spacing:0px;border-collapse:collapse;}#colorPicker td{margin:0px;padding:0px;border:1px solid;font-size:11px;text-align:center;cursor:auto;}#colorPicker .header{background-color:#fff;}#colorPicker .button{background-color:#fff;cursor:pointer;cursor:hand;}#colorPicker .button:hover{padding-top:3px;padding-bottom:3px;color:#fff;background-color:#136;}#colorPicker .cell{padding:4px;font-size:7px;cursor:crosshair;}#colorPicker .cell:hover{padding:10px;}.wikibarPopup{position:absolute;z-index:10;border:1px solid #014;color:#014;background-color:#cef;}.wikibarPopup table{margin:0;padding:0;border:0;border-spacing:0;border-collapse:collapse;}.wikibarPopup .button:hover{color:#eee;background-color:#014;}.wikibarPopup .disabled{color:#888;}.wikibarPopup .disabled:hover{color:#888;background-color:#cef;}.wikibarPopup tr .seperator hr{margin:0;padding:0;background-color:#cef;width:100%;border:0;border-top:1px dashed #014;}.wikibarPopup tr .icon{font-family:verdana;font-weight:bolder;}.wikibarPopup tr .marker{font-family:verdana;font-weight:bolder;}.wikibarPopup td{font-size:0.9em;padding:2px;}.wikibarPopup input{border:0;border-bottom:1px solid #014;margin:0;padding:0;font-family:arial;font-size:100%;background-color:#fff;}',\n 'WikiBarStyleSheet');\n}\nfunction wikibar_createMenu(place,toolset,title,editor){\n if(!wikibar_isValidMenuItem(toolset)){return;}\n if(!(toolset.TYPE=='MAIN_MENU' || toolset.TYPE=='MENU')){ return; }\n for(var key in toolset){\n if(key.substring(0,9)=='SEPERATOR'){\n wikibar_createMenuSeperator(place);\n continue;\n }\n if(key.substring(0,8)=='DYNAITEM'){\n var dynaTools = toolset[key](title,editor);\n if(dynaTools.TYPE && dynaTools.TYPE=='MENU'){\n wikibar_createMenuItem(place,dynaTools,null,editor,title);\n }else{\n dynaTools.TYPE = 'MENU';\n wikibar_createMenu(place, dynaTools, title, editor);\n }\n continue;\n }\n if((toolset[key].TYPE!='MENU' && toolset[key].TYPE!='MAIN_MENU') && !toolset[key].HANDLER){continue;}\n wikibar_createMenuItem(place,toolset,key,editor,title);\n }\n}\nfunction wikibar_createMenuItem(place,toolset,key,editor,title){\n if(!key){\n var tool = toolset;\n }else{\n tool = toolset[key];\n tool.key = key;\n }\n if(!wikibar_isValidMenuItem(tool)){return;}\n var toolIsOnMainMenu = (toolset.TYPE=='MAIN_MENU');\n var toolIsMenu = (tool.TYPE=='MENU');\n var theButton;\n if(toolIsOnMainMenu){\n theButton = createTiddlyButton(\n place,\n '',\n (tool.TOOLTIP? tool.TOOLTIP : ''),\n (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem),\n 'button');\n theButton.innerHTML = (tool.CAPTION? tool.CAPTION : key);\n theButton.isOnMainMenu = true;\n addClass(theButton, (toolIsMenu? 'menu' : 'item'));\n place.appendChild( document.createTextNode('\sn') );\n if(!toolIsMenu){\n if(config.options['chkWikibarPopmenuOnMouseOver']){\n theButton.onmouseover = function(e){ wikibarPopup.remove(); };\n }\n }\n }else{\n theButton=createTiddlyElement(place, 'tr',key,'button');\n theButton.title = (tool.TOOLTIP? tool.TOOLTIP : '');\n theButton.onclick = (toolIsMenu? wikibar_onClickMenuItem : wikibar_onClickItem);\n var tdL = createTiddlyElement(theButton, 'td','','marker');\n var td = createTiddlyElement(theButton, 'td');\n var tdR = createTiddlyElement(theButton, 'td','','marker');\n td.innerHTML = (tool.CAPTION? tool.CAPTION : key);\n if(toolIsMenu){\n tdR.innerHTML='&nbsp;&nbsp;&rsaquo;';\n }\n if(tool.SELECTED){\n tdL.innerHTML = '&radic; ';\n addClass(theButton, 'selected');\n }\n if(tool.DISABLED){\n addClass(theButton, 'disabled');\n }\n }\n theButton.tiddlerTitle = title;\n theButton.toolItem = tool;\n theButton.editor = editor;\n theButton.tabIndex = 999;\n if(toolIsMenu){\n if(config.options['chkWikibarPopmenuOnMouseOver']){\n theButton.onmouseover = wikibar_onClickMenuItem;\n }\n }\n}\nfunction wikibar_createMenuSeperator(place){\n if(place.id.substring(0,7)=='wikibar') { return; }\n var onclickSeperator=function(e){\n if(!e){ e = window.event; }\n e.cancelBubble = true;\n if (e.stopPropagation){ e.stopPropagation(); }\n return(false);\n };\n var theButton=createTiddlyElement(place,'tr','','seperator');\n var td = createTiddlyElement(theButton, 'td','','seperator');\n td.colSpan=3;\n theButton.onclick=onclickSeperator;\n td.innerHTML = '<hr>';\n}\nfunction wikibar_genWikibarAbout(){\n var toolset={};\n toolset.version = {\n CAPTION: '<center>WikiBar ' +\n config.macros.wikibar.major + '.' +\n config.macros.wikibar.minor + '.' +\n config.macros.wikibar.revision +\n (config.macros.wikibar.beta? ' beta '+config.macros.wikibar.beta : '') +\n '</center>',\n HANDLER: function(){}\n };\n toolset.SEPERATOR = {};\n toolset.author = {\n CAPTION: '<center>Arphen Lin<br>arphenlin@gmail.com</center>',\n TOOLTIP: 'send mail to the author',\n HANDLER: function(){ window.open('mailto:arphenlin@gmail.com'); }\n };\n toolset.website = {\n CAPTION: '<center>aiddlywiki.sourceforge.net</center>',\n TOOLTIP: 'go to the web site of WikiBar',\n HANDLER: function(){ window.open('http:\s/\s/aiddlywiki.sourceforge.net/'); }\n };\n return toolset;\n}\nfunction wikibar_genWikibarOptions(title, editor){\n var toolset={};\n toolset.popOnMouseOver = {\n CAPTION:'popup menu on mouse over',\n SELECTED: config.options['chkWikibarPopmenuOnMouseOver'],\n HANDLER: function(param){\n config.options['chkWikibarPopmenuOnMouseOver'] = !config.options['chkWikibarPopmenuOnMouseOver'];\n saveOptionCookie('chkWikibarPopmenuOnMouseOver');\n var title = param.button.tiddlerTitle;\n var wikibar = document.getElementById('wikibar'+title);\n if(wikibar){ wikibar.parentNode.removeChild(wikibar); }\n wikibar_createWikibar(title);\n }\n };\n toolset.setEditorSize = {\n CAPTION:'set editor height: <input id=\s"txtWikibarEditorRows\s" type=text size=1 MAXLENGTH=3 value=\s"' +\n (config.options['txtWikibarEditorRows']? config.options['txtWikibarEditorRows']:editor.rows) + '\s"> ok',\n HANDLER: function(param){\n var input = document.getElementById('txtWikibarEditorRows');\n if(input){\n var rows = parseInt(input.value, 10);\n if(!isNaN(rows)){\n var editor = param.button.editor;\n editor.rows = rows;\n }else{\n rows=config.maxEditRows;\n }\n config.options['txtWikibarEditorRows'] = rows;\n saveOptionCookie('txtWikibarEditorRows');\n config.maxEditRows = rows;\n }\n }\n };\n toolset.setEditorSizeOnLoadingWikibar = {\n CAPTION:'set editor height on loading wikibar',\n SELECTED: config.options['chkWikibarSetEditorHeight'],\n HANDLER: function(param){\n config.options['chkWikibarSetEditorHeight'] = !config.options['chkWikibarSetEditorHeight'];\n saveOptionCookie('chkWikibarSetEditorHeight');\n if(config.options['chkWikibarSetEditorHeight']){\n var rows = config.options['txtWikibarEditorRows'];\n if(!isNaN(rows)){ rows = 15; }\n var editor = param.button.editor;\n editor.rows = rows;\n config.options['txtWikibarEditorRows'] = rows;\n saveOptionCookie('txtWikibarEditorRows');\n }\n }\n };\n toolset.SEPERATOR = {};\n toolset.update = {\n CAPTION: 'check for updates',\n DISABLED: true,\n HANDLER: function(){}\n };\n return toolset;\n}\nfunction wikibar_genPaletteSelector(){\n try{\n var cpTiddlers = store.getTaggedTiddlers('ColorPalettes');\n if(!cpTiddlers) { return; }\n var palettes=[];\n palettes.push(wikibarColorTool.defaultPaletteName);\n for(var i=0; i<cpTiddlers.length; i++){\n palettes.push(cpTiddlers[i].title.trim());\n }\n var toolset={};\n for(i=0; i<palettes.length; i++){\n toolset[palettes[i]] = {\n TOOLTIP: palettes[i],\n SELECTED: (palettes[i]==wikibarColorTool.paletteName),\n HANDLER: wikibar_doSelectPalette\n };\n }\n return toolset;\n }catch(ex){ return null; }\n}\nfunction wikibar_onClickItem(e){\n if(!e){ e = window.event; }\n var theTarget = resolveTarget(e);\n if(theTarget.tagName=='INPUT'){\n e.cancelBubble = true;\n if (e.stopPropagation){ e.stopPropagation(); }\n return;\n }\n var theButton = wikibar_resolveTargetButton(theTarget);\n if(!theButton){ return(false); }\n var o = theButton.toolItem;\n if(!o) { return; }\n var param = {\n event: e,\n button: theButton\n };\n if(o.HANDLER){ o.HANDLER(param); }\n if(o.DISABLED){\n e.cancelBubble = true;\n if (e.stopPropagation){ e.stopPropagation(); }\n }\n return(false);\n}\nfunction wikibar_onClickMenuItem(e){\n if(!e){ e = window.event; }\n var theButton = wikibar_resolveTargetButton(resolveTarget(e));\n if(!theButton){ return(false); }\n e.cancelBubble = true;\n if (e.stopPropagation){ e.stopPropagation(); }\n var title = theButton.tiddlerTitle;\n var editor = theButton.editor;\n var tool = theButton.toolItem;\n if(!tool) { return; }\n var popup = wikibarPopup.create(this);\n if(popup){\n wikibar_createMenu(popup,tool,title,editor);\n if(!popup.hasChildNodes()){\n wikibarPopup.remove();\n }else{\n wikibarPopup.show(popup, false);\n }\n }\n return(false);\n}\nvar wikibarColorTool = {\n defaultPaletteName : 'default',\n defaultColumns : 16,\n defaultPalette : [\n '#FFF','#DDD','#CCC','#BBB','#AAA','#999','#666','#333','#111','#000','#FC0','#F90','#F60','#F30','#C30','#C03',\n '#9C0','#9D0','#9E0','#E90','#D90','#C90','#FC3','#FC6','#F96','#F63','#600','#900','#C00','#F00','#F36','#F03',\n '#CF0','#CF3','#330','#660','#990','#CC0','#FF0','#C93','#C63','#300','#933','#C33','#F33','#C36','#F69','#F06',\n '#9F0','#CF6','#9C3','#663','#993','#CC3','#FF3','#960','#930','#633','#C66','#F66','#903','#C39','#F6C','#F09',\n '#6F0','#9F6','#6C3','#690','#996','#CC6','#FF6','#963','#630','#966','#F99','#F39','#C06','#906','#F3C','#F0C',\n '#3F0','#6F3','#390','#6C0','#9F3','#CC9','#FF9','#C96','#C60','#C99','#F9C','#C69','#936','#603','#C09','#303',\n '#0C0','#3C0','#360','#693','#9C6','#CF9','#FFC','#FC9','#F93','#FCC','#C9C','#969','#939','#909','#636','#606',\n '#060','#3C3','#6C6','#0F0','#3F3','#6F6','#9F9','#CFC','#9CF','#FCF','#F9F','#F6F','#F3F','#F0F','#C6C','#C3C',\n '#030','#363','#090','#393','#696','#9C9','#CFF','#39F','#69C','#CCF','#C9F','#96C','#639','#306','#90C','#C0C',\n '#0F3','#0C3','#063','#396','#6C9','#9FC','#9CC','#06C','#369','#99F','#99C','#93F','#60C','#609','#C3F','#C0F',\n '#0F6','#3F6','#093','#0C6','#3F9','#9FF','#699','#036','#039','#66F','#66C','#669','#309','#93C','#C6F','#90F',\n '#0F9','#6F9','#3C6','#096','#6FF','#6CC','#366','#069','#36C','#33F','#33C','#339','#336','#63C','#96F','#60F',\n '#0FC','#6FC','#3C9','#3FF','#3CC','#399','#033','#39C','#69F','#00F','#00C','#009','#006','#003','#63F','#30F',\n '#0C9','#3FC','#0FF','#0CC','#099','#066','#3CF','#6CF','#09C','#36F','#0CF','#09F','#06F','#03F','#03C','#30C'\n ],\n colorPicker : null,\n pickColorHandler: null,\n userData: null\n};\nwikibarColorTool.paletteName = wikibarColorTool.defaultPaletteName;\nwikibarColorTool.columns = wikibarColorTool.defaultColumns;\nwikibarColorTool.palette = wikibarColorTool.defaultPalette;\nwikibarColorTool.onPickColor = function(e){\n if (!e){ e = window.event; }\n var theCell = resolveTarget(e);\n if(!theCell){ return(false); }\n color = theCell.bgColor.toLowerCase();\n if(!color) { return; }\n wikibarColorTool.displayColorPicker(false);\n if(wikibarColorTool.pickColorHandler){\n wikibarColorTool.pickColorHandler(color, wikibarColorTool.userData);\n }\n return(false);\n};\nwikibarColorTool.onMouseOver = function(e){\n if (!e){ e = window.event; }\n var theButton = resolveTarget(e);\n if(!theButton){ return(false); }\n if(!wikibarColorTool) { return; }\n color = theButton.bgColor.toUpperCase();\n if(!color) { return; }\n td=document.getElementById('colorPickerInfo');\n if(!td) { return; }\n td.bgColor = color;\n td.innerHTML = '<span style=\s"color:#000;\s">'+color+'</span>&nbsp;&nbsp;&nbsp;' +\n '<span style=\s"color:#fff;\s">'+color+'</span>';\n e.cancelBubble = true;\n if (e.stopPropagation){ e.stopPropagation(); }\n return(false);\n};\nwikibarColorTool.openColorPicker = function(theTarget, pickColorHandler, userData){\n wikibarColorTool.skipClickDocumentEvent = true;\n wikibarColorTool.pickColorHandler = pickColorHandler;\n wikibarColorTool.userData = userData;\n wikibarColorTool.moveColorPicker(theTarget);\n};\nwikibarColorTool.convert3to6HexColor = function(c){\n c=c.trim();\n var rx=/^\s#(\sd|[a-f])(\sd|[a-f])(\sd|[a-f])$/gi;\n return (rx.test(c)? c.replace(rx, '#$1$1$2$2$3$3') : c);\n};\nwikibarColorTool.numToHexColor = function (n){\n if(typeof(n)=='number' && (n>=0 && n<=255)) {\n s = n.toString(16).toLowerCase();\n return ((s.length==1)? '0'+s : s);\n }else{\n return null;\n }\n};\nwikibarColorTool.renderColorPalette = function(){\n if(wikibarColorTool.paletteName==wikibarColorTool.defaultPaletteName){\n wikibarColorTool.palette=wikibarColorTool.defaultPalette;\n wikibarColorTool.columns=wikibarColorTool.defaultColumns;\n return;\n }\n tiddlerText = (store.getTiddlerText(wikibarColorTool.paletteName, '')).trim();\n if(tiddlerText.length<=0) { return; }\n var cpContents = tiddlerText.split('\sn');\n var colors=[];\n columns = wikibarColorTool.defaultColumns;\n var tmpArray=null;\n errCount=0;\n for(var i=0; i<cpContents.length; i++){\n cpLine=cpContents[i].trim();\n if( (!cpLine) || (cpLine.length<=0) || (cpLine.charAt(0) == '#') ){ continue; }\n if(cpLine.substring(0,8).toLowerCase()=='columns:'){\n tmpArray = cpLine.split(':');\n try{\n columns = parseInt(tmpArray[1],10);\n }catch(ex){\n columns = wikibarColorTool.defaultColumns;\n }\n }else{\n tmpArray = cpLine.replace('\st', ' ').split(/[ ]{1,}/);\n try{\n color='';\n for(var j=0; j<3; j++){\n c=parseInt(tmpArray[j].trim(), 10);\n if(isNaN(c)){\n break;\n }else{\n c=wikibarColorTool.numToHexColor(c);\n if(!c) {break;}\n color+=c;\n }\n }\n if(color.length==6){\n colors.push('#'+color);\n } else {\n throw 'error';\n }\n }catch(ex){\n }\n }\n }\n if(colors.length>0){\n wikibarColorTool.palette = colors;\n wikibarColorTool.columns = columns;\n }else{\n throw 'renderColorPalette(): No color defined in the palette.';\n }\n};\nwikibarColorTool.displayColorPicker = function(visible){\n if(wikibarColorTool.colorPicker){\n wikibarColorTool.colorPicker.style.display = (visible? 'block' : 'none');\n }\n};\nwikibarColorTool.moveColorPicker = function(theTarget){\n if(!wikibarColorTool.colorPicker){\n wikibarColorTool.createColorPicker();\n }\n var cp = wikibarColorTool.colorPicker;\n var rootLeft = findPosX(theTarget);\n var rootTop = findPosY(theTarget);\n var popupLeft = rootLeft;\n var popupTop = rootTop;\n var popupWidth = cp.offsetWidth;\n var winWidth = findWindowWidth();\n if(popupLeft + popupWidth > winWidth){\n popupLeft = winWidth - popupWidth;\n }\n cp.style.left = popupLeft + 'px';\n cp.style.top = popupTop + 'px';\n wikibarColorTool.displayColorPicker(true);\n};\nwikibarColorTool.createColorPicker = function(unused, palette){\n if(palette){ wikibarColorTool.paletteName=palette; }\n wikibarColorTool.renderColorPalette();\n wikibarColorTool.colorPicker = document.createElement('div');\n wikibarColorTool.colorPicker.id = 'colorPicker';\n document.body.appendChild(wikibarColorTool.colorPicker);\n var theTable = document.createElement('table');\n wikibarColorTool.colorPicker.appendChild(theTable);\n var theTR = document.createElement('tr');\n theTable.appendChild(theTR);\n var theTD = document.createElement('td');\n theTD.className = 'header';\n theTD.colSpan = wikibarColorTool.columns;\n theTD.innerHTML = wikibarColorTool.paletteName;\n theTR.appendChild(theTD);\n for(var i=0; i<wikibarColorTool.palette.length; i++){\n if((i%wikibarColorTool.columns)===0){\n theTR = document.createElement('tr');\n theTable.appendChild(theTR);\n }\n theTD = document.createElement('td');\n theTD.className = 'cell';\n theTD.bgColor = wikibarColorTool.convert3to6HexColor(wikibarColorTool.palette[i]);\n theTD.onclick = wikibarColorTool.onPickColor;\n theTD.onmouseover = wikibarColorTool.onMouseOver;\n theTR.appendChild(theTD);\n }\n rest = wikibarColorTool.palette.length % wikibarColorTool.columns;\n if(rest>0){\n theTD = document.createElement('td');\n theTD.colSpan = wikibarColorTool.columns-rest;\n theTD.bgColor = '#000000';\n theTR.appendChild(theTD);\n }\n theTR = document.createElement('tr');\n theTable.appendChild(theTR);\n theTD = document.createElement('td');\n theTD.colSpan = wikibarColorTool.columns;\n theTD.id = 'colorPickerInfo';\n theTR.appendChild(theTD);\n};\nwikibarColorTool.onDocumentClick = function(e){\n if (!e){ e = window.event; }\n if(wikibarColorTool.skipClickDocumentEvent) {\n wikibarColorTool.skipClickDocumentEvent = false;\n return true;\n }\n if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){\n wikibarColorTool.displayColorPicker(false);\n }\n return true;\n};\nfunction wikibar_doSelectPalette(param){\n clearMessage();\n var theButton = param.button;\n if(!theButton.toolItem.key) { return; }\n var palette = theButton.toolItem.key;\n var oldPaletteName = wikibarColorTool.paletteName;\n if(oldPaletteName != palette){\n try{\n wikibarColorTool.createColorPicker(theButton, palette);\n displayMessage('Palette \s"'+palette+'\s" ('+ wikibarColorTool.palette.length +' colors) is selected');\n }catch(ex){\n errMsg = ex;\n if(errMsg.substring(0,18)=='renderColorPalette'){\n displayMessage('Invalid palette \s"' + palette + '\s", please check it out!');\n wikibarColorTool.createColorPicker(theButton, oldPaletteName);\n }\n }\n }\n}\nvar wikibarPopup = {\n skipClickDocumentEvent: false,\n stack: []\n};\nwikibarPopup.resolveRootPopup = function(o){\n if(o.isOnMainMenu){ return null; }\n if(o.className.substring(0,12)=='wikibarPopup'){ return o;}\n return wikibarPopup.resolveRootPopup(o.parentNode);\n};\nwikibarPopup.create = function(root){\n for(var i=0; i<wikibarPopup.stack.length; i++){\n var p=wikibarPopup.stack[i];\n if(p.root==root){\n wikibarPopup.removeFrom(i+1);\n return null;\n }\n }\n var rootPopup = wikibarPopup.resolveRootPopup(root);\n if(!rootPopup){\n wikibarPopup.remove();\n }else{\n wikibarPopup.removeFromRootPopup(rootPopup);\n }\n var popup = createTiddlyElement(document.body,'div','wikibarPopup'+root.toolItem.key,'wikibarPopup');\n var pop = createTiddlyElement(popup,'table','','');\n wikibarPopup.stack.push({rootPopup: rootPopup, root: root, popup: popup});\n return pop;\n};\nwikibarPopup.show = function(unused,slowly){\n var curr = wikibarPopup.stack[wikibarPopup.stack.length-1];\n var overlayWidth = 1;\n var rootLeft, rootTop, rootWidth, rootHeight, popupLeft, popupTop, popupWidth;\n if(curr.rootPopup){\n rootLeft = findPosX(curr.rootPopup);\n rootTop = findPosY(curr.root);\n rootWidth = curr.rootPopup.offsetWidth;\n popupLeft = rootLeft + rootWidth - overlayWidth;\n popupTop = rootTop;\n }else{\n rootLeft = findPosX(curr.root);\n rootTop = findPosY(curr.root);\n rootHeight = curr.root.offsetHeight;\n popupLeft = rootLeft;\n popupTop = rootTop + rootHeight;\n }\n var winWidth = findWindowWidth();\n popupWidth = curr.popup.offsetWidth;\n if(popupLeft + popupWidth > winWidth){\n popupLeft = rootLeft - popupWidth + overlayWidth;\n }\n curr.popup.style.left = popupLeft + 'px';\n curr.popup.style.top = popupTop + 'px';\n curr.popup.style.display = 'block';\n addClass(curr.root, 'highlight');\n if(config.options.chkAnimate){\n anim.startAnimating(new Scroller(curr.popup,slowly));\n }else{\n window.scrollTo(0,ensureVisible(curr.popup));\n }\n};\nwikibarPopup.remove = function(){\n if(wikibarPopup.stack.length > 0){\n wikibarPopup.removeFrom(0);\n }\n};\nwikibarPopup.removeFrom = function(from){\n for(var t=wikibarPopup.stack.length-1; t>=from; t--){\n var p = wikibarPopup.stack[t];\n removeClass(p.root,'highlight');\n p.popup.parentNode.removeChild(p.popup);\n }\n wikibarPopup.stack = wikibarPopup.stack.slice(0,from);\n};\nwikibarPopup.removeFromRootPopup = function(from){\n for(var t=0; t<wikibarPopup.stack.length; t++){\n var p = wikibarPopup.stack[t];\n if(p.rootPopup==from){\n wikibarPopup.removeFrom(t);\n break;\n }\n }\n};\nwikibarPopup.onDocumentClick = function(e){\n if (!e){ e = window.event; }\n if(wikibarPopup.skipClickDocumentEvent){\n wikibarPopup.skipClickDocumentEvent=false;\n return true;\n }\n if((!e.eventPhase) || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){\n wikibarPopup.remove();\n }\n return true;\n};\nvar wikibarStore = {\n TYPE: 'MAIN_MENU',\n help:{\n TYPE:'MENU',\n CAPTION: '<font face=\s"verdana\s">?</font>',\n TOOLTIP: 'about WikiBar',\n options:{\n TYPE:'MENU',\n DYNAITEM: wikibar_genWikibarOptions\n },\n about:{\n TYPE:'MENU',\n DYNAITEM: wikibar_genWikibarAbout\n }\n },\n preview:{\n TOOLTIP: 'preview this tiddler',\n CAPTION: '<font face=\s"verdana\s">&infin;</font>',\n HANDLER: wikibar_doPreview\n },\n line:{\n TOOLTIP: 'horizontal line',\n CAPTION: '<font face=\s"verdana\s">&mdash;</font>',\n syntax: '\sn----\sn',\n HANDLER: wikibar_editFormatByCursor\n },\n crlf:{\n TOOLTIP: 'new line',\n CAPTION: '<font face=\s"verdana\s">&para;</font>',\n syntax: '\sn',\n HANDLER: wikibar_editFormatByCursor\n },\n selectAll:{\n TOOLTIP: 'select all',\n CAPTION: '<font face=\s"verdana\s">&sect;</font>',\n HANDLER: wikibar_editSelectAll\n },\n deleteSelected:{\n TOOLTIP: 'delete selected',\n CAPTION: '<font face=\s"verdana\s">&times;</font>',\n syntax: '',\n HANDLER: wikibar_editFormat\n },\n textFormat:{\n TYPE: 'MENU',\n CAPTION: 'text',\n TOOLTIP: 'text formatters',\n ignore:{\n TOOLTIP: 'ignore wiki word',\n CAPTION: 'ignore wikiWord',\n syntax: '~user_text',\n hint: 'wiki_word',\n HANDLER: wikibar_editFormatByWord\n },\n bolder:{\n TOOLTIP: 'bolder text',\n CAPTION: '<strong>bolder</strong>',\n syntax: "''user_text''",\n hint: 'bold_text',\n HANDLER: wikibar_editFormatByWord\n },\n italic:{\n TOOLTIP: 'italic text',\n CAPTION: '<em>italic</em>',\n syntax: '\s/\s/user_text\s/\s/',\n hint: 'italic_text',\n HANDLER: wikibar_editFormatByWord\n },\n underline:{\n TOOLTIP: 'underline text',\n CAPTION: '<u>underline</u>',\n syntax: '__user_text__',\n hint: 'underline_text',\n HANDLER: wikibar_editFormatByWord\n },\n strikethrough:{\n TOOLTIP: 'strikethrough text',\n CAPTION: '<strike>strikethrough</strike>',\n syntax: '==user_text==',\n hint: 'strikethrough_text',\n HANDLER: wikibar_editFormatByWord\n },\n superscript:{\n TOOLTIP: 'superscript text',\n CAPTION: 'X<sup>superscript</sup>',\n syntax: '^^user_text^^',\n hint: 'superscript_text',\n HANDLER: wikibar_editFormatByWord\n },\n subscript:{\n TOOLTIP: 'subscript text',\n CAPTION: 'X<sub>subscript</sub>',\n syntax: '~~user_text~~',\n hint: 'subscript_text',\n HANDLER: wikibar_editFormatByWord\n },\n comment:{\n TOOLTIP: 'comment text',\n CAPTION: 'comment text',\n syntax: '/%user_text%/',\n hint: 'comment_text',\n HANDLER: wikibar_editFormatByWord\n },\n monospaced:{\n TOOLTIP: 'monospaced text',\n CAPTION: '<code>monospaced</code>',\n syntax: '{{{user_text}}}',\n hint: 'monospaced_text',\n HANDLER: wikibar_editFormatByWord\n }\n },\n paragraph:{\n TYPE: 'MENU',\n TOOLTIP: 'paragarph formatters',\n list:{\n TYPE: 'MENU',\n TOOLTIP: 'list tools',\n bullet:{\n TOOLTIP: 'bullet point',\n syntax: '*user_text',\n hint: 'bullet_text',\n HANDLER: wikibar_editFormatByLine\n },\n numbered:{\n TOOLTIP: 'numbered list',\n syntax: '#user_text',\n hint: 'numbered_text',\n HANDLER: wikibar_editFormatByLine\n }\n },\n heading:{\n TYPE: 'MENU',\n heading1:{\n CAPTION:'<h1>Heading 1</h1>',\n TOOLTIP: 'Heading 1',\n syntax: '!user_text',\n hint: 'heading_1',\n HANDLER: wikibar_editFormatByLine\n },\n heading2:{\n CAPTION:'<h2>Heading 2<h2>',\n TOOLTIP: 'Heading 2',\n syntax: '!!user_text',\n hint: 'heading_2',\n HANDLER: wikibar_editFormatByLine\n },\n heading3:{\n CAPTION:'<h3>Heading 3</h3>',\n TOOLTIP: 'Heading 3',\n syntax: '!!!user_text',\n hint: 'heading_3',\n HANDLER: wikibar_editFormatByLine\n },\n heading4:{\n CAPTION:'<h4>Heading 4</h4>',\n TOOLTIP: 'Heading 4',\n syntax: '!!!!user_text',\n hint: 'heading_4',\n HANDLER: wikibar_editFormatByLine\n },\n heading5:{\n CAPTION:'<h5>Heading 5</h5>',\n TOOLTIP: 'Heading 5',\n syntax: '!!!!!user_text',\n hint: 'heading_5',\n HANDLER: wikibar_editFormatByLine\n }\n },\n comment:{\n TYPE: 'MENU',\n commentByLine:{\n CAPTION:'comment by line',\n TOOLTIP: 'line comment',\n syntax: '/%user_text%/',\n hint: 'comment_text',\n HANDLER: wikibar_editFormatByLine\n },\n commentByBlock:{\n CAPTION:'comment by block',\n TOOLTIP: 'block comment',\n syntax: '/%\snuser_text\sn%/',\n hint: 'comment_text',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n },\n monospaced:{\n TYPE: 'MENU',\n monosByLine:{\n CAPTION: 'monospaced by line',\n TOOLTIP: 'line monospaced',\n syntax: '{{{\snuser_text\sn}}}',\n hint: 'monospaced_text',\n HANDLER: wikibar_editFormatByLine\n },\n monosByBlock:{\n CAPTION: 'monospaced by block',\n TOOLTIP: 'block monospaced',\n syntax: '{{{\snuser_text\sn}}}',\n hint: 'monospaced_text',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n },\n quote:{\n TYPE: 'MENU',\n quoteByLine:{\n CAPTION: 'quote by line',\n TOOLTIP: 'line quote',\n syntax: '>user_text',\n hint: 'quote_text',\n HANDLER: wikibar_editFormatByLine\n },\n quoteByBlcok:{\n CAPTION: 'quote by block',\n TOOLTIP: 'block quote',\n syntax: '<<<\snuser_text\sn<<<',\n hint: 'quote_text',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n },\n plugin:{\n TYPE: 'MENU',\n code:{\n CAPTION: 'code area',\n TOOLTIP: 'block monospaced for plugin',\n syntax: '\sn\s/\s/{{{\snuser_text\sn\s/\s/}}}\sn',\n hint: 'monospaced_plugin_code',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n },\n commentByLine:{\n CAPTION: 'comment by line',\n TOOLTIP: 'line comment',\n syntax: '\s/\s/user_text',\n hint: 'plugin_comment',\n HANDLER: wikibar_editFormatByLine\n },\n commentByBlock:{\n CAPTION: 'comment by block',\n TOOLTIP: 'block comment',\n syntax: '\s/\s***\snuser_text\sn***\s/',\n hint: 'plugin_comment',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n },\n css:{\n TYPE: 'MENU',\n code:{\n CAPTION: 'code area',\n TOOLTIP: 'block monospaced for css',\n syntax: '\sn\snuser_text\sn\sn',\n hint: 'monospaced_css_code',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n },\n commentByLine:{\n CAPTION: 'comment by line',\n TOOLTIP: 'line comment',\n syntax: '',\n hint: 'css_comment',\n HANDLER: wikibar_editFormatByLine\n },\n commentByBlock:{\n CAPTION: 'comment by block',\n TOOLTIP: 'block comment',\n syntax: '',\n hint: 'css_comment',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n }\n },\n color:{\n TYPE: 'MENU',\n TOOLTIP: 'color tools',\n highlight:{\n CAPTION:'highlight text',\n TOOLTIP: 'highlight text',\n syntax: '@@user_text@@',\n hint: 'highlight_text',\n HANDLER: wikibar_editFormatByWord\n },\n color:{\n CAPTION:'text color',\n TOOLTIP: 'text color',\n hint: 'your_text',\n syntax: '@@color(%1):user_text@@',\n HANDLER: wikibar_getColorCode,\n doMore: wikibar_editFormatByWord\n },\n bgcolor:{\n CAPTION:'background color',\n TOOLTIP: 'background color',\n hint: 'your_text',\n syntax: '@@bgcolor(%1):user_text@@',\n HANDLER: wikibar_getColorCode,\n doMore: wikibar_editFormatByWord\n },\n colorcode:{\n CAPTION:'color code',\n TOOLTIP: 'insert color code',\n syntax: '%1',\n HANDLER: wikibar_getColorCode,\n doMore: wikibar_editFormatByCursor\n },\n 'color palette':{\n TYPE:'MENU',\n DYNAITEM: wikibar_genPaletteSelector,\n SEPERATOR:{},\n morePalette:{\n CAPTION:'more palettes',\n TOOLTIP:'get more palettes',\n HANDLER: wikibar_getMorePalette\n }\n }\n },\n link:{\n TYPE: 'MENU',\n TOOLTIP: 'insert link',\n wiki:{\n CAPTION:'wiki link',\n TOOLTIP: 'wiki link',\n syntax: '[[user_text]]',\n hint: 'wiki_word',\n HANDLER: wikibar_editFormatByWord\n },\n pretty:{\n CAPTION: 'pretty link',\n TOOLTIP: 'pretty link',\n syntax: '[[user_text|%1]]',\n hint: 'pretty_word',\n param: 'PrettyLink Target',\n HANDLER: wikibar_getLinkUrl,\n doMore: wikibar_editFormatByWord\n },\n url:{\n TOOLTIP: 'url link',\n syntax: '[[user_text|%1]]',\n hint: 'your_text',\n param: 'http:\s/\s/...',\n HANDLER: wikibar_getLinkUrl,\n doMore: wikibar_editFormatByWord\n },\n image:{\n TOOLTIP: 'image link',\n syntax: '[img[user_text|%1]]',\n hint: 'alt_text',\n param: 'image/icon.jpg',\n HANDLER: wikibar_getLinkUrl,\n doMore: wikibar_editFormatByWord\n }\n },\n macro:{},\n more:{\n TYPE: 'MENU',\n TOOLTIP: 'more tools',\n table:{\n TYPE: 'MENU',\n TOOLTIP: 'table',\n table:{\n CAPTION:'create table',\n TOOLTIP: 'create a new table',\n syntax: '\sn%1\sn',\n HANDLER: wikibar_getTableRowCol,\n doMore: wikibar_editFormatByWord\n },\n header:{\n TOOLTIP: 'table header text',\n syntax: '|user_text|c',\n hint: 'table_header',\n HANDLER: wikibar_editFormatByWord\n },\n cell:{\n TOOLTIP: 'create a tabel cell',\n syntax: '|user_text|',\n hint: 'your_text',\n HANDLER: wikibar_editFormatByWord\n },\n columnHeader:{\n CAPTION:'column header',\n TOOLTIP: 'create a column header cell',\n syntax: '|!user_text|',\n hint: 'column_header',\n HANDLER: wikibar_editFormatByWord\n },\n cell:{\n TYPE: 'MENU',\n CAPTION: 'cell options',\n bgcolor:{\n CAPTION: 'background color',\n TOOLTIP: 'cell bgcolor',\n syntax: '|bgcolor(%1):user_text|',\n hint: 'your_text',\n HANDLER: wikibar_getColorCode,\n doMore: wikibar_editFormatByTableCell\n },\n alignLeft:{\n CAPTION: 'align left',\n TOOLTIP: 'left align cell text',\n syntax: '|user_text|',\n hint: 'your_text',\n HANDLER: wikibar_editFormatByTableCell\n },\n alignCenter:{\n CAPTION: 'align center',\n TOOLTIP: 'center align cell text',\n syntax: '| user_text |',\n hint: 'your_text',\n HANDLER: wikibar_editFormatByTableCell\n },\n alignRight:{\n CAPTION: 'align right',\n TOOLTIP: 'right align cell text',\n syntax: '| user_text|',\n hint: 'your_text',\n HANDLER: wikibar_editFormatByTableCell\n }\n }\n },\n html:{\n TYPE: 'MENU',\n html:{\n CAPTION: '&lt;html&gt;',\n TOOLTIP: 'html tag',\n syntax: '<html>\snuser_text\sn</html>',\n hint: 'html_content',\n byBlock: true,\n HANDLER: wikibar_editFormatByLine\n }\n }\n },\n addon:{\n TYPE: 'MENU',\n TOOLTIP:'3rd party tools',\n 'about addons':{\n TOOLTIP: 'list loaded addons',\n HANDLER: wikibar_doListAddons\n },\n SEPERATOR:{}\n }\n};\naddEvent(document, 'click', wikibarColorTool.onDocumentClick);\naddEvent(document, 'click', wikibarPopup.onDocumentClick);\nwikibar_install();\n//}}}
/***\n!Calendar Styles\n***/\n/*{{{*/\n.viewer .calendarHolder {\n border: none;\n}\n\n.calendarHolder table {\n border: none;\n}\n\n.calendarHolder tr, .calendarHolder td {\n border: none;\nvertical-align: top;\npadding: 0;\nmargin: 0;\n}\n\n.viewer #calendarWrapper {\n width: 18.5em;\n border: 1px solid #006;\n border-collapse: separate;\n cursor: pointer;\n}\n\n#calendarWrapper table {\n width: 100%;\n}\n\n#calendarWrapper #calendarLine td {\nheight: 2.5em;\npadding: 0;\n}\n\n#calendarWrapper td {\n text-align: center;\nvertical-align: middle;\n width: 14.28%;\n}\n\n#calendarWrapper #calendarHeader td{\n text-align: center;\n color: #ffffff;\nbackground-color: #4682b4;\nheight: 2em;\npadding: 0;\n}\n\n#calendarWrapper #weekNames td {\n text-align: center;\n color: #000;\n background-color: #87cefa;\n height: 2em;\n padding: 0em 0.5em 0em 0.5em;\n}\n\n#calendarWrapper .weekDay {\n background-color: #ccff99;\n}\n\n#calendarWrapper .holiDay {\n background-color: #9ACD32;\n}\n\n#calendarWrapper .currentDay {\n border: solid #87cefa 2px;\n font-weight: bold;\n}\n\n#calendarWrapper .currentscheduledDay {\n border: solid #ff0000 2px;\n font-weight: bold;\n}\n\n#calendarWrapper .workingDay {\n background-color: #ffffff;\n}\n\n#calendarWrapper .scheduledDay {\n border: solid orange 2px;\n}\n\n#calendarWrapper .otherMonthDay {\n background-color: #999;\n}\n/*}}}*/
config.options.chkHttpReadOnly = true;
<html><iframe src="http://www.google.com/calendar/"width="720" height="560" scrolling="yes"></iframe></html>\n
/***\n!Colors Used\n| color | code | description |h\n|bgcolor(#04b):| #04b |header gradient top color |\n|bgcolor(#001):| #001 |header gradient bottom color |\n|bgcolor(#003):| #003 |Horiz main menu background |\n|bgcolor(#87cefa):| #87cefa |calendar week header background |\n|bgcolor(#fff):| #fff |menu tiddlylink text, menu tiddlylink hover background |\n|bgcolor(#c33):| #c33 |hover,higtlight background |\n|bgcolor(#999):| #999 |disabled text, seperator |\n|bgcolor(#911):| #911 |disabled text, seperator |\n***/\n\n/***\n!my color changes\n***/\n\n/*{{{*/\n\n.menuLine {\n background: #003;\n}\n\n.topMenu, .topMenu .tiddlyLinkExisting {\n color: white;\n}\n\n.rightMenu, .rightMenu .tiddlyLinkExisting {\n color: white;\n}\n\n.topMenu .tiddlyLinkExisting:hover {\n color: black;\n background: white;\n}\n\n.rightMenu .tiddlyLinkExisting:hover {\n color: black;\n background: white;\n}\n\n.menuLine .button {\n color: white;\n background: transparent;\n}\n\n.topMenu .tiddlyLink {\n color:black;\n}\n\n.topMenu .button:hover, .topMenu .tiddlyLink:hover {\n color: white;\n background:#000;\n} \n\n#messageArea {\n background:#fff;\n}\n\n#sidebarOptions .sliderPanel {\n background: #fff;\n color: black;\n}\n\n/* tiddler border and background */\ndiv.tiddler {\nbackground:white;\nborder-top:2px solid #ccc;\nborder-left:2px solid #ccc;\nborder-bottom:2px solid #aaa;\nborder-right:2px solid #aaa;\n}\n\n.buttonpopup {\ncolor: white;\nborder: 1px solid darkgray;\nbackground: #006;\n}\n\n.buttonpopup:hover {\ncolor: white;\nborder: 1px solid darkgray;\nbackground: #04b;\n}\n\n.sliderpopup {\ncolor: white;\nborder: 1px solid darkgray;\nbackground: darkgray;\n}\n\n.nestedbuttonpopup {\ncolor: white;\nborder-style: none;\nbackground: #009;\n}\n\n.nestedsliderpopup {\ncolor: white;\nborder-style: none;\nbackground: darkgray;\n}\n\n.topMenu .button {\ncolor: white;\nborder: 1px solid darkgray;\nbackground: #006;\n}\n\n/*}}}*/
/* layout style changes */\n\n/* make the right side always leave room for a scrollbar */\nhtml{\noverflow: scroll;\n}\n\n/* modify display area so we use all the space */\n#displayArea {\n margin: 1em 1em 0em 1em;\n} \n\n/*tiddler margin and rounded corners */\ndiv.tiddler {\nmargin: 0em 0em 0.5em 0em;\n-moz-border-radius: 1.0em;\n}\n\n#sidebar {\n display:none;\n}\n\n#messageArea {\nwidth: 25em;\n-moz-border-radius: 4.0px;\n}\n\n.menuLine {\npadding: 0em 1em 0em 1em;\nheight: 1.5em;\n}\n\n.rightMenu {\npadding: 0em .5em 0em 1em;\nposition: absolute;\n}\n\n.viewer {\nmargin: 0.5em 0.5em 0.5em 0.5em;\n}\n\n.tiddlyLinkExisting {\nfont-weight: normal;\n}\n\n.buttonpopup {\nmargin: 0em 1em 0em 0em;\nwidth: 9em;\ntext-align: center;\nposition: relative;\nfloat: left;\n}\n\n.sliderpopup {\nwidth: 9em;\ntext-align: center;\nposition: absolute;\n}\n\n.nestedbuttonpopup {\nwidth: 9em;\ntext-align: center;\nposition: relative;\nfloat: left;\n}\n\n.nestedsliderpopup {\nwidth: 9em;\ntext-align: center;\nposition: absolute;\n}\n\n/* IE style stuff */\n\n.topMenu .button {\nmargin: 0em 1em 0em 0em;\nwidth: 9em;\ntext-align: center;\nposition: relative;\nfloat: left;\n}\n\n\n.menuLine .button {\nmargin: 0em .5em 0em 0em;\nbackground: transparent;\nborder: 0px;\nfont-size: 8pt;\nwidth: 9.5em;\ntext-align: center;\nposition: relative;\nfloat: right;\n}\n\n.menuLine .floatingpanel {\nwidth: 8em;\ntext-align: center;\nposition: absolute;\n}\n\n[[calendarStyles]]
<<toggleSideBar 'show/hide: sidebar' 'Toggle the SideBar Menu'>>
<?php\n/***\n! User settings\nEdit these lines according to your need\n***/\n//{{{\n$AUTHENTICATE_USER = true; // true | false\n$USERS = array(\n 'UserName1'=>'Password1', \n 'UserName2'=>'Password2', \n 'UserName3'=>'Password3'); // set usernames and strong passwords\n$DEBUG = false; // true | false\n//}}}\n/***\n!Code\nNo change needed under\n***/\n//{{{\n\n/***\n * store.php - upload a file in this directory\n * version :1.4 - 23/02/2006 - BidiX@BidiX.info\n * \n * see : \n * http://tiddlywiki.bidi.info/#UploadPlugin for usage\n * http://www.php.net/manual/en/features.file-upload.php \n * for détails on uploading files\n * usage : \n * POST \n * UploadPlugin[backupDir=<backupdir>;user=<user>;password=<password>;uploadir=<uploaddir>]\n * userfile <file>\n * GET\n *\n * Revision history\n * v 1.4 - 23/02/2006 :\n * add uploaddir option : a path for the uploaded file relative to the current directory\n * backupdir is a relative path\n * make recusively directories if necessary for backupDir and uploadDir\n * v 1.3 - 17/02/2006 :\n * presence and value of user are checked with $USERS Array (thanks to PauloSoares)\n * v 1.2 - 12/02/2006 : \n * POST \n * UploadPlugin[backupDir=<backupdir>;user=<user>;password=<password>;]\n * userfile <file>\n* if $AUTHENTICATE_USER\n * presence and value of user and password are checked with \n * $USER and $PASSWORD\n * v 1.1 - 23/12/2005 : \n * POST UploadPlugin[backupDir=<backupdir>] userfile <file>\n * v 1.0 - 12/12/2005 : \n * POST userfile <file>\n *\n * Copyright (c) BidiX@BidiX.info 2005-2006\n ***/\n//}}}\n\n//{{{\n\nif ($_SERVER['REQUEST_METHOD'] == 'GET') {\n /*\n * GET Request\n */\n ?>\n <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n <html>\n <head>\n <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >\n <title>BidiX.info - TiddlyWiki UploadPlugin - Store script</title>\n </head>\n <body>\n <p>\n <p>store.php V 1.4\n <p>BidiX@BidiX.info\n <p>&nbsp;</p>\n <p>&nbsp;</p>\n <p>&nbsp;</p>\n <p align="center">This page is designed to upload a <a href="http://www.tiddlywiki.com/">TiddlyWiki<a>.</p>\n <p align="center">for details see : <a href="http://TiddlyWiki.bidix.info/#HowToUpload">TiddlyWiki.bidix.info/#HowToUpload<a>.</p> \n </body>\n </html>\n <?php\n}\nelse {\n /*\n * POST Request\n */\n \n // Recursive mkdir\n function mkdirs($dir) {\n if( is_null($dir) || $dir === "" ){\n return false;\n }\n if( is_dir($dir) || $dir === "/" ){\n return true;\n }\n if( mkdirs(dirname($dir)) ){\n return mkdir($dir);\n }\n return false;\n }\n \n // var definitions\n $uploadDir = './';\n $uploadDirError = false;\n $backupError = false;\n $optionStr = $_POST['UploadPlugin'];\n $optionArr=explode(';',$optionStr);\n $options = array();\n $backupFilename = '';\n $filename = $_FILES['userfile']['name'];\n \n // get options\n foreach($optionArr as $o) {\n list($key, $value) = split('=', $o);\n $options[$key] = $value;\n }\n \n // authenticate User\n if ((!$AUTHENTICATE_USER) \n || (($options['user']) && ($options['password']) && ($USERS[$options['user']] == $options['password']))) {\n // make uploadDir\n if ($options['uploaddir']) {\n if (! is_dir($options['uploaddir'])) {\n mkdirs($options['uploaddir']);\n }\n if (! is_dir($options['uploaddir'])) {\n $uploadDirError = "uploadDir mkdir error";\n }\n $uploadDir = $uploadDir . $options['uploaddir'];\n if ($uploadDir{strlen($uploadDir)-1} != '/') {\n $uploadDir = $uploadDir . '/';\n }\n }\n if (!$uploadDirError) {\n // backup existing file\n if (file_exists($uploadDir . $_FILES['userfile']['name']) && ($options['backupDir'])) {\n if (! is_dir($options['backupDir'])) {\n mkdirs($options['backupDir']);\n if (! is_dir($options['backupDir'])) {\n $backupError = "backup mkdir error";\n }\n }\n $backupFilename = $options['backupDir'].'/'.substr($filename, 0, strpos($filename, '.'))\n .date('.Ymd.His').substr($filename,strpos($filename,'.'));\n $filename = $uploadDir . $_FILES['userfile']['name'];\n rename($filename, $backupFilename) or ($backupError = "rename error");\n }\n // move uploaded file to to uploadDir\n if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadDir . $_FILES['userfile']['name'])) {\n if (!$backupError) {\n if($DEBUG) {\n echo "debug mode \sn\sn";\n }\n echo "0 - File successfully loaded in " .$uploadDir . $_FILES['userfile']['name']. "\sn";\n if ($backupFilename)\n echo "backupFile=$backupFilename;\sn";\n } else {\n echo "BackupError : $backupError - File successfully loaded in " .$uploadDir . $_FILES['userfile']['name']. "\sn";\n }\n } \n else {\n echo "Error : " . $_FILES['error']." - File NOT uploaded !\sn";\n }\n }\n else {\n echo "UploadDirError : $uploadDirError - File NOT uploaded !\sn";\n }\n }\n else {\n echo "Error : UserName or Password do not match \sn";\n echo "UserName : [".$options['user']. "] Password : [". $options['password'] . "]\sn";\n }\n if ($DEBUG) {\n echo ("\snHere is some debugging info : \sn");\n echo("\s$filename : $filename \sn");\n echo("\s$backupFilename : $backupFilename \sn");\n print ("\s$_FILES : \sn");\n print_r($_FILES);\n print ("\s$options : \sn");\n print_r($options);\n }\n}\n//}}}\n?>
Some guy bought a new fridge for his house. To get\nrid of his old fridge, he put it in his front yard\nand hung a sign on it saying:\n "Free to good home. You want it, you take it". For\nthree days the fridge sat there without even one\nperson looking twice at it. He eventually decided\nthat people were too un-trusting of this deal. It\nlooked to good to be true, so he changed the sign to\nread: "Fridge for sale $50". The next day someone\nstole it.\n\n While looking at a house, my brother asked the\nreal estate agent which direction was North because,\nhe explained, he didn't want the sun waking him up\nevery morning. She asked, "Does the sun rise in the\nNorth?"\n When my brother explained that the sun rises in\nthe East, (and has for sometime), she shook her head\nand said, "Oh, I don't keep up with that stuff"\n\n I used to work in technical support for a 24/7\ncall center. One day I got a call from an individual\nwho asked what hours the call center was open. I\ntold him, "The number you dialed is open 24 hours a\nday, 7 days a week." He responded, "Is that Eastern\nor Pacific time?" Wanting to end the call quickly, I\nsaid, "Uh, Pacific"\n\n My colleague and I were eating our lunch in our\ncafeteria, when we overheard one of the\nadministrative assistants talking about the sunburn\nshe got on her weekend drive to the shore. She drove\ndown in a convertible, but "didn't think she'd get\nsunburned because the car was moving"\n\n My sister has a lifesaving tool in her car It's\ndesigned to cut through a seat belt if she gets\ntrapped. She keeps it in the trunk\n\n My friends and I were on a beer run and noticed\nthat the cases were discounted 10%. Since it was a\nbig party, we bought 2 cases. The cashier multiplied\n2 times 10% and gave us a 20% discount\n\n I was hanging out with a friend when we saw a\nwoman with a nose ring attached to an earring by a\nchain. My friend said, "Wouldn't the chain rip out\nevery time she turned her head?" I explained that a\nperson's nose and ear remain the same distance apart\nno matter which way the head is turned\n\n I couldn't find my luggage at the airport baggage\narea. So I went to the lost luggage office and told\nthe woman there that my bags never showed up. She\nsmiled and told me not to worry because she was a\ntrained professional and I was in good hands. "Now,"\nshe asked me, "has your plane arrived yet? "\n\n While working at a Pizza Parlor I observed a man\nordering a small pizza to go. He appeared to be\nalone and the cook asked him if he would like it cut\ninto 4 pieces or 6. He though about it for some time\nbefore responding. "Just cut it into 4 pieces; I\ndon't think I'm hungry enough to eat 6".
/***\n''Name:'' TWUpdate\n''Author:'' Tom Otvos\n''Version:'' 0.2\n\n***/\n//{{{\n\nversion.extensions.twupdate = {major: 0, minor: 2, revision: 0, date: new Date(2006,3,13,0,0,0,0), source: ""};\n\nconfig.macros.twupdate = { \n label: "update TW Core",\n sourceUrl: "http://www.tiddlywiki.com/empty.html", \n lingo: {\n prompt: "Update this TiddlyWiki from TiddlyWiki.com", \n warning: "Are you sure you want to update this document with the latest version of TiddlyWiki?\sn\snIf you want to continue, your document will first be saved with a backup.",\n success: "Update was successful. Click on 'OK' to reload the document",\n errNoHttp: "Unable to allocate an HTTP request object for the update",\n progressLoading: "Getting update from TiddlyWiki.com...",\n progressLoadSuccess: "File successfully loaded",\n progressLoadFailure: "File was not loaded successfully (%0)",\n progressMerging: "Merging with existing document..."\n }\n}\n\nconfig.macros.twupdate.handler = function(place)\n{\n if(!readOnly)\n createTiddlyButton(place, this.label, this.prompt, this.onClick, null, null, null);\n}\n\nconfig.macros.twupdate.onClick = function(e)\n{\n if (!confirm(config.macros.twupdate.lingo.warning)) return;\n\n try {\n // force a save with backup\n var saveBackups = config.options.chkSaveBackups;\n config.options.chkSaveBackups = true;\n saveChanges();\n config.options.chkSaveBackups = saveBackups;\n \n var ajax = new AjaxHelper();\n displayMessage(config.macros.twupdate.lingo.progressLoading);\n ajax.getText(config.macros.twupdate.sourceUrl, config.macros.twupdate.performUpdate); \n }\n catch (e) {\n alert(e);\n }\n\n return false;\n}\n\nconfig.macros.twupdate.performUpdate = function(emptyHtml, status, statusText)\n{\n // note that this is begin called from a callback from an event handler, so\n // "this" is most definitely not defined!\n \n if (status == 200)\n displayMessage(config.macros.twupdate.lingo.progressLoadSuccess);\n else {\n displayMessage(config.macros.twupdate.lingo.progressLoadFailure.format([statusText]));\n return;\n }\n displayMessage(config.macros.twupdate.lingo.progressMerging);\n \n // the bulk of this is cribbed from saveChanges()...\n var originalPath = document.location.toString();\n // Check we were loaded from a file URL\n if (originalPath.substr(0,5) != "file:") {\n alert(config.messages.notFileUrlError);\n if (store.tiddlerExists(config.messages.saveInstructions))\n displayTiddler(null,config.messages.saveInstructions);\n return;\n }\n var localPath = getLocalPath(originalPath);\n\n // Locate the storeArea div's\n var posOpeningDiv = emptyHtml.indexOf(startSaveArea);\n var posClosingDiv = emptyHtml.lastIndexOf(endSaveArea);\n if ((posOpeningDiv == -1) || (posClosingDiv == -1)) {\n alert(config.messages.invalidFileError.format(['empty.html']));\n return;\n }\n\n // Save new file\n var revised = emptyHtml.substr(0,posOpeningDiv + startSaveArea.length) + \n convertUnicodeToUTF8(allTiddlersAsHtml()) + "\sn\st\st" +\n emptyHtml.substr(posClosingDiv);\n var newSiteTitle = convertUnicodeToUTF8((wikifyPlain("SiteTitle") + " - " + wikifyPlain("SiteSubtitle")).htmlEncode());\n revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");\n revised = revised.replaceChunk("<!--PRE-HEAD-START--"+">","<!--PRE-HEAD-END--"+">","\sn" + store.getTiddlerText("MarkupPreHead","") + "\sn");\n revised = revised.replaceChunk("<!--POST-HEAD-START--"+">","<!--POST-HEAD-END--"+">","\sn" + store.getTiddlerText("MarkupPostHead","") + "\sn");\n revised = revised.replaceChunk("<!--PRE-BODY-START--"+">","<!--PRE-BODY-END--"+">","\sn" + store.getTiddlerText("MarkupPreBody","") + "\sn");\n revised = revised.replaceChunk("<!--POST-BODY-START--"+">","<!--POST-BODY-END--"+">","\sn" + store.getTiddlerText("MarkupPostBody","") + "\sn");\n var save = saveFile(localPath, revised);\n if (save) {\n displayMessage(config.messages.mainSaved, "file://" + localPath);\n store.setDirty(false);\n alert(config.macros.twupdate.lingo.success);\n document.location.reload();\n }\n else\n alert(config.messages.mainFailed);\n}\n\nfunction AjaxHelper()\n{\n this.http = null;\n \n try\n {\n this.http = new XMLHttpRequest()\n }\n \n catch(e)\n {\n // if we don't get an internal object, try allocating it using ActiveX, with successive\n // fallbacks to earlier MSXML versions as necessary\n try\n {\n this.http = new ActiveXObject("Msxml2.XMLHTTP.4.0")\n } \n catch(e) \n {\n try\n {\n this.http = new ActiveXObject("MSXML2.XMLHTTP")\n } \n catch(e) \n {\n try\n {\n this.http = new ActiveXObject("Microsoft.XMLHTTP")\n } \n catch(e) \n {\n this.http = null\n }\n }\n }\n }\n \n if (!this.http) throw 'Unable to allocate an HTTP request object';\n}\n\nAjaxHelper.prototype.getText = function(url, callback, async, force)\n{\n if (!this.http) return;\n if (async == undefined) async = true;\n if (force == undefined) force = false;\n // ??? right now, we are not handling "forced" requests\n this._request("GET", url, callback, async, true, false);\n}\n\nAjaxHelper.prototype.getXML = function(url, callback, async, force)\n{\n if (!this.http) return;\n if (async == undefined) async = true;\n if (force == undefined) force = false;\n // ??? right now, we are not handling "forced" requests\n this._request("GET", url, callback, async, true, true);\n}\n\nAjaxHelper.prototype.getHead = function(url, callback, async, force)\n{\n if (!this.http) return;\n if (async == undefined) async = true;\n if (force == undefined) force = false;\n // ??? right now, we are not handling "forced" requests\n this._request("HEAD", url, callback, async, false, false);\n}\n\nAjaxHelper.prototype.abort = function()\n{\n if (this.http) this.http.abort();\n}\n\nAjaxHelper.prototype.setRequestHeader = function(name, value)\n{\n if (this.http) this.http.setRequestHeader(name, value);\n}\n\nAjaxHelper.prototype._request = function(method, url, callback, async, hasResponse, hasResponseXML)\n{\n if (!this.http) return;\n \n // get reference to request object so we can use it in closure\n var xmlHttp = this.http, helper = this;\n xmlHttp.onreadystatechange = function()\n {\n if (!async) return;\n if (xmlHttp.readyState == 4)\n callback((hasResponse ? (hasResponseXML ? xmlHttp.responseXML : xmlHttp.responseText) : null), xmlHttp.status, xmlHttp.statusText, helper._parsedResponseHeaders());\n }\n \n try {\n // need some cross-domain privileges for Firefox\n try {\n netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");\n } \n catch (e) \n {\n }\n \n xmlHttp.open(method, url, async);\n xmlHttp.send(null);\n if (!async) callback((hasResponse ? (hasResponseXML ? xmlHttp.responseXML : xmlHttp.responseText) : null), xmlHttp.status, xmlHttp.statusText, this._parsedResponseHeaders());\n }\n \n catch (e)\n {\n alert(e);\n }\n}\n\nAjaxHelper.prototype._parsedResponseHeaders = function()\n{\n if (this.http) {\n var headersArray = new Array();\n var headers = this.http.getAllResponseHeaders().split("\sn");\n for (var i = 0; i < headers.length; i++) {\n var h = headers[i].trim();\n if (h.length == 0) continue;\n // value can have ':' so do not use split here!\n var sep = h.indexOf(':');\n headersArray[h.substring(0, sep).trim()] = h.substr(sep + 1).trim();\n }\n return headersArray;\n }\n else\n return null;\n}\n\n//}}}\n
//<<upload http://mysite.verizon.net/avatar00/ index.htm bkup>>