a simple macro button for creating custom-named backup files\n!Planned Features\n* custom timestamp format for backups\n* an optional edit summary can be added to the filename\n!Implementation\n* based upon Eric's [[NewDocumentPlugin|http://www.tiddlytools.com/#NewDocumentPlugin]] and/or [[LessBackupsPlugin|http://lessbackupsplugin.tiddlyspot.com]]\n* edit summary via a simple input box ({{{prompt()}}})\n!!Issues\n* potentially dangerous characters need to be excluded from the edit summary
/***\n|''Name''|BlockCollapseMacro|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#BlockCollapseMacro]]|\n|''Version''|0.3|\n|''Author''|FND|\n|''License''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|macro for collapsing/expanding block elements' height on click|\n!Usage Notes\n* two options:\n** add {{{<<blockCollapse [class] [tag]>>}}} to the desired tiddler(s)\n** add as a macro to ViewTemplate: {{{<span macro='blockCollapse [class] [tag]'></span>}}}\n!!Example\n{{{<<blockCollapse "footer" "h1">>}}} <<blockCollapse "footer" "h1">> /% DEBUG: not working here %/\n!Revision History\n!!v0.3 (2007-08-17)\n* adapted from [[TableHighlightMacro|http://devpad.tiddlyspot.com/#TableHighlightMacro]]\n!To Do\n* rename plugin => also rename dependencies (macro name, default class and style sheet)\n* fix/remove DEBUG flags\n* adjust Description and Usage Notes\n!Code\n***/\n//{{{\nconfig.macros.blockCollapse = {}\nconfig.macros.blockCollapse.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n // process parameters\n var collapseClass = (params[0] && params[0] != "") ? params[0] : "blockCollapse";\n var targetElement = (params[1] && params[1] != "") ? params[1] : "pre";\n // toggle collapsing\n var els = story.findContainingTiddler(place).getElementsByTagName(targetElement);\n for(var i = 0; i < els.length; i++) {\n els[i].onclick = function() {\n config.macros.blockCollapse.toggleCollapse(this, collapseClass);\n };\n }\n}\n\nconfig.macros.blockCollapse.toggleCollapse = function(el, customClass) {\n if(!hasClass(el, customClass)) {\n addClass(el, customClass);\n //el.style.height = "1em !important"; // DEBUG\n //el.style.border = "10px dashed #F00 !important"; // DEBUG \n } else {\n removeClass(el, customClass);\n //el.style.height = ""; // DEBUG\n //el.style.border = ""; // DEBUG\n }\n}\n\n// set default styles\nsetStylesheet(".blockCollapse { "\n + "height: 1em !important; "\n + "border: 10px dashed #0F0 !important; " // DEBUG\n + "overflow: hidden !important; " // DEBUG\n + "}",\n "StyleSheetBlockCollapse");\n//}}}
/***\n|''Name''|ButtonMemoryMacro|\n|''Version''|0.2|\n|''Status''|@@experimental@@|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#ButtonMemoryMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|creates a list of buttons and remembers the order they were clicked in|\n!Usage\n{{{\n<<btnmem "[button 1 label];[button 2 label];[button 3 label] ...">>\n}}}\n!!Example\n<<btnmem "foo;bar;baz">>\n!Revision History\n!!v0.1 (2007-12-20)\n* initial release\n!!v0.2 (2007-12-21)\n* added configuration options\n* changed parameter processing\n* selection buttons now update output\n!To Do\n* rename\n* named macro parameters for config items\n* code sanitzing\n* documentation\n* allow for more than one instance at a time (due to global selection array and output container)\n!Code\n***/\n//{{{\nconfig.macros.btnmem = {\n resetLabel: "reset",\n submitLabel: "submit",\n itemSeparator: ";",\n itemPrefix: "* ",\n itemSuffix: "\sn",\n outputID: "btnMemOutput",\n itemButtonClass: "button btnMemItemBtn",\n functionButtonClass: "button btnMemFunctionBtn",\n selectionBoxClass: "btnMemSelectionBox",\n functionBoxClass: "btnMemFunctionBox",\n selection: []\n};\n\nconfig.macros.btnmem.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n // create selection buttons\n if(params[0]) var items = params[0].split(this.itemSeparator);\n var e = createTiddlyElement(place, "div", null, this.selectionBoxClass);\n for(var i = 0; i < items.length; i++) {\n createTiddlyButton(e, items[i], null,\n function() { config.macros.btnmem.extendSelection(this.firstChild.nodeValue); },\n this.itemButtonClass);\n }\n // create function buttons\n e = createTiddlyElement(place, "div", null, this.functionBoxClass);\n createTiddlyButton(e, this.resetLabel, null,\n function() { config.macros.btnmem.resetResults(); },\n this.functionButtonClass);\n createTiddlyButton(e, this.submitLabel, null,\n function() { config.macros.btnmem.submitResults(); },\n this.functionButtonClass);\n // create output container -- DEBUG: reuse place instead!?\n config.macros.btnmem.output = createTiddlyElement(place, "div", this.outputID);\n}\n\nconfig.macros.btnmem.extendSelection = function(str) {\n this.selection.push(str);\n var output = "";\n var e = document.getElementById(this.outputID);\n if(e) {\n e.innerHTML = "";\n for(var i = 0; i < this.selection.length; i++) {\n output += this.itemPrefix + this.selection[i] + this.itemSuffix;\n }\n wikify(output.trim(), e);\n }\n}\n\nconfig.macros.btnmem.resetResults = function() {\n this.selection = [];\n var e = document.getElementById(this.outputID);\n if(e) e.innerHTML = "";\n}\n\nconfig.macros.btnmem.submitResults = function() {\n var output = config.macros.btnmem.selection;\n this.resetResults();\n var e = document.getElementById(this.outputID);\n if(e) wikify("submitting selection:\sn" + output.join(), e);\n}\n//}}}
<<tiddler TemplateColorPaletteView with:ColorPalette>>
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','Background')}} Background>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','Foreground')}} Foreground>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','PrimaryPale')}} PrimaryPale>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','PrimaryLight')}} PrimaryLight>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','PrimaryMid')}} PrimaryMid>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','PrimaryDark')}} PrimaryDark>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','SecondaryPale')}} SecondaryPale>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','SecondaryLight')}} SecondaryLight>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','SecondaryMid')}} SecondaryMid>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','SecondaryDark')}} SecondaryDark>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','TertiaryPale')}} TertiaryPale>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','TertiaryLight')}} TertiaryLight>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','TertiaryMid')}} TertiaryMid>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','TertiaryDark')}} TertiaryDark>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('ColorPalette','Error')}} Error>>
/***\n|''Name''|CommentsFormatter|\n|''Description''|formatter adding comments syntax|\n|''Author:''|FND|\n|''Version''|0.1.2|\n|''Status''|@@experimental@@|\n|''Source''|http://devpad.tiddlyspot.com/#CommentsFormatter|\n|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/|\n|''License''|[[BSD|http://www.opensource.org/licenses/bsd-license.php]]|\n!Usage\n!!Examples\n{{{\nlorem /# foo\nipsum /# bar\n}}}\n<<<\nlorem /# foo\nipsum /# bar\n<<<\n!Revision History\n!!v0.1 (2009-05-06)\n* initial release\n!Code\n***/\n//{{{\n(function(formatters) {\n\nformatters.push({\n name: "comment",\n match: "\s/#.*?(\sn|$)",\n handler: function(w) {\n createTiddlyElement(w.output, "span", null, "comment", w.matchText);\n createTiddlyElement(w.output, "br");\n }\n});\n\n})(config.formatters);\n//}}}
/***\n|''Name''|ComputedStyleMacro|\n|''Author''|FND|\n|''Version''|0.1|\n|''Status''|@@experimental@@|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#EvalMacro]]|\n|''CodeRepository''|http://fnd.lewcid.org/svn/TiddlyWiki/|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Description''|retrieves parent container's computed CSS properties|\n!Usage\n{{{\n<<calcStyle "CSS property">>\n}}}\n!!Examples\n<<calcStyle "height">>\n<<calcStyle "font-size">>\n!Revision History\n!!v0.1 (2008-03-31)\n* initial release\n!Code\n***/\n//{{{\nconfig.macros.calcStyle = {};\nconfig.macros.calcStyle.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n wikify("; " + params[0] + "\sn" + ": " + getStyle(place, params[0]), place);\n};\n\n// retrieve computed CSS property\n// by Inge Jørgensen (http://www.elektronaut.no/articles/2006/06/07/computed-styles)\nfunction getStyle(element, cssRule) {\n if(document.defaultView && document.defaultView.getComputedStyle) {\n var value = document.defaultView.getComputedStyle(element, "").getPropertyValue(\n cssRule.replace(/[A-Z]/g, function(match, char) { \n return "-" + char.toLowerCase(); \n })\n );\n }\n else if(element.currentStyle)\n var value = element.currentStyle[cssRule];\n else\n var value = false;\n return value;\n}\n//}}}
/***\n|''Name''|ConditionalTableFormattingMacro|\n|''Description''|apply formatting based on table contents|\n|''Author''|FND|\n|''Version''|0.2|\n|''Status''|@@experimental@@|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#EvalMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n!Usage\n{{{\n<<conditionalTableFormatting [cell|row] matchValue className>>\n}}}\n!!Parameters\n|!Index|!Description|!Optional|!Default Value|\n|1|case #1: value to search for|no|N/A|\n|2|case #1: class to apply to matching elements|no|N/A|\n|3|case #1: apply class to individual cells or the entire row|yes|cell|\n|4|case #2: value to search for|yes|N/A|\n|5|case #2: class to apply to matching elements|yes|N/A|\n|6|case #2: apply class to individual cells or the entire row|yes|cell|\n|7|...|yes|N/A|\n|8|...|yes|N/A|\n|9|...|yes|cell|\n|10|case #//n//: value to search for|yes|N/A|\n|11|case #//n//: class to apply to matching elements|yes|N/A|\n|12|case #//n//: apply class to individual cells or the entire row|yes|cell|\n!!Examples\n<<<\n|foo|bar|baz|\n<<conditionalTableFormatting "" "bar" "header">>\n<<<\n<<<\n|1|2|3|\n|lorem|ipsum|dolor|\n|foo|bar|baz|\n<<conditionalTableFormatting "row" "lorem" "header" "cell" "2" "wizard">>\n<<<\n!Notes\nThe first table within the respective container (usually a tiddler) is used.\nIn order to target a different table, a CSS class wrapper can be used:\n{{{\n {{dummyClass{\n |foo|bar|baz|\n }}}\n}}}\n!Revision History\n!!v0.1 (2008-05-30)\n* initial release\n!!v0.2 (2008-06-01)\n* significant changes to accommodate multiple cases per macro call\n!To Do\n* documentation\n* option for combining matching conditions (boolean operators?)\n* add option to target respective column\n* add option for RegEx matching\n!Code\n***/\n//{{{\nconfig.macros.conditionalTableFormatting = {};\n\nconfig.macros.conditionalTableFormatting.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n while(params.length) {\n // process parameters\n var target = (params.shift() === "row") ? "row" : "cell";\n var match = params.shift();\n var className = params.shift();\n // retrieve table cells\n var table = place.getElementsByTagName("table")[0];\n var cells = table.getElementsByTagName("td");\n for(var i = 0; i < cells.length; i++) {\n var text = cells[i].innerText || cells[i].textContent;\n // apply conditional formatting\n if(text === match) {\n addClass((target === "row") ? cells[i].parentNode : cells[i], className);\n }\n }\n }\n};\n//}}}
//{{{\n//--\n//-- Popup menu (improvements to be included in the core)\n//--\n\nvar Popup = {\n stack: [] // Array of objects with members root: and popup:\n };\n\nPopup.create = function(root,elem,theClass)\n{\n var stackPosition = this.findStackPosition(root,"popup");\n Popup.remove(stackPosition+1);\n var popup = createTiddlyElement(document.body,elem ? elem : "ol","popup",theClass ? theClass : "popup");\n popup.stackPosition = stackPosition;\n Popup.stack.push({root: root, popup: popup});\n return popup;\n};\n\nPopup.onDocumentClick = function(e)\n{\n if (!e) var e = window.event;\n var target = resolveTarget(e);\n if(e.eventPhase == undefined)\n Popup.remove();\n else if(e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET)\n Popup.remove();\n return true;\n};\n\nPopup.show = function(offset,unused1,unused2)\n{\n var curr = Popup.stack[Popup.stack.length-1];\n this.place(curr.root,curr.popup,offset);\n addClass(curr.root,"highlight");\n if(config.options.chkAnimate && anim && typeof Scroller == "function")\n anim.startAnimating(new Scroller(curr.popup));\n else\n window.scrollTo(0,ensureVisible(curr.popup));\n};\n\nPopup.place = function(root,popup,offset)\n{\n if(!offset) var offset = {x:0, y:0};\n if (popup.stackPosition>=0){\n offset.x = offset.x + 15;\n }\n var rootLeft = findPosX(root);\n var rootTop = findPosY(root);\n var rootHeight = root.offsetHeight;\n var popupLeft = rootLeft + offset.x;\n var popupTop = rootTop + rootHeight + offset.y;\n var winWidth = findWindowWidth();\n if(popup.offsetWidth > winWidth*0.75)\n popup.style.width = winWidth*0.75 + "px";\n var popupWidth = popup.offsetWidth;\n if(popupLeft + popupWidth > winWidth)\n popupLeft = winWidth - popupWidth;\n popup.style.left = popupLeft + "px";\n popup.style.top = popupTop + "px";\n popup.style.display = "block";\n}\n\nPopup.findStackPosition = function(item,node)\n{\n var pointer = -1;\n for (var i=this.stack.length-1; i> -1; i--){\n if(isDescendant(item,this.stack[i][node])){\n pointer = i; \n }\n }\n return pointer;\n};\n\nPopup.remove = function(pos)\n{\n if (!pos) var pos = 0;\n if(Popup.stack.length > pos) {\n Popup.removeFrom(pos);\n }\n};\n\nPopup.removeFrom = function(from)\n{\n for(var t=Popup.stack.length-1; t>=from; t--) {\n var p = Popup.stack[t];\n removeClass(p.root,"highlight");\n removeNode(p.popup);\n }\n Popup.stack = Popup.stack.slice(0,from);\n};\n//}}}
/***\n|''Name''|CrossIndexingMacro|\n|''Version''|0.7|\n|''Status''|@@beta@@|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#CrossIndexingMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|[//TBD//]|\n!Notes\nCreated [[for DaveG|http://groups.google.com/group/TiddlyWiki/browse_thread/thread/afa54bd105e791fa]]'s [[My Notes TiddlyWiki|http://www.giffmex.org/emptynotestw.html]].\n!Usage\n{{{\n<<crossIndex [tag] [scope]>>\n}}}\n!Revision History\n!!v0.5 (2008-02-08)\n* initial release\n!!v0.6 (2008-02-09)\n* renamed to CrossIndexingMacro (from TiddlerHierarchyMacro)\n* added listing of uncategorized items\n* linkified headings\n!!v0.7 (2008-02-10)\n* added optional scope parameter\n* fixed "uncategorized" listings\n* minor code enhancements\n!To Do\n* rename\n* documentation\n* code sanitizing\n!Code\n***/\n//{{{\nconfig.macros.crossIndex = {};\n\nconfig.macros.crossIndex.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var scope = params[1] || tiddler.title;\n var index = this.getIndex(scope, params[0]);\n var output = "";\n var i;\n for(topic in index) {\n if(index[topic].length > 0) {\n output += "![[" + topic + "]]\sn";\n for(i = 0; i < index[topic].length; i++) {\n output += "* [[" + index[topic][i] + "]]\sn";\n }\n }\n }\n wikify(output, place);\n}\n\nconfig.macros.crossIndex.getIndex = function(scope, category) {\n // retrieve topics\n var topics = store.getTaggedTiddlers(category).map(function(t) { return t.title });\n // generate index\n var index = {\n uncategorized: []\n };\n for(i = 0; i < topics.length; i++) {\n index[topics[i]] = [];\n store.forEachTiddler(function(title, tiddler) {\n if(tiddler.tags.containsAll([scope, topics[i]]))\n index[topics[i]].push(title);\n else if(tiddler.tags.contains(scope) && !tiddler.tags.containsAny(topics))\n index.uncategorized.pushUnique(title);\n });\n }\n return index;\n}\n//}}}
/***\n|Name|DcTableOfContentsPlugin|\n|Author|[[Doug Compton|http://www.zagware.com/tw/plugins.html#DcTableOfContentsPlugin]]|\n|Contributors|[[Lewcid|http://lewcid.org]], [[FND|http://devpad.tiddlyspot.com]], [[ELS|http://www.tiddlytools.com]]|\n|Source|[[FND's DevPad|http://devpad.tiddlyspot.com#DcTableOfContentsPlugin]]|\n|Version|0.4.1|\n|~CoreVersion|2.2|\n<<showtoc>>\n!Description\nThis macro will insert a table of contents reflecting the headings that are used in a tiddler and will be automatically updated when you make changes. Each item in the table of contents can be clicked on to jump to that heading. It can be used either inside of select tiddlers or inside a system wide template.\n\nA parameter can be used to show the table of contents of a seperate tiddler, &lt;<showtoc tiddlerTitle>&gt;\n\nIt will also place a link beside each header which will jump the screen to the top of the current tiddler. This will only be displayed if the current tiddler is using the &lt;<showtoc>&gt; macro.\n\nThe appearance of the table of contents and the link to jump to the top can be modified using CSS. An example of this is given below.\n\n!Usage\n!!Only in select tiddlers\nThe table of contents above is an example of how to use this macro in a tiddler. Just insert &lt;<showtoc>&gt; in a tiddler on a line by itself.\n\nIt can also display the table of contents of another tiddler by using the macro with a parameter, &lt;<showtoc tiddlerTitle>&gt;\n!!On every tiddler\nIt can also be used in a template to have it show on every tiddler. An example ViewTemplate is shown below.\n\n//{{{\n<div class='toolbar' macro='toolbar -closeTiddler closeOthers +editTiddler permalink references jump'></div>\n<div class='title' macro='view title'></div>\n<div class='subtitle'>Created <span macro='view created date DD-MM-YY'></span>, updated <span macro='view modified date DD-MM-YY'></span></div>\n<div class='tagging' macro='tagging'></div>\n<div class='tagged' macro='tags'></div>\n<div class="toc" macro='showtoc'></div>\n<div class='viewer' macro='view text wikified'></div>\n<div class='tagClear'></div>\n//}}}\n\n!Examples\nIf you had a tiddler with the following headings:\n{{{\n!Heading1a\n!!Heading2a\n!!Heading2b\n!!!Heading3\n!Heading1b\n}}}\nthis table of contents would be automatically generated:\n* Heading1a\n** Heading2a\n** Heading2b\n*** Heading3\n* Heading1b\n!Changing how it looks\nTo modifiy the appearance, you can use CSS similiar to the below.\n//{{{\n.dcTOC ul {\n color: red;\n list-style-type: lower-roman;\n}\n.dcTOC a {\n color: green;\n border: none;\n}\n\n.dcTOC a:hover {\n background: white;\n border: solid 1px;\n}\n.dcTOCTop {\n font-size: 2em;\n color: green;\n}\n//}}}\n\n!Revision History\n!!v0.1.0 (2006-04-07)\n* initial release\n!!v0.2.0 (2006-04-10)\n* added the [top] link on headings to jump to the top of the current tiddler\n* appearance can now be customized using CSS\n* all event handlers now return false\n!!v0.3.0 (2006-04-12)\n* added the ability to show the table of contents of a seperate tiddler\n* fixed an error when a heading had a ~WikiLink in it\n!!v0.3.5 (2007-10-16)\n* updated formatter object for compatibility with TiddlyWiki v2.2 (by Lewcid)\n!!v0.4.0 (2007-11-14)\n* added toggle button for collapsing/expanding table of contents element\n* refactored documentation\n!To Do\n* code sanitizing/rewrite\n* documentation refactoring\n* use shadow tiddler for styles\n!Code\n***/\n//{{{\n\nversion.extensions.DcTableOfContentsPlugin= {\n major: 0, minor: 4, revision: 0,\n type: "macro",\n source: "http://devpad.tiddlyspot.com#DcTableOfContentsPlugin"\n};\n\n// Replace heading formatter with our own\nfor (var n=0; n<config.formatters.length; n++) {\n var format = config.formatters[n];\n if (format.name == 'heading') {\n format.handler = function(w) {\n // following two lines is the default handler\n var e = createTiddlyElement(w.output, "h" + w.matchLength);\n w.subWikifyTerm(e, this.termRegExp); //updated for TW 2.2+\n\n // Only show [top] if current tiddler is using showtoc\n if (w.tiddler && w.tiddler.isTOCInTiddler == 1) {\n // Create a container for the default CSS values\n var c = createTiddlyElement(e, "div");\n c.setAttribute("style", "font-size: 0.5em; color: blue;");\n // Create the link to jump to the top\n createTiddlyButton(c, " [top]", "Go to top of tiddler", window.scrollToTop, "dcTOCTop", null, null);\n }\n }\n break;\n }\n}\n\nconfig.macros.showtoc = {\n handler: function(place, macroName, params, wikifier, paramString, tiddler) {\n var text = "";\n var title = "";\n var myTiddler = null;\n\n // Did they pass in a tiddler?\n if (params.length) {\n title = params[0];\n myTiddler = store.getTiddler(title);\n } else {\n myTiddler = tiddler;\n }\n\n if (myTiddler == null) {\n wikify("ERROR: Could not find " + title, place);\n return;\n }\n\n var lines = myTiddler .text.split("\sn");\n myTiddler.isTOCInTiddler = 1;\n\n // Create a parent container so the TOC can be customized using CSS\n var r = createTiddlyElement(place, "div", null, "dcTOC");\n // create toggle button\n createTiddlyButton(r, "toggle", "show/collapse table of contents",\n function() { config.macros.showtoc.toggleElement(this.nextSibling); },\n "toggleButton")\n // Create a container so the TOC can be customized using CSS\n var c = createTiddlyElement(r, "div");\n\n if (lines != null) {\n for (var x=0; x<lines.length; x++) {\n var line = lines[x];\n if (line.substr(0,1) == "!") {\n // Find first non ! char\n for (var i=0; i<line.length; i++) {\n if (line.substr(i, 1) != "!") {\n break;\n }\n }\n var desc = line.substring(i);\n // Remove WikiLinks\n desc = desc.replace(/\s[\s[/g, "");\n desc = desc.replace(/\s]\s]/g, "");\n\n text += line.substr(0, i).replace(/[!]/g, '*');\n text += '<html><a href="javascript:;" onClick="window.scrollToHeading(\s'' + title + '\s', \s'' + desc+ '\s', event)">' + desc+ '</a></html>\sn';\n }\n }\n }\n wikify(text, c);\n }\n}\n\nconfig.macros.showtoc.toggleElement = function(e) {\n if(e) {\n if(e.style.display != "none") {\n e.style.display = "none";\n } else {\n e.style.display = "";\n }\n }\n};\n\nwindow.scrollToTop = function(evt) {\n if (! evt)\n var evt = window.event;\n\n var target = resolveTarget(evt);\n var tiddler = story.findContainingTiddler(target);\n\n if (! tiddler)\n return false;\n\n window.scrollTo(0, ensureVisible(tiddler));\n\n return false;\n};\n\nwindow.scrollToHeading = function(title, anchorName, evt) {\n var tiddler = null;\n\n if (! evt)\n var evt = window.event;\n\n if (title) {\n story.displayTiddler(store.getTiddler(title), title, null, false);\n tiddler = document.getElementById(story.idPrefix + title);\n } else {\n var target = resolveTarget(evt);\n tiddler = story.findContainingTiddler(target);\n }\n\n if (tiddler == null)\n return false;\n \n var children1 = tiddler.getElementsByTagName("h1");\n var children2 = tiddler.getElementsByTagName("h2");\n var children3 = tiddler.getElementsByTagName("h3");\n var children4 = tiddler.getElementsByTagName("h4");\n var children5 = tiddler.getElementsByTagName("h5");\n\n var children = new Array();\n children = children.concat(children1, children2, children3, children4, children5);\n\n for (var i = 0; i < children.length; i++) {\n for (var j = 0; j < children[i].length; j++) {\n var heading = children[i][j].innerHTML;\n\n // Remove all HTML tags\n while (heading.indexOf("<") >= 0) {\n heading = heading.substring(0, heading.indexOf("<")) + heading.substring(heading.indexOf(">") + 1);\n }\n\n // Cut off the code added in showtoc for TOP\n heading = heading.substr(0, heading.length-6);\n\n if (heading == anchorName) {\n var y = findPosY(children[i][j]);\n window.scrollTo(0,y);\n return false;\n }\n }\n }\n return false\n};\n//}}}
/***\n|Name|DebuggingPlugin|\n|Source|[[FND's DevPad|http://devpad.tiddlyspot.com/#DebuggingPlugin]]|\n|Version|0.5|\n|Author|FND|\n|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires|N/A|\n|Overrides|N/A|\n|Description|provides a simple framework for debugging|\n!Usage\n* {{{showDebugBuffer(string)}}}\n* {{{print_r(array, indentationPrefix)}}}\n!Changelog\n!!v0.5 (2007-05-29)\n* initial release\n!To Do\n* use tiddler instead of a "raw" element\n!Code\n***/\n//{{{\n/* Styles (can be customized in the StyleSheetDEBUG shadow tiddler) */\n\nconfig.shadowTiddlers.StyleSheetDEBUG = "/*{{{*/\sn"\n + "#DebugBuffer {\sn\stmargin: 10em 1em 1em;\sn\stpadding: 4px;\sn\stborder: 1px solid #AAA;\sn\stfont-size: 1.2em;\sn\stbackground-color: #F8F8F8;\sn}\sn"\n + "/*}}}*/";\nstore.addNotification("StyleSheetDEBUG", refreshStyles);\n\n/* Functions */\n\n// create pane for debugging outputs\nfunction createDebugBuffer(text) {\n // initialize DEBUG buffer\n text = "******************\sn"\n + "** DEBUG BUFFER **\sn"\n + "******************\sn\sn"\n + text;\n // create output element\n createTiddlyElement(document.body, "pre", "DebugBuffer", null, text);\n}\n\n// print_r() for JavaScript (http://www.phpbuilder.com/board/showthread.php?t=10294264)\nfunction print_r(input, _indent) {\n if(typeof(_indent) == 'string') {\n var indent = _indent + ' ';\n var paren_indent = _indent + ' ';\n } else {\n var indent = ' ';\n var paren_indent = '';\n }\n switch(typeof(input)) {\n case 'boolean':\n var output = (input ? 'true' : 'false') + "\sn";\n break;\n case 'object':\n if ( input===null ) {\n var output = "null\sn";\n break;\n }\n var output = ((input.reverse) ? 'Array' : 'Object') + " (\sn";\n for(var i in input) {\n output += indent + "[" + i + "] => " + print_r(input[i], indent);\n }\n output += paren_indent + ")\sn";\n break;\n case 'number':\n case 'string':\n default:\n var output = "" + input + "\sn";\n }\n return output;\n}\n//}}}
/*{{{*/\n// TiddlyWiki\nconfig.options.txtUserName = "FND";\nconfig.options.chkAutoSave = false;\nconfig.options.chkSaveBackups = false;\nconfig.options.txtBackupFolder = "Backup";\n/*}}}*/
[[templatesTest]]\n[[TagNavigatorTest]]\n[[SimpleCommentsTest]]\n[[TiddlerToCTest]]
/***\n|''Name:''|DoBackupMacro|\n|''Version:''|2.0 (9-Apr-2006)|\n|''Author:''|[[Jack]]|\n|''Type:''|Macro|\n!Description\nCreates a button which allows you to backup your TiddlyWiki on demand.\n!Usage\nAdd the following command to your SideBarOptions tiddler:\n{{{<<doBackup>>}}}\n!Revision History\n* Original by [[Jack]] 9-Apr-2006\n!To Do\n* List non-explicit links (e.g. from tagging macro)\n\n!Code\n***/\n//{{{\nversion.extensions.doBackup= {major: 2, minor: 0, revision: 0, date: new Date("Apr 9, 2006")};\nconfig.macros.doBackup={label: "backup", prompt: "Backup this TiddlyWiki"}\nconfig.macros.doBackup.handler = function(place)\n{\n if(!readOnly)\n createTiddlyButton(place,this.label,this.prompt,function ()\n{doBackup(); return false;},null,null,this.accessKey);\n}\n\ndoBackup = function() {\n var optSaveBackups = config.options.chkSaveBackups\n config.options.chkSaveBackups = true\n saveChanges()\n config.options.chkSaveBackups = optSaveBackups\n}\n\n//}}}
/***\n|Name|EasyHighlightingPlugin|\n|Source|[[FND's DevPad|http://devpad.tiddlyspot.com/#EasyHighlightingPlugin]]|\n|Version|0.1|\n|Author|FND|\n|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires|N/A|\n|Overrides|N/A|\n|Description|allow for simple highlighting by selecting text|\n!Usage\n[tbd]\n!Changelog\n!!v0.1 (2007-05-27)\n* alpha version\n!Issues / To Do\n[tbd; cf [[[tw] discussion|http://groups.google.com/group/TiddlyWiki/t/349af49c41f8bf44]]]\n''N.B.:'' development is currently ''ON HOLD'':\n<<<\nSince the text is selected from the formatted (wikified) output, I'll run into trouble as soon as there's any kind of wiki markup involved (e.g. trying to highlight "lorem ''ipsum'' dolor" would not be recognized -- or it might even strip the bold formatting).\n<<<\n!Code\n***/\n//{{{\n/*\n** Styles (can be customized in the StyleSheetEasyHighlighting shadow tiddler)\n*/\n\nconfig.shadowTiddlers.StyleSheetEasyHighlighting = "/*{{{*/\sn"\n + ".highlightDefault {\sn\stbackground-color: #FF0;\sn\stcursor: pointer;\sn}\sn"\n + "/*}}}*/";\nstore.addNotification("StyleSheetEasyHighlighting", refreshStyles);\n\n/*\n** Macro Code\n*/\n\nconfig.macros.EasyHighlighting = { label: "Highlight", prompt: "Toggle highlighting" };\nconfig.macros.EasyHighlighting.handler =\n function(place, macroName, params, wikifier, paramString, tiddler) {\n \n}\n\n/*\n** Command Buttons\n*/\n\n/* Macro Button */\nconfig.macros.EasyHighlighting = { label: "Highlight", prompt: "Toggle highlighting", accessKey: "h" }; // DEBUG: check accessKey usage\nconfig.macros.EasyHighlighting.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n createTiddlyButton(place, this.label, this.prompt, function() { // DEBUG: how to pass current tiddler to function?\n // highlight selected text\n highlightPassage(place, tiddler, "highlightDefault"); // DEBUG: tiddler is undefined (see above)\n return false; // DEBUG: ?\n }, null, null, this.accessKey\n );\n}\n\n/* Toolbar Button */\nconfig.commands.EasyHighlighting = { label: "Highlight", prompt: "Toggle highlighting" } // DEBUG: accessKey!?\nconfig.commands.EasyHighlighting.handler = function() {\n // highlight selected text\n highlightPassage(place, tiddler, "highlightDefault");\n return false; // DEBUG: ?\n}\n\n/*\n** Main Code\n*/\n\nhighlightPassage = function(place, tiddler, className) {\n // get selection\n var selection = getSelText();\n if(selection == "") {\n alert("Error: No text selected.");\n return\n }\n // retrieve tiddler -- DEBUG: obsolete?! only necessary for macro button, because tiddler parameter is not working there (see Command Buttons section)\n var here = story.findContainingTiddler(place);\n if(!here) {\n alert("Error: No tiddler specified.");\n return;\n }\n var title = here.getAttribute("tiddler");\n var tiddler = store.getTiddler(title);\n // determine tiddler contents\n var tiddlerContents = tiddler.text;\n var tiddlerParts = tiddlerContents.split(selection);\n var preSelection = tiddlerParts[0]; // DEBUG: to do\n var postSelection = tiddlerParts[1]; // DEBUG: to do\n // highlight selected passage\n alert(tiddlerParts.length + "\sn\snpreSelection:\sn" + preSelection + "\sn\snpostSelection:\sn" + postSelection); // DEBUG\n tiddlerContents = preSelection + "{{" + className + "{" + selection + "}}}" + postSelection;\n alert("tiddlerContents:\sn" + tiddlerContents); // DEBUG\n // store altered tiddler contents\n //wikify(tiddlerContents, place); // DEBUG'd\n // ??\n return false;\n}\n\n/*\n** Support Functions\n*/\n\n// getSelText() by Jeff Anderson (http://www.codetoad.com/javascript_get_selected_text.asp)\nfunction getSelText() {\n var txt = "";\n if (window.getSelection) {\n txt = window.getSelection();\n } else if (document.getSelection) {\n txt = document.getSelection();\n } else if (document.selection) {\n txt = document.selection.createRange().text;\n } else {\n return;\n }\n return txt;\n}\n//}}}
This is a test for the EasyHighlightingPlugin.\n<<EasyHighlighting>>\n<<<\nLorem ipsum dolor ''sit'' amet, consectetur adipisicing elit, sed do //eiusmod// tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea @@commodo@@ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse --cillum-- dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia __deserunt__ mollit anim id est laborum.\n<<<
/***\n<<EasyLayout>>\n***/\n//{{{\n/*\n** Macro Initialization\n*/\n\nconfig.macros.EasyLayout = {};\nconfig.macros.EasyLayout.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n this.loadSettings();\n this.generateUI(place);\n};\n\n/*\n** User Interface\n*/\n\nconfig.macros.EasyLayout.generateUI = function(parent) {\n // create root form\n var frm = createTiddlyElement(parent, "form", null, "easyLayout"); // DEBUG: requires action parameter\n frm.style.border = "1px solid #AAA"; // DEBUG: use shadow tiddler for styles\n frm.style.marginBottom = "1em"; // DEBUG: use shadow tiddler for styles\n frm.style.padding = "5px"; // DEBUG: use shadow tiddler for styles\n frm.style.overflow = "hidden"; // DEBUG: use shadow tiddler for styles\n frm.style.backgroundColor = "#EEE"; // DEBUG: use shadow tiddler for styles\n\n // create custom UI elements\n this.createUiElements(frm);\n\n // create control buttons\n var btns = createTiddlyElement(frm, "div");\n btns.style.textAlign = "right"; // DEBUG: use shadow tiddler for styles\n // preview\n var btn = createTiddlyElement(btns, "input");\n btn.setAttribute("type", "button");\n btn.setAttribute("value", "Apply");\n btn.onclick = function() {\n config.macros.EasyLayout.applyChanges(false);\n return false;\n }\n // save\n btn = createTiddlyElement(btns, "input");\n btn.setAttribute("type", "button");\n btn.setAttribute("value", "Save");\n btn.onclick = function() {\n config.macros.EasyLayout.applyChanges(true);\n return false;\n }\n};\n\n// DEBUG: read from JSON structure for easy modification\nconfig.macros.EasyLayout.createUiElements = function(frm) {\n // initialize variables\n var fs = null; // fieldset\n var sc = null; // section\n\n /*\n ** Header\n */\n fs = this.createFieldset(frm, "Header");\n // height\n sc = this.createSection(fs);\n this.createInputField(sc, "input", "height");\n this.createOptions(sc, "headerHeight");\n // width\n sc = this.createSection(fs);\n this.createInputField(sc, "input", "width");\n this.createOptions(sc, "headerWidth");\n\n /*\n ** Sidebar\n */\n fs = this.createFieldset(frm, "Sidebar");\n // width\n sc = this.createSection(fs);\n this.createInputField(sc, "input", "width");\n this.createOptions(sc, "sidebarWidth");\n // offset\n sc = this.createSection(fs);\n this.createInputField(sc, "input", "offset");\n this.createOptions(sc, "sidebarOffset");\n};\n\n/*\n** Layout Modification\n*/\n\nconfig.macros.EasyLayout.applyChanges = function(permanent) {\n alert("not implemented"); // DEBUG: to do\n if(permanent)\n this.saveSettings();\n}\n\n/*\n** Settings\n*/\n\nconfig.macros.EasyLayout.saveSettings = function() {\n alert("permanent settings not implemented"); // DEBUG: to do -- options: slices in a dedicated tiddler, extended fields, JSON(?)\n}\n\nconfig.macros.EasyLayout.loadSettings = function() {\n alert("permanent settings not implemented"); // DEBUG: to do\n}\n\n/*\n** DOM Utilities\n*/\n\nconfig.macros.EasyLayout.createFieldset = function(parent, label) {\n var e = createTiddlyElement(parent, "fieldset");\n e.style.marginBottom = "5px"; // DEBUG: use shadow tiddler for styles\n createTiddlyElement(e, "legend", null, null, label);\n return e;\n};\n\nconfig.macros.EasyLayout.createSection = function(parent) {\n var e = createTiddlyElement(parent, "DIV");\n e.style.marginBottom = "5px"; // DEBUG: use shadow tiddler for styles\n return e;\n};\n\nconfig.macros.EasyLayout.createInputField = function(parent, ID, description) {\n var e = createTiddlyElement(parent, "div", null, null, description + ":");\n e.style.fontWeight = "bold"; // DEBUG: use shadow tiddler for styles\n e.style.marginRight = "1em"; // DEBUG: use shadow tiddler for styles\n e = createTiddlyElement(parent, "input", ID);\n e.setAttribute("type", "text"); // DEBUG: might not work in IE; need to set attribute before appending node to document!?\n return e;\n};\n\nconfig.macros.EasyLayout.createOptions = function(parent, IdPrefix) { // DEBUG: dynamic arguments - e.g. createOptions("px", "em", "%") \n parent.innerHTML = parent.innerHTML // innerHTML required due to IE bug\n + "<input id='" + IdPrefix + "1' name='" + IdPrefix + "' type='radio'>"\n + "<label for='" + IdPrefix + "1'>px</label>"\n + "<input id='" + IdPrefix + "2' name='" + IdPrefix + "' type='radio'>"\n + "<label for='" + IdPrefix + "2'>em</label>"\n + "<input id='" + IdPrefix + "3' name='" + IdPrefix + "' type='radio'>"\n + "<label for='" + IdPrefix + "3'>%</label>"\n};\n//}}}
free-floating edit window (non-disruptive edit mode)\nedit mode as a (temporary) portlet instead of replacing the wikified tiddler view\ncf. [[mock-up image|http://www.tiddlywiki.org/wiki/Image:EditPortlet.png]]
<!--{{{-->\n<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>\n<div class='title' macro='view title'></div>\n<div class='editor' macro='edit title'></div>\n<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>\n<div class='editor' macro='edit text'></div>\n<!--}}}-->
/***\n|''Name''|EvalMacro|\n|''Version''|0.96|\n|''Status''|stable|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#EvalMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|Allows executing JavaScript code to return computed values.|\n!Usage\n{{{\n<<eval [code] [mode]>>\n}}}\n* {{{<<eval {{code}}>>}}}\n** if no mode is specified, the first parameter's contents will be wikified\n** through the use evaluated parameters, calculations can be performed within this parameter\n* {{{<<eval [[code]] "scriptMode">>}}}\n** if "scriptMode" is specified, the contents of the first parameter will be evaluated in place, proving access to local variables like the tiddler object\n** no output is generated in this mode by default, though the {{{wikify()}}} function can be used for that\n!!Examples\n<<eval {{\n var dateFormat = "YYYY-0MM-0DD 0hh:0mm";\n var now = new Date;\n "time: " + now.formatString(dateFormat);\n}}>>\n<<eval\n [[\n var dateFormat = "YYYY-0MM-0DD";\n var title = tiddler.title;\n var author = tiddler.modifier;\n var date = tiddler.modified.formatString(dateFormat);\n wikify(title + ": " + author + ", " + date, place);\n ]]\n "scriptMode"\n>>\n!Revision History\n!!v0.9 (2007-10-14)\n* initial release\n!!v0.95 (2007-12-23)\n* introduced script mode\n!!v0.96 (2008-04-18)\n* bugfix regarding type conversion\n!Code\n***/\n//{{{\nconfig.macros.eval = {};\nconfig.macros.eval.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n if(params[1] == "scriptMode")\n eval(params[0]);\n else\n wikify(params[0].toString(), place);\n}\n//}}}
/***\n|Name|ForEachTiddlerTest|\n|Source|[[FND's DevPad|http://devpad.tiddlyspot.com/#FETTest]]|\n|Version|0.1|\n|Author|FND|\n|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires|N/A|\n|Overrides|N/A|\n|Description|just for testing/debugging purposes|\n!Usage\nAdd {{{<<FET>>}}} to the desired tiddler(s).\n<<FET>>\n!Changelog\n!!v0.1 (2007-05-21)\n* initial release\n!Issues / To Do\n* ...\n!Code\n***/\n//{{{\n/*\n** Command Button\n*/\n\n/* Macro Button */\n// adapted from Jack's DoBackupMacro (http://groups.google.com/group/TiddlyWiki/browse_thread/thread/5f1123d08bdadeac/86245d5e4bbe846c)\nconfig.macros.FET = { label: "FETTest", prompt: "ForEachTiddler Test" };\nconfig.macros.FET.handler = function(place) {\n createTiddlyButton(place, this.label, this.prompt, function() {\n var tmp = FETTest().tiddlers;\n tmp = FETTest(tmp, "plugin"); // DEBUG: test for second run\n alert(FETTest(tmp, "systemConfig")); // DEBUG: test for third run\n return false; // DEBUG: ?\n }, null, null, this.accessKey\n ); // DEBUG - to do: look up createTiddlyButton()'s parameters\n}\n\n/*\n** Main Code\n*/\n\nFETTest = function(object, filter) {\n // initialize\n alert(object + "\sn\sn" + filter); // DEBUG\n var tiddlers = []; // title and tags[] for each tiddler\n var tags = []; // global tags list\n var results = {}; // object for return values\n if(object == null) { // use store if no object has been specified\n object = store;\n }\n // retrieve matching tiddlers\n object.forEachTiddler(\n function(title, tiddler) {\n if(filter == null || inArray(filter, tiddler.tags)) { // check whether tiddler is assigned the filter tag\n var t = {}; // DEBUG: viable container for using forEachTiddler on?\n t.title = title;\n t.tags = tiddler.tags;\n tiddlers.push(t);\n // add unique tags to global list\n for(var i = 0; i < tiddler.tags.length; i++) {\n tags.pushUnique(tiddler.tags[i]);\n }\n }\n }\n );\n // return results\n results.tiddlers = tiddlers;\n results.tags = tags;\n return results;\n}\n\n/*\n** Support Functions\n*/\n\nfunction inArray(needle, haystack) {\n for(var i = 0; i < haystack.length; i++) {\n if(haystack[i] == needle) {\n return true;\n }\n }\n return false;\n}\n//}}}
/***\n|Name|InlineJavascriptPlugin|\n|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|\n|Version|1.6.0|\n|Author|Eric Shulman - ELS Design Studios|\n|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires||\n|Overrides||\n|Description|Insert Javascript executable code directly into your tiddler content.|\n\n''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. You may also include a {{{title="..."}}} parameter to specify the 'tooltip' text that will appear whenever the mouse is moved over the onClick link text\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''Display script source in tiddler output''\nBy including the keyword parameter "show", in the initial {{{<script>}}} marker, the plugin will include the script source code in the output that it displays in the tiddler.\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><script show>\n alert('InlineJavascriptPlugin: this is a demonstration message');\n</script>\ndynamic output:\n><script show>\n return (new Date()).toString();\n</script>\nwikified dynamic output:\n><script show>\n return "link to current user: [["+config.options.txtUserName+"]]";\n</script>\ndynamic output using 'place' to get size information for current tiddler:\n><script show>\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>\ncreating an 'onclick' button/link that runs a script:\n><script label="click here" title="clicking this link will show an 'alert' box" show>\n if (!window.story) window.story=window;\n alert("Hello World!\snlinktext='"+place.firstChild.data+"'\sntiddler='"+story.findContainingTiddler(place).id.substr(7)+"'");\n</script>\nloading a script from a source url:\n>http://www.TiddlyTools.com/demo.js contains:\n>>{{{function demo() { alert('this output is from demo(), defined in demo.js') } }}}\n>>{{{alert('InlineJavascriptPlugin: demo.js has been loaded'); }}}\n><script src="demo.js" show>\n return "loading demo.js..."\n</script>\n><script label="click to execute demo() function" show>\n demo()\n</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''2007.02.19 [1.6.0]'' added support for title="..." to specify mouseover tooltip when using an onclick (label="...") script\n''2006.10.16 [1.5.2]'' add newline before closing '}' in 'function out_' wrapper. Fixes error caused when last line of script is a comment.\n''2006.06.01 [1.5.1]'' when calling wikify() on script return value, pass hightlightRegExp and tiddler params so macros that rely on these values can render properly\n''2006.04.19 [1.5.0]'' added 'show' parameter to force display of javascript source code in tiddler output\n''2006.01.05 [1.4.0]'' added 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]'' when 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]'' for '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. Based on a suggestion by BradleyMeck\n''2005.11.08 [1.2.0]'' handle loading of javascript from an external URL via src="..." syntax\n''2005.11.08 [1.1.0]'' pass 'place' param into scripts to provide direct DOM access \n''2005.11.08 [1.0.0]'' initial 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: 6, revision: 0, date: new Date(2007,2,19)};\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")?(?: title=\s\s\s"((?:.|\s\sn)*?)\s\s\s")?( show)?\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[5]) { // there is script code\n if (lookaheadMatch[4]) // show inline script code in tiddler output\n wikify("{{{\sn"+lookaheadMatch[0]+"\sn}}}\sn",w.output);\n if (lookaheadMatch[2]) { // 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[5]+"\sn};_out(this);"\n link.setAttribute("title",lookaheadMatch[3]?lookaheadMatch[3]:"");\n link.setAttribute("href","javascript:;");\n link.style.cursor="pointer";\n }\n else { // run inline script code\n var code="function _out(place){"+lookaheadMatch[5]+"\sn};_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,w.highlightRegExp,w.tiddler);\n }\n }\n w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;\n }\n }\n} )\n//}}}
/***\n|''Name''|JashMacro|\n|''Version''|0.1|\n|''Status''|@@experimental@@|\n|''Author''|[[Billy Reisinger|http://www.billyreisinger.com]]|\n|''Contributor''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#JashMacro]]|\n|''License''|[[GNU General Public License|http://www.gnu.org/licenses/gpl.html]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|JavaScript shell console|\n!Notes\nThis macro is entirely based upon (and dependent on) [[Jash|http://www.billyreisinger.com/jash/]] by [[Billy Reisinger|http://www.billyreisinger.com]].\nIt dynamically loads the required code from the online resource.\n!Usage\n{{{\n<<Jash [label] [tooltip] [class] [access key]>>\n}}}\n<<Jash>>\n!Revision History\n!!v0.1 (2007-12-10)\n* initial release\n!Code\n***/\n//{{{\nconfig.macros.Jash = {\n label: "Jash",\n prompt: "open Jash",\n buttonClass: "",\n accessKey: ""\n};\n\nconfig.macros.Jash.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var label = params[0] || this.label;\n var prompt = params[1] || this.prompt;\n var buttonClass = params[2] || this.buttonClass;\n var accessKey = params[3] || this.accessKey;\n createTiddlyButton(place, label, prompt, config.macros.Jash.toggle, buttonClass, null, accessKey);\n}\n\nconfig.macros.Jash.toggle = function(place, macroName, params, wikifier, paramString, tiddler) {\n document.body.appendChild(document.createElement("script")).src = "http://www.billyreisinger.com/jash/source/latest/Jash.js";\n}\n//}}}
/***\n|''Name''|JashMacro|\n|''Version''|0.1|\n|''Status''|@@experimental@@|\n|''Author''|[[Billy Reisinger|http://www.billyreisinger.com]]|\n|''Contributor''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#JashMacro]]|\n|''License''|[[GNU General Public License|http://www.gnu.org/licenses/gpl.html]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|JavaScript shell console|\n!Notes\nThis macro is entirely based upon [[Jash|http://www.billyreisinger.com/jash/]] by [[Billy Reisinger|http://www.billyreisinger.com]].\n!Usage\n{{{\n<<Jash [label] [tooltip] [class] [access key]>>\n}}}\n<<Jash>>\n!Revision History\n!!v0.1 (2007-12-10)\n* initial release\n!Code\n***/\n//{{{\nconfig.macros.Jash = {\n label: "Jash",\n prompt: "open Jash",\n buttonClass: "",\n accessKey: ""\n};\n\nconfig.macros.Jash.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var label = params[0] || this.label;\n var prompt = params[1] || this.prompt;\n var buttonClass = params[2] || this.buttonClass;\n var accessKey = params[3] || this.accessKey;\n createTiddlyButton(place, label, prompt, config.macros.Jash.toggle, buttonClass, null, accessKey);\n config.macros.Jash.toggle(); // DEBUG: ugly hack to prevent Jash from being launched on startup\n}\n\nconfig.macros.Jash.toggle = function(place, macroName, params, wikifier, paramString, tiddler) {\n if("jash" in window) {\n window.jash.close();\n } else {\n window.jash = new Jash();\n window.jash.main();\n }\n}\n\n/*\n** Jash.css\n** http://www.billyreisinger.com/jash/source/latest/Jash.css\n*/\nconfig.shadowTiddlers.StyleSheetJash = "#JashParent {\sn"+\n " width: 581px;\sn"+\n " height: 450px;\sn"+\n " border: 1px solid gray;\sn"+\n " color: black;\sn"+\n " z-index: 10000;\sn"+\n " overflow: hidden;\sn"+\n " background: #ccc;\sn"+\n " opacity: 0.90;\sn"+\n " filter: alpha(opacity=90);\sn"+\n " position: absolute;\sn"+\n " left: 25%;\sn"+\n " color: black;\sn"+\n " font-family: monospace;\sn"+\n " margin: 0;\sn"+\n "}\sn"+\n "#JashParent div {\sn"+\n " margin: 0;\sn"+\n "}\sn"+\n "#JashParent a, #JashParent a:visited, #JashParent a:active, #JashParent a:hover {\sn"+\n " text-decoration: none;\sn"+\n " color: black;\sn"+\n "}\sn"+\n ".transparentMode {\sn"+\n " opacity: 0.20 !important;\sn"+\n " filter: alpha(opacity=20) !important;\sn"+\n "}\sn"+\n "#JashDragBar {\sn"+\n " BACKGROUND: gray;\sn"+\n " CURSOR: move;\sn"+\n " COLOR: white;\sn"+\n " font-family: monospace;\sn"+\n " font-weight: bold;\sn"+\n " text-indent: 4px;\sn"+\n " font-size: 14px;\sn"+\n " HEIGHT: 25px;\sn"+\n " TEXT-ALIGN: left;\sn"+\n " overflow: hidden;\sn"+\n " border: 1px outset white;\sn"+\n "}\sn"+\n ".JashXButton {\sn"+\n " border: 1px solid white;\sn"+\n " color: white !important;\sn"+\n " position: absolute;\sn"+\n " background: #bbb;\sn"+\n " width: 20px; \sn"+\n " text-align: center;\sn"+\n " display: block;\sn"+\n " right: 3px; _right: 1px;\sn"+\n " top: 4px; _top: 1px;\sn"+\n " font-family: Arial sans-serif;\sn"+\n " font-size: 18px;\sn"+\n " cursor: pointer;\sn"+\n "}\sn"+\n "a.JashXButton:hover {\sn"+\n " background: #ddd; \sn"+\n "}\sn"+\n "#JashTextareaWrap {\sn"+\n " width: 100%;\sn"+\n " _height: 420px;\sn"+\n "}\sn"+\n "html>body #JashTextareaWrap {\sn"+\n " height: 100%;\sn"+\n "}\sn"+\n "#JashOutput {\sn"+\n " border: 2px inset white;\sn"+\n " FONT-SIZE: 10px;\sn"+\n " font-family: \s"Lucida Console\s", monaco, monospace;\sn"+\n " BACKGROUND: black;\sn"+\n " width: 99%;\sn"+\n " COLOR: lightgreen;\sn"+\n " PADDING: 2px;\sn"+\n " height: 60%;\sn"+\n " height: expression(parseInt(this.parentNode.parentNode.offsetHeight * (3/5)) + 'px');\sn"+\n " \sn"+\n "}\sn"+\n "#JashInput {\sn"+\n " padding: 2px;\sn"+\n " WIDTH: 99%;\sn"+\n " border: 2px inset white;\sn"+\n " HEIGHT: 25%;\sn"+\n " font-family: monospace;\sn"+\n " font-size: 11px;\sn"+\n " height: expression(parseInt(this.parentNode.parentNode.offsetHeight * (3/13)) + 'px');\sn"+\n "}\sn"+\n "#JashParent .cssEntry {\sn"+\n " background: lightgreen;\sn"+\n " font-size: 11px;\sn"+\n " font-family: monospace;\sn"+\n "}\sn"+\n "#JashBottomBar {\sn"+\n " BACKGROUND: #ccc;\sn"+\n " POSITION: relative;\sn"+\n " HEIGHT: 20px;\sn"+\n " overflow: hidden;\sn"+\n " margin-top: 2px;\sn"+\n "}\sn"+\n "#JashBottomBar a {\sn"+\n " HEIGHT: 14px;\sn"+\n " font-size: 9px;\sn"+\n " font-weight: normal;\sn"+\n " font-family: arial;\sn"+\n " float: left;\sn"+\n " padding: 4px;\sn"+\n " background: #eee;\sn"+\n " cursor: pointer;\sn"+\n " border: 1px outset white;\sn"+\n " margin-right: 1px;\sn"+\n "}\sn"+\n "#JashBottomBar a:hover {\sn"+\n " padding-top: 3px;\sn"+\n " padding-bottom: 5px;\sn"+\n " background-color: white;\sn"+\n "}\sn"+\n "#JashBottomBar a:active, #JashBottomBar a:focus {\sn"+\n " padding-top: 5px;\sn"+\n " padding-bottom: 3px;\sn"+\n " background-color: #ddd;\sn"+\n "}\sn"+\n "#JashResizeButton {\sn"+\n " BORDER: 1px solid gray;\sn"+\n " BACKGROUND: #eee;\sn"+\n " WIDTH: 17px;\sn"+\n " height: 17px;\sn"+\n " line-height: 0;\sn"+\n " CURSOR: move;\sn"+\n " position: absolute;\sn"+\n " bottom: 0px;\sn"+\n " right: 0px;\sn"+\n " z-index: 2000;\sn"+\n "}"\nstore.addNotification("StyleSheetJash", refreshStyles);\n\n/*\n** Jash.js\n** http://www.billyreisinger.com/jash/source/latest/Jash.js\n*/\n\nfunction Jash(){this.jashRoot="http://www.billyreisinger.com/jash/source/latest/";this.domGetElFunctions={id:new Array("document.getElementById","$"),className:new Array("getElementsByClassName","$C")};var line="-------------------------------------------------";var _null="nooutput";this.revision="$Revision: 1.14 $".replace(/(\s$|[A-Za-z]|\ss|:)/g,'');this.version="$Name: REL_1_35_7 $".replace(/\s$|Name:|\ss|REL_/g,'').replace(/_/g,'.');this.versionDate="$Date: 2007/11/16 03:24:54 $";this.main=function(){this.browser=this.returnBrowserType();this.lineNumber=0;this.mainBlock;this.output=document.getElementById("JashOutput");this.input;this.outputHistory=new Array();this.cssEvalFlag=false;this.innerHtmlInspection=false;this.accessKeyText=this.getAccessKeyText();this.defaultText="Jash, v"+this.version+"\snEnter \s"jash.help()\s" for a list of commands.\sn";this.cls=this.clear;this.tabIndexIndex=0;this.currentNode={};this.tips=["Did you know?\snThe DOM Inspector will automatically put\sn an element with an ID in the input field for you.","Did you know?\snYou can tie this script into your own to jash scripts. Use 'jash.methodName' anywhere\sn in your scripts, and pull\sn up this window before executing to see\sn the results.","Did you know?\snUse jash.stopWatch.start() and jash.stopWatch.stop() to\sn time execution speeds! Handy for optimization.","Did you know?\snPress TAB to complete a function, method, or property name.\sn If more than one match is found, a list of possible\sn matches will appear.","Did you know?\snYou can use jash.show() to show a list of the names\snand types of an object's members.\snOn the other hand, jash.dump will show names and\sn_values_ of an object's members.","Whoa ---- you can now tab-complete HTML element ids after typing document.getElementsById(' (or the '$' shorthand if using Prototype). This also works with class names (i.e. document.getElementsByClassName)"]\nthis.defaultText+=line+"\sn"+this.tips[(parseInt((Math.random()*10)%this.tips.length))]+"\sn"+line+"\sn";if(this.returnBrowserType()!="sa"){this.stylesheet=document.body.appendChild(document.createElement('link'));}else{this.stylesheet=document.getElementsByTagName("head")[0].appendChild(document.createElement("link"));}\nthis.stylesheet.type='text/css';this.stylesheet.rel='stylesheet';this.stylesheet.href=this.jashRoot+'Jash.css';this.create();Jash.TabComplete.prototype=this;this.tabComplete=new Jash.TabComplete();Jash.Evaluator.prototype=this;this.evaluation=new Jash.Evaluator();this.history=new Jash.History();var _self=this;window.setTimeout(function(){_self.input.focus();},500);if(typeof event!="undefined")delete event;}\nthis.returnBrowserType=function(){if(window.navigator.userAgent.toLowerCase().indexOf("opera")!=-1){return"op";}\nif(window.navigator.userAgent.toLowerCase().indexOf("msie")!=-1){return"ie";}\nif(window.navigator.userAgent.toLowerCase().indexOf("firefox")!=-1){return"ff";}\nif(window.navigator.userAgent.toLowerCase().indexOf("safari")!=-1){return"sa";}}\nthis.returnOsType=function(){var ua=window.navigator.userAgent.toLowerCase();if(ua.indexOf("macintosh")!=-1){return"mac";}else if(ua.indexOf("windows")!=-1){return"win";}else if(ua.indexOf("linux i686")!=-1){return"linux";}}\nthis.getAccessKeyText=function(){var txt;var agt=this.returnOsType();switch(this.browser){case"ie":txt="Alt";break;case"ff":if(agt=="mac"){txt="Ctrl";}else if(agt=="linux"){txt="Alt";}else{txt="Alt-Shift";}\nbreak;case"op":txt="Shift-Esc";break;case"sa":if(agt=="mac"){txt="Ctrl";}else{txt="Alt";}\nbreak;default:txt="Alt";break;}\nreturn txt;}\nthis.print=function(text,clear,suppressLineNumbers,autoscroll){clear=(typeof clear!="undefined")?clear:false;autoscroll=(typeof autoscroll!="undefined")?autoscroll:true;if(this.output==null||document.getElementById("JashParent")==null){this.create();this.output=document.getElementById("JashOutput");this.mainBlock=document.getElementById("JashParent");}\nif(clear){this.clear();}\nif(text!=""){if(typeof suppressLineNumbers!="undefined"&&!suppressLineNumbers){this.output.value+=this.lineNumber+". ";}\nthis.output.value+=text+"\sn";if(autoscroll){this.output.scrollTop=this.output.scrollHeight;}\nthis.lineNumber++;}\nreturn _null;}\nthis.show=function(obj){this.print(line,false,true);var out="";this.lineNumber=0;for(var p in obj){if(typeof obj[p]=="function"){var t=obj[p].toString();t=t.replace(/[\sx0A\sx0D]/g,"").replace(/\ss+/g,"").replace(/\s{.+\s}/g,"{ ... }");t=t.replace(p,"");t=p+": "+t;}else{t=p+": "+typeof obj[p];}\nout+=++this.lineNumber+". "+t+"\sn";}\nthis.print(out,false,true);this.print(line,false,true);this.output.scrollTop=this.output.scrollHeight;return _null;}\nthis.dump=function(obj){if(typeof obj=="string"){this.print(obj);}else{this.print(line,false,true);var out=new Array();if(typeof obj.push=="undefined"){for(var th in obj){out.push(++this.lineNumber+". "+th+" = "+obj[th]);}}else{for(var i=0;i<obj.length;i++){out.push(++this.lineNumber+". "+obj[i]);}}\nthis.print(out.join("\sn"),false,true);this.print(line,false,true);this.output.scrollTop=this.output.scrollHeight;}\nreturn _null;}\nthis.clear=function(){this.outputHistory.push(this.output.value);this.output.value="";this.input.focus();return _null;}\nthis.showOutputHistory=function(){this.outputHistory.push(this.output.value);this.dump(this.outputHistory);}\nthis.assignInputKeyEvent=function(keyCode){if(keyCode==13){this.evaluation.evaluate(this.input.value);this.input.value="";return false;}else if(keyCode==38){if(this.browser!="op"){this.input.value=this.history.getPreviousInput();}\nreturn false;}else if(keyCode==40){if(this.browser!="op"){this.input.value=this.history.getNextInput();}\nreturn false;}else if(keyCode==9){this.tabComplete.tabComplete();return false;}}\nthis.getXBrowserYOffset=function(){var y;if(self.pageYOffset){y=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){y=document.documentElement.scrollTop;}else if(document.body){y=document.body.scrollTop;}\nreturn y;}\nthis.getMouseXY=function(e){var tempX=0\nvar tempY=0\nif(window.event){if(document.documentElement&&document.documentElement.scrollTop){tempX=window.event.clientX+document.documentElement.scrollLeft;tempY=window.event.clientY+document.documentElement.scrollTop;}else{tempX=window.event.clientX+document.body.scrollLeft;tempY=window.event.clientY+document.body.scrollTop;}}else{tempX=e.pageX;tempY=e.pageY;}\nreturn{x:tempX,y:tempY};}\nthis.getDimensions=function(el){var dims={}\nif(document.all){dims.x=el.offsetWidth;dims.y=el.offsetHeight;}else{dims.x=parseInt(document.defaultView.getComputedStyle(el,"").getPropertyValue("width"));dims.y=parseInt(document.defaultView.getComputedStyle(el,"").getPropertyValue("height"));}\nreturn dims;}\nthis.addEvent=function(obj,eventName,func){if(obj.addEventListener)\nreturn obj.addEventListener(eventName,func,true);else if(obj.attachEvent){obj.attachEvent("on"+eventName,func);return true;}\nreturn false;}\nthis.findElementPosition=function(obj){var curleft=0;var curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft\ncurtop=obj.offsetTop\nwhile(obj=obj.offsetParent){curleft+=obj.offsetLeft\ncurtop+=obj.offsetTop}}\nreturn[curleft,curtop];}\nthis.create=function(){if(document.getElementsByTagName("frameset").length>0){alert("Jash currently does not support pages with frames.");return;}\nvar self=this;var debugParent=document.createElement("div");var windowScrollY=0;if(document.documentElement&&document.documentElement.scrollTop){windowScrollY=document.documentElement.scrollTop;}else if(document.body){windowScrollY=document.body.scrollTop}else{windowScrollY=window.scrollY;}\ndebugParent.style.top=windowScrollY+50+"px";debugParent.id="JashParent";this.addEvent(document,"keydown",function(e){e=(typeof window.event!="undefined")?window.event:e;if(e.keyCode=="27"){if(typeof e.shiftKey=="undefined"||!e.shiftKey){self.close();}}});var textareaWrap=document.createElement("div");textareaWrap.id="JashTextareaWrap";var debugOutput=document.createElement("textarea");debugOutput.id="JashOutput";debugOutput.wrap="off";debugOutput.readOnly="true";debugOutput.value=this.defaultText;var inp=document.createElement("textarea");inp.id="JashInput";var last="";inp.onkeydown=function(e){e=(typeof window.event!="undefined")?window.event:e;return self.assignInputKeyEvent(e.keyCode);}\ninp.onkeypress=function(e){e=(typeof window.event!="undefined")?window.event:e;var k=e.keyCode;if(!self.evaluation.cssEvalFlag){if(k==9||k==13||k==38||k==40){if(k!=40&&this.browser!="ie"){return false;}}}else if(k==9){return false;}}\nvar dragBut=document.createElement("div");dragBut.innerHTML="Jash";dragBut.id="JashDragBar";dragBut.onmousedown=function(e){e=(typeof window.event!="undefined")?window.event:e;var xplus=(typeof e.layerX=="undefined")?e.offsetX:e.layerX;var yplus=(typeof e.layerY=="undefined")?e.offsetY:e.layerY;document.onmousemove=function(e){var coords=self.getMouseXY(e);document.getElementById("JashParent").style.top=coords.y-yplus+"px";document.getElementById("JashParent").style.left=coords.x-xplus+"px";}\nreturn false;}\ndocument.onmouseup=function(){document.onmousemove=null;};dragBut.onclick=function(){return false;}\nvar xBut=document.createElement("a");xBut.className="JashXButton";xBut.innerHTML="X";xBut.href="#";xBut.onclick=function(){self.close();return false;}\nvar clearBut=document.createElement("a");clearBut.innerHTML="Clear ("+this.accessKeyText+"-C)";clearBut.accessKey="C";clearBut.className="JashButton";clearBut.onclick=function(){self.clear();return false;}\nthis.setCrossBrowserAccessKeyFunctionForAnchor(clearBut);var evalBut=document.createElement("a");evalBut.value="Evaluate ("+this.accessKeyText+"-Z)";evalBut.innerHTML="Evaluate ("+this.accessKeyText+"-Z)";evalBut.accessKey="Z";evalBut.className="JashButton";evalBut.title="Evaluate current input ("+this.accessKeyText+"-Z)";evalBut.onclick=function(){self.evaluation.evaluate(inp.value);if(!self.evaluation.cssEvalFlag){inp.value="";}\ninp.focus();return false;}\nthis.setCrossBrowserAccessKeyFunctionForAnchor(evalBut);var helpBut=document.createElement("a");helpBut.innerHTML="Help";helpBut.className="JashButton";helpBut.title="Help: show list of commands (or type jash.help(); )";helpBut.onclick=function(){self.help();}\nvar domBut=document.createElement("a");domBut.innerHTML="Mouseover DOM ("+this.accessKeyText+"-X)";domBut.title="Mouseover DOM: toggle to turn on/off inspection of document nodes ("+this.accessKeyText+"-X)";domBut.className="JashButton";domBut.accessKey="X";domBut.tabIndex="4";this.domActive=false;domBut.onclick=function(){if(!self.domActive){document.body.onmouseover=function(e){if(typeof e=="undefined"){e=window.event;}\nself.showNodes(e);}\nself.setButtonVisualActiveState(domBut,"on");self.domActive=true;}else{document.body.onmouseover=function(){}\nself.domActive=false;self.setButtonVisualActiveState(domBut,"off");}\nreturn _null;}\nthis.setCrossBrowserAccessKeyFunctionForAnchor(domBut);var innerHtmlInspectBut=document.createElement("a");innerHtmlInspectBut.innerHTML="innerHTML Dump ("+this.accessKeyText+"-A)";innerHtmlInspectBut.title="innerHTML Inspect: toggle to turn on/off innerHTML inspection of document nodes ("+this.accessKeyText+"-A)";innerHtmlInspectBut.className="JashButton";innerHtmlInspectBut.accessKey="A";innerHtmlInspectBut.tabIndex="5";this.innerHtmlInspection=false;innerHtmlInspectBut.onclick=function(){self.innerHtmlInspection=!self.innerHtmlInspection;self.setButtonVisualActiveState(innerHtmlInspectBut,self.innerHtmlInspection?"on":"off");return _null;}\nthis.setCrossBrowserAccessKeyFunctionForAnchor(innerHtmlInspectBut);var cssBut=document.createElement("a");cssBut.innerHTML="CSS Input ("+this.accessKeyText+"-S)";cssBut.title="CSS Input: turn on CSS input to enter arbitrary CSS ("+this.accessKeyText+"-S)";cssBut.className="JashButton";cssBut.accessKey="S";cssBut.onclick=function(){if(!self.evaluation.cssEvalFlag){self.setButtonVisualActiveState(cssBut,"on");self.evaluation.cssEvalFlag=true;inp.className="cssEntry";if(document.getElementById("JashStyleInput")!=null){self.evaluation.styleInputTag.disabled=false;}\ninp.value="";}else{self.setButtonVisualActiveState(cssBut,"off");inp.className="";self.evaluation.cssEvalFlag=false;if(document.getElementById("JashStyleInput")!=null){self.evaluation.styleInputTag.disabled=true;}\ninp.value="";}\ninp.focus();return _null;}\nthis.setCrossBrowserAccessKeyFunctionForAnchor(cssBut);var resizeBut=document.createElement("div");resizeBut.id="JashResizeButton";this.minDims={x:100,y:100};resizeBut.onmousedown=function(e){e=(typeof window.event!="undefined")?window.event:e;var originalDims=self.getDimensions(textareaWrap);var originMouseDims=self.getMouseXY(e);document.onmousemove=function(e){var newMouseDims=self.getMouseXY(e);var newWidth=originalDims.x+(newMouseDims.x-originMouseDims.x);if(newWidth<self.minDims.x){newWidth=self.minDims.x;}\ntextareaWrap.style.width=newWidth+"px";debugParent.style.width=newWidth+"px";var newHeight=originalDims.y+(newMouseDims.y-originMouseDims.y);if(newHeight<self.minDims.y){newHeight=self.minDims.y;}\ntextareaWrap.style.height=newHeight+"px";debugParent.style.height=newHeight+"px";}\ndocument.onmouseup=function(){document.onmousemove="";}}\nvar bottomBar=document.createElement("div");bottomBar.id="JashBottomBar";debugParent.appendChild(dragBut);debugParent.appendChild(xBut);bottomBar.appendChild(evalBut);bottomBar.appendChild(cssBut);bottomBar.appendChild(domBut);bottomBar.appendChild(innerHtmlInspectBut);bottomBar.appendChild(clearBut);bottomBar.appendChild(helpBut);debugParent.appendChild(bottomBar);debugParent.appendChild(resizeBut);document.body.appendChild(debugParent);textareaWrap.appendChild(debugOutput);textareaWrap.appendChild(inp);debugParent.appendChild(textareaWrap);this.bottomBar=document.getElementById("JashBottomBar");this.dragBar=document.getElementById("JashDragBar")\nthis.output=document.getElementById("JashOutput");this.input=document.getElementById("JashInput");this.mainBlock=debugParent;this.addEvent(window,'scroll',function(){debugParent.style.top=50+self.getXBrowserYOffset()+'px';});}\nthis.setButtonVisualActiveState=function(button,state){if(state=="on"){button.style.backgroundColor="lightgreen";}else{button.style.backgroundColor="";}}\nthis.help=function(){var out=new Array();out.push(line);out.push("Jash v"+this.version+" "+this.versionDate.replace(/\s$/g,''),true);out.push("http://www.billyreisinger.com/jash/documentation.html");out.push(line);out.push("METHODS");out.push(line);out.push("this.cls() - clear console and terminal");out.push("jash.print(str,clear) - output str to console ~~ str = string ~~ clear = true|false: clear console before output");out.push("this.close() - close this console");out.push("this.dump(obj) - output object and members to console");out.push("this.show(obj) - print out the names and types (only) of all members of obj");out.push("this.stopWatch.start() - start timer");out.push("this.stopWatch.stop() - end timer and return result in ms");out.push("this.kill(HTML Element) - remove an element from the page.");out.push("this.getDimensions(HTML Element) - get width, height dimensions of an html element. Returns an object [x,y]");out.push(line);out.push("KEYSTROKES");out.push(line);out.push("press up arrow in input field to retrieve last input");out.push("press ESC to show/hide console");out.push("press "+this.accessKeyText+"-Q to turn on/off Transparent mode, so you can see through the Jash.");out.push("press ENTER in input field to enter a command");out.push("press TAB to auto-complete input");out.push("press "+this.accessKeyText+"-Z to evaluate input");out.push("press "+this.accessKeyText+"-X to activate/deactivate DOM inspector");out.push("press "+this.accessKeyText+"-A to activate/deactivate innerHTML dump (only works w/ DOM inspector)");out.push("press "+this.accessKeyText+"-C to clear output and input");out.push("press "+this.accessKeyText+"-S to turn on/off CSS input mode. In CSS input mode, you can enter arbitrary CSS selectors and rules, as you would normally do in a CSS stylesheet.");this.print(out.join("\sn"));return _null;}\nthis.close=function(){if(this.mainBlock.style.display=="none"){this.mainBlock.style.display="block";this.input.focus();}else{this.mainBlock.style.display="none";}}\nthis.setCrossBrowserAccessKeyFunctionForAnchor=function(el){var self=this;el.tabIndex=++this.tabIndexIndex;if(this.browser=="ie"){el.onfocus=function(){if(window.event.altKey){el.onclick();}\nself.input.focus();}}}\nthis.stopWatch={t_start:0,t_end:0,t_total:0,start:function(){t_start=new Date().getTime();return t_start;},stop:function(){t_end=new Date().getTime();t_total=t_end-t_start;return(t_total);}}\nthis.showNodes=function(e){if(typeof e=="undefined")e=window.event;var el=typeof e.target=="undefined"?e.srcElement:e.target;this.currentNode=el;var childMost=this.identifyNode(el,false);var out="";var childmostTxt="childmost..... "+childMost.txt+"\sn";while(el=el.parentNode){if(el.nodeName.toLowerCase()=="html"){out="parentmost.... <html>\sn"+out;break;}\nout=this.identifyNode(el).txt+"\sn"+out;}\nout="**** PRESS "+this.accessKeyText+"-X TO PAUSE / UNPAUSE ****\sn"+out;out+=childmostTxt;this.print(out,true,true,false);if(this.innerHtmlInspection){this.print("INNER HTML");if(this.currentNode.innerHTML.indexOf("<")!=-1){this.print(Jash.Indenter.indent(this.currentNode.innerHTML),false,true,false);}else{this.print(this.currentNode.innerHTML,false,true,false);}}\nif(!this.evaluation.cssEvalFlag){if(childMost.id!=""){if(typeof $!="undefined"){this.input.value='$("'+childMost.id+'")';}else{this.input.value='document.getElementById("'+childMost.id+'")';}}else{this.input.value="this.currentNode";}}}\nthis.identifyNode=function(el,showDots){showDots=typeof showDots=="boolean"?showDots:true;var out={txt:"",id:""};if(showDots)out.txt+=".............. ";out.txt+="<"+el.nodeName.toLowerCase();for(var i=0;i<el.attributes.length;i++){if((this.browser=="ie"&&el.attributes[i].specified===true)||this.browser!="ie"){out.txt+=" "+el.attributes[i].name;out.txt+="=\s""+el.attributes[i].value+"\s"";}}\nout.txt+=">";return out;}\nthis.kill=function(){this.currentNode.parentNode.removeChild(this.currentNode);}}\nJash.Evaluator=function(){this.cssEvalFlag=false;var _null="nooutput";this.evaluate=function(input){if(input=="")return false;this.history.add(input);if(this.cssEvalFlag){this.evalCss(input);this.print(input);}else{var output=this.evalJs(input);if(typeof output!="undefined"){this.print(">> "+input);this.print(output);}}}\nthis.evalJs=function(input){try{var result;if(this.browser=="ie"){result=eval(input);}else{result=window.eval(input);}\nif(result!=null&&result.toString()!=_null){return(result.toString());}else{return"null"}}catch(e){return(e.message);}}\nthis.evalCss=function(input){try{this.insertStyleRule(input);}catch(e){}\nreturn input;}\nthis.insertStyleRule=function(rule){var lastStyleSheetIndex=document.styleSheets.length-1;if(document.getElementById("JashStyleInput")==null){this.styleInputTag=document.createElement("style");this.styleInputTag.id="JashStyleInput";this.styleInputTag.type="text/css";document.body.appendChild(this.styleInputTag);}\nif(this.browser=="ff"||this.browser=="op"){this.styleInputTag.innerHTML+=rule+"\sn";}else if(this.browser=="ie"||this.browser=="sa"){if(this.browser=="ie"){var i=0;}else if(this.browser="sa"){var i=document.styleSheets.length-1;}\nvar rulesArray=rule.split("}");for(var t=0;t<rulesArray.length;t++){var ruleSplit=rulesArray[t].split("{");var selectors=ruleSplit[0].split(",");for(var k=0;k<selectors.length;k++){document.styleSheets[i].addRule(selectors[k],ruleSplit[1]);}}}\nreturn"";}\nreturn this;}\nJash.History=function(){this.entries=new Array('');this.position=0;}\nJash.History.prototype={add:function(input){this.entries.push(input);this.position=this.entries.length-1;},getPreviousInput:function(){if(this.position<0){return'';}\nvar entry=typeof this.entries[this.position]!="undefined"?this.entries[this.position]:'';if(this.position>0){this.position--;}\nreturn entry;},getNextInput:function(){if(this.position+1<this.entries.length){return this.entries[++this.position];}else{return'';}}}\nJash.Indenter={indentChar:"\st",nodesCommonlyUnclosed:new Array("link ","img ","meta ","!DOCTYPE ","input ","param","hr","br"),stringRepeat:function(stringToRepeat,times){var string=new Array();for(var i=0;i<times;i++){string.push(stringToRepeat);}\nreturn string.join('');},closeUnclosedNode:function(str){for(var k=0;k<this.nodesCommonlyUnclosed.length;k++){var reg=new RegExp("^"+this.nodesCommonlyUnclosed[k].toLowerCase());if(str.toLowerCase().match(reg)){return str.replace(">","/>");}}\nreturn str;},indentAndAdd:function(level,string,arr){var indents=this.stringRepeat(this.indentChar,level);arr.push(indents+string);return arr;},indent:function(source){var source=source;var arr=new Array();source=source.replace(/[\sn\sr\st]/g,'');source=source.replace(/>\ss+/g,">");source=source.replace(/\ss+</g,"<");var splitsrc=source.split("<");for(i=0;i<splitsrc.length;i++){splitsrc[i]=this.closeUnclosedNode(splitsrc[i]);}\nsource=splitsrc.join("<");var level=0;var sourceLength=source.length;var position=0;while(position<sourceLength){if(source.charAt(position)=='<'){var startedAt=position;var tagLevel=1;if(source.charAt(position+1)=='/'){tagLevel=-1;}\nif(source.charAt(position+1)=='!'){tagLevel=0;}\nwhile(source.charAt(position)!='>'){position++;}\nif(source.charAt(position-1)=='/'){tagLevel=0;}\nvar tagLength=position+1-startedAt;if(tagLevel===-1){level--;}\narr=this.indentAndAdd(level,source.substr(startedAt,tagLength),arr);if(tagLevel===1){level++;}}\nif((position+1)<sourceLength){if(source.charAt(position+1)!=='<'){startedAt=position+1;while(source.charAt(position)!=='<'&&position<sourceLength){position++;}\nif(source.charAt(position)==='<'){tagLength=position-startedAt;arr=this.indentAndAdd(level,source.substr(startedAt,tagLength),arr);}}else{position++;}}else{break;}}\nreturn arr.join("\sn");}}\nJash.Profiler=function(func,onFinish){this.func=func;this.time=0;this.defaultOnFinish=function(){};this.results=new Array();this.onFinish=typeof onFinish!="function"?this.defaultOnFinish:onFinish;var self=this;this.reverseWhile=function(reps){this.stopWatch.start();while(reps>0){this.func();reps--;}\nreturn this.stopWatch.stop();}\nthis.forLoop=function(reps){this.stopWatch.start();for(i=0;i<reps;i++){this.func();}\nreturn this.stopWatch.stop();}\nthis.loop=function(kind,reps){if(!this.results[kind]){this.results[kind]=new Array();}\nvar repsMemberName="r_"+reps;if(!this.results[kind][repsMemberName]){this.results[kind][repsMemberName]=new Array();}\nvar time=this[kind](reps);this.results[kind][repsMemberName].push(time);}\nthis.runOnce=function(){if(!this.results.runOnce){this.results.runOnce=new Array();}\nthis.stopWatch.start();func();this.results.runOnce.push(this.stopWatch.stop());}\nthis.stopWatch={t_start:0,t_end:0,t_total:0,start:function(){t_start=new Date().getTime();return t_start;},stop:function(){t_end=new Date().getTime();t_total=t_end-t_start;self.time=t_total;return t_total;}}\nthis.average=function(arr){var sum=0;for(i=0;i<arr.length;i++){sum+=arr[i];}\nreturn sum/arr.length}\nthis.multiPass=function(passes,type,reps){if(typeof type=="undefined"){type="runOnce";}else if(typeof this[type]=="undefined"){jash.print("Error: the loop type '"+type+"' does not exist");return false;}\nvar self=this;if(type=="runOnce"){if(passes<1){self.reportProfile(Math.round(this.average(this.results.runOnce)),type,reps);}else{window.setTimeout(function(){self.runOnce();self.multiPass(--passes,type);},50);}}else{if(passes<1){var repsMemberName="r_"+reps;self.reportProfile(Math.round(this.average(this.results[type][repsMemberName])),type,reps);}else{window.setTimeout(function(){self.loop(type,reps);self.multiPass(--passes,type,reps);},50);}}}\nthis.reportProfile=function(avgMs,type,reps){var line="-------PROFILER----------------------------------------------";var str=line+"\sn"+this.func+"\sn"+line+"\sn";str+="Type of profile: "+type+"\sn";if(typeof reps!="undefined"){str+="Loop iterations: "+reps+"\sn";}\nstr+="Average execution time: "+avgMs+"ms"+"\sn";if(type=="runOnce"){howManyTimes=this.results.runOnce.length;}else{repsMemberName="r_"+reps;howManyTimes=this.results[type][repsMemberName].length;}\nstr+="Average calculated from "+howManyTimes+" pass(es)\sn";str+=line+"\sn";jash.print(str);}}\nJash.TabComplete=function(){this.tabComplete=function(e){e=(typeof window.event!="undefined")?window.event:e;var inputText=this.input.value;var match=null;if(match=this.searchInputForDomGetElFunctions(inputText)){this.tabCompleteIdOrClassInJavascript(match.match[0],match.type);this.focusCaretAtEndOfInput();return false;}else if(this.evaluation.cssEvalFlag){this.tabCompleteIdOrClassInCss(inputText);this.focusCaretAtEndOfInput();return false;}else{this.tabCompleteJavascript(e,inputText);this.focusCaretAtEndOfInput();}}\nthis.focusCaretAtEndOfInput=function(){this.input.selectionEnd=this.input.selectionStart=this.input.value.length;}\nthis.tabCompleteJavascript=function(e,inputText){var words=inputText.split(/\ss+/);var lastWord=words[(words.length-1)];var numOpeningParens=lastWord.split("(").length-1;var numClosingParens=lastWord.split(")").length-1;var scope;var sentinel=0;var diff=numOpeningParens-numClosingParens;if(diff>0){numClosingParens=lastWord.split("(")[numOpeningParens].split(")").length-1;var numRealDanglers=numOpeningParens-numClosingParens;scope=lastWord.split("(").slice(numRealDanglers).join("(");}else if(diff<0){this.print("error: too many closing parentheses");return false;}else{scope=lastWord;}\nscope=scope.split(".");var fragment=scope.pop();scope=scope.join(".");if(scope=="")scope="window";var members=this.getMembers(scope);var results=this.findTextMatchesInArray(members,fragment);if(results==false){}else if(typeof results!="string"){this.dump(results);var bestMatch=this.findBestStringMatch(fragment,results);if(fragment!=''){fragReg=new RegExp(fragment+"$");this.input.value=this.input.value.replace(fragReg,bestMatch);}else{this.input.value+=bestMatch;}}else{var reggie=new RegExp(fragment+"$");this.input.value=this.input.value.replace(reggie,results);}\nreturn false;}\nthis.doAllStringsInArrayHaveSameCharacterAtIndex=function(index,arr){var matched=0;if(!arr[0].charAt(index))return false;var character=arr[0].charAt(index);for(var i=1;i<arr.length;i++){if(!arr[i].charAt(index)||arr[i].charAt(index)!=character){return false;}}\nreturn true;}\nthis.findBestStringMatch=function(str,arr){var fragLength=str.length;var matches=this.doAllStringsInArrayHaveSameCharacterAtIndex(fragLength,arr);while(matches){fragLength++;matches=this.doAllStringsInArrayHaveSameCharacterAtIndex(fragLength,arr);}\nreturn arr[0].substr(0,fragLength);}\nthis.tabCompleteIdOrClassInJavascript=function(inputText,type){var query=inputText.split("(");query=query[query.length-1].replace(/\sW/g,'');var matches=new Array();var els=document.getElementsByTagName("*");if(type=="id"){for(var i=0;i<els.length;i++){if(els[i].id&&els[i].id.indexOf(query)==0){matches.push(els[i].id);}}}else if(type=="class"){for(var i=0;i<els.length;i++){if(els[i].className&&els[i].className!=''){var classes=els[i].className.split(/\ss/);for(var ii=0;ii<classes.length;ii++){if(classes[ii].indexOf(query)==0||query==''){if(matches.join("***").indexOf(classes[ii])==-1){matches.push(classes[ii]);}}}}}}\nif(matches.length==1){this.input.value+=matches[0].split(query)[1];}else if(matches.length==0){this.print("no match");}else{this.dump(matches.sort());var bestMatch=this.findBestStringMatch(query,matches);if(query!=''){var replacement=inputText.split("(");replacement[replacement.length-1]=replacement[replacement.length-1].replace(query,bestMatch);this.input.value=this.input.value.replace(inputText,replacement.join("("));}else{this.input.value+=bestMatch;}}}\nthis.tabCompleteIdOrClassInCss=function(inputText){var selectors=inputText.replace(/(\s.|#)/g,' $1').split(/\ss+/);var lastSelector=selectors[selectors.length-1];var els=document.getElementsByTagName("*");var matches=new Array();if(lastSelector.match(/^\s./)){for(var i=0;i<els.length;i++){if(els[i].className&&els[i].className!=''){var classes=els[i].className.split(/\ss/);for(var ii=0;ii<classes.length;ii++){if(classes[ii].indexOf(lastSelector.substr(1))==0||lastSelector=="."){if(matches.join("***").indexOf(classes[ii])==-1){matches.push("."+classes[ii]);}}}}}}else if(lastSelector.match(/^#/)){for(var i=0;i<els.length;i++){if(els[i].id&&els[i].id.indexOf(lastSelector.substr(1))==0){matches.push("#"+els[i].id);}}}\nif(matches.length==1){this.input.value+=matches[0].split(lastSelector)[1];}else if(matches.length==0){this.print("no match");}else{this.dump(matches.sort());var bestMatch=this.findBestStringMatch(lastSelector,matches);if(lastSelector!=''){this.input.value=this.input.value.replace(lastSelector,bestMatch);}else{this.input.value+=bestMatch;}}}\nthis.searchInputForDomGetElFunctions=function(inputText){for(var i=0;i<this.domGetElFunctions.id.length;i++){var selfct=new RegExp(this.domGetElFunctions.id[i].replace("\s$","\s\s\s$")+"\s\s\s(['\s"]\s\sw*$");if(inputText.match(selfct)){return{match:inputText.match(selfct),type:"id"};}}\nfor(var i=0;i<this.domGetElFunctions.className.length;i++){var selfct=new RegExp(this.domGetElFunctions.className[i].replace("\s$","\s\s\s$")+"\s\s\s(['\s"]\s\sw*$");if(inputText.match(selfct)){return{match:inputText.match(selfct),type:"class"};}}}\nthis.findTextMatchesInArray=function(arrayToTest,findMe){var resultsArray=new Array();var tester=new RegExp("^"+findMe);for(var i=0;i<arrayToTest.length;i++){if(tester.test(arrayToTest[i])){resultsArray.push(arrayToTest[i]);}}\nif(resultsArray.length>1){resultsArray.sort();return resultsArray;}else if(resultsArray.length==1){return resultsArray[0];}else{return false;}}\nthis.getMembers=function(context){var members=new Array();for(memberName in eval(context)){members.push(memberName);}\nreturn members;}\nreturn this;}\nnew function(){if("jash"in window){window.jash.close();}else{window.jash=new Jash();window.jash.main();}}\n//}}}
@@border-bottom(1px dashed #000):font-weight(bold):Current Projects@@\n* [[TiddlerToCPlugin]]\n* [[TableHighlightMacro]]\n* [[RelativeLinkMacro]]\n* [[BlockCollapseMacro]]\n* [[SuppressEmptyTagsP.|SuppressEmptyTagsPlugin]]\n* [[PasswordPromptPlugin]]\n\n@@border-bottom(1px dashed #000):font-weight(bold):Planned Projects@@\n* [[BackupMacro|BackupMacro Concept]]\n* [[DisableWikiLinksPlugin|http://groups.google.com/group/TiddlyWiki/browse_thread/thread/aee32d11ed9ea28d]]\n* [[SubTiddlers|SubTiddlers Concept]]\n* [[TagNavigatorPlugin|TagNavigator Concept]]\n* [[EditPortlet]]\n* [[TableSlicesPlugin]]\n* [[EasyLayoutPlugin]]\n\n@@border-bottom(1px dashed #000):font-weight(bold):Abandoned Projects@@\n* [[SimpleCommentsPlugin]]\n* [[EasyHighlightingPlugin]]
/***\n|''Name''|MediaWikiTableFormatterPlugin|\n|''Description''|Allows MediaWiki style tables in TiddlyWiki|\n|''Author''|Martin Budden (mjbudden (at) gmail (dot) com)|\n|''Contributors''|FND|\n|''Version''|0.1.2|\n|''Status''|stable|\n|''Source''|http://devpad.tiddlyspot.com/#MediaWikiTableFormatterPlugin|\n|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/formatters/MediaWikiTableFormatterPlugin.js|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion:''|2.1.0|\n!Description\nEnables [[MediaWiki|http://www.mediawiki.org]]'s table markup in TiddlyWiki, allowing for multi-line contents within table cells.\n(Note that all TiddlyWiki markup still applies.)\n!Usage\nDetailed documentation available at [[MediaWiki.org|http://www.mediawiki.org/wiki/Help:Tables]].\n!!Examples\n{{{\n{|\n! Heading 1\n! Heading 2\n! Heading 3\n|-\n| row 1, column 1\n| row 1, column 2\n| row 1, column 3\n|-\n| row 2, column 1\n| row 2, column 2\n| row 2, column 3\n|}\n}}}\n{|\n! Heading 1\n! Heading 2\n! Heading 3\n|-\n| row 1, column 1\n| row 1, column 2\n| row 1, column 3\n|-\n| row 2, column 1\n| row 2, column 2\n| row 2, column 3\n|}\n!Revision History\n!!v0.1 (2008-10-31)\n* initial release\n!!v0.1.2 (2008-11-05)\n* removed unnecessary code\n!Code\n***/\n//{{{\nif(!version.extensions.MediaWikiTableFormatterPlugin) { //# ensure that the plugin is only installed once\nversion.extensions.MediaWikiTableFormatterPlugin = {installed:true};\n\nif(version.major < 2 || (version.major == 2 && version.minor < 1)) {\n alertAndThrow('MediaWikiTableFormatterPlugin requires TiddlyWiki 2.1 or later.');\n}\n\nconfig.formatters.push({\n name: 'enhancedTable',\n match: '^\s\s{\s\s|',\n handler: function(w) {\n var pair = MediaWikiTemplate.findTableBracePair(w.source,w.matchStart);\n if(pair.start==w.matchStart) {\n w.nextMatch = w.matchStart;\n var table = MediaWikiTemplate.createElement(w.output,'table');\n var tbody = MediaWikiTemplate.createElement(table,'tbody'); // required for IE\n var mwt = new MediaWikiTemplate();\n mwt.wikifyTable(tbody,w,pair);\n }\n }\n});\n\n\nMediaWikiTemplate = function()\n{\n this.stack = [];\n this.error = false;\n this.tiddler = null;\n};\n\nMediaWikiTemplate.createElement = function(parent,element)\n{\n return parent.appendChild(document.createElement(element));\n}\n\nMediaWikiTemplate.setAttributesFromParams = function(e,p)\n{\n var re = /\ss*(.*?)=(?:(?:"(.*?)")|(?:'(.*?)')|((?:\sw|%|#)*))/mg;\n var match = re.exec(p);\n while(match) {\n var s = match[1].unDash();\n if(s == 'bgcolor') {\n s = 'backgroundColor';\n }\n try {\n if(match[2]) {\n e.setAttribute(s,match[2]);\n } else if(match[3]) {\n e.setAttribute(s,match[3]);\n } else {\n e.setAttribute(s,match[4]);\n }\n }\n catch(ex) {}\n match = re.exec(p);\n }\n};\n\nMediaWikiTemplate.findRawDelimiter = function(delimiter,text,start)\n//# find a delimiter that is not enclosed by [[..]]\n{\n var d = text.indexOf(delimiter,start);\n if(d==-1)\n return -1;\n var b = {start:-1,end:-1};\n var bs = text.indexOf('[[',start);\n if(bs==-1 || bs >d)\n return d;\n var s1 = -1;\n if(bs!=-1 && bs <d) {\n var be = text.indexOf(']]',bs);\n if(be!=-1) {\n b.start = bs;\n b.end = be;\n }\n }\n if(b.start!=-1 && d>b.start)\n s1 = b.end+2;\n return s1==-1 ? d : MediaWikiTemplate.findRawDelimiter(delimiter,text,s1);\n};\n\nMediaWikiTemplate.findTableBracePair = function(text,start)\n{\n var ret = {start:-1,end:-1};\n var s = text.indexOf('{|',start);\n if(s==-1)\n return ret;\n var e = text.indexOf('\sn|}',s+2);\n if(e==-1)\n return ret;\n e++;\n var s2 = text.indexOf('{|',s+2);\n if(s2==-1 || s2 > e)\n return {start:s,end:e};\n var tp = MediaWikiTemplate.findTableBracePair(text,s+2);\n while(tp.end!=-1 && e>tp.start && e<=tp.end) {\n //# intervening table brace pair, so skip over\n e = tp.end+2;\n tp = MediaWikiTemplate.findTableBracePair(text,e);\n e = text.indexOf('\sn|}',e);\n if(e==-1)\n return ret;\n e++;\n }\n return {start:s,end:e};\n};\n\nMediaWikiTemplate.prototype.wikifyTable = function(table,w,pair)\n{\n function lineEnd(w) {\n var r = w.source.indexOf('\sn',w.nextMatch);\n while(r!=-1) {\n var n = w.source.substr(r+1,1);\n if(n=='|' || n=='!' || (n=='{' && w.source.substr(r+2,1)=='|'))\n break;\n r = w.source.indexOf('\sn',r+1);\n }\n return r;\n }\n function subWikifyText(e,w,text) {\n var oldSource = w.source; var oldMatch = w.nextMatch;\n w.source = text; w.nextMatch = 0;\n w.subWikifyUnterm(e);\n w.source = oldSource; w.nextMatch = oldMatch;\n }\n //# skip over {|\n w.nextMatch += 2;\n var i = lineEnd(w);\n if(i>w.nextMatch) {\n MediaWikiTemplate.setAttributesFromParams(table.parentNode,w.source.substring(w.nextMatch,i));\n w.nextMatch = i;\n }\n w.nextMatch++;\n if(w.source.substr(w.nextMatch,2)=='|+') {\n var caption = MediaWikiTemplate.createElement(table,'caption');\n w.nextMatch += 2;\n i = lineEnd(w);\n var d = MediaWikiTemplate.findRawDelimiter('|',w.source,w.nextMatch);\n if(d!=-1 && d<i) {\n MediaWikiTemplate.setAttributesFromParams(caption,w.source.substring(w.nextMatch,d));\n w.nextMatch = d+1;\n }\n w.subWikifyTerm(caption,/(\sn)/mg);\n }\n var tr = MediaWikiTemplate.createElement(table,'tr');\n if(w.source.substr(w.nextMatch,2)=='|-') {\n w.nextMatch += 2;\n i = lineEnd(w);\n if(i>w.nextMatch) {\n MediaWikiTemplate.setAttributesFromParams(tr,w.source.substring(w.nextMatch,i));\n w.nextMatch = i;\n }\n w.nextMatch++;\n }\n var x = w.source.substr(w.nextMatch,2);\n while(x!='|}') {\n if(x=='{|') {\n //# nested table\n var pair2 = MediaWikiTemplate.findTableBracePair(w.source,w.nextMatch);\n if(pair2.start==w.nextMatch) {\n var table2 = MediaWikiTemplate.createElement(cell,'table');\n this.wikifyTable(table2,w,pair2);\n }\n } else if(x=='|-') {\n //# new row\n tr = MediaWikiTemplate.createElement(table,'tr');\n w.nextMatch += 2;\n i = lineEnd(w);\n if(i==-1)\n break;\n if(i>w.nextMatch) {\n MediaWikiTemplate.setAttributesFromParams(tr,w.source.substring(w.nextMatch,i));\n w.nextMatch = i;\n }\n w.nextMatch++;\n } else if(x.substr(0,1)=='!') {\n //# header cell\n w.nextMatch++;\n i = lineEnd(w);\n if(i==-1)\n break;\n var cell = MediaWikiTemplate.createElement(tr,'th');\n var c = w.source.indexOf('!!',w.nextMatch);\n while(c!=-1 && c<i) {\n d = MediaWikiTemplate.findRawDelimiter('|',w.source,w.nextMatch);\n if(d!=-1 && d<c) {\n MediaWikiTemplate.setAttributesFromParams(cell,w.source.substring(w.nextMatch,d));\n w.nextMatch = d+1;\n }\n while(w.source.substr(w.nextMatch,1)==' ') {\n w.nextMatch++;\n }\n w.subWikifyTerm(cell,/(\s!\s!)/mg);\n cell = MediaWikiTemplate.createElement(tr,'th');\n c = w.source.indexOf('!!',w.nextMatch);\n }\n d = MediaWikiTemplate.findRawDelimiter('|',w.source,w.nextMatch);\n if(d!=-1 && d<i) {\n MediaWikiTemplate.setAttributesFromParams(cell,w.source.substring(w.nextMatch,d));\n w.nextMatch = d+1;\n }\n while(w.source.substr(w.nextMatch,1)==' ') {\n w.nextMatch++;\n }\n subWikifyText(cell,w,w.source.substring(w.nextMatch,i));\n w.nextMatch = i+1;\n } else if(x.substr(0,1)=='|') {\n //# cell\n w.nextMatch++;\n i = lineEnd(w);\n if(i==-1)\n break;\n cell = MediaWikiTemplate.createElement(tr,'td');\n c = w.source.indexOf('||',w.nextMatch);\n while(c!=-1 && c<i) {\n d = MediaWikiTemplate.findRawDelimiter('|',w.source,w.nextMatch);\n if(d!=-1 && d<c) {\n MediaWikiTemplate.setAttributesFromParams(cell,w.source.substring(w.nextMatch,d));\n w.nextMatch = d+1;\n }\n while(w.source.substr(w.nextMatch,1)==' ') {\n w.nextMatch++;\n }\n w.subWikifyTerm(cell,/(\s|\s|)/mg);\n cell = MediaWikiTemplate.createElement(tr,'td');\n c = w.source.indexOf('||',w.nextMatch);\n }\n d = MediaWikiTemplate.findRawDelimiter('|',w.source,w.nextMatch);\n if(d!=-1 && d<i) {\n MediaWikiTemplate.setAttributesFromParams(cell,w.source.substring(w.nextMatch,d));\n w.nextMatch = d+1;\n }\n while(w.source.substr(w.nextMatch,1)==' ') {\n w.nextMatch++;\n }\n subWikifyText(cell,w,w.source.substring(w.nextMatch,i));\n w.nextMatch = i+1;\n }\n x = w.source.substr(w.nextMatch,2);\n }\n w.nextMatch = pair.end + 3;\n return;\n};\n\n} //# end of 'install only once'\n//}}}
/***\n|''Name''|NestedBrowserMacro|\n|''Description''|Creates a browser pane inside a tiddler for viewing external pages.|\n|''Version''|0.1.1|\n|''Source''|[[Rodney's Corner|http://rodney.gotdns.com]] (mirror: [[FND's DevPad|http://devpad.tiddlyspot.com/#NestedBrowserMacro]])|\n|''Author''|[[RodneyGomes]]|\n|''Contributor''|FND|\n|''Type''|Macro|\n!Usage\nA name must be specified for the browser window in order to give for the back and forward buttons to work. Also required are the URL, width and height for the browser pane.\n{{{\n<<browse frameName url width height>>\n}}}\n!!Example\n{{{\n<<browse "Google" "http://www.google.com" "100%" "100px">>\n}}}\n<<browse "Google" "http://www.google.com" "100%" "100px">>\n!Limitations\nUses an //iframe//, which some browsers might not support.\n!Revision History\n!!v0.1.0 (2006-02-18)\n* initial release \n!!v0.1.1 (2007-10-04)\n* various adjustments of the meta description\n* mirrored at [[FND's DevPad|http://devpad.tiddlyspot.com/#NestedBrowserMacro]] as the original source is not available anymore\n!Code\n***/\n//{{{\nconfig.macros.browse = {};\n\nconfig.macros.browse.handler = function(place,macroName,params) {\n \n var frameName = params[0];\n var url = params[1];\n var width = params[2];\n var height = params[3];\n \n var myBackButton = document.createElement('a');\n myBackButton.href = "javascript:frames['" + frameName + "'].history.back()";\n var buttonText = document.createTextNode('[Back]');\n myBackButton.appendChild(buttonText);\n \n var myForwardButton = document.createElement('a');\n myForwardButton.href = "javascript:frames['" + frameName + "'].history.forward()";\n var buttonText = document.createTextNode('[Forward]');\n myForwardButton.appendChild(buttonText);\n \n var myIframe = document.createElement('iframe'); \n myIframe.name = frameName;\n myIframe.src = url;\n myIframe.style.width = width;\n myIframe.style.height = height;\n \n place.appendChild(myBackButton);\n place.appendChild(myForwardButton);\n place.appendChild(myIframe);\n \n}\n//}}}
/***\n|''Name''|NewFromHereMacro|\n|''Version''|0.9|\n|''Status''|stable|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#NewFromHereMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|Creates a new tiddler, using the originating tiddler's title as a prefix.|\n!Note\nThis macro is based upon the [[NewHerePlugin|http://mptw.tiddlyspot.com/#NewHerePlugin]].\n!Usage\n{{{\n<<newFromHere [parameters]>>\n}}}\nParameter handling is identical to the [[NewTiddler|http://www.tiddlywiki.com/#NewTiddlerMacro]] macro.\n!!Example\n<<newFromHere>>\n<<newFromHere label:"new tiddler from here">>\n!Revision History\n!!v0.9 (2007-12-27)\n* initial release\n!To Do\n* custom separator character\n* optional default tag\n!Code\n***/\n//{{{\nconfig.macros.newFromHere = {\n separator: ": "\n};\n\nconfig.macros.newFromHere.handler = function(place,macroName,params,wikifier,paramString,tiddler) {\n wikify("<<newTiddler " + paramString + " title:[[" + tiddler.title + this.separator + "]]>>",\n place,null,tiddler);\n};\n//}}}
/***\n|Name|OpenTaggedTiddlersMacro|\n|Source|[[FND's DevPad|http://devpad.tiddlyspot.com/#OpenTaggedTiddlersMacro]]|\n|Version|0.1.2|\n|Author|[[one_each|http://groups.google.com/group/TiddlyWiki/browse_thread/t/77d70c4e01e7c6fa]]|\n|Contributor|FND|\n|License|public domain|\n|~CoreVersion|1.2|\n|Type|macro|\n|Requires|N/A|\n|Overrides|N/A|\n|Description|open all tiddlers with a given tag|\n!Usage\n{{{\n<<openAll [[tag]] ["title:..."] [closeAllFirst]>>\n}}}\n!Options\nAlthough the tag is required as the first parameter, the options listed below are optional and may appear in any order.\n|!Option|!Description|\n|closeAllFirst|close all other tiddlers first|\n|<nowiki>title:Title</nowiki>|button caption (enclose in quotation marks if the text contains spaces)|\n!Examples\n|!Code|!Output|\n|{{{<<openAll systemConfig>>}}}|<<openAll systemConfig>>|\n|{{{<<openAll systemConfig closeAllFirst>>}}}|<<openAll systemConfig closeAllFirst>>|\n|{{{<<openAll systemConfig "title:Open system tiddlers">>}}}|<<openAll systemConfig "title:Open system tiddlers">>|\n!Revision History\n!!v0.1.1 (2005-09-01)\n* initial release [[by one_each|http://groups.google.com/group/TiddlyWiki/browse_thread/t/77d70c4e01e7c6fa]] (named "openAll macro")\n!!v0.1.2 (2005-06-30)\n* minor code cleanup by FND\n* removed {{{reverseOrder}}} parameter due to incompatibility with TiddlyWiki 2.2\n* renamed to OpenTaggedTiddlersMacro\n!Issues / To Do\n* code cleanup / refactoring\n!Code\n***/\n//{{{\nversion.extensions.openAll = {major: 0, minor: 1, revision: 1, date: new Date("Jun 30, 2007")};\nconfig.macros.openAll = {}\nconfig.macros.openAll.handler = function(place,macroName,params) {\n var title = "Open all " + params[0];\n var closeAllFirst = "false";\n for(var i = 1; i < params.length; i++) { // skip the first parameter\n if(params[i] == "closeAllFirst")\n closeAllFirst = "true";\n if(params[i].substring(0,6) == "title:")\n title = params[i].substring(6);\n }\n var btn = createTiddlyButton(place,title,null,onClickOpenAllMacro);\n btn.setAttribute("tag",params[0]);\n btn.setAttribute("closeAllFirst",closeAllFirst);\n}\n\n// Event handler for 'openAll' macro\nfunction onClickOpenAllMacro(e)\n{\n if (!e) var e = window.event;\n var tag = this.getAttribute("tag");\n var tagged = store.getTaggedTiddlers(tag);\n if(this.getAttribute("closeAllFirst") == "true")\n story.closeAllTiddlers();\n for(var t=tagged.length-1; t>=0; t--)\n displayTiddler(this,tagged[t].title,0,null,null,false,e.shiftKey || e.altKey);\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false);\n}\n//}}}
<!--{{{-->\n<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>\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 id='searchBar' macro="search"></span>\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 id='mainMenu' refresh='content' tiddler='MainMenu'></div>\n<div id='sidebar'>\n<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>\n<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>\n</div>\n<div id='displayArea'>\n<div id='messageArea'></div>\n<div id='tiddlerDisplay'></div>\n</div>\n<!--}}}-->
/***\n|''Name''|PaletteViewMacro|\n|''Version''|0.2|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#PaletteViewMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|Displays color palettes.|\n!Notes\nThere is also [[ViewPalettePlugin|http://simon.tiddlyspot.com/#ViewPalettePlugin]], which currently does not work with TiddlyWiki v2.2 though.\n!Usage\n{{{\n<<paletteView [tiddler name]>>\n}}}\n!!Example\n<<paletteView [[ColorPalette]]>>\n!Revision History\n!!v0.1 (2007-11-18)\n* initial release\n!!v0.2 (2007-11-20)\n* limited processing to slices containing [[actual color values|http://www.w3.org/TR/CSS21/syndata.html#color-units]]\n* changed fallback value to the tiddler the macro is called from (instead of using [[ColorPalette]])\n!To Do\n* selection list for all available palettes (tag-based)\n* parameter for custom table class\n* customizable column order\n* documentation (e.g. using from within [[ViewTemplate]])\n!Code\n***/\n//{{{\nconfig.macros.paletteView = {};\n\nconfig.macros.paletteView.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var title = params[0] || tiddler.title;\n //var palettes = store.getTaggedTiddlers(params[0]); // DEBUG: yet to be implemented\n var colors = store.calcAllSlices(title);\n var labels = [];\n for(var c in colors) {\n if(this.isColor(colors[c])) {\n labels.push(c);\n }\n }\n if(labels.length > 0) {\n var output = "|!Sample|!Value|!Name|h\sn";\n for(var i = 0; i < labels.length; i++) {\n output += "|padding:0 4em;background-color:" + colors[labels[i]] + ";&nbsp;|"\n + "{{{" + colors[labels[i]] + "}}}|"\n + "[[" + labels[i] + "|" + title + "]]|\sn";\n }\n wikify(output, place);\n }\n};\n\nconfig.macros.paletteView.isColor = function(s) {\n var colors = ["Black", "Green", "Silver", "Lime", "Gray", "Olive", "White", "Yellow",\n "Maroon", "Navy", "Red", "Blue", "Purple", "Teal", "Fuchsia", "Aqua", "Orange"];\n var match = s.match(/^#[0-9A-F]{3}$|^#[0-9A-F]{6}$|^RGB\s([\sd,\ss]{5,}\s)$/i);\n if(match) return true;\n if(colors.contains(s)) return true;\n return false;\n};\n//}}}
/***\n|''Name''|ParagraphFormatter|\n|''Description''|formatter modifying TiddlyWiki's handling of line breaks|\n|''Author:''|FND|\n|''Version''|0.1.1|\n|''Status''|@@beta@@|\n|''Source''|http://devpad.tiddlyspot.com/#ParagraphFormatter|\n|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n!Description\nThis formatter modifies the way line breaks in wiki markup are rendered;\nsingle line breaks are ignored, two line breaks result in a blank line being inserted.\n!Usage\n!!Examples\n{{{\nlorem\nipsum\n\ndolor\nsit\namet\n}}}\n<<<\nlorem\nipsum\n\ndolor\nsit\namet\n<<<\n!Revision History\n!!v0.1 (2008-12-03)\n* initial release\n!Code\n***/\n//{{{\n(function(formatters) { //# set up alias\n\n// modify line-break formatter\nvar lineBreak = formatters[formatters.findByField("name", "lineBreak")];\nlineBreak.match = "<br ?/?>";\n// create paragraph formatter\nformatters.push({\n name: "paragraph",\n match: "\s\sn\s\sn",\n handler: function(w) {\n createTiddlyElement(w.output, "br");\n createTiddlyElement(w.output, "br");\n }\n});\n\n})(config.formatters); //# end of alias\n//}}}
/***\n|''Name:''|PasswordOptionPlugin|\n|''Description:''|Extends TiddlyWiki options with non encrypted password option.|\n|''Version:''|1.0.2|\n|''Date:''|Apr 19, 2007|\n|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|\n|''Author:''|BidiX (BidiX (at) bidix (dot) info)|\n|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|\n|''~CoreVersion:''|2.2.0 (Beta 5)|\n***/\n//{{{\nversion.extensions.PasswordOptionPlugin = {\n major: 1, minor: 0, revision: 2, \n date: new Date("Apr 19, 2007"),\n source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',\n author: 'BidiX (BidiX (at) bidix (dot) info',\n license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',\n coreVersion: '2.2.0 (Beta 5)'\n};\n\nconfig.macros.option.passwordCheckboxLabel = "Save this password on this computer";\nconfig.macros.option.passwordInputType = "password"; // password | text\nsetStylesheet(".pasOptionInput {width: 11em;}\sn","passwordInputTypeStyle");\n\nmerge(config.macros.option.types, {\n 'pas': {\n elementType: "input",\n valueField: "value",\n eventName: "onkeyup",\n className: "pasOptionInput",\n typeValue: config.macros.option.passwordInputType,\n create: function(place,type,opt,className,desc) {\n // password field\n config.macros.option.genericCreate(place,'pas',opt,className,desc);\n // checkbox linked with this password "save this password on this computer"\n config.macros.option.genericCreate(place,'chk','chk'+opt,className,desc); \n // text savePasswordCheckboxLabel\n place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));\n },\n onChange: config.macros.option.genericOnChange\n }\n});\n\nmerge(config.optionHandlers['chk'], {\n get: function(name) {\n // is there an option linked with this chk ?\n var opt = name.substr(3);\n if (config.options[opt]) \n saveOptionCookie(opt);\n return config.options[name] ? "true" : "false";\n }\n});\n\nmerge(config.optionHandlers, {\n 'pas': {\n get: function(name) {\n if (config.options["chk"+name]) {\n return encodeCookie(config.options[name].toString());\n } else {\n return "";\n }\n },\n set: function(name,value) {config.options[name] = decodeCookie(value);}\n }\n});\n\n// need to reload options to load passwordOptions\nloadOptionsCookie();\n\n/*\nif (!config.options['pasPassword'])\n config.options['pasPassword'] = '';\n\nmerge(config.optionsDesc,{\n pasPassword: "Test password"\n });\n*/\n//}}}
/***\n|''Name''|PasswordPromptMacro|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#PasswordPromptMacro]]|\n|''Version''|0.8|\n|''Author''|FND|\n|''Contributors''|[[Lewcid|http://tw.lewcid.org]], [[BidiX|http://www.bidix.info]]|\n|''License''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|create a prompt for password input|\n<<<\n''N.B.'' [[PasswordPromptMacro]] has been superseded by [[PasswordPromptPlugin]]\n<<<\n!Usage Notes\n* styling can be customized in the [[StyleSheetPasswordPrompt]] shadow tiddler\n!Revision History\n!!v0.1 (2007-07-19)\n* initial proof-of-concept implementation\n!!v0.8 (2007-07-21)\n* fixed IE issues (thanks Saq and BidiX)\n* made ENTER/RETURN key trigger the password check\n* various changes and improvements\n!To Do\n* {{{checkPassword()}}}: provide "interface" for other plugins to use this functionality (cf. {{{displayMessage()}}}) <br>&rArr; read/write password from/to custom variable ({{{config.macros.passwordPrompt.password}}}?) or use function call(??) instead of using macro parameter<br>&rArr; encryption issues!?\n* fix positioning issue in IE (caused by negative margin)\n* clean up code<br>&rArr; remove/fix {{{DEBUG}}} flags<br>&rArr; use {{{this}}} instead of {{{config.macros.passwordPrompt}}}\n* documentation\n!Code\n***/\n//{{{\n/*\n** Styles (can be customized in the StyleSheetPasswordPrompt shadow tiddler)\n*/\n\nconfig.shadowTiddlers.StyleSheetPasswordPrompt = "/*{{{*/\sn"\n + "#passwordPrompt {\sn"\n + "\stz-index: 100;\sn"\n + "\stposition: absolute;\sn"\n + "\sttop: 50%;\sn"\n + "\stleft: 50%;\sn"\n + "\stwidth: 15em;\sn"\n + "\stheight: 4.5em;\sn"\n + "\stline-height: 1.3em;\sn"\n + "\stmargin: -2em 0 0 -5em;\sn"\n + "\stborder: 2px solid #AAA;\sn"\n + "\stpadding: 10px;\sn"\n + "\sttext-align: center;\sn"\n + "\stbackground-color: #EEE;\sn"\n + "}\sn"\n + "/*}}}*/";\nstore.addNotification("StyleSheetPasswordPrompt", refreshStyles);\n\n/*\n** Macro Code\n*/\n\nconfig.macros.passwordPrompt = { label: "toggle prompt", prompt: "show/hide password prompt" };\nconfig.macros.passwordPrompt.handler = \nfunction(place, macroName, params, wikifier, paramString, tiddler) {\n if(!readOnly) {\n createTiddlyButton(place, this.label, this.prompt, function() {\n // process parameters -- DEBUG: obsolete (for testing purposes only)?\n if (params[0]) {\n config.macros.passwordPrompt.password = params[0];\n } else {\n config.macros.passwordPrompt.password = "";\n }\n // toggle password prompt\n config.macros.passwordPrompt.togglePrompt(this);\n return false;\n }, null, null, this.accessKey\n );\n }\n}\n\n/*\n** Main Code\n*/\n\nconfig.macros.passwordPrompt.togglePrompt = function() {\n var e = document.getElementById("passwordPrompt");\n if(!e) {\n // create display container for password prompt\n var r = createTiddlyElement(document.body, "form");\n r.setAttribute("id", "passwordPrompt");\n r.setAttribute("action", "");\n r.setAttribute("onsubmit", "return false"); // DEBUG: valid? obsolete (cf. i.onKeyPress)?\n // create label\n var l = createTiddlyElement(r, "label", null, null, "Enter password:");\n l.setAttribute("for", "passwordField");\n // create password field\n var i = document.createElement ("input");\n i.setAttribute("id", "passwordField");\n i.setAttribute("type","password");\n i.onkeypress = function(e) { e = e; return config.macros.passwordPrompt.checkEnter(e); };\n r.appendChild(i); // needs to be done *after* setting the type attribute\n // create separator\n createTiddlyElement(r, "br");\n // create submit button\n var b = document.createElement ("input");\n b.setAttribute("type","button");\n b.setAttribute("value", "ok");\n b.onclick = config.macros.passwordPrompt.checkPassword;\n r.appendChild(b); // needs to be done *after* setting the type attribute\n // select password field\n i.focus();\n } else {\n // remove input field\n e.parentNode.removeChild(e);\n }\n}\n\nconfig.macros.passwordPrompt.checkPassword = function() {\n var e = document.getElementById("passwordField");\n if(e.value === config.macros.passwordPrompt.password) {\n config.macros.passwordPrompt.togglePrompt();\n alert("password correct"); // DEBUG: for testing purposes only\n }\n else\n alert("password incorrect");\n}\n\nconfig.macros.passwordPrompt.checkEnter = function(e) {\n // retrieve key code\n if(!e)\n var e = window.event;\n if(e.keyCode)\n var code = e.keyCode;\n else if(e.which)\n var code = e.which;\n // check key code\n if(code == 13) // ENTER key\n this.checkPassword();\n return true;\n}\n//}}}
/***\n|''Name''|PasswordPromptPlugin|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#PasswordPromptMacro]]|\n|''Version''|0.95|\n|''Author''|FND|\n|''Contributors''|[[Lewcid|http://tw.lewcid.org]], [[BidiX|http://www.bidix.info]], [[Loic|http://dachary.org]]|\n|''License''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|create a prompt for masked password inputs|\n!Usage Notes\n* {{{passwordPrompt.handler(promptString, callbackFunction);}}}, whereas the callback function takes the prompt's inputs as parameter\n* styling can be customized in the [[StyleSheetPasswordPrompt]] shadow tiddler\n!Revision History\n!!v0.1 (2007-07-19)\n* initial proof-of-concept implementation\n!!v0.8 (2007-07-21)\n* fixed IE issues (thanks Saq and BidiX)\n* made ENTER/RETURN key trigger the password check\n* various changes and improvements\n!!v0.9 (2007-07-22)\n* converted from a macro to a general-purpose component (function library)\n!!v0.95 (2007-08-05)\n* corrected callback usage (thanks Loic)\n!To Do\n* add cancel button\n* clean up code<br>&rArr; remove/fix {{{DEBUG}}} flags<br>&rArr; use {{{this.}}} instead of {{{passwordPrompt.}}}\n* documentation\n* fix positioning issue in IE (not perfectly centered due to issues with negative margin)\n!Code\n***/\n//{{{\n/*\n** Styles (can be customized in the StyleSheetPasswordPrompt shadow tiddler)\n*/\n\nconfig.shadowTiddlers.StyleSheetPasswordPrompt = "/*{{{*/\sn"\n + "#passwordPrompt {\sn"\n + "\stz-index: 100;\sn"\n + "\stposition: absolute;\sn"\n + "\sttop: 50%;\sn"\n + "\stleft: 50%;\sn"\n + "\stwidth: 15em;\sn"\n + "\stheight: 4.5em;\sn"\n + "\stline-height: 1.3em;\sn"\n + "\stmargin: -2em 0 0 -5em;\sn"\n + "\stborder: 2px solid #AAA;\sn"\n + "\stpadding: 10px;\sn"\n + "\sttext-align: center;\sn"\n + "\stbackground-color: #EEE;\sn"\n + "}\sn\sn"\n + "#passwordPrompt label {\sn"\n + "\stdisplay: block;\sn"\n + "}\sn\sn"\n + "* html #passwordPrompt { /* IE fix */\sn"\n + "\stmargin: 0;\sn"\n + "}\sn"\n + "/*}}}*/";\nstore.addNotification("StyleSheetPasswordPrompt", refreshStyles);\n\n/*\n** Password Prompt class\n*/\n\npasswordPrompt = {}\n\npasswordPrompt.handler = function(promptString, callback) {\n passwordPrompt.togglePrompt(promptString, callback);\n return false; // DEBUG: obsolete/nonsense!?\n}\n\npasswordPrompt.togglePrompt = function(promptString, callback) {\n var e = document.getElementById("passwordPrompt");\n if(!e) {\n // create display container for password prompt\n var r = createTiddlyElement(document.body, "form");\n r.setAttribute("id", "passwordPrompt");\n r.setAttribute("action", "");\n r.setAttribute("onsubmit", "return false"); // DEBUG: valid? obsolete (cf. i.onKeyPress)?\n // create label\n var l = createTiddlyElement(r, "label", null, null, promptString);\n l.setAttribute("for", "passwordField");\n // create password field\n var i = document.createElement("input");\n i.setAttribute("id", "passwordField");\n i.setAttribute("type","password");\n i.onkeypress = function(e, callback) { e = e || window.event; return passwordPrompt.checkEnter(e, callback); }; // DEBUG: "e = e || window.event;"??\n r.appendChild(i); // needs to be done *after* setting the type attribute\n // create separator\n createTiddlyElement(r, "br");\n // create submit button\n var b = document.createElement ("input");\n b.setAttribute("type","button");\n b.setAttribute("value", "ok");\n b.onclick = function() { passwordPrompt.checkPassword(callback); }\n r.appendChild(b); // needs to be done *after* setting the type attribute\n // select password field\n i.focus();\n } else {\n // remove input field\n e.parentNode.removeChild(e);\n }\n return false; // DEBUG: obsolete/nonsense!?\n}\n\npasswordPrompt.checkPassword = function(callback) {\n var e = document.getElementById("passwordField");\n passwordPrompt.togglePrompt();\n return callback(e.value);\n}\n\npasswordPrompt.checkEnter = function(e, callback) {\n // retrieve key code\n if(!e)\n var e = window.event;\n if(e.keyCode)\n var code = e.keyCode;\n else if(e.which)\n var code = e.which;\n // check key code\n if(code == 13) // ENTER key\n this.checkPassword(callback);\n // do not suppress key presses\n return true;\n}\n//}}}
//{{{\npasswordPrompt.handler("test", passwordPromptTest);\n\nfunction passwordPromptTest(inputs) {\n if(inputs === null)\n alert("'inputs' is null");\n else if(inputs === "")\n alert("'inputs' is empty");\n else\n alert("'inputs' is\sn" + inputs);\n}\n//}}}
This is the sandbox for testing the [[PasswordPromptMacro]].\n\n/%<<passwordPrompt>> (password: none)%/\n/%<<passwordPrompt "test">> (password: "test")%/
/***\n|''Name''|PrintMacro|\n|''Version''|0.1|\n|''Status''|@@experimental@@|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#PrintMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|prints the current document|\n!Usage\n{{{\n<<print [label] [tooltip] [class] [access key]>>\n}}}\n<<print>>\n!Revision History\n!!v0.1 (2007-12-10)\n* initial release\n!Code\n***/\n//{{{\nconfig.macros.print = {\n label: "print",\n prompt: "print document",\n buttonClass: "",\n accessKey: ""\n};\n\nconfig.macros.print.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var label = params[0] || this.label;\n var prompt = params[1] || this.prompt;\n var buttonClass = params[2] || this.buttonClass;\n var accessKey = params[3] || this.accessKey;\n createTiddlyButton(place, label, prompt,\n function() { window.print(); },\n buttonClass, null, accessKey);\n}\n//}}}
/***\n|''Name''|RandomSliceMacro|\n|''Version''|0.1|\n|''Status''|@@experimental@@|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#RandomSliceMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|Fetches a random slice from a given tiddler.|\n!Usage\n{{{\n<<randomSlice [tiddler name] [show label] [separator string]>>\n}}}\n!!Examples\n<<randomSlice [[ColorPalette]]>>\n<<randomSlice [[ColorPalette]] true "::">>\n!Revision History\n!!v0.1 (2007-12-16)\n* initial release\n!To Do\n* documentation\n* custom label position (pre-/suffix)\n!Code\n***/\n//{{{\nconfig.macros.randomSlice = {};\n\nconfig.macros.randomSlice.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var title = params[0] || tiddler.title;\n var showLabel = params[1] || false;\n var separator = params[2] || ": ";\n var slices = store.calcAllSlices(title);\n var labels = [];\n for(var name in slices) { // use Hash.keys() instead? cf. http://rick.measham.id.au/javascript/hash.htm\n labels.push(name);\n }\n if(labels.length > 0) {\n var r = Math.round((labels.length - 1) * Math.random());\n var value = slices[labels[r]];\n if(showLabel) {\n var output = labels[r] + separator + value;\n } else {\n var output = value;\n }\n wikify(output, place);\n }\n};\n//}}}
/***\n|''Name''|RawTextAdaptor|\n|''Description''|adaptor for importing plain-text files (e.g. from Subversion) as tiddlers|\n|''Author''|FND|\n|''Version''|0.2.3|\n|''Status''|@@beta@@|\n|''Source''|http://devpad.tiddlyspot.com/#RawTextAdaptor|\n|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/adaptors/|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''CoreVersion''|2.5|\n!Revision History\n!!v0.1 (2008-10-28)\n* initial release\n!To Do\n* properly normalize URIs (cf. {{{trimURI}}})\n!Code\n***/\n//{{{\nif(!version.extensions.RawTextAdaptor) { //# ensure that the plugin is only installed once\nversion.extensions.RawTextAdaptor = { installed: true };\n\nconfig.adaptors.rawtext = function() {};\n\n(function(adaptor) { //# set up alias\n\nadaptor.prototype = new AdaptorBase();\nadaptor.serverType = "rawtext";\nadaptor.serverLabel = "Raw Text";\nadaptor.defaultModifier = "..."; // XXX: use empty string?\n\nadaptor.prototype.getWorkspaceList = function(context, userParams, callback) {\n context = this.setContext(context, userParams, callback);\n context.workspaces = [{ title: "N/A" }];\n if(context.callback) {\n context.status = true;\n window.setTimeout(function() { callback(context, context.userParams); }, 0);\n }\n return true;\n};\n\nadaptor.prototype.getTiddlerList = function(context, userParams, callback) {\n context = this.setContext(context, userParams, callback);\n if(context.callback) {\n context.status = true;\n var filename = adaptor.trimURI(context.host).split("/").pop();\n context.tiddlers = [adaptor.createTiddler(filename)];\n window.setTimeout(function() { callback(context, context.userParams); }, 0);\n }\n return true;\n};\n\nadaptor.prototype.getTiddler = function(title, context, userParams, callback) {\n context = this.setContext(context, userParams, callback);\n if(!context.tiddler) {\n context.tiddler = adaptor.createTiddler(title);\n }\n context.tiddler.fields["server.type"] = adaptor.serverType;\n context.tiddler.fields["server.host"] = AdaptorBase.minHostName(context.host);\n var req = httpReq("GET", context.host, adaptor.getTiddlerCallback, context);\n return typeof req == "string" ? req : true;\n};\n\nadaptor.getTiddlerCallback = function(status, context, responseText, uri, xhr) {\n context.status = status;\n context.statusText = xhr.statusText;\n context.httpStatus = xhr.status;\n if(status) {\n context.tiddler.text = responseText;\n }\n if(context.callback) {\n context.callback(context, context.userParams);\n }\n};\n\n// create tiddler from filename\nadaptor.createTiddler = function(filename) {\n var tiddler = new Tiddler(filename);\n var pos = filename.lastIndexOf(".");\n if(pos != -1) { // strip file extension\n tiddler.title = filename.substr(0, pos); //# N.B.: altering title is acceptable since it's not used as URI component\n if(filename.substr(pos) == ".js") { // treat as plugin\n tiddler.tags = ["systemConfig"];\n }\n }\n tiddler.created = new Date();\n tiddler.modified = tiddler.created;\n tiddler.modifier = adaptor.defaultModifier;\n return tiddler;\n};\n\n// strip fragments and parameters from URI\nadaptor.trimURI = function(uri) {\n return uri.split("#")[0].split("?")[0];\n}\n\n})(config.adaptors.rawtext); //# end of alias\n\n} //# end of "install only once"\n//}}}
{{annotation{(via [[MathCell TiddlyWiki|http://genisis329.googlepages.com/TWMath.html#%5B%5BRegexp%20Tester%5D%5D]])}}}\n<html><form><table style="width: 80%; right: 0em;"><tbody><tr><td>REGEX</td><td><input type="text" name="regex" style="width: 100%;"></input></td></tr><tr><td>\nFLAGS</td><td style="text-align: right;">Global<input type="checkbox" name="g"><br/>Multiline<input type="checkbox" name="m"><br/>Ignore Case<input type="checkbox" name="i"></td></tr><tr>\n<td>STRING</td><td><textarea type="text" name="string" style="width: 100%; height: 5em;"></textarea></td></tr>\n<tr><td></td><td style="text-align: right;"><input type="button" value="execute" onclick="\nvar flagging = []\nif(this.form.g.checked)flagging.push('g');\nif(this.form.i.checked)flagging.push('i');\nif(this.form.m.checked)flagging.push('m');\nvar Reg = new RegExp(this.form.regex.value,flagging.join(''));\nvar result =this.form.string.value.match(Reg);\nfor(var i = 0; i < result.length;i++){alert(result[i].toSource())}\nthis.form.lastChild.innerHTML = result.join(&quot;&lt;hr/&gt;&quot;);\n"></input></td></tr></tbody></table>\n<br/>RESULT<hr/>\n<pre name="results"></pre></form>\n</html>
/***\n|''Name''|RelativeLinkMacro|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#RelativeLinkMacro]]|\n|''Version''|0.2|\n|''Author''|FND|\n|''License''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|creates PrettyLinks relative to the current tiddler|\n!Usage Notes\n{{{\n<<relLink "sub-tiddler" ["link title"]>>\n}}}\n!!Examples\n* {{{<<relLink "SubTiddler">>}}}: <<relLink "SubTiddler">>\n* {{{<<relLink "SubTiddler" "custom link title">>}}}: <<relLink "SubTiddler" "custom link title">>\n!Revision History\n!!v0.1 (2007-08-10)\n* initial proof-of-concept implementation\n!!v0.2 (2007-08-10)\n* added optional parameter for link title\n!To Do\n* rename plugin(?)\n* adjust description\n!Code\n***/\n//{{{\nconfig.macros.relLink = {}\nconfig.macros.relLink.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n if(!params[1])\n var link = "[[" + tiddler.title + params[0] + "]]";\n else\n var link = "[[" + params[1] + "|" + tiddler.title + params[0] + "]]";\n wikify(link, place);\n}\n//}}}
/***\nRemoteBackgroundPlugin v1.0 (2007-02-19)\n by FND\n\nRetrieves a random image from XKCD and uses it as background image.\n\n''N.B.:'' Do not abuse this; retrieving the images from XKCD could be regarded as hotlinking!\n!!Changelog\n!!!v0.9 (2007-02-18)\n* initial release\n!!!v1.0 (2007-02-19)\n* added ability to position background image\n* minor code adjustments\n!!ToDo\n* wait until TiddlyWiki loaded has completed before loading remote data\n* extensive bug-testing (esp. non-Mozilla browsers)\n!!Code\n***/\n/*{{{*/\nsetBgImg();\n\n// set background image\nfunction setBgImg() {\n if (img() != null) {\n document.body.style.backgroundImage = "url(" + img()[0] + ")";\n document.body.style.backgroundRepeat = "no-repeat";\n document.body.style.backgroundPosition = "center";\n document.body.style.backgroundAttachment = "fixed";\n document.body.title = img()[1];\n } else {\n alert("error fetching remote image");\n }\n}\n\n// fetch image URL\nfunction img() {\n // get remote location\n var maxCount = 225; // current amount of comcics - 2007-02-19\n var counter = Math.ceil(Math.random() * maxCount);\n var remoteSite = "http://xkcd.com/c" + counter + ".html";\n // fetch remote image\n var XmlHttp = true;\n var source = null;\n try { // query for permission to access remote file\n netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");\n } catch (e) {\n XmlHttp = false;\n }\n // initiate XmlHttp\n if (typeof XMLHttpRequest != 'undefined') { // Mozilla, Opera, Safari and Internet Explorer 7\n XmlHttp = new XMLHttpRequest();\n }\n if (!XmlHttp) { // Internet Explorer 6 and older\n try {\n XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");\n } catch(e) {\n try {\n XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");\n } catch(e) {\n XmlHttp = null;\n }\n }\n }\n // get remote document\n if (XmlHttp != false) {\n XmlHttp = new XMLHttpRequest();\n if (XmlHttp) {\n // establish connection\n XmlHttp.open('GET', remoteSite, false);\n XmlHttp.send(null);\n // get image URL\n //source = XmlHttp.responseXML.getElementsByTagName('img')[1].src; // source data no valid XML => RexEx workaround\n var extract = XmlHttp.responseText.match(/<img src="(.+)" title="(.+)" alt/i);\n image = new Array(extract[1], extract[2]); // store URL and title value\n }\n }\n return image;\n}\n/*}}}*/
/***\n|''Name''|SearchTagPlugin|\n|''Description''|adds web-search links to internal wiki links|\n|''Author''|FND|\n|''Version''|0.1|\n|''Status''|@@experimental@@|\n|''Source''|http://devpad.tiddlyspot.com/#SearchTagPlugin|\n|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/|\n|''License''|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n!Notes\nAlso see http://www.aboutus.org/TiddlyWikiGoogleTagCombinations.\n!Revision History\n!!v0.1 (2008-07-16)\n* initial release\n!Code\n***/\n//{{{\nif(!version.extensions.SearchTagPlugin) {\nversion.extensions.SearchTagPlugin = {\n installed: true,\n URL: "http://google.com/search?q=",\n label: "[G]"\n};\n \n// hijack createTiddlyLink() to prepend search link\ncreateTiddlyLink_SearchTag = window.createTiddlyLink;\nwindow.createTiddlyLink = function(place, title, includeText, className, isStatic, linkedFromTiddler, noToggle) {\n var cfg = version.extensions.SearchTagPlugin;\n createTiddlyText(createExternalLink(place, cfg.URL + title), cfg.label);\n createTiddlyText(place, " ");\n return createTiddlyLink_SearchTag.apply(this, arguments);\n};\n\n} //# end of "install only once"\n//}}}
/***\n|''Name:''|SearchTextTweaks|\n|''Description:''|adds descriptive text to the search box|\n|''Author:''|Saq Imtiaz (lewcid@gmail.com)|\n|''Contributor:''|FND|\n|''Source:''|http://tw.lewcid.org/#SearchTextTweaks|\n|''Code Repository:''|http://tw.lewcid.org/svn/plugins|\n|''Version:''|2.0 beta|\n|''Date:''|2007-09-09|\n|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion:''|2.1|\n!Configuration\nUsing [[StyleSheet]], the {{{inactive}}} class can be used to change the search box's style (using CSS) when it is not active.\nFor example, the following code dims the text in the search box when it is not active:\n{{{\n.inactive { color: #aaa; }\n}}}\n***/\n// /%\n//!BEGIN-PLUGIN-CODE\n//{{{\nconfig.macros.search.defaultText = "Search";\n\nconfig.macros.search.old_handler = config.macros.search.handler;\nconfig.macros.search.handler = function(place,macroName,params) {\n this.old_handler.apply(this,arguments);\n var e = place.lastChild;\n e.setAttribute("defaultText",params[0]||this.defaultText);\n e.value = e.getAttribute("defaultText");\n e.onblur = function() {\n if(this.value == '' || !this.value)\n this.value = this.getAttribute("defaultText");\n addClass(this, "inactive");\n };\n};\n\nconfig.macros.search.onFocus = function(e) {\n if(this.value == this.getAttribute("defaultText"))\n this.value = '';\n removeClass(this, "inactive");\n this.select();\n};\n//}}}\n//!END-PLUGIN-CODE\n// %/
<<closeAll>><<permaview>><<newTiddler>>{{separator{ }}}<<saveChanges>><<doBackup>><<tiddler TspotSidebar>>{{separator{ }}}<<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
/***\n|Name|SimpleCommentsPlugin|\n|Source|[[FND's DevPad|http://devpad.tiddlyspot.com/#SimpleCommentsPlugin]]|\n|Version|0.7|\n|Author|FND|\n|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires|N/A|\n|Overrides|N/A|\n|Description|add comments to a tiddler|\n!Usage\nAdd {{{<<addComment>>}}} to the desired tiddler(s).\nAlternatively, add the following to the tiddler toolbar (usually in ViewTemplate, {{{<div class='toolbar' macro='...'>}}}): {{{addComment}}} (currently untested)\n\n''N.B.:'' For now, TiddlyWiki needs to be saved manually after adding a comment, thus making this plugin rather unsuitable for read-only TiddlyWikis.\n!Changelog\n!!v0.5 (2007-05-08)\n* initial release\n!!v0.6 (2007-05-10)\n* moved required styles into a shadow tiddler\n!!v0.7 (2007-05-14)\n* complete rewrite from DOM-based to string-based processing\n!Issues / To Do\n* proper creation of command buttons\n* global option and/or macro parameter for reverseOrder\n* revise CSS properties\n* review code (esp. section marked with DEBUG)\n* some functions/routines might be redundant (i.e. already present in the TiddlyWiki core, e.g. {{{trim()}}}, {{{IsoTimestamp()}}} & {{{zeroPad()}}}?)\n!Code\n***/\n//{{{\n/*\n** Styles (can be customized in the StyleSheetSimpleComments shadow tiddler)\n*/\n\nconfig.shadowTiddlers.StyleSheetSimpleComments = "/*{{{*/\sn"\n + ".comments {\sn\stmargin-top: 2em;\sn\stpadding: 1em 4px 4px;\sn\stborder-top: 2px ridge #AAA;\sn\stbackground-color: #F8F8F8;\sn}\sn\sn"\n + ".comments .comment {\sn\stmargin: 0.5em 1em;\sn\stpadding: 4px;\sn\stborder: 1px solid #AAA;\sn\stbackground-color: #FFF;\sn}\sn\sn"\n + ".comments .comment h1,\sn.comments .comment h2 {\sn\stmargin: 0 0 0.2em;\sn\stpadding: 0;\sn\stborder-bottom: 1px solid #AAA;\sn\stbackground-color: transparent;\sn}\sn\sn"\n + ".comments .comment h1 {\sn\stfloat: right;\sn}\sn\sn"\n + ".comments .comment p {\sn\stmargin: 0 0 0.2em;\sn}\sn"\n + "/*}}}*/";\nstore.addNotification("StyleSheetSimpleComments", refreshStyles);\n\n/*\n** Command Buttons\n*/\n\n/* Macro Button */\n// adapted from Jack's DoBackupMacro (http://groups.google.com/group/TiddlyWiki/browse_thread/thread/5f1123d08bdadeac/86245d5e4bbe846c)\nconfig.macros.addComment = { label: "Add comment", prompt: "Add a new comment" }; // DEBUG: prompt not needed!?\nconfig.macros.addComment.handler = function(place) {\n if(!readOnly) {\n createTiddlyButton(place, this.label, this.prompt, function() {\n addTiddlerComment(this);\n return false; // DEBUG: ?\n }, null, null, this.accessKey\n ); // DEBUG - to do: look up createTiddlyButton()'s parameters\n }\n}\n\n/* Toolbar Button */\nconfig.commands.addComment = { text: "Add comment", tooltip: "Add a comment" }\nconfig.commands.addComment.handler = function() {\n addTiddlerComment(this); // DEBUG: does that work?\n}\n\n/*\n** Script\n*/\n\n// adapted from Eric Shulman's CommentScript (http://www.tiddlytools.com/#CommentScript)\naddTiddlerComment = function(place) {\n // select current tiddler\n var here = story.findContainingTiddler(place);\n if (!here) {\n alert("error: no tiddler specified");\n return;\n }\n var title = here.getAttribute("tiddler");\n var tiddler = store.getTiddler(title);\n // retrieve tiddler sections\n var tiddlerContentsPre = tiddler.text + "\sn";\n var tiddlerComments = "";\n var tiddlerContentsPost = "";\n var RegEx = /^([\sS\ss]*)\s{\s{comments\s{((?:\s{\s{comment\s{[^}]*\s}\s}\s}|\ss+)*)\s}\s}\s}([\sS\ss]*)$/i; // RegEx provided by Andreas "Qtax" Zetterlund (www.qtax.se)\n var tiddlerContents = RegEx.exec(tiddler.text);\n if (tiddlerContents != null) {\n tiddlerContentsPre = tiddlerContents[1];\n tiddlerComments += lTrim(tiddlerContents[2]); // assuming there is only a single comments section per tiddler\n tiddlerContentsPost = tiddlerContents[3];\n }\n // append comment\n var reverseOrder = false; // DEBUG: global option!?\n if (reverseOrder) {\n tiddlerComments = newComment() + "\sn" + tiddlerComments;\n } else {\n tiddlerComments += newComment() + "\sn";\n }\n tiddlerComments = "{{comments{\sn" + tiddlerComments + "}}}";\n // re-create tiddler contents\n tiddlerContents = tiddlerContentsPre + tiddlerComments + tiddlerContentsPost;\n // store new tiddler contents\n store.saveTiddler(tiddler.title, tiddler.title, tiddlerContents, tiddler.modifier, tiddler.modified, tiddler.tags); // DEBUG: look up saveTiddler()'s parameters\n story.refreshTiddler(title, 1, true); // DEBUG: look up refreshTiddler()'s parameters\n // DEBUG: save file automatically? (could also be uploaded if the respective plugin is installed)\n}\n\nfunction newComment() {\n // get comment\n var comment = getComment();\n // create comment\n if (comment != null) {\n // get username\n getUserName();\n // get timestamp\n var now = new Date();\n var timestamp = IsoTimestamp(now, true); // use UTC -- DEBUG: use toLocaleString()?; make UTC a macro parameter\n // add timestamp and username\n comment = "{{comment{\sn"\n + "!" + timestamp + "\sn"\n + "!!" + config.options.txtUserName + "\sn"\n + comment + "\sn"\n + "}}}";\n }\n return comment;\n}\n\nfunction getComment() { // DEBUG: use temporary textarea instead of dialog box?\n var comment = prompt("Please enter your comment (wiki markup is allowed).", "");\n comment = trim(comment);\n if (comment == "") { // disallow empty comments\n getComment();\n }\n return comment;\n}\n\nfunction getUserName() {\n if (config.options.txtUserName == "" || config.options.txtUserName == null) { // does not accept "Cancel"!\n config.options.txtUserName = prompt("Please enter your username.", config.options.txtUserName);\n config.options.txtUserName = trim(config.options.txtUserName);\n getUserName(); // check for empty username\n }\n}\n\nfunction IsoTimestamp(date, UTC) {\n var date = new Date(date)\n if (UTC == true) {\n date = date.getUTCFullYear() + "-"\n + zeroPad(date.getUTCMonth() + 1, 2) + "-"\n + zeroPad(date.getUTCDate(), 2) + " "\n + zeroPad(date.getUTCHours(), 2) + ":"\n + zeroPad(date.getUTCMinutes(), 2)\n + " UTC";\n } else { \n date = date.getFullYear() + "-"\n + zeroPad(date.getMonth() + 1, 2) + "-"\n + zeroPad(date.getDate(), 2) + " "\n + zeroPad(date.getHours(), 2) + ":"\n + zeroPad(date.getMinutes(), 2);\n }\n return date;\n}\n\nfunction zeroPad(number, digits) {\n var s = String(number);\n while (s.length < digits)\n s = '0' + s;\n return s;\n}\n\n// remove leading whitespaces\nfunction lTrim(str) {\n var RE = /^\ss*((\sS+\ss*)*)$/;\n return str.replace(RE, "$1");\n}\n\n// remove trailing whitespaces\nfunction rTrim(str) {\n var RE = /^((\ss*\sS+)*)\ss*$/;\n return str.replace(RE, "$1");\n}\n\n// remove leading and trailing whitespaces\nfunction trim(str) {\n return lTrim(rTrim(str));\n}\n//}}}
This is the sandbox for testing the SimpleCommentsPlugin.\nAdd comments by using the button below.\nThe styling can be changed in the StyleSheetSimpleComments shadow tiddler.\n\n<<addComment>>\n{{comments{\n{{comment{\n!2007-05-14 15:10 UTC\n!!FND\nFrist!!111!!!!\n}}}\n}}}\n@@display:block;width:50%;margin:1em auto;border:1px dashed #aaa;padding:0.5em;text-align:center;background-color:#fffff1;Please specify your username:\n<<option txtUserName>>\n@@
/***\n|''Name''|SimpleSearchPlugin|\n|''Description''|displays search results as a simple list of matching tiddlers|\n|''Authors''|FND|\n|''Version''|0.4.1|\n|''Status''|stable|\n|''Source''|http://devpad.tiddlyspot.com/#SimpleSearchPlugin|\n|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/SimpleSearchPlugin.js|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''Keywords''|search|\n!Revision History\n!!v0.2.0 (2008-08-18)\n* initial release\n!!v0.3.0 (2008-08-19)\n* added Open All button (renders Classic Search option obsolete)\n* sorting by relevance (title matches before content matches)\n!!v0.4.0 (2008-08-26)\n* added tag matching\n!To Do\n* tag matching optional\n* animations for container creation and removal\n* when clicking on search results, do not scroll to the respective tiddler (optional)\n* use template for search results\n!Code\n***/\n//{{{\nif(!version.extensions.SimpleSearchPlugin) { //# ensure that the plugin is only installed once\nversion.extensions.SimpleSearchPlugin = { installed: true };\n\nif(!config.extensions) { config.extensions = {}; }\n\nconfig.extensions.SimpleSearchPlugin = {\n heading: "Search Results",\n containerId: "searchResults",\n btnCloseLabel: "close",\n btnCloseTooltip: "dismiss search results",\n btnCloseId: "search_close",\n btnOpenLabel: "Open all",\n btnOpenTooltip: "open all search results",\n btnOpenId: "search_open",\n\n displayResults: function(matches, query) {\n story.refreshAllTiddlers(true); // update highlighting within story tiddlers\n var el = document.getElementById(this.containerId);\n query = '"""' + query + '"""'; // prevent WikiLinks\n if(el) {\n removeChildren(el);\n } else { //# fallback: use displayArea as parent\n var container = document.getElementById("displayArea");\n el = document.createElement("div");\n el.id = this.containerId;\n el = container.insertBefore(el, container.firstChild);\n }\n var msg = "!" + this.heading + "\sn";\n if(matches.length > 0) {\n msg += "''" + config.macros.search.successMsg.format([matches.length.toString(), query]) + ":''\sn";\n this.results = [];\n for(var i = 0 ; i < matches.length; i++) {\n this.results.push(matches[i].title);\n msg += "* [[" + matches[i].title + "]]\sn";\n }\n } else {\n msg += "''" + config.macros.search.failureMsg.format([query]) + "''"; // XXX: do not use bold here!?\n }\n createTiddlyButton(el, this.btnCloseLabel, this.btnCloseTooltip, config.extensions.SimpleSearchPlugin.closeResults, "button", this.btnCloseId);\n wikify(msg, el);\n if(matches.length > 0) { // XXX: redundant!?\n createTiddlyButton(el, this.btnOpenLabel, this.btnOpenTooltip, config.extensions.SimpleSearchPlugin.openAll, "button", this.btnOpenId);\n }\n },\n\n closeResults: function() {\n var el = document.getElementById(config.extensions.SimpleSearchPlugin.containerId);\n removeNode(el);\n config.extensions.SimpleSearchPlugin.results = null;\n highlightHack = null;\n },\n\n openAll: function(ev) {\n story.displayTiddlers(null, config.extensions.SimpleSearchPlugin.results);\n return false;\n }\n};\n\nconfig.shadowTiddlers.StyleSheetSimpleSearch = "/*{{{*/\sn" +\n "#" + config.extensions.SimpleSearchPlugin.containerId + " {\sn" +\n "\stoverflow: auto;\sn" +\n "\stpadding: 5px 1em 10px;\sn" +\n "\stbackground-color: [[ColorPalette::TertiaryPale]];\sn" +\n "}\sn\sn" +\n "#" + config.extensions.SimpleSearchPlugin.containerId + " h1 {\sn" +\n "\stmargin-top: 0;\sn" +\n "\stborder: none;\sn" +\n "}\sn\sn" +\n "#" + config.extensions.SimpleSearchPlugin.containerId + " ul {\sn" +\n "\stmargin: 0.5em;\sn" +\n "\stpadding-left: 1.5em;\sn" +\n "}\sn\sn" +\n "#" + config.extensions.SimpleSearchPlugin.containerId + " .button {\sn" +\n "\stdisplay: block;\sn" +\n "\stborder-color: [[ColorPalette::TertiaryDark]];\sn" +\n "\stpadding: 5px;\sn" +\n "\stbackground-color: [[ColorPalette::TertiaryLight]];\sn" +\n "}\sn\sn" +\n "#" + config.extensions.SimpleSearchPlugin.containerId + " .button:hover {\sn" +\n "\stborder-color: [[ColorPalette::SecondaryMid]];\sn" +\n "\stbackground-color: [[ColorPalette::SecondaryLight]];\sn" +\n "}\sn\sn" +\n "#" + config.extensions.SimpleSearchPlugin.btnCloseId + " {\sn" +\n "\stfloat: right;\sn" +\n "\stmargin: -5px -1em 5px 5px;\sn" +\n "}\sn\sn" +\n "#" + config.extensions.SimpleSearchPlugin.btnOpenId + " {\sn" +\n "\stfloat: left;\sn" +\n "\stmargin-top: 5px;\sn" +\n "}\sn" +\n "/*}}}*/";\nstore.addNotification("StyleSheetSimpleSearch", refreshStyles);\n\n// override Story.search()\nStory.prototype.search = function(text, useCaseSensitive, useRegExp) {\n highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(), useCaseSensitive ? "mg" : "img");\n var matches = store.search(highlightHack, null, "excludeSearch");\n var q = useRegExp ? "/" : "'";\n config.extensions.SimpleSearchPlugin.displayResults(matches, q + text + q);\n};\n\n// override TiddlyWiki.search() to sort by relevance\nTiddlyWiki.prototype.search = function(searchRegExp, sortField, excludeTag, match) {\n var candidates = this.reverseLookup("tags", excludeTag, !!match);\n var primary = [];\n var secondary = [];\n var tertiary = [];\n for(var t = 0; t < candidates.length; t++) {\n if(candidates[t].title.search(searchRegExp) != -1) {\n primary.push(candidates[t]);\n } else if(candidates[t].tags.join(" ").search(searchRegExp) != -1) {\n secondary.push(candidates[t]);\n } else if(candidates[t].text.search(searchRegExp) != -1) {\n tertiary.push(candidates[t]);\n }\n }\n var results = primary.concat(secondary).concat(tertiary);\n if(sortField) {\n results.sort(function(a, b) {\n return a[sortField] < b[sortField] ? -1 : (a[sortField] == b[sortField] ? 0 : +1);\n });\n }\n return results;\n};\n\n} //# end of "install only once"\n//}}}
Experimental [[TiddlyWiki]] Projects @@margin-left:0.5em;font-size:0.9em;(eternally work in progress)@@
FND's ~DevPad
/***\n!Page Layout\n!!General\n***/\n/*{{{*/\nbody {\n background-color: [[ColorPalette::Background]];\n}\n/*}}}*/\n/***\n!!Header\n***/\n/*{{{*/\n.headerForeground,\n.headerShadow {\n padding: 1em 1em 1em 2em;\n}\n\n.siteTitle {\n font-size: 2.5em;\n}\n\n.siteSubtitle {\n margin-left: 1em;\n font-size: 1em;\n}\n/*}}}*/\n/***\n!!Main Menu\n***/\n/*{{{*/\n#mainMenu {\n white-space: nowrap;\n text-align: left;\n}\n\n#mainMenu ul {\n margin: 0.2em 0 0;\n padding: 0 0 0 1em;\n}\n/*}}}*/\n/***\n!!Sidebar\n***/\n/*{{{*/\n#sidebar {\n right: 0px;\n}\n\n#sidebarOptions .button {\n border-color: [[ColorPalette::Background]];\n}\n\n#sidebarOptions .button:hover {\n border-color: [[ColorPalette::SecondaryMid]];\n}\n\n#sidebarTabs .tabContents {\n max-height: 35em; /* not IE6-compatible */\n overflow: auto;\n width: 92.5%;\n}\n\n#sidebarTabs .tabContents .tabContents {\n max-height: 30em !important; /* not IE6-compatible */\n}\n/*}}}*/\n/***\n!!Search Bar\n***/\n/*{{{*/\n#searchBar {\n float: right;\n font-size: 0.9em;\n}\n\n#searchBar .button {\n margin-right: 0.5em;\n border: none;\n}\n/*}}}*/\n/***\n!!Message Area {{annotation{(notification box)}}}\n***/\n/*{{{*/\n#messageArea {\n top: auto;\n bottom: 0;\n}\n/*}}}*/\n/***\n!Tiddlers\n!!Layout\n***/\n/*{{{*/\n.tiddler {\n position: relative; /* fix disappearing borders issue */\n max-height: 60em; /* not IE6-compatible */\n overflow: auto;\n margin-bottom: 1em;\n border-top: 1px solid [[ColorPalette::TertiaryPale]];\n border-right: 1px solid [[ColorPalette::TertiaryDark]];\n border-bottom: 1px solid [[ColorPalette::TertiaryDark]];\n border-left: 1px solid [[ColorPalette::TertiaryPale]];\n padding-bottom: 1em;\n}\n\n.tiddler.selected {\n border-color: [[ColorPalette::TertiaryMid]];\n}\n\n.subtitle {\n margin-top: -1.5em;\n margin-bottom: 0.5em;\n padding-bottom: 0.5em;\n border-bottom: 1px solid [[ColorPalette::TertiaryMid]];\n font-size: x-small;\n text-align: right;\n}\n\n.editor {\n margin-top: 0.5em;\n}\n/*}}}*/\n/***\n!!Contents\n***/\n/*{{{*/\n.viewer {\n font-size: 1.1em;\n}\n\n.viewer li {\n margin-bottom: 0.2em;\n}\n\n.viewer pre {\n max-height: 50em; /* not IE6-compatible */\n overflow: auto;\n}\n\n.viewer table caption {\n padding-top: 0;\n font-style: italic;\n}\n\n/* Headings */\n\nh1 {\n padding: 0.1em 0.1em 0.1em 0.4em;\n color: [[ColorPalette::TertiaryMid]];\n background-color: [[ColorPalette::TertiaryPale]];\n}\n\nh2, h3, h4, h5 {\n padding: 0 0.2em;\n color: [[ColorPalette::Foreground]];\n background-color: transparent;\n}\n\nh2 {\n border-bottom: 1px solid [[ColorPalette::TertiaryMid]];\n}\n\nh3 {\n border-bottom: 1px dashed [[ColorPalette::TertiaryMid]];\n}\n/*}}}*/\n/***\n!Custom Classes\n***/\n/*{{{*/\n/* horizontal separator */\n\n.separator {\n display: block;\n margin: 0.2em 2em 0.2em 0;\n border-top: 1px solid [[ColorPalette::TertiaryMid]];\n}\n\n#sidebarOptions .separator {\n margin-left: 0.5em;\n}\n\n/* popup styles (cf. [[templatePopup]]) */\n\n.dropdownPopup {\n color: [[ColorPalette::Background]];\n}\n\n.infoPopup {\n border: 1px solid [[ColorPalette::Foreground]];\n color: [[ColorPalette::Foreground]];\n background-color: #FFFFE1;\n}\n\n.dropdownPopup ol,\n.infoPopup ol {\n padding-left: 2em;\n list-style-type: decimal;\n}\n\n.dropdownPopup ul,\n.infoPopup ul {\n padding-left: 1.2em;\n list-style-type: disc;\n}\n\n.infoPopup ol,\n.infoPopup ul {\n margin: 1em 0;\n}\n\n.dropdownPopup ul ul,\n.infoPopup ul ul {\n list-style-type: circle;\n}\n\n.dropdownPopup ul ul ul,\n.infoPopup ul ul ul {\n list-style-type: square;\n}\n\n.dropdownPopup a,\n.infoPopup a {\n display: inline !important;\n}\n\n/* annotation */\n\n.annotation {\n font-size: 0.9em;\n color: gray;\n}\n\ndiv.annotation {\n margin-left: 2em;\n}\n\n/* borderless table */\n\n.viewer .borderlessTable,\n.viewer .borderlessTable * {\n border: 0;\n}\n\n.viewer .borderlessTable th {\n border: 1px solid #000;\n font-weight: normal;\n text-align: left;\n color: [[ColorPalette::Foreground]];\n background-color: transparent;\n}\n/*}}}*/\n/***\n!Print Layout\n***/\n/*{{{*/\n@media print {\n #searchBar {\n display: none;\n }\n\n .tiddler,\n .viewer pre {\n max-height: none; /* not IE6-compatible */\n overflow: visible;\n }\n}\n/*}}}*/
* TiddlyWiki equivalent of MediaWiki's subpages\n* sub-tiddlers' names are preceded by the parent tiddler's name and a separator (e.g. "parent/sub")\n* the parent tiddler contains an automatically-created index of all sub-tiddlers (like a table of contents, or like a horizontal menu bar)\n* sub-tiddlers contain a "breadcrumb" link back to the parent tiddler(s)\n* multiple sub-levels?\n* all tiddlers optionally contain a button to create a sub-tiddler\n----\nrelated examples / alternatives:\n* [[PartTiddlerPlugin|http://tiddlywiki.abego-software.de/#PartTiddlerPlugin]]\n* tiddler fields: [[ListboxPlugin|http://www.tiddlytools.com/#ListboxPlugin]], [[TaskViewTemplate|http://www.tiddlytools.com/#TaskViewTemplate]] / [[TaskTemplateTweak|http://www.tiddlytools.com/#TaskTemplateTweak]]\n* [[easySlicer|http://yann.perrin.googlepages.com/twkd.html#easySlicer]] (might even render this project obsolete)
/***\n|Name|SuppressEmptyTagsPlugin|\n|Source|[[FND's DevPad|http://devpad.tiddlyspot.com/#SuppressEmptyTagsPlugin]]|\n|Version|1.1|\n|Author|FND|\n|Contributors|[[Saq Imtiaz|http://tw.lewcid.org]], [[Eric Shulman|http://www.tiddlytools.com]]|\n|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires|N/A|\n|Overrides|config.macros.tags.handler|\n|Description|suppress tagged box when tiddler is untagged|\n!Changelog\n!!v0.5 (2007-06-11)\n* initial release\n!!v1.0 (2007-06-11)\n* proper overriding of core function (thanks Saq)\n* changed ~CoreVersion to 2.1 (from 2.2)\n!!v1.1 (2007-06-11)\n* further improved hijacking method (thanks Eric)\n!Code\n***/\n//{{{\nconfig.macros.tags.oldHandler = config.macros.tags.handler;\nconfig.macros.tags.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n if(tiddler.tags && tiddler.tags.length > 0)\n this.oldHandler.apply(this, arguments);\n else\n place.style.display = 'none';\n};\n//}}}
/***\n|''Name''|TableHighlightMacro|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#TableHighlightMacro]]|\n|''Version''|0.3|\n|''Author''|FND|\n|''License''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|macro for highlighting elements on mouse-over (hover)|\n!Usage Notes\n* two options:\n** add {{{<<tableHighlight [class tag]>>}}} to the desired tiddler(s)\n** add as a macro to ViewTemplate: {{{<span macro='tableHighlight [class tag]'></span>}}}\n!!Example\nhighlight table rows (using footer class for compatibility reasons): {{{<<tableHighlight "footer" "tr">>}}} <<tableHighlight "footer" "tr">>\n!Revision History\n!!v0.1 (2007-08-16)\n* initial proof-of-concept implementation\n!!v0.2 (2007-08-16)\n* added shadow tiddler for styles\n!!v0.3 (2007-08-16)\n* added optional parameters for class name and target element\n* replaced minimal shadow tiddler with {{{setStylesheet()}}} call\n* greatly improved code efficiency (thanks Lewcid)\n!To Do\n* rename plugin (e.g. ElementHoverHighlightMacro?) => also rename dependencies (macro name, default class and style sheet)\n* adjust Description and Usage Notes\n!Code\n***/\n//{{{\nconfig.macros.tableHighlight = {}\nconfig.macros.tableHighlight.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n // process parameters\n var highlightClass = (params[0] && params[0] != "") ? params[0] : "tableHighlightActive";\n var targetElement = (params[1] && params[1] != "") ? params[1] : "td";\n // highlight elements\n var cells = story.findContainingTiddler(place).getElementsByTagName(targetElement);\n for(var i = 0; i < cells.length; i++) {\n cells[i].onmouseover = function() { addClass(this, highlightClass); };\n cells[i].onmouseout = function() { removeClass(this, highlightClass); };\n }\n}\n\n// set default styles\nsetStylesheet(".tableHighlightActive { "\n + "background-color: " + store.getTiddlerSlice("ColorPalette", "SecondaryPale") + ";"\n + " }",\n + "StyleSheetTableHighlight");\n//}}}
easy interface for records on DataVault\n\ncf. [[SliceGridPlugin|http://www.tiddlytools.com/#SliceGridPlugin]]
/***\n|''Name''|TableToTiddlersMacro|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#TableToTiddlersMacro]]|\n|''Version''|0.1|\n|''Status''|@@experimental@@|\n|''Author''|FND|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|generates individual tiddlers from a table|\n!Notes\n* one tiddler per row (tiddler name is value of first column)\n* transposing; one row in each tiddler per column (excluding first column) in the source data\n!Usage\n{{{\n<<table2tiddlers [tiddler] [tags] [header] [footer] [author] [prefixes] [suffixes]>>\n}}}\n!!Parameters\n|!Index|!Optional|!Description|!Default Value|h\n|1|yes|name of target tiddler (containing the table to be processed)|current tiddler|\n|2|yes|tags to assign to newly-created tiddlers|slices2tiddlers|\n|3|yes|author to assign to newly-created tiddlers|slices2tiddlers|\n|4|yes|table includes header row (true/false)|false|\n|5|yes|table includes footer row (true/false)|false|\n|6|yes|bracketed list of prefixes to assign to newly-created tiddlers' rows (one item per row)|N/A|\n|7|yes|bracketed list of suffixes to assign to newly-created tiddler's rows (one item per row)|N/A|\n!!Example\n{{{\n<<table2tiddlers [[Log Data]] "logs" "admin" "true" "true" "|!Time| |!User| [[|!Avg. Value|]] |!Signature|" "|h | | |f">>\n}}}\nThis will generate a table of three rows ("Time", "User", "Avg. Value") in each newly-created tiddler, provided that there are a total of four columns in the source data.\n!Revision History\n!!v0.1 (2008-01-10)\n* initial release\n!To Do\n* use launch button instead of executing the macro when rendered\n* instead of suffix and prefix arrays as parameters, use one parameter (prefix-suffix pair) for each row\n* documentation\n!Code\n***/\n//{{{\nconfig.macros.table2tiddlers = {\n tags: ["slices2tiddlers"],\n modifier: "slices2tiddlers"\n};\n\nconfig.macros.table2tiddlers.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var tiddlerTitle = params[0] || tiddler.title;\n var tags = params[1] ? params[1].readBracketedList() : this.tags;\n var modifier = params[2] || this.modifier;\n var header = (params[3] == "true") ? true : false; // table includes header row\n var footer = (params[4] == "true") ? true : false; // table includes footer row\n var prefixes = params[5] ? params[5].readBracketedList(false) : [];\n var suffixes = params[6] ? params[6].readBracketedList(false) : [];\n var tiddlers = [];\n var errors = [];\n // retrieve individual rows\n var rows = store.getTiddlerText(tiddlerTitle);\n if(rows)\n rows = rows.split("\sn");\n else\n wikify("error: tiddler not found", place);\n // create tiddlers from rows\n if(rows && rows.length > 0) {\n // remove table header and footer\n if(header)\n rows.splice(0, 1);\n if(footer)\n rows.splice(rows.length - 1, 1);\n // create tiddlers\n var cols, title, text;\n for(var i = 0; i < rows.length; i++) {\n // retrieve columns\n cols = rows[i].split("|");\n cols.splice(0, 1); // remove first element (always empty)\n cols.splice(cols.length - 1, 1); // remove last element (always empty)\n // create new tiddler\n title = cols[0];\n text = "";\n for(var j = 1; j < cols.length; j++) {\n text += (prefixes[j - 1] || "")\n + cols[j]\n + (suffixes[j - 1] || "")\n + "\sn";\n }\n if(!store.tiddlerExists(title)) { // do not overwrite local tiddlers\n store.saveTiddler(title, title, text, modifier, (new Date), tags, null, null, (new Date));\n tiddlers.push(title);\n } else {\n errors.push(title);\n }\n }\n // report results\n var output = "";\n if(errors.length > 0) {\n output += "!Tiddlers Not Created (" + errors.length + ")\sn";\n for(i = 0; i < errors.length; i++)\n output += "* [[" + errors[i] + "]]\sn";\n }\n if(tiddlers.length > 0) {\n output += "!Tiddlers Created (" + tiddlers.length + ")\sn";\n for(i = 0; i < tiddlers.length; i++)\n output += "* [[" + tiddlers[i] + "]]\sn";\n }\n wikify(output, place);\n }\n};\n//}}}
/***\n|''Name''|TagBoxToggleMacro|\n|''Version''|0.1|\n|''Status''|@@experimental@@|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#TagBoxToggleMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Description''|toggles the visibility of the respective tiddler's tag box|\n!Usage\n{{{\n<<taggedToggle\n [class name]\n [button label]\n [button tooltip]\n [button class]\n [button access key]\n [startup mode]\n>>\n}}}\n!!Example\n<<taggedToggle "" "" "" "" "" "hide">>\n!Revision History\n!!v0.1 (2007-12-20)\n* initial release\n!To Do\n* documentation\n!Code\n***/\n//{{{\nconfig.macros.taggedToggle = {\n className: "tagged",\n label: "Toggle Tagged",\n prompt: "Switch tag box on and off",\n buttonClass: "",\n accessKey: ""\n};\n\nconfig.macros.taggedToggle.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n // process command line parameters\n var className = params[0] || this.className;\n var label = params[1] || this.label;\n var prompt = params[2] || this.prompt;\n var buttonClass = params[3] || this.buttonClass;\n var accessKey = params[4] || this.accessKey;\n // startup mode\n var t = story.findContainingTiddler(place);\n if(params[5] == "hide") {\n this.toggle(t, className);\n }\n // create toggle button\n createTiddlyButton(place, label, prompt,\n function() { config.macros.taggedToggle.toggle(t, className); },\n buttonClass, null, accessKey);\n};\n\nconfig.macros.taggedToggle.toggle = function(el, className) {\n if(el) {\n els = getElementsByClass(className, el);\n if(els[0].style.display != "none") {\n els[0].style.display = "none";\n } else {\n els[0].style.display = "";\n }\n }\n};\n\n/* by Dustin Diaz (http://www.dustindiaz.com/getelementsbyclass/) */\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\s\s\ss)"+searchClass+"(\s\s\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|''Name''|TagComboMacro|\n|''Version''|0.1|\n|''Status''|@@experimental@@|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#TagComboMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|returns a list of tiddlers matching a combination of tags|\n!Usage\n{{{\n<<tagcombo [tag1] [tag2] [tag3] ... >>\n}}}\n!!Example\n<<tagcombo [[systemConfig]] [[plugins]]>>\n!Revision History\n!!v0.1 (2007-11-30)\n* initial release\n!To Do\n* rename\n* remove excessive spacing (i.e. replace {{{.join()}}} with {{{for()}}} loop!?)\n* custom output format (e.g. comma-separated list)\n!Code\n***/\n//{{{\nconfig.macros.tagcombo = {};\nconfig.macros.tagcombo.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var r = [];\n var t = store.getTaggedTiddlers(params[0]);\n for(var i = 0; i < t.length; i++) {\n if(t[i].tags.containsAll(params)) {\n r.push(t[i].title);\n }\n }\n wikify("* [[" + r.join("]]\sn* [[") + "]]", place);\n}\n//}}}
(preliminary implementation at [[ForEachTiddlerTest]])\n!Name\n* TagNavigatorPlugin\n* DynamicTagTreePlugin (or TagTreePlugin)\n* TagComboPlugin\n!User Interface\n{{{\n __________________________________\n| _______ _____ |\n| Tag 1 Tag 2 | Tag 3 | | add | |\n| ¯¯¯¯¯¯¯ +------------+\n|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|* [[Tag 4]] |\n| * [[Tiddler 1]] |* [[Tag 5]] |\n| * [[Tiddler 2]] |* [[Tag 6]] |\n| * [[Tiddler 3]] +------------+\n| * [[Tiddler 4]] |\n| * [[Tiddler 5]] |\n| * [[Tiddler 6]] |\n|__________________________________|\n}}}\n* upper part: tag (de)selection\n** "Tag 3" removes this tag from the combination\n** "add" expands a list of available tags (tags 4-6) to add to the combination (listed are only tags used in combination with the previously-selected tags)\n* lower part: tiddler selection (list of tiddlers using the selected tags)\n!Flowchart \n{{{\n +---------------------+\n | select all tiddlers | store\n +---------------------+\n |\n V\n /¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\s\n | list of matching tiddlers |<----+ story object\n \s___________________________/ |\n | |\n V |\n +-----------------------------+ |\n | retrieve tags from tiddlers | | using getTags(), or forEachTiddler() and .tags property\n +-----------------------------+ |\n | |\n V |\n +----------------------+ |\n | filter and sort tags | | using pushUnique() or readBracketedList() -- possibly obsolete (see above)\n +----------------------+ |\n | |\n V |\n /¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\s |\n | list of unique tags | |\n \s_____________________/ |\n | |\n V |\n /¯¯¯¯¯¯¯¯¯¯¯¯/ |\n / select tag / | == BREAK POINT ==\n /____________/ |\n | |\n V |\n +--------------------------+ |\n | select matching tiddlers | | using getTaggedTiddlers() -- problem (now obsolete?): how to return a story object?\n +--------------------------+ |\n | |\n V |\n +-------------------------+ |\n | retrieve tiddler titles |-------+ using forEachTiddler() and .title property\n +-------------------------+\n \n\n\n Key:\n ¯¯¯¯\n +---------+ /¯¯¯¯¯¯¯¯\s /¯¯¯¯¯¯¯¯¯¯¯¯¯/\n | Process | | Result | / Interaction /\n +---------+ \s________/ /_____________/\n}}}
/***\n|Name|TagNavigatorPlugin (working title)|\n|Source|[[FND's DevPad|http://devpad.tiddlyspot.com/#TagNavigatorPlugin]]|\n|Version|0.1|\n|Author|FND|\n|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires|N/A|\n|Overrides|N/A|\n|Description|select tiddlers based on tag combinations|\n!Usage\n{{{<<TagNav tag1 tag2 tag3 ... >>}}}\n''N.B.:'' Tags containing spaces must be enclosed either in {{{[[brackets]]}}} or in {{{"quotation marks"}}}.\n!Revision History\n!!v0.1 (2007-06-08)\n* initial alpha version\n!Issues / To Do\n* many, many issues; cf. DEBUG markers in code\n* popup menu can't be closed yet (can even be opened multiple times!)\n* displayed the count of the number of matching tiddlers\n!Code\n***/\n//{{{\n// create TagNavigator namespace\nTagNav = {};\n\n// create shadow tiddler for CSS rules\nTagNav.addStyles = function(shadowTiddler) {\n config.shadowTiddlers[shadowTiddler] = "/*{{{*/\sn"\n + "#TagNavigator {\sn"\n + "\stposition: absolute;\sn" // DEBUG: messy display (overlay issues)\n + "\stz-index: 99;\sn"\n + "\stmargin: 0;\sn"\n + "\stborder: 1px solid [[ColorPalette::PrimaryDark]];\sn"\n + "\stpadding: 0;\sn"\n + "\stbackground-color: [[ColorPalette::TertiaryPale]];\sn"\n + "}\sn\sn"\n + "#TagNavigatorTagBar,\sn"\n + "#TagNavigatorTiddlers {\sn"\n + "\stmargin: 0;\sn"\n + "\stpadding: 5px;\sn"\n + "\stlist-style-type: none;\sn"\n + "}\sn\sn"\n + "#TagNavigatorTagBar {\sn"\n + "\stmargin-bottom: 1.2em;\sn" // required due to floating\n + "}\sn\sn"\n + "#TagNavigatorTiddlers {\sn"\n + "\stclear: both;\sn"\n + "\stborder-top: 1px solid [[ColorPalette::PrimaryDark]];\sn"\n + "}\sn\sn"\n + "#TagNavigatorTagBar li {\sn"\n + "\stfloat: left;\sn"\n + "\stmargin: 0 0.2em 0.5em;\sn"\n + "}\sn\sn"\n + "#TagNavigator .buttonClose {\sn"\n + "\stfloat: left;\sn" // DEBUG: temporary solution (right-floating expands container width)\n + "\stmargin: 0 5px 5px 0;\sn"\n + "\stborder: 1px solid [[ColorPalette::PrimaryDark]];\sn"\n + "\stpadding: 0 1px;\sn"\n + "}\sn"\n + "/*}}}*/";\n store.addNotification(shadowTiddler, refreshStyles);\n}\nTagNav.addStyles("StyleSheetTagNavigator");\n\n/*\n** Macro\n*/\n\nconfig.macros.TagNav = {\n label: "Tag Navigator",\n prompt: "select tiddlers based on tag combinations",\n accessKey: null\n};\n\nconfig.macros.TagNav.handler =\n function(place, macroName, params, wikifier, paramString, tiddler) {\n // create macro button\n createTiddlyButton(place, this.label, this.prompt,\n function() {\n // select active button\n TagNav.Btn = this;\n // close (remove) existing popups\n TagNav.popupClose(TagNav.Container, TagNav.active);\n // set activity status \n TagNav.active = true;\n // process macro parameters (initial tags)\n TagNav.activeTags = [];\n if(params[0]) {\n for(var i = 0; i < params.length; i++) {\n TagNav.activeTags.pushUnique(params[i], true);\n }\n }\n // initialize\n TagNav.initializeTiddlerSelection();\n TagNav.initializeInterface();\n return false; // DEBUG: purpose? obsolete?\n },\n null, null, this.accessKey);\n return false; // DEBUG: purpose? obsolete?\n}\n\n/*\n** Initialization\n*/\n\n// initialize tiddler selection\nTagNav.initializeTiddlerSelection = function() {\n // get all tiddlers\n TagNav.tiddlers = store.reverseLookup("tags", "", false, "title"); // DEBUG: dirty hack!?\n // get tiddler titles\n TagNav.titles = TagNav.getTiddlerTitles(TagNav.tiddlers);\n // get tiddler tags\n TagNav.tags = TagNav.getTiddlerTags(TagNav.tiddlers);\n // process initial tags\n if(TagNav.activeTags.length > 0) {\n for(var i = 0; i < TagNav.activeTags.length; i++) {\n // update matching tiddler set\n TagNav.filter(TagNav.activeTags[i])\n }\n } \n}\n\n// initialize Tag Navigator interface\nTagNav.initializeInterface = function() {\n // create container elements\n TagNav.Container = createTiddlyElement(document.body, "div", "TagNavigator", null, null); // DEBUG: using document.body as parent only sub-optimal? \n btn = createTiddlyButton(TagNav.Container, "x", "close Tag Navigator popup", TagNav.popupClose, "buttonClose", null, null); // close button\n TagNav.TagBar = createTiddlyElement(TagNav.Container, "ul", "TagNavigatorTagBar", null, null);\n TagNav.TiddlerBox = createTiddlyElement(TagNav.Container, "ul", "TagNavigatorTiddlers", null, null);\n // adjust Tag Navigator popup position\n TagNav.popupPosition(TagNav.Btn, TagNav.Container);\n // add previously-selected filter tags to tag bar\n var item, btn;\n for(var i = 0; i < TagNav.activeTags.length; i++) {\n item = createTiddlyElement(TagNav.TagBar, "li", null, null, null);\n btn = createTiddlyButton(item, TagNav.activeTags[i], null, null, "buttonBland", null, null); // DEBUG: buttonBland class not styled yet\n }\n // add button for new filter tag to tag bar\n item = createTiddlyElement(TagNav.TagBar, "li", null, null, null);\n btn = createTiddlyButton(item, "+", "add a tag to filter by", TagNav.tagSelection, null, null, null);\n // fill in contents of tiddler\n TagNav.listTiddlerTitles(TagNav.TiddlerBox, TagNav.titles); \n}\n\n/*\n** Interface\n*/\n\n// event click on tiddler button: open tiddler and close popups\nTagNav.tiddlerSelection = function(e) {\n var theTarget = resolveTarget(e);\n // close popup\n TagNav.popupClose();\n // open tiddler\n var title = theTarget.getAttribute("tiddler");\n story.displayTiddler(null, title); // DEBUG: temporary workaround (see below)\n //onClickTiddlerLink(e); // DEBUG: causes error "theLink.getAttribute is not a function"\n}\n\n// event click on tag button: add new filtering level\nTagNav.tagSelection = function(e) {\n //TagNav.listTiddlerTags(TagNav.TagBar, TagNav.tags); // DEBUG'd: continue here\n /* DEBUG'd\n var theTarget = resolveTarget(e);\n var tag = theTarget.getAttribute("tag");\n if(tag) {\n // update matching tiddler set\n TagNav.filter(tag);\n // create sub-menu -- DEBUG: buggy/incomplete (e.g. how to close popups)\n TagNav.subMenus.push(Popup.create(theTarget));\n var TagNavigator = createTiddlyElement(theTarget, "ul", "TagNavigator", null, null);\n TagNav.listTiddlers(TagNavigator, TagNav.titles);\n TagNav.listTags(TagNavigator, TagNav.tags);\n Popup.show(TagNavigator, false);\n }\n */\n}\n\n// adjust Tag Navigator popup position -- based upon Popup.show()\nTagNav.popupPosition = function(parent, popup) {\n var rootLeft = findPosX(parent);\n var rootTop = findPosY(parent);\n var rootHeight = parent.offsetHeight;\n var popupLeft = rootLeft;\n var popupTop = rootTop + rootHeight;\n var popupWidth = popup.offsetWidth;\n var winWidth = findWindowWidth();\n if(popupLeft + popupWidth > winWidth)\n popupLeft = winWidth - popupWidth;\n popup.style.left = popupLeft + "px";\n popup.style.top = popupTop + "px";\n popup.style.display = "block";\n if(anim && config.options.chkAnimate)\n anim.startAnimating(new Scroller(popup, false));\n else\n window.scrollTo(0,ensureVisible(popup));\n}\n\n// close (remove) existing popup\nTagNav.popupClose = function(popup, check) {\n if(check) {\n popup.parentNode.removeChild(popup);\n }\n check = false;\n}\n\n/*\n** Tiddler Processing\n*/\n\n// retrieve tiddlers with a specific tag from tiddlers array\nTagNav.getTaggedTiddlers = function(container, tag) {\n var tiddlers = [];\n for(var i = 0; i < container.length; i++) {\n if(container[i].tags.contains(tag)) {\n tiddlers.push(container[i]);\n }\n }\n return tiddlers;\n}\n\n// retrieve titles from tiddlers array\nTagNav.getTiddlerTitles = function(container) {\n var titles = [];\n for(var i = 0; i < container.length; i++) {\n titles.push(container[i].title);\n }\n titles.sort();\n return titles;\n}\n\n// retrieve tags from tiddlers array\nTagNav.getTiddlerTags = function(tiddlers) {\n var tags = [];\n for(var i = 0; i < tiddlers.length; i++) {\n for(var j = 0; j < tiddlers[i].tags.length; j++) {\n tags.pushUnique(tiddlers[i].tags[j]);\n }\n }\n tags.sort();\n return tags;\n}\n\n// update matching tiddler set\nTagNav.filter = function(tag) {\n TagNav.tiddlers = TagNav.getTaggedTiddlers(TagNav.tiddlers, tag);\n TagNav.titles = TagNav.getTiddlerTitles(TagNav.tiddlers);\n TagNav.tags = TagNav.getTiddlerTags(TagNav.tiddlers);\n}\n\n// create list of tiddlers as links\nTagNav.listTiddlerTitles = function(parent, titles) {\n var item, btn;\n if(titles.length == 0) {\n createTiddlyElement(parent, "span", null, null, "no matching tiddlers");\n }\n for(var i = 0; i < titles.length; i++) {\n item = createTiddlyElement(parent, "li", null, null, null);\n btn = createTiddlyButton(item, titles[i], "open tiddler", TagNav.tiddlerSelection, "tiddlyLink tiddlyLinkExisting");\n btn.setAttribute("tiddler", titles[i]);\n }\n}\n\n// create list of tags as links -- DEBUG: revise titles and prompts\nTagNav.listTiddlerTags = function(parent, tags) {\n var item, btn;\n if(tags.length == 0) {\n createTiddlyElement(parent, "li", null, null, "no matching tags");\n }\n for(var i = 0; i < tags.length; i++) {\n item = createTiddlyElement(parent, "li", null, null, null);\n btn = createTiddlyButton(item, tags[i], "filter using this tag", TagNav.tagSelection);\n btn.setAttribute("tag", tags[i]);\n }\n}\n//}}}
This is the sandbox for testing the TagNavigatorPlugin.\nActivate the Tag Navigator by using the button below.\nThe styling can be changed in the StyleSheetTagNavigator shadow tiddler.\n\n|<<TagNav>><br>(no initial tags)|<<TagNav systemConfig>><br>(inital tag "systemConfig")|<<TagNav systemConfig plugin>><br>(inital tags "systemConfig" and "plugin")|
/***\n|''Name''|TaggedBackupsPlugin|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#TableHighlightMacro]]|\n|''Version''|0.1|\n|''Author''|FND|\n|''License''|[[Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|allows the creation of backup files with an edit summary|\n!Usage Notes\n<<taggedBackup>>\n!Revision History\n!!v0.1 (2007-08-11)\n* initial proof-of-concept implementation\n!To Do\n* rename plugin(?)\n* ensure that full backup path does not exceed OS limits (256 chars?)\n!Code\n***/\n//{{{\nconfig.macros.taggedBackup = {}\nconfig.macros.taggedBackup.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var originalPath = document.location.toString();\n var localPath = getLocalPath(originalPath);\n var original = loadFile(localPath);\n var backupPath = getBackupPath(localPath);\n alert(originalPath + "\sn" + localPath + "\sn" + backupPath) // DEBUG\n // insert edit summary ("tag")\n var backupFileName = backupPath.substring(0, backupPath.lastIndexOf("."));\n var backupFileExt = backupPath.substring(backupPath.lastIndexOf("."));\n //prompt("Please enter a concise edit summary"); // DEBUG'd\n alert(backupPath) // DEBUG\n //var backup = saveFile(backupPath, original); // DEBUG'd\n if(backup)\n displayMessage(config.messages.backupSaved, "file://" + backupPath);\n else\n alert(config.messages.backupFailed);\n}\n\n// getBackupPath() -- DEBUG: needs to be hijacked/overwritten\nfunction getBackupPath(localPath)\n{\n var backSlash = true;\n var dirPathPos = localPath.lastIndexOf("\s\s");\n if(dirPathPos == -1)\n {\n dirPathPos = localPath.lastIndexOf("/");\n backSlash = false;\n }\n var backupFolder = config.options.txtBackupFolder;\n if(!backupFolder || backupFolder == "")\n backupFolder = ".";\n var backupPath = localPath.substr(0,dirPathPos) + (backSlash ? "\s\s" : "/") + backupFolder + localPath.substr(dirPathPos);\n backupPath = backupPath.substr(0,backupPath.lastIndexOf(".")) + "." + (new Date()).convertToYYYYMMDDHHMMSSMMM() + ".html"; // DEBUG: replace YYYYMMDDHHMMSSMMM with ISO 8601 and add edit summary\n return backupPath;\n}\n//}}}
<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','Background')}} Background $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','Foreground')}} Foreground $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','PrimaryPale')}} PrimaryPale $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','PrimaryLight')}} PrimaryLight $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','PrimaryMid')}} PrimaryMid $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','PrimaryDark')}} PrimaryDark $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','SecondaryPale')}} SecondaryPale $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','SecondaryLight')}} SecondaryLight $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','SecondaryMid')}} SecondaryMid $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','SecondaryDark')}} SecondaryDark $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','TertiaryPale')}} TertiaryPale $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','TertiaryLight')}} TertiaryLight $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','TertiaryMid')}} TertiaryMid $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','TertiaryDark')}} TertiaryDark $1>>\n<<tiddler [[TemplateShowColor]] with:{{store.getTiddlerSlice('$1','Error')}} Error $1>>
@@margin:0 1em;padding:0 4em;background-color:$1;&nbsp;@@ @@padding-right:1em;{{{$1}}}@@ [[$2|$3]]
@@margin: 0 1em;padding: 0 4em;width: 20em;background-color: $1;&nbsp;@@ [[$2|ColorPalette]]
/***\n|Name|TidIDEPlugin|\n|Source|http://www.TiddlyTools.com/#TidIDEPlugin|\n|Version|1.6.1|\n|Author|Eric Shulman - ELS Design Studios|\n|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires||\n|Overrides||\n|Description|TiddlyWiki Integrated Development Environment - tools for authors and plugin writers|\n\n~TidIDE (//prounounced "Tie Dyed"//) - ''Tid''dlyWiki ''I''ntegrated ''D''evelopment ''E''nvironment - tools for ~TiddlyWiki authors and editors. \n\nProvides a full-featured tiddler editor with key-by-key ''LIVE PREVIEW'' of //formatted// tiddler content!! Also includes diagnostic tools to help you debug your TiddlyWiki problems by letting you view current TiddlyWiki internal option values, messages, shadows, stylesheets, notify and macro functions or display the internal DOM (Document Object Model) tree structure for any specific part of the TiddlyWiki document.\n!!!!!Configuration\n<<<\nAutomatically freeze preview updates when a tiddler takes more than <<option txtTidIDEAutoFreeze>> milliseconds to render.\n<<<\n!!!!!Usage/Example\n<<<\n{{{<<tidIDE id:example "font:Courier New" size:8pt system +edit:GettingStarted>>}}}\n<<tidIDE id:example "font:Courier New" size:8pt system +edit:GettingStarted>>\n!!!!!parameters:\n* ''id'' - assign a unique ID to this instance of TidIDE. (default id=current tiddler title or "" if not in a tiddler)\n* ''font'' - sets the CSS font-family used by textarea controls in editor and system information panels. Note: if the font name includes a space (e.g., Courier New), then you must enclose the entire parameter in double-quotes: {{{"font:Courier New"}}}.\n* ''size'' - sets the CSS font-size used by text input and droplist controls in editor and system information panels.\n* ''system'' includes system information panel.\n* ''edit'' includes tiddler editor/previewer.\n**''edit:here'' automatically sets the editor to show the current tiddler contents (if in a tiddler)\n**''edit:tiddlertitle'' automatically sets the editor to show the specified tiddler contents\n* use ''{{{[[label|tiddlertitle]]}}}'' to include 'custom panels' (and corresponding labelled checkboxes to toggle their display)\n* all parameters are optional. The default panel is "edit:here".\n* panel parameters preceded by a "+" are displayed by default. If only one panel specified in the parameters, it is automatically displayed, even if the "+" is omitted.\n!!!!!using the editor\nThe editor includes a droplist of all tiddlers in the document, sorted alpha-numerically by tiddler title. Shadow tiddlers that have not been customized are added to the end of this list and marked with "(shadow)". Next to the droplist are several buttons:\n* ''view'' opens the tiddler in the normal ~TiddlyWiki display area\n* ''add'' prompts for a new tiddler title and begins a new editing session\n* ''remove'' deletes an existing tiddler (note: shadow tiddlers cannot be removed)\n* ''save'' saves changes to the tiddler currently being edited\n* ''save as'' saves changes using a new tiddler title\nIf a tiddlername was not specified in the macro, select a tiddler from the droplist (or press ''add'') to begin editing. Once a tiddler has been loaded into the editor, you can change it's content, enter or select tags.\n\nNormally, when you save changes to a tiddler, the created/modified dates and tiddler author are automatically updated. However, it is sometimes useful to make small changes to a tiddler without automatically updating the date/author information. Select the ''minor edits'' checkbox to prevent those values from being //automatically// changed. In addition, this enables the date/author edit fields which allows you to //manually// 'back date' a tiddler or change the author to another name. When the tiddler is saved, the date/author values shown in the edit fields will be used.\n!!!!!using the previewer\nThe ''preview'' checkbox adds a display area that shows you what your tiddler changes will look like, //before// committing to those changes.\n\nBy default, this preview display is automatically rendered each time a key is typed into the tiddler content edit field. As soon as changes are entered, they will be instantly visible within the preview display. Unfortunately, the partial tiddler source definitions that occur //during// editing may somtimes cause rendering problems, and some exceptionally complex tiddlers make take an unusually long amount of time to completely render their content. In such cases, key-by-key display updates are undesirable or impractical.\n\nWhen ''preview'' is selected, you can also select ''freeze'' to suspend automatic key-by-key preview display updates. The preview display will not be re-rendered again until you press the ''refresh'' button, or clear the 'freeze' checkbox, or switch to editing a different tiddler. The editor automatically freezes the preview display whenever the //rendering time// exceeds a pre-determined time limit (see configuration section), specified in milliseconds. Note: the ''actual elapsed time'' used to process and render any given tiddler is reported in the browser's status bar area whenever that tiddler is previewed.\n\nThe previewer also can display a ''DOM viewer'' and an ''HTML viewer'' that are also updated with each keystroke. These text-based displays can be helpful while attempting to correct or enhance the formatting of tiddler content, especially when complex combinations of wiki-syntax produce unexpected or undesired results.\n!!!!!system information and TW option settings\nYou can use the ''system information'' panel to view a variety of system internal data and functions, and view/modify ''all'' of ~TiddlyWiki's internal config.option.* settings. NOTE: Non-default config.options are stored in cookies and are retrieved whenever the TW document is loaded into a browser; however, ''core TW functions and custom-defined plugins can explicitly ignore or reset any locally-stored cookie values and use their own, internally-defined values'' instead. As a result, changes to these may be completely ignored, or may only have an effect during the current TW document "session" (i.e., until the TW document is reloaded), even though a persistent cookie value has been saved.\n!!!!! ~DOMViewer macro\nsyntax: {{{<<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!!!!!Installation\n<<<\nimport (or copy/paste) the following tiddlers into your document:\n''TidIDEPlugin'' (tagged with <<tag systemConfig>>)\n^^documentation and javascript for macro handling^^\n<<<\n!!!!!Revision History\n<<<\n''2006.12.09 [1.6.1]'' in handler(), allow non-existing tiddler title when processing "edit:title" param\nso that new tiddler (or journal) can be created directly from newTiddler, newJournal, or tidIDE macro (without pressing "new" button). Also, set 'edit=text' attribute on text area field so that default content can be initialized from "text:xxx" parameter specified in newTiddler/newJournal macro.\n''2006.11.28 [1.6.0]'' added font and size params to set CSS for form controls in editor and system info panels\n|please see [[TidIDEPluginHistory]] for additional revision details|\n''2006.04.15 [0.5.0]'' Initial ALPHA release. Converted from TiddlerTweaker inline script.\n<<<\n!!!!!Credits\n<<<\nThis feature was developed by EricShulman from [[ELS Design Studios|http:/www.elsdesign.com]].\n<<<\n!!!!!Code\n***/\n// // version info\n//{{{\nversion.extensions.tidIDE = {major: 1, minor: 6, revision: 1, date: new Date(2006,12,9)};\n//}}}\n\n// // macro definition\n//{{{\nconfig.macros.tidIDE = {\n versionMsg: "TidIDE v%0.%1.%2: ",\n datetimefmt: "0MM/0DD/YYYY 0hh:0mm",\n titleMsg: "Please enter a new tiddler title",\n isShadowMsg: "'%0' is a shadow tiddler and cannot be removed.",\n renderMsg: "rendering preview...",\n timeoutMsg: " (> %0ms)",\n freezeMsg: " - preview is frozen. Press [refresh] to re-display.",\n evalMsg: "Warning!!\sn\snThis action will process '%0' as a systemConfig (plugin) tiddler, and may produce unexpected results!\sn\snAre you sure you want to proceed?",\n toolsDef: "<html><a href='javascript:config.macros.tidIDE.set(\s"%0\s",\s"%1\s");'>edit %1...</a></html>",\n editorLabel: "TiddlerEditor",\n systemLabel: "SystemInfo"\n};\nconfig.macros.tidIDE.handler= function(place,macroName,params) {\n var here=story.findContainingTiddler(place);\n var selectors="";\n var panels="";\n var showsys=false;\n var title="";\n var id=""; if (here) id=here.id.substr(7);\n var p=params.shift();\n if (!p) p="edit:here"; // default to editor if no params\n var openpanels=[];\n var panelcount=0;\n var fontsize="8pt";\n var fontface="Courier New,fixed";\n while (p) {\n var defOpen=(p.substr(0,1)=="+"); if (defOpen) p=p.substr(1);\n if (p.substr(0,3)=="id:")\n { id=p.substr(3); }\n else if (p.substr(0,5)=="font:")\n { fontface=p.substr(5); }\n else if (p.substr(0,5)=="size:")\n { fontsize=p.substr(5); }\n else if (p.substr(0,4)=="edit") {\n panelcount++;\n defOpen=defOpen || (!params[0] && panelcount==1); // if only one panel to show, default to open\n var toolname=this.editorLabel;\n if (p.indexOf('|')!=-1) toolname=p.substr(0,p.indexOf('|'));\n selectors+=this.html.editorchk.replace(/%toolname%/mg,toolname);\n selectors=selectors.replace(/%showpanel%/mg,defOpen?"CHECKED":"");\n panels+=this.html.editorpanel;\n // editor panel setup...\n panels=panels.replace(/%showpanel%/mg,defOpen?"block":"none");\n panels=panels.replace(/%maxrows%/mg,config.options.txtMaxEditRows);\n panels=panels.replace(/%disabled%/mg,readOnly?"DISABLED":"");\n panels=panels.replace(/%readonlychk%/mg,readOnly?"CHECKED":"");\n panels=panels.replace(/%minoredits%/mg,config.options.chkForceMinorUpdate&&!readOnly?"":"DISABLED");\n panels=panels.replace(/%minorchk%/mg,config.options.chkForceMinorUpdate?"CHECKED":"");\n panels=panels.replace(/%fontsize%/mg,fontsize);\n panels=panels.replace(/%fontface%/mg,fontface);\n var tiddlers=store.getTiddlers("title"); var tiddlerlist=""; \n for (var t=0; t<tiddlers.length; t++)\n tiddlerlist+='<option value="'+tiddlers[t].title+'">'+tiddlers[t].title+'</option>';\n for (var t in config.shadowTiddlers)\n if (!store.tiddlerExists(t)) tiddlerlist+="<option value='"+t+"'>"+t+" (shadow)</option>";\n panels=panels.replace(/%tiddlerlist%/mg,tiddlerlist);\n var tags = store.getTags(); var taglist="";\n for (var t=0; t<tags.length; t++)\n taglist+="<option value='"+tags[t][0]+"'>"+tags[t][0]+"</option>";\n panels=panels.replace(/%taglist%/mg,taglist);\n if (p.substr(0,5)=="edit:") { \n title=p.substr(5); \n if (here && title=="here") title=here.id.substr(7);\n }\n }\n else if (p=="system") {\n panelcount++;\n defOpen=defOpen || (!params[0] && panelcount==1); // if only one panel to show, default to open\n var toolname=this.systemLabel;\n showsys=defOpen;\n if (p.indexOf('|')!=-1) toolname=p.substr(0,p.indexOf('|'));\n selectors+=this.html.systemchk.replace(/%toolname%/mg,toolname);\n selectors=selectors.replace(/%showpanel%/mg,defOpen?"CHECKED":"");\n panels+=this.html.systempanel;\n panels=panels.replace(/%showpanel%/mg,defOpen?"block":"none");\n panels=panels.replace(/%fontsize%/mg,fontsize);\n panels=panels.replace(/%fontface%/mg,fontface);\n }\n else {\n panelcount++;\n defOpen=defOpen || (!params[0] && panelcount==1); // if only one panel to show, default to open\n var toolid=toolname=p;\n if (p.indexOf('|')!=-1)\n { toolname=p.substr(0,p.indexOf('|')); toolid=p.substr(p.indexOf('|')+1); }\n selectors+=this.html.toolschk.replace(/%toolid%/mg,toolid).replace(/%toolname%/mg,toolname);\n selectors=selectors.replace(/%showpanel%/mg,defOpen?"CHECKED":"");\n panels+=this.html.toolspanel.replace(/%toolid%/mg,toolid);\n panels=panels.replace(/%showpanel%/mg,defOpen?"block":"none");\n if (defOpen) openpanels.push(toolid);\n }\n p=params.shift(); // next param\n }\n var html=this.html.framework;\n if (panelcount<2)\n html=html.replace(/%version%/mg,'').replace(/%selector%/mg,''); // omit header/selectors if just one panel to display\n else {\n html=html.replace(/%version%/mg,\n this.versionMsg.format([version.extensions.tidIDE.major,version.extensions.tidIDE.minor,version.extensions.tidIDE.revision]));\n html=html.replace(/%selector%/mg,selectors+"<hr style='margin:0;padding:0'>");\n }\n html=html.replace(/%panels%/mg,panels);\n html=html.replace(/%id%/mg,id);\n var newIDE=createTiddlyElement(place,"span");\n newIDE.innerHTML=html;\n if (title.length) this.set(id,title); // pre-load tiddler editor (if needed)\n if (showsys) config.macros.tidIDE.getsys(id); // pre-load system information (if needed)\n if (openpanels.length) for (i=0;i<openpanels.length;i++) { config.macros.tidIDE.loadPanel(id,openpanels[i]); }\n // see [[TextAreaPlugin]] for extended ctrl-F/G (search/search again)and TAB handler definitions\n var elems=newIDE.getElementsByTagName("textarea");\n for (var i=0;i<elems.length;i++) { \n if (window.addKeyDownHandlers!=undefined) window.addKeyDownHandlers(elems[i]);\n }\n}\n//}}}\n\n// // CUSTOM PANEL FUNCTIONS \n//{{{\nconfig.macros.tidIDE.loadPanel=function(id,toolid) {\n var place=document.getElementById(id+"_"+toolid+"_panel"); if (!place) return;\n var t=store.getTiddler(toolid);\n place.innerHTML=""; \n if (t) wikify(t.text,place); else place.innerHTML=this.toolsDef.format([id,toolid]);\n}\n//}}}\n\n// // EDITOR PANEL FUNCTIONS\n//{{{\nconfig.macros.tidIDE.set=function(id,title) {\n var place=document.getElementById(id+"_editorpanel"); if (!place) return;\n var f=document.getElementById(id+"_editorform");\n var p=document.getElementById(id+"_preview");\n if (f.dirty && !confirm(config.commands.cancelTiddler.warning.format([f.current]))) return;\n // reset to form defaults\n f.dirty=false;\n f.current="";\n f.created.value=f.created.defaultValue;\n f.modified.value=f.modified.defaultValue;\n f.author.value=f.author.defaultValue;\n f.content.value=f.content.defaultValue;\n f.tags.value=f.tags.defaultValue;\n f.size.value=f.size.defaultValue;\n f.freeze.checked=false;\n f.domview.value="";\n f.htmlview.value="";\n f.status.value="";\n p.innerHTML="";\n if (!title.length) return;\n f.current=title;\n // values for new/shadow tiddlers\n var cdate=new Date();\n var mdate=new Date();\n var modifier=config.options.txtUserName;\n var text=config.views.editor.defaultText.format([title]);\n var tags="";\n // adjust values for shadow tiddlers\n if (store.isShadowTiddler(title))\n { modifier=config.views.wikified.shadowModifier; text=store.getTiddlerText(title) }\n // get values for specified tiddler (if it exists)\n var t=store.getTiddler(title);\n if (t) { var cdate=t.created; var mdate=t.modified; var modifier=t.modifier; var text=t.text; var tags=t.getTags(); }\n if (!t && !store.isShadowTiddler(title)) f.tiddlers.options[f.tiddlers.options.length]=new Option(title,title,false,true); // add item to list\n f.tiddlers.value=title; // select current title (just in case it wasn't already selected)\n f.created.value=cdate.formatString(this.datetimefmt);\n f.modified.value=mdate.formatString(this.datetimefmt);\n f.author.value=modifier;\n f.content.value=text;\n f.tags.value=tags;\n f.minoredits.checked=config.options.chkForceMinorUpdate&&!readOnly;\n f.size.value=f.content.value.length+" bytes";\n if (f.preview.checked) { p.style.display="block"; this.render(id); }\n}\n\nconfig.macros.tidIDE.add=function(id) {\n var place=document.getElementById(id+"_editorpanel"); if (!place) return;\n var f=document.getElementById(id+"_editorform");\n var p=document.getElementById(id+"_preview");\n if (f.dirty && !confirm(config.commands.cancelTiddler.warning.format([f.current]))) return;\n var title=prompt(this.titleMsg,config.macros.newTiddler.title);\n while (title && store.tiddlerExists(title) && !confirm(config.messages.overwriteWarning.format([title])))\n title=prompt(this.titleMsg,config.macros.newTiddler.title);\n if (!title || !title.trim().length) return; // cancelled by user\n f.dirty=false; // suppress unneeded confirmation message\n this.set(id,title);\n}\n\nconfig.macros.tidIDE.remove=function(id) {\n var place=document.getElementById(id+"_editorpanel"); if (!place) return;\n var f=document.getElementById(id+"_editorform");\n var p=document.getElementById(id+"_preview");\n if (!f.current.length) return;\n if (!store.tiddlerExists(f.current) && store.isShadowTiddler(f.current)) { alert(this.isShadowMsg.format([f.current])); return; }\n if (config.options.chkConfirmDelete && !confirm(config.commands.deleteTiddler.warning.format([f.current]))) return;\n if (store.tiddlerExists(f.current)) {\n story.closeTiddler(f.current);\n store.removeTiddler(f.current);\n store.setDirty(true);\n if(config.options.chkAutoSave) saveChanges();\n }\n f.tiddlers.options[f.tiddlers.selectedIndex]=null; // remove item from list\n f.dirty=false; // suppress unneeded confirmation message\n this.set(id,""); // clear form controls\n}\n\nconfig.macros.tidIDE.save=function(id,saveAs) {\n var place=document.getElementById(id+"_editorpanel"); if (!place) return;\n var f=document.getElementById(id+"_editorform");\n var title=f.current;\n if (!title || !title.trim().length || saveAs) { // get a new title\n title=prompt(this.titleMsg,config.macros.newTiddler.title);\n while (title && store.tiddlerExists(title) && !confirm(config.messages.overwriteWarning.format([title])))\n title=prompt(this.titleMsg,config.macros.newTiddler.title);\n if (!title || !title.trim().length) return; // cancelled by user\n f.tiddlers.options[f.tiddlers.options.length]=new Option(title,title,false,true); // add item to list\n f.current=title;\n }\n var author=config.options.txtUserName;\n var mdate=new Date();\n var content=f.content.value;\n var tags=f.tags.value;\n var tiddler=store.saveTiddler(title,title,content,author,mdate,tags);\n if (f.minoredits.checked) {\n var author=f.author.value;\n var mdate=new Date(f.modified.value);\n var cdate=new Date(f.created.value);\n tiddler.assign(null,null,author,mdate,null,cdate);\n }\n store.setDirty(true);\n if(config.options.chkAutoSave) saveChanges();\n story.refreshTiddler(title,null,true);\n f.dirty=false;\n}\n//}}}\n\n// // EDITOR PANEL: PREVIEW FUNCTIONS\n//{{{\nif (config.options.txtTidIDEAutoFreeze==undefined)\n config.options.txtTidIDEAutoFreeze=250; // limit (in milliseconds) for auto-freezing preview display\n\nconfig.macros.tidIDE.render=function(id) {\n var place=document.getElementById(id+"_editorpanel"); if (!place) return;\n var f=document.getElementById(id+"_editorform");\n var p=document.getElementById(id+"_preview");\n var d=document.getElementById(id+"_domview");\n var h=document.getElementById(id+"_htmlview");\n p.innerHTML="";\n f.status.value=this.renderMsg;\n var start=new Date();\n wikify(f.content.value.replace(regexpCarriageReturn,''),p);\n var end=new Date();\n this.renderDOM(id);\n this.renderHTML(id);\n f.status.value=f.current+": "+(end-start+1)+"ms";\n // automatically suspend preview updates for slow rendering tiddlers\n if (end-start+1>config.options.txtTidIDEAutoFreeze) {\n f.freeze.checked=true;\n f.status.value+=this.timeoutMsg.format([config.options.txtTidIDEAutoFreeze]);\n }\n if (f.freeze.checked) f.status.value+=this.freezeMsg;\n}\n\nconfig.macros.tidIDE.renderDOM=function(id) {\n var place=document.getElementById(id+"_editorpanel"); if (!place) return;\n var f=document.getElementById(id+"_editorform");\n var p=document.getElementById(id+"_preview");\n var d=document.getElementById(id+"_domview");\n var h=document.getElementById(id+"_htmlview");\n p.style.height=(f.dom.checked||f.html.checked)?"10em":"25em";\n if (f.dom.checked) d.value=this.getNodeTree(p,"| ");\n d.style.display=f.dom.checked?"inline":"none";\n d.style.width=f.html.checked?"49.5%":"100%";\n h.style.width=f.dom.checked?"49.5%":"100%";\n}\n\nconfig.macros.tidIDE.renderHTML=function(id) {\n var place=document.getElementById(id+"_editorpanel"); if (!place) return;\n var f=document.getElementById(id+"_editorform");\n var p=document.getElementById(id+"_preview");\n var d=document.getElementById(id+"_domview");\n var h=document.getElementById(id+"_htmlview");\n p.style.height=(f.dom.checked||f.html.checked)?"10em":"25em";\n if (f.html.checked) h.value=this.formatHTML(p.innerHTML);\n h.style.display=f.html.checked?"inline":"none";\n d.style.width=f.html.checked?"49.5%":"100%";\n h.style.width=f.dom.checked?"49.5%":"100%";\n}\n\nconfig.macros.tidIDE.formatHTML=function(txt) {\n if (config.browser.isIE) return txt; // BYPASS - 4/24/2006 due to IE hang problem. Will fix later...\n var out="";\n var indent="";\n var level=0;\n for (var i=0;i<txt.length;i++) {\n var c=txt.substr(i,1);\n if (c=="<") {\n if (txt.substr(i+1,1)=="/") indent=indent.substr(0,indent.length-2);\n out+="\sn"+indent;\n if (txt.substr(i+1,1)!="/" && txt.substr(i+1,3)!="br>" && txt.substr(i+1,2)!="p>" && txt.substr(i+1,3)!="hr>") indent+=" ";\n }\n out+=c;\n if (c=="\sn")\n out+=indent;\n if (c==">" && txt.substr(i+1,1)!="<")\n out+="\sn"+indent;\n }\n return out;\n}\n\nconfig.macros.tidIDE.getNodeTree=function(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 += this.getNodeTree(thisChild,theIndent,showPath,inline,thePrefix,thePath+theNum);\n }\n return out;\n}\n//}}}\n\n// // DOMViewer macro\n//{{{\nversion.extensions.DOMViewer = version.extensions.tidIDE;\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=config.macros.tidIDE.getNodeTree(theTarget,theIndent,showPath,inline);\n wikify(out,place);\n }\n else {\n var out=config.macros.tidIDE.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 var 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}\n//}}}\n\n// // SYSTEM PANEL FUNCTIONS\n//{{{\nconfig.macros.tidIDE.showObject=function(o) { // generate formatted output for displaying object references\n var t="";\n for (var p in o) {\n if (typeof o[p]=="function") {\n t+="- - - - - - - - - - "+p+" - - - - - - - - - -\sn";\n t+=o[p].toString();\n t+="\sn- - - - - - - - - - END: "+p+" - - - - - - - - - -\sn";\n }\n else\n t+='['+typeof o[p]+'] '+p+": "+o[p]+"\sn";\n }\n return t;\n}\n\nconfig.macros.tidIDE.getsys=function(id) {\n var place=document.getElementById(id+"_systempanel"); if (!place) return;\n var f=document.getElementById(id+"_systemform");\n f.sysview.value="";\n // OPTIONS\n while (f.sys_opts.options.length > 1) { f.sys_opts.options[1]=null; } // clear list\n f.config_view.value=""; // clear edit field\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 c=1;\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 if ((opt[i].substr(0,3)=="txt")||(opt[i].substr(0,3)=="chk")) {\n var txt = (opt[i].substr(0,3)=="chk"?("["+(config.options[opt[i]]?"x":"_")+"] "):"")+opt[i]+(cookies[opt[i]]?" (cookie)":"");\n var val = config.options[opt[i]];\n f.sys_opts.options[c++]=new Option(txt,val,false,false);\n }\n }\n // STYLESHEETS\n while (f.sys_styles.options.length > 1) { f.sys_styles.options[1]=null; } // clear list\n var c=1;\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 f.sys_styles.options[c++]=new Option(txt,val,false,false);\n }\n // SHADOWS\n while (f.sys_shadows.options.length > 1) { f.sys_shadows.options[1]=null; } // clear list\n var c=1;\n for(var s in config.shadowTiddlers) f.sys_shadows.options[c++]=new Option(s,config.shadowTiddlers[s],false,false);\n // NOTIFICATIONS\n while (f.sys_notify.options.length > 1) { f.sys_notify.options[1]=null; } // clear list\n var c=1;\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+" */\sn"+n.notify.toString();\n f.sys_notify.options[c++]=new Option(txt,val,false,false);\n }\n // MACROS\n while (f.sys_macros.options.length > 1) { f.sys_macros.options[1]=null; } // clear list\n var c=1;\n var macros=new Array(); for (var m in config.macros) macros.push(m); macros.sort();\n for(var i=0; i < macros.length; i++)\n f.sys_macros.options[c++]=new Option(macros[i],this.showObject(config.macros[macros[i]]),false,false);\n // TOOLBAR COMMANDS\n while (f.sys_commands.options.length > 1) { f.sys_commands.options[1]=null; } // clear list\n var c=1;\n for(var cmd in config.commands)\n f.sys_commands.options[c++]=new Option(cmd,this.showObject(config.commands[cmd]),false,false);\n // FORMATTERS\n while (f.sys_formatters.options.length > 1) { f.sys_formatters.options[1]=null; } // clear list\n var c=1;\n for(var i=0; i < config.formatters.length; i++)\n f.sys_formatters.options[c++]=new Option(config.formatters[i].name,this.showObject(config.formatters[i]),false,false);\n // PARAMIFIERS\n while (f.sys_params.options.length > 1) { f.sys_params.options[1]=null; } // clear list\n var c=1;\n for(var param in config.paramifiers)\n f.sys_params.options[c++]=new Option(param,this.showObject(config.paramifiers[param]),false,false);\n // GLOBALS\n //global variables and functions (excluding most DOM and ~TiddyWiki core definitions)://\n var DOM0_globals = {\n addEventListener: 1, alert: 1, atob: 1, back: 1, blur: 1, btoa: 1, captureEvents: 1, clearInterval: 1,\n clearTimeout: 1, close: 1, closed: 1, Components: 1, confirm: 1, content: 1, controllers: 1, crypto: 1,\n defaultStatus: 1, defaultStatus: 1, directories: 1, disableExternalCapture: 1, dispatchEvent: 1, document: 1,\n dump: 1, enableExternalCapture: 1, escape: 1, find: 1, focus: 1, forward: 1, frameElement: 1, frames: 1,\n fullScreen: 1, getAttention: 1, getComputedStyle: 1, getSelection: 1, history: 1, home: 1, innerHeight: 1,\n innerWidth: 1, length: 1, location: 1, locationbar: 1, menubar: 1, moveBy: 1, moveTo: 1, name: 1,\n navigator: 1, open: 1, openDialog: 1, opener: 1, outerHeight: 1, outerWidth: 1, pageXOffset: 1,\n pageYOffset: 1, parent: 1, personalbar: 1, pkcs11: 1, print: 1, prompt: 1, prompter: 1, releaseEvents: 1,\n removeEventListener: 1, resizeBy: 1, resizeTo: 1, routeEvent: 1, screen: 1, screenX: 1, screenY: 1,\n scroll: 1, scrollbars: 1, scrollBy: 1, scrollByLines: 1, scrollByPages: 1, scrollMaxX: 1, scrollMaxY: 1,\n scrollTo: 1, scrollX: 1, scrollY: 1, self: 1, setInterval: 1, setResizable: 1, setTimeout: 1, sidebar: 1,\n sizeToContent: 1, status: 1, statusbar: 1, stop: 1, toolbar: 1, top: 1, unescape: 1, updateCommands: 1,\n window: 1, getInterface: 1\n };\n var tw_globals = {\n version: 1, config: 1, DEFAULT_VIEW_TEMPLATE: 1, DEFAULT_EDIT_TEMPLATE: 1, store: 1, story: 1,\n Formatter: 1, anim: 1, readOnly: 1, highlightHack: 1, main: 1, restart: 1, saveTest: 1, loadSystemConfig: 1,\n processConfig: 1, invokeMacro: 1, Formatter: 1, wikify: 1, wikifyPlain: 1, highlightify: 1, Wikifier: 1, \n Tiddler: 1, regexpBackSlashEn: 1, regexpBackSlash: 1, regexpBackSlashEss: 1, regexpNewLine: 1, \n regexpCarriageReturn: 1, TiddlyWiki: 1, displayTiddlers: 1, displayTiddler: 1, Story: 1, displayMessage: 1,\n clearMessage: 1, refreshElements: 1, applyHtmlMacros: 1, refreshPageTemplate: 1, applyPageTemplate: 1,\n refreshDisplay: 1, refreshPageTitle: 1, refreshStyles: 1, loadOptionsCookie: 1, saveOptionCookie: 1,\n saveUsingSafari: 1, startSaveArea: 1, endSaveArea: 1, checkUnsavedChanges: 1, saveChanges: 1,\n getBackupPath: 1, generateRss: 1, allTiddlersAsHtml: 1,\n convertUTF8ToUnicode: 1, manualConvertUTF8ToUnicode: 1, mozConvertUTF8ToUnicode: 1,\n convertUnicodeToUTF8: 1, manualConvertUnicodeToUTF8: 1, mozConvertUnicodeToUTF8: 1,\n saveFile: 1, loadFile: 1, ieSaveFile: 1, ieLoadFile: 1, mozillaSaveFile: 1, mozillaLoadFile: 1,\n operaUrlToFilename: 1, operaSaveFile: 1, operaLoadFile: 1, safariFilenameToUrl: 1, safariLoadFile: 1,\n safariSaveFile: 1, detectPlugin: 1, createTiddlyButton: 1, createTiddlyLink: 1, refreshTiddlyLink: 1,\n createExternalLink: 1, onClickTiddlerLink: 1, createTagButton: 1, onClickTag: 1, onClickTagOpenAll: 1,\n createTiddlyError: 1, Animator: 1, Zoomer: 1, Cascade: 1, Scroller: 1, Slider: 1, Popup: 1,\n createTiddlerPopup: 1, scrollToTiddlerPopup: 1, hideTiddlerPopup: 1, RGB: 1, drawGradient: 1,\n createTiddlyText: 1, createTiddlyElement: 1, addEvent: 1, removeEvent: 1, addClass: 1,\n removeClass: 1, hasClass: 1, resolveTarget: 1, getPlainText: 1, ensureVisible: 1, \n findWindowWidth: 1, findWindowHeight: 1, findScrollX: 1, findScrollY: 1, findPosX: 1, findPosY: 1,\n insertSpacer: 1, removeChildren: 1, setStylesheet: 1,\n Packages: 1, sun: 1, java: 1, netscape: 1, XPCNativeWrapper: 1, GeckoActiveXObject: 1\n };\n while (f.sys_globals.options.length > 1) { f.sys_globals.options[1]=null; } // clear list\n if (config.browser.isIE) return; // BYPASS - 8/16/2006 // DON'T LIST GLOBALS IN IE... throws object error - WFFL\n try {\n var c=1;\n for (var v in window) if (!(DOM0_globals[v] || tw_globals[v])) {\n var t=window[v];\n if ((typeof window[v])=='object') {\n var t='';\n for (var p in window[v]) {\n t+=((typeof window[v][p])!='function')?('['+typeof window[v][p]+'] '+p):p;\n t+=((typeof window[v][p])!='function')?('='+window[v][p]):'';\n t+='\sn';\n }\n }\n f.sys_globals.options[c++]=new Option(((typeof window[v])!='function')?('['+typeof window[v]+'] '+v):v,t,false,false);\n } \n }\n catch(e) { ; }\n}\n\nconfig.macros.tidIDE.setsys=function(id) {\n var place=document.getElementById(id+"_systempanel"); if (!place) return;\n var f=document.getElementById(id+"_systemform");\n if (f.sys_opts.selectedIndex==0) return; // heading - do nothing\n var name=f.sys_opts.options[f.sys_opts.selectedIndex].text.replace(/\s[[Xx_]\s] /,'').replace(/ \s(cookie\s)/,'')\n var value=f.config_view.value;\n config.options[name]=value;\n saveOptionCookie(name);\n f.sys_opts.options[f.sys_opts.selectedIndex].value=value;\n return;\n}\n//}}}\n\n// // HTML DEFINITIONS\n//{{{\nconfig.macros.tidIDE.html = { };\nconfig.macros.tidIDE.html.framework = " \s\n <html> %version% <form style='display:inline;margin:0;padding:0;'>%selector%</form> %panels% </html> \s\n";\n//}}}\n//{{{\nconfig.macros.tidIDE.html.editorchk = " \s\n <input type=checkbox name=editor \s\n style='display:inline;width:auto;margin:1px;' \s\n title='add/delete/modify tiddlers' %showpanel% \s\n onclick='document.getElementById(\s"%id%_editorpanel\s").style.display=this.checked?\s"block\s":\s"none\s"; \s\n if (this.checked) config.macros.tidIDE.render(\s"%id%\s");'>%toolname% \s\n";\nconfig.macros.tidIDE.html.systemchk = " \s\n <input type=checkbox name=system \s\n style='display:inline;width:auto;margin:1px;' \s\n title='view TiddlyWiki system internals and configurable options' %showpanel% \s\n onclick='document.getElementById(\s"%id%_systempanel\s").style.display=this.checked?\s"block\s":\s"none\s"; \s\n if (this.checked) config.macros.tidIDE.getsys(\s"%id%\s");'>%toolname% \s\n";\nconfig.macros.tidIDE.html.toolschk = " \s\n <input type=checkbox name=tools \s\n style='display:inline;width:auto;margin:1px;' \s\n title='' %showpanel% \s\n onclick='document.getElementById(\s"%id%_%toolid%_panel\s").style.display=this.checked?\s"block\s":\s"none\s"; \s\n if (this.checked) config.macros.tidIDE.loadPanel(\s"%id%\s",\s"%toolid%\s");'>%toolname% \s\n";\n//}}}\n//{{{\nconfig.macros.tidIDE.html.toolspanel = " \s\n <div id='%id%_%toolid%_panel' style='display:%showpanel%;margin:0;margin-top:0.5em'> \s\n </div> \s\n";\n//}}}\n//{{{\nconfig.macros.tidIDE.html.systempanel = " \s\n <div id='%id%_systempanel' style='display:%showpanel%;margin:0;margin-top:0.5em;white-space:nowrap'> \s\n <form id='%id%_systemform' style='display:inline;margin:0;padding:0;'> \s\n <!-- configurable options --> \s\n <table style='width:100%;border:0;padding:0;margin:0'><tr style='border:0;padding:0;margin:0'> \s\n <td style='width:30%;border:0;padding:0;margin:0'> \s\n <select size=1 name='sys_opts' style='width:100%;font-size:%fontsize%;' \s\n onchange='this.form.config_view.value=this.value'> \s\n <option value=\s"\s">config.options.*</option> \s\n </select> \s\n </td><td style='width:50%;border:0;padding:0;margin:0;'> \s\n <input type=text name='config_view' size=60 style='width:99%;font-size:%fontsize%;' value=''> \s\n </td><td style='width:20%;white-space:nowrap;border:0;padding:0;margin:0;'> \s\n <input type=button style='width:50%;' value='set option' title='save this TiddlyWiki option value' \s\n onclick='config.macros.tidIDE.setsys(\s"%id%\s");config.macros.tidIDE.getsys(\s"%id%\s");'><!-- \s\n --><input type=button style='width:50%;' value='refresh' title='retrieve current options and system values' \s\n onclick='this.form.sysview.style.display=\s"none\s"; config.macros.tidIDE.getsys(\s"%id%\s");'> \s\n </td></tr><tr style='border:0;padding:0;margin:0'><td colspan=3 \s\n style='white-space:nowrap;width:100%;border:0;padding:0;margin:0'> \s\n <!-- system objects --> \s\n <select size=1 name='sys_styles' style='width:25%;font-size:%fontsize%;' \s\n onchange='this.form.sysview.style.display=\s"block\s"; this.form.%id%_sysview.value=this.value'> \s\n <option value=\s"\s">stylesheets...</option> \s\n </select><select size=1 name='sys_shadows' style='width:25%;font-size:%fontsize%;' \s\n onchange='this.form.sysview.style.display=\s"block\s"; this.form.%id%_sysview.value=this.value'> \s\n <option value=\s"\s">shadows...</option> \s\n </select><select size=1 name='sys_notify' style='width:25%;font-size:%fontsize%;' \s\n onchange='this.form.sysview.style.display=\s"block\s"; this.form.%id%_sysview.value=this.value'> \s\n <option value=\s"\s">notifications...</option> \s\n </select><select size=1 name='sys_globals' style='width:25%;font-size:%fontsize%;' \s\n onchange='this.form.sysview.style.display=\s"block\s"; this.form.%id%_sysview.value=this.value'> \s\n <option value=\s"\s">globals...</option> \s\n </select><br><select size=1 name='sys_macros' style='width:25%;font-size:%fontsize%;' \s\n onchange='this.form.sysview.style.display=\s"block\s"; this.form.%id%_sysview.value=this.value'> \s\n <option value=\s"\s">macros...</option> \s\n </select><select size=1 name='sys_commands' style='width:25%;font-size:%fontsize%;' \s\n onchange='this.form.sysview.style.display=\s"block\s"; this.form.%id%_sysview.value=this.value'> \s\n <option value=\s"\s">toolbars...</option> \s\n </select><select size=1 name='sys_formatters' style='width:25%;font-size:%fontsize%;' \s\n onchange='this.form.sysview.style.display=\s"block\s"; this.form.%id%_sysview.value=this.value'> \s\n <option value=\s"\s">wikifiers...</option> \s\n </select><select size=1 name='sys_params' style='width:25%;font-size:%fontsize%;' \s\n onchange='this.form.sysview.style.display=\s"block\s"; this.form.%id%_sysview.value=this.value'> \s\n <option value=\s"\s">paramifiers...</option> \s\n </select> \s\n <!-- system value display area --> \s\n <span style='white-space:normal;'><textarea id='%id%_sysview' name=sysview cols=60 rows=12 \s\n onfocus='this.select()' style='width:99.5%;height:16em;font-size:%fontsize%;font-family:%fontface%;display:none'></textarea></span> \s\n </td></tr></table> \s\n </form> \s\n </div> \s\n";\n//}}}\n//{{{\nconfig.macros.tidIDE.html.editorpanel = " \s\n <div id='%id%_editorpanel' style='display:%showpanel%;margin:0;margin-top:0.5em'> \s\n <form id='%id%_editorform' style='display:inline;margin:0;padding:0;'> \s\n <!-- tiddler editor list and buttons --> \s\n <select size=1 name=tiddlers style='display:inline;width:40%;font-size:%fontsize%;' \s\n onchange='config.macros.tidIDE.set(\s"%id%\s",this.value); this.value=this.form.current;'> \s\n <option value=''>select a tiddler...</option> \s\n %tiddlerlist% \s\n </select><!-- \s\n --><input name=add type=button style='display:inline;width:10%' \s\n value='new' title='create a new tiddler' \s\n onclick='config.macros.tidIDE.add(\s"%id%\s")' %disabled%><!-- \s\n --><input name=remove type=button style='display:inline;width:10%' \s\n value='remove' title='delete this tiddler' \s\n onclick='config.macros.tidIDE.remove(\s"%id%\s")' %disabled%><!-- \s\n --><input name=save type=button style='display:inline;width:10%' \s\n value='save' title='save changes to this tiddler' \s\n onclick='config.macros.tidIDE.save(\s"%id%\s")' %disabled%><!-- \s\n --><input name=saveas type=button style='display:inline;width:10%' \s\n value='save as' title='save changes to a new tiddler' \s\n onclick='config.macros.tidIDE.save(\s"%id%\s",true)' %disabled%><!-- \s\n --><input name=view type=button style='display:inline;width:10%' \s\n value='open' title='open this tiddler for regular viewing' \s\n onclick='if (!this.form.current.length) return; story.displayTiddler(null,this.form.current)'><!-- \s\n --><!-- COMMENTED OUT <input name=run type=button style='display:inline;width:9%' \s\n value='run' title='evaluate this tiddler as a javascript \s"systemConfig\s" plugin' \s\n onclick='if (!confirm(config.macros.tidIDE.evalMsg.format([this.form.current]))) return false; \s\n var err=processConfig(this.form.content.value); \s\n if(err)displayMessage(config.messages.customConfigError.format([err,this.form.current]));'> END COMMENT --><!-- \s\n --><input name=previewbutton type=button style='display:inline;width:10%;' \s\n value='preview' title='show \s"live\s" preview display' \s\n onclick='document.getElementById(\s"%id%_previewpanel\s").style.display=\s"block\s"; \s\n this.form.preview.checked=true; config.macros.tidIDE.render(\s"%id%\s")'><!-- \s\n hidden field for preview show/hide state: \s\n --><input name=preview type=checkbox style='display:none;'>\s\n <!-- tiddler content edit --> \s\n <div><textarea id='%id%_content' name='content' edit='text' cols=60 rows=%maxrows% \s\n style='width:100%;font-size:%fontsize%;font-family:%fontface%;' \s\n onkeyup='var f=this.form; f.dirty=true; f.size.value=this.value.length+\s" bytes\s"; \s\n var p=document.getElementById(\s"%id%_preview\s"); \s\n if (f.preview.checked && !f.freeze.checked) { config.macros.tidIDE.render(\s"%id%\s"); }'></textarea></div> \s\n <!-- tag edit and droplist --> \s\n <table width='100%' style='border:0;padding:0;margin:0'><tr style='border:0;padding:0;margin:0'> \s\n <td style='border:0;padding:0;margin:0'> \s\n <input type=text name=tags size=60 style='width:100%;font-size:%fontsize%;' value='' \s\n onchange='this.form.dirty=true' %disabled%> \s\n </td><td width='1' style='border:0;padding:0;margin:0;'> \s\n <select size=1 name=taglist style='font-size:%fontsize%;' \s\n onchange='this.form.dirty=true; this.form.tags.value+=\s" \s"+this.value' %disabled%> \s\n <option value=''>select tags...</option> \s\n %taglist% \s\n </select> \s\n </td></tr></table> \s\n <!-- created/modified dates, author, current tiddler size --> \s\n <div style='float:right;'> \s\n created <input type=text name=created size=15 \s\n style='display:inline;font-size:%fontsize%;text-align:center;padding:0;' value='' \s\n onchange='this.form.dirty=true' %minoredits%> \s\n modified <input type=text name=modified size=15 \s\n style='display:inline;font-size:%fontsize%;text-align:center;padding:0;' value='' \s\n onchange='this.form.dirty=true;' %minoredits%> \s\n by <input type=text name=author size=15 \s\n style='display:inline;font-size:%fontsize%;padding:0;' value='' \s\n onfocus='this.select()' onchange='this.form.dirty=true' %minoredits%> \s\n <input type=text name=size size=10 \s\n style='display:inline;font-size:%fontsize%;text-align:center;padding:0;' value='' \s\n onfocus='this.blur()' onkeydown='return false' DISABLED> \s\n </div> \s\n <!-- toggles: read-only, minor edit --> \s\n <span style='white-space:nowrap'> \s\n <input type=checkbox name=readonly \s\n style='display:inline;width:auto;margin:1px;' %readonlychk% \s\n title='do not allow tiddler changes to be saved' \s\n onclick='readOnly=config.options.chkHttpReadOnly=this.checked;saveOptionCookie(\s"chkHttpReadOnly\s"); \s\n var f=this.form; f.minoredits.disabled=f.tags.disabled=f.taglist.disabled=this.checked; \s\n f.add.disabled=f.remove.disabled=f.save.disabled=f.saveas.disabled=this.checked; \s\n f.created.disabled=f.modified.disabled=f.author.disabled=this.checked||!f.minoredits.checked;'>readonly \s\n <input type=checkbox name=minoredits \s\n style='display:inline;width:auto;margin:1px;' %disabled% %minorchk% \s\n title='check: save datestamps/author as entered, uncheck: auto-update modified/author' \s\n onclick='this.form.created.disabled=this.form.modified.disabled=this.form.author.disabled=!this.checked; \s\n config.options.chkForceMinorUpdate=this.checked;saveOptionCookie(\s"chkForceMinorUpdate\s");'>minor edits \s\n </span> \s\n <!-- tiddler preview display --> \s\n <div id='%id%_previewpanel' style='display:none;white-space:nowrap'> \s\n <div id='%id%_preview' class='viewer' style='margin:0;margin-top:.5em;height:25em;overflow:auto;white-space:normal'> \s\n &nbsp; \s\n </div> \s\n <!-- DOM and HTML viewers --> \s\n <textarea id='%id%_domview' name=domview cols=60 rows=12 wrap=off \s\n onfocus='this.select()' style='display:none;width:100%;height:16em;font-size:%fontsize%;'></textarea><!-- \s\n --><textarea id='%id%_htmlview' name=htmlview cols=60 rows=12 wrap=off \s\n onfocus='this.select()' style='display:none;width:100%;height:16em;font-size:%fontsize%;'></textarea> \s\n <!-- status line, preview option checkboxes, run/refresh buttons --> \s\n <table width='100%' style='border:0;padding:0;margin:0'><tr style='border:0;padding:0;margin:0'> \s\n <td style='border:0;padding:0;margin:0'> \s\n <input type=text '%id%_status' name=status style='padding:0;width:100%;font-size:%fontsize%;'> \s\n </td><td style='width:1%;border:0;padding:0;margin:0;text-align:right;white-space:nowrap'> \s\n <input type=checkbox name=dom style='display:inline;width:auto;margin:1px;' \s\n title='show Document Object Model (DOM) information' \s\n onclick='config.macros.tidIDE.renderDOM(\s"%id%\s");'>DOM \s\n <input type=checkbox name=html style='display:inline;width:auto;margin:1px;' \s\n title='show rendered HTML' \s\n onclick='config.macros.tidIDE.renderHTML(\s"%id%\s");'>HTML \s\n <input type=checkbox name=freeze style='display:inline;width:auto;margin:1px;' \s\n title='do not update preview display as changes are made' \s\n onclick='var p=document.getElementById(\s"%id%_preview\s"); \s\n if (this.checked) this.form.status.value+=config.macros.tidIDE.freezeMsg; \s\n else config.macros.tidIDE.render(\s"%id%\s");'>freeze \s\n <!-- COMMENTED OUT <input type=button style='display:inline;width:auto;' value='run' \s\n title='evaluate this tiddler as a javascript \s"systemConfig\s" plugin' \s\n onclick='if (!confirm(config.macros.tidIDE.evalMsg.format([this.form.current]))) return false; \s\n var err=processConfig(this.form.content.value); \s\n if(err)displayMessage(config.messages.customConfigError.format([err,this.form.current]));'> END COMMENT --><!-- \s\n --><input type=button style='display:inline;width:auto;' value='refresh' \s\n title='update preview display' \s\n onclick='config.macros.tidIDE.render(\s"%id%\s")'><!-- \s\n --><input type=button style='display:inline;width:auto;' value='hide' \s\n title='hide preview display' \s\n onclick='document.getElementById(\s"%id%_previewpanel\s").style.display=\s"none\s"; \s\n this.form.preview.checked=false; config.macros.tidIDE.render(\s"%id%\s")'> \s\n </td></tr></table> \s\n </div> \s\n </form> \s\n </div> \s\n";\n//}}}
/***\n|''Name''|TiddlerPopupMacro|\n|''Version''|0.1|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#TiddlerPopupMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|Shows the contents of the specified tiddler in a popup.|\n!Notes\nThis is a sample macro, created only for educational purposes.\n!Usage\n{{{\n<<tiddlerPopup [tiddler name]>>\n}}}\n!!Example\n<<tiddlerPopup [[ColorPalette]]>>\n!Revision History\n!!v0.1 (2007-11-19)\n* initial release\n!To Do\n* parameters for {{{buttonClass}}}, {{{popupClass}}}, {{{id}}}, {{{accessKey}}}\n* customizable order (title, tags, contents)\n!Code\n***/\n//{{{\nconfig.macros.tiddlerPopup = {\n label: "label",\n tooltip: "tooltip",\n buttonClass: null,\n id: null,\n accessKey: null\n};\n\nconfig.macros.tiddlerPopup.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var title = params[0] || tiddler.title;\n this.label = title;\n this.tooltip = "show " + title;\n createTiddlyButton(place, this.label, this.tooltip,\n function(e) { config.macros.tiddlerPopup.show(e, this, title) },\n this.buttonClass, this.id, this.accessKey);\n};\n\nconfig.macros.tiddlerPopup.show = function(ev, el, title) {\n // prevent event bubbling\n ev.cancelBubble = true;\n if(ev.stopPropagation) ev.stopPropagation();\n // show tiddler contents\n var tiddler = store.getTiddler(title);\n var popup = Popup.create(el, "div");\n if(tiddler) {\n var contents = "tags: " + tiddler.tags.join(" ") + "\sn----\sn"\n + "[[" + tiddler.title + "]]\sn----\sn"\n + tiddler.text;\n } else {\n if(store.getTiddlerText(title)) { // shadow tiddler\n var contents = "[[" + title + "]]\sn----\sn" + store.getTiddlerText(title);\n } else {\n var contents = "Error: Tiddler [[" + title + "]] not found.";\n }\n }\n wikify(contents, popup);\n Popup.show();\n}\n//}}}
/***\n|''Name''|TiddlerPreviewPlugin|\n|''Description''|provides a toolbar command for previewing tiddlers in edit mode|\n|''Author''|FND|\n|''Contributors''|Saq Imtiaz|\n|''Version''|0.2.5|\n|''Status''|@@beta@@|\n|''Source''|http://svn.tiddlywiki.org/contributors/FND/plugins/TiddlerPreviewPlugin.js|\n|''CodeRepository''|http://svn.tiddlywiki.org/contributors/FND/|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''CoreVersion''|2.2|\n!Usage\nPreviews are accessed via the {{{previewTiddler}}} command, which must be added to the [[tiddler toolbar|http://www.tiddlywiki.org/wiki/Tiddler_Toolbar]].\n!Configuration Options\n<<option chkPopupPreview>> use popup for preview\n!Revision History\n!!v0.2 (2008-12-06)\n* initial release\n!To Do\n* styling inconsistencies in preview (e.g. tag buttons)\n* disable in view mode\n* smooth scrolling\n!Code\n***/\n//{{{\nif(!version.extensions.TiddlerPreviewPlugin) { //# ensure that the plugin is only installed once\nversion.extensions.TiddlerPreviewPlugin = { installed: true };\n\nconfig.optionsDesc.chkPopupPreview = "use popup for preview";\n\nconfig.commands.previewTiddler = {\n text: "preview",\n tooltip: "preview tiddler contents",\n className: "preview",\n\n handler: function(ev, src, title) {\n var tiddlerElem = story.findContainingTiddler(src);\n if(config.options.chkPopupPreview) {\n this.generatePopup(title, tiddlerElem, src, ev);\n } else {\n this.generatePane(title, tiddlerElem);\n }\n return false;\n },\n\n generatePane: function(title, tiddlerElem) {\n var containers = tiddlerElem.getElementsByTagName("div");\n var pane = containers[containers.length - 1];\n if(pane && hasClass(pane, this.className)) {\n removeChildren(pane);\n } else {\n pane = createTiddlyElement(tiddlerElem, "div", null,\n this.className + " viewer");\n }\n this.displayPreview(pane, tiddlerElem, title);\n pane.ondblclick = function(ev) {\n window.scrollTo(0, ensureVisible(this.parentNode));\n stopEvent(ev);\n return false;\n };\n window.scrollTo(0, ensureVisible(pane));\n },\n\n generatePopup: function(title, tiddlerElem, src, ev) {\n var popup = Popup.create(src, "div",\n this.className + " popupTiddler viewer");\n this.displayPreview(popup, tiddlerElem, title);\n Popup.show();\n stopEvent(ev);\n return false;\n },\n\n displayPreview: function(container, tiddlerElem, title) {\n var tiddler = merge(new Tiddler(title), store.getTiddler(title));\n var newTitle = title;\n if(tiddlerElem) {\n var fields = {};\n story.gatherSaveFields(tiddlerElem, fields);\n tiddler.fields = store.tiddlerExists(newTitle) ?\n store.fetchTiddler(newTitle).fields :\n (newTitle != title && store.tiddlerExists(title) ?\n store.fetchTiddler(title).fields :\n merge({}, config.defaultCustomFields));\n for(var p in fields) {\n if(TiddlyWiki.isStandardField(p)) {\n if(p == "tags") {\n tiddler[p] = fields[p].readBracketedList();\n } else {\n tiddler[p] = fields[p];\n }\n } else {\n tiddler.fields[p] = fields[p];\n }\n }\n var template = story.chooseTemplateForTiddler(title, DEFAULT_VIEW_TEMPLATE);\n container.innerHTML = story.getTemplateForTiddler(title, template, tiddler);\n applyHtmlMacros(container, tiddler);\n forceReflow();\n }\n }\n};\n\nconfig.shadowTiddlers.StyleSheetPreview = ("/*{{{*/\sn" +\n ".%0 {\sn" +\n "\stpadding: 5px;\sn" +\n "\stbackground-color: #eee;\sn" +\n "}\sn\sn" +\n ".%0 .toolbar {\sn" +\n "\stdisplay: none;\sn" +\n "}\sn" +\n "/*}}}*/").format([config.commands.previewTiddler.className]);\nstore.addNotification("StyleSheetPreview", refreshStyles);\n\n} //# end of "install only once"\n//}}}\n
/***\n|Name|TiddlerToCPlugin|\n|Source|[[FND's DevPad|http://devpad.tiddlyspot.com/#TiddlerToCPlugin]]|\n|Version|0.7|\n|Author|FND|\n|Contributors|[[Saq|http://tw.lewcid.org]]|\n|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires|N/A|\n|Overrides|N/A|\n|Description|create a table of contents from a tiddler's headings|\n!Notes\nDoug Compton has written a similar, though much more advanced plugin for this purpose, called [[DcTableOfContentsPlugin|http://devpad.tiddlyspot.com/#DcTableOfContentsPlugin]].\n!Usage\nAdd {{{<<ToC>>}}} to the desired tiddler(s). Alternatively, a parameter can be used to display the table of contents for another tiddler: {{{<<ToC "tiddlerName">>}}}.\nThe styling can be modified in the [[StyleSheetTableOfContents]] shadow tiddler.\n<<ToC>>\n!Changelog\n!!v0.5a (2007-05-20)\n* initial release\n!!v0.5b (2007-05-20)\n* renamed to TiddlerToCPlugin (to prevent confusion with the existing [[TableOfContentsPlugin|http://tiddlytools.com/#TableOfContentsPlugin]])\n!!v0.6 (2007-05-21)\n* several bugfixes and significant improvements regarding the macro code (thanks Saq)\n!!v0.7 (2007-08-29)\n* fixed error for tiddlers not containing any headings\n!Issues / To Do\n* add links to sections (problematic, as there are no anchors, yet?)\n* introduce thresholds (minimum amount of headings to show a ToC, maximum depth)\n!Code\n***/\n//{{{\n/*\n** Styles (can be customized in the StyleSheetTableOfContents shadow tiddler)\n*/\n\nconfig.shadowTiddlers.StyleSheetTableOfContents = "/*{{{*/\sn"\n + ".ToC {\sn\stfloat: left; /* auto-width */\sn\stmargin: 0 2em 2em 0;\sn\stborder: 1px solid #aaa;\sn\stpadding: 5px;\sn\stbackground-color: #eee;\sn}\sn\sn"\n + ".ToC ol {\sn\stmargin: 0 1em;\sn}\sn\sn"\n + "h1 {\sn\stclear: left;\sn}\sn"\n + "/*}}}*/";\nstore.addNotification("StyleSheetTableOfContents", refreshStyles);\n\n/*\n** Macro Code\n*/\n\nconfig.macros.ToC = { label: "Add Table of Contents", prompt: "Add Table of Contents" }; // DEBUG: obsolete?\nconfig.macros.ToC.handler =\n function(place, macroName, params, wikifier, paramString, tiddler) {\n // process parameters\n if (params[0]) { // tiddler name\n tiddler = store.getTiddler(params[0]);\n }\n // create table of contents\n generateToC(place, tiddler);\n return false; // DEBUG: ?\n}\n\n/*\n** Main Code\n*/\n\ngenerateToC = function(place, tiddler) {\n // retrieve headings\n var RegEx = /^!+(.*)$/gim;\n var tiddlerContents = tiddler.text.match(RegEx);\n // create ToC\n if(tiddlerContents) {\n var ToC = "";\n for(var i = 0; i < tiddlerContents.length; i++) {\n ToC += tiddlerContents[i] + "\sn";\n }\n // replace headings markup with list markup\n for(var i = 0; i < 6; i++) { // DEBUG: inefficient!? (use a single RegEx instead? problem: JavaScript RegEx limitations)\n ToC = ToC.replace(/^(#*)!/gim, "$1#");\n }\n // add ToC wrapper container\n ToC = "{{ToC{\sn''Table of Contents''\sn" + ToC + "}}}\sn";\n // add ToC to tiddler\n wikify(ToC, place);\n }\n return false;\n}\n//}}}
This is the sandbox for testing the TiddlerToCPlugin.\nThe styling can be changed in the StyleSheetTableOfContents shadow tiddler.\n\nTable of contents for the current tiddler:\n<<ToC>>\n@@display(block):clear(both):@@\nTable of contents for the StyleSheet tiddler:\n<<ToC "StyleSheet">>\n@@display(block):clear(both):@@\n!Heading 1\nLorem ipsum dolor sit amet, consectetur adipisicing elit.\n!!Heading 1-1\nSed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n!!Heading 1-2\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n!Heading 2\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n!!Heading 2-1\nExcepteur sint occaecat cupidatat non proident.\n!!Heading 2-2\nSunt in culpa qui officia deserunt mollit anim id est laborum.
/***\n|''Name''|TiddlerWriteMacro|\n|''Version''|0.1|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#TiddlerPopupMacro]]|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|Shows the contents of the specified tiddler.|\n!Notes\nThis is a sample macro, created only for educational purposes.\n!Usage\n{{{\n<<tiddlerWrite tiddlerName>>\n}}}\n!!Example\n<<tiddlerWrite [[ColorPalette]]>>\n!Revision History\n!!v0.1 (2007-11-19)\n* initial release\n!Code\n***/\n//{{{\nconfig.macros.tiddlerWrite = {};\nconfig.macros.tiddlerWrite.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n var title = params[0];\n if(title == tiddler.title) {\n title = "Error: Can't use the same tiddler from which the macro is called (infinite recursion)!";\n }\n var tiddler = store.getTiddler(title);\n if(tiddler) {\n var contents = "tags: " + tiddler.tags.join(" ") + "\sn----\sn"\n + "[[" + tiddler.title + "]]\sn----\sn"\n + tiddler.text;\n } else {\n if(store.getTiddlerText(title)) { // shadow tiddler\n var contents = "[[" + title + "]]\sn----\sn" + store.getTiddlerText(title);\n } else {\n var contents = "Error: Tiddler [[" + title + "]] not found.";\n }\n }\n wikify("<<<\sn" + contents + "\sn<<<", place);\n}\n//}}}
[[TiddlyWiki]] - a reusable non-linear personal web notebook\nhttp://www.tiddlywiki.com
/***\n|''Name''|ToggleElementMacro|\n|''Description''|toggles the visibility of the element specified|\n|''Author''|FND|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#ToggleElementMacro]]|\n|''Version''|0.6|\n|''Status''|@@experimental@@|\n|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|\n|''~CoreVersion''|2.1|\n!Notes\nThis macro was created for use with the [[overflow technique|http://cleanlayout.tiddlyspot.com/#StyleSheet]] (cf. [[[twdev] StyleSheetLayout: overflow technique|http://groups.google.at/group/TiddlyWikiDev/browse_thread/thread/b55011665c5e04d9/]]).\n!Usage\n{{{\n<<toggleElement\n [element ID]\n [button label]\n [button tooltip]\n [button class]\n [button access key]\n [startup mode]\n>>\n}}}\nAll parameters are optional.\nIf the last parameter is {{{"hide"}}}, the respective element will be hidden when the macro is first rendered.\nIn order to use the default value for a certain property, the respective parameter can either be omitted or defined as empty by using {{{""}}}.\n!!Examples\n|!Code|!Result|\n|{{{<<toggleElement>>}}}| <<toggleElement>> |\n|{{{<<toggleElement "mainMenu" "Toggle MainMenu" "" "tiddlyLinkExisting">>}}}| <<toggleElement "mainMenu" "Toggle MainMenu" "" "tiddlyLinkExisting">> |\n|{{{<<toggleElement "mainMenu" "Toggle MainMenu" "" "" "" "hide">>}}}| <<toggleElement "mainMenu" "Toggle MainMenu" "" "" "" "hide">> |\n!Revision History\n!!v0.5 (2007-09-22)\n* initial proof-of-concept implementation\n!!v0.6 (2007-11-11)\n* added parameter for hiding element by default\n* renamed to [[ToggleElementMacro]] (from [[ToggleElementPlugin]])\n!To Do\n* use named parameters\n* documentation (esp. parameters)\n* separate button labels depending on element's toggle state\n* add animations (using [[AnimationsLibrary]]; cf. [[ToggleElementPlugin (animated)]])\n!Code\n***/\n//{{{\nconfig.macros.toggleElement = {\n elementID: "sidebar",\n label: "Toggle Sidebar",\n prompt: "Switch sidebar on and off",\n buttonClass: "",\n accessKey: ""\n};\n\nconfig.macros.toggleElement.handler = function(place, macroName, params) {\n // process command line parameters\n var elementID = params[0] || this.elementID;\n var label = params[1] || this.label;\n var prompt = params[2] || this.prompt;\n var buttonClass = params[3] || this.buttonClass;\n var accessKey = params[4] || this.accessKey;\n // startup mode\n if(params[5] == "hide") {\n this.toggle(elementID);\n }\n // create toggle button\n createTiddlyButton(place, label, prompt,\n function() { config.macros.toggleElement.toggle(elementID); },\n buttonClass, null, accessKey);\n};\n\nconfig.macros.toggleElement.toggle = function(id) {\n var e = document.getElementById(id);\n if(e) {\n if(e.style.display != "none") {\n e.style.display = "none";\n } else {\n e.style.display = "";\n }\n }\n};\n//}}}
/***\nRequired by Tiddlyspot\n***/\n//{{{\n\nconfig.options.chkHttpReadOnly = false; // make it so you can by default see edit controls via http\n\nif (window.location.protocol != "file:")\n config.options.chkGTDLazyAutoSave = false; // disable autosave in d3\n\nconfig.tiddlyspotSiteId = 'devpad';\n\n// probably will need to redo this for TW 2.2\nwith (config.shadowTiddlers) {\n SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';\n SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");\n OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");\n DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[Welcome to Tiddlyspot]] ");\n MainMenu = MainMenu.replace(/^/,"[[Welcome to Tiddlyspot]] ");\n}\n\nmerge(config.shadowTiddlers,{\n\n'Welcome to Tiddlyspot':[\n "This document is a ~TiddlyWiki from tiddlyspot.com. A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.",\n "",\n "@@font-weight:bold;font-size:1.3em;color:#444; //What now?// &nbsp;&nbsp;@@ Before you can save any changes, you need to enter your password in the form below. Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",\n "<<tiddler TspotControls>>",\n "See also GettingStarted.",\n "",\n "@@font-weight:bold;font-size:1.3em;color:#444; //Working online// &nbsp;&nbsp;@@ You can edit this ~TiddlyWiki right now, and save your changes using the \s"save to web\s" button in the column on the right.",\n "",\n "@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// &nbsp;&nbsp;@@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick. You can make changes and save them locally without being connected to the Internet. When you're ready to sync up again, just click \s"upload\s" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",\n "",\n "@@font-weight:bold;font-size:1.3em;color:#444; //Help!// &nbsp;&nbsp;@@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]]. Also visit [[TiddlyWiki Guides|http://tiddlywikiguides.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help. If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].",\n "",\n "@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// &nbsp;&nbsp;@@ We hope you like using your tiddlyspot.com site. Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."\n].join("\sn"),\n\n'TspotControls':[\n "| tiddlyspot password:|<<option pasUploadPassword>>|",\n "| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . . " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<<br>>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",\n "| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[announcements|http://announce.tiddlyspot.com/]], [[blog|http://tiddlyspot.com/blog/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|"\n].join("\sn"),\n\n'TspotSidebar':[\n "<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . . " + config.tiddlyspotSiteId + ">><html><a href='http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download' class='button'>download</a></html>"\n].join("\sn"),\n\n'TspotOptions':[\n "tiddlyspot password:",\n "<<option pasUploadPassword>>",\n ""\n].join("\sn")\n\n});\n//}}}\n
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin | Ok |\n| 10/1/2008 18:46:1 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/1/2008 18:52:39 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/1/2008 18:59:27 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 10/1/2008 19:5:36 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 7/2/2008 16:37:2 | FND | [[/|http://devpad.tiddlyspot.com/#DcTableOfContentsPlugin]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 8/2/2008 23:32:5 | FND | [[/|http://devpad.tiddlyspot.com/#EvalMacro]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 10/2/2008 14:54:35 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 31/3/2008 8:16:25 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 18/4/2008 11:34:40 | FND | [[/|http://devpad.tiddlyspot.com/#EvalMacro]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 12/5/2008 14:22:20 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 30/5/2008 22:5:44 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 1/6/2008 3:35:5 | FND | [[/|http://devpad.tiddlyspot.com/#ConditionalTableFormattingMacro]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 16/7/2008 14:50:40 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 16/7/2008 14:51:19 | FND | [[/|http://devpad.tiddlyspot.com/#SearchTagPlugin]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 19/8/2008 15:59:49 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 19/8/2008 16:11:27 | FND | [[/|http://devpad.tiddlyspot.com/#SimpleSearchPlugin]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 26/8/2008 13:26:43 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 15/10/2008 12:59:28 | FND | [[/|http://devpad.tiddlyspot.com/#DcTableOfContentsPlugin]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 29/10/2008 8:56:10 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 31/10/2008 16:28:9 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 4/11/2008 16:58:52 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 5/11/2008 13:2:29 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 26/11/2008 9:47:48 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 4/12/2008 15:39:45 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 6/12/2008 18:25:34 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 6/12/2008 18:26:27 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 6/12/2008 18:33:5 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 25/1/2009 21:50:27 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 25/1/2009 21:51:26 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 19/3/2009 11:23:4 | FND | [[/|http://devpad.tiddlyspot.com/#eMailMacro%20templatesTest%20TagNavigatorTest%20SimpleCommentsTest%20TiddlerToCTest]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 6/5/2009 16:15:9 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 6/5/2009 18:56:0 | FND | [[/|http://devpad.tiddlyspot.com/#CommentsFormatter]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . | Ok |\n| 6/5/2009 18:56:31 | FND | [[/|http://devpad.tiddlyspot.com/#CommentsFormatter]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 6/5/2009 20:32:22 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 7/5/2009 16:24:12 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 8/7/2009 10:45:16 | FND | [[/|http://devpad.tiddlyspot.com/]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |\n| 9/2/2010 17:51:1 | FND | [[/|http://devpad.tiddlyspot.com/#SimpleSearchPlugin%20templatesTest%20TagNavigatorTest%20SimpleCommentsTest%20TiddlerToCTest]] | [[store.cgi|http://devpad.tiddlyspot.com/store.cgi]] | . | index.html | . |
/***\n|''Name:''|UploadPlugin|\n|''Description:''|Save to web a TiddlyWiki|\n|''Version:''|3.4.5|\n|''Date:''|Oct 15, 2006|\n|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|\n|''Documentation:''|http://tiddlywiki.bidix.info/#UploadDoc|\n|''Author:''|BidiX (BidiX (at) bidix (dot) info)|\n|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|\n|''~CoreVersion:''|2.0.0|\n|''Browser:''|Firefox 1.5; InternetExplorer 6.0; Safari|\n|''Include:''|config.lib.file; config.lib.log; config.lib.options; PasswordTweak|\n|''Require:''|[[UploadService|http://tiddlywiki.bidix.info/#UploadService]]|\n***/\n//{{{\nversion.extensions.UploadPlugin = {\n major: 3, minor: 4, revision: 5, \n date: new Date(2006,9,15),\n source: 'http://tiddlywiki.bidix.info/#UploadPlugin',\n documentation: 'http://tiddlywiki.bidix.info/#UploadDoc',\n author: 'BidiX (BidiX (at) bidix (dot) info',\n license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',\n coreVersion: '2.0.0',\n browser: 'Firefox 1.5; InternetExplorer 6.0; Safari'\n};\n//}}}\n\n////+++!![config.lib.file]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.file) config.lib.file= {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\nconfig.lib.file.dirname = function (filePath) {\n var lastpos;\n if ((lastpos = filePath.lastIndexOf("/")) != -1) {\n return filePath.substring(0, lastpos);\n } else {\n return filePath.substring(0, filePath.lastIndexOf("\s\s"));\n }\n};\nconfig.lib.file.basename = function (filePath) {\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 } else\n return filePath.substring(filePath.lastIndexOf("\s\s")+1);\n};\nwindow.basename = function() {return "@@deprecated@@";};\n//}}}\n////===\n\n////+++!![config.lib.log]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.log) config.lib.log= {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 1}, \n date: new Date(2006,8,19)\n};\nconfig.lib.Log = function(tiddlerTitle, logHeader) {\n if (version.major < 2)\n this.tiddler = store.tiddlers[tiddlerTitle];\n else\n this.tiddler = store.getTiddler(tiddlerTitle);\n if (!this.tiddler) {\n this.tiddler = new Tiddler();\n this.tiddler.title = tiddlerTitle;\n this.tiddler.text = "| !date | !user | !location |" + logHeader;\n this.tiddler.created = new Date();\n this.tiddler.modifier = config.options.txtUserName;\n this.tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers[tiddlerTitle] = this.tiddler;\n else\n store.addTiddler(this.tiddler);\n }\n return this;\n};\n\nconfig.lib.Log.prototype.newLine = function (line) {\n var now = new Date();\n var newText = "| ";\n newText += now.getDate()+"/"+(now.getMonth()+1)+"/"+now.getFullYear() + " ";\n newText += now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" | ";\n newText += config.options.txtUserName + " | ";\n var location = document.location.toString();\n var filename = config.lib.file.basename(location);\n if (!filename) filename = '/';\n newText += "[["+filename+"|"+location + "]] |";\n this.tiddler.text = this.tiddler.text + "\sn" + newText;\n this.addToLine(line);\n};\n\nconfig.lib.Log.prototype.addToLine = function (text) {\n this.tiddler.text = this.tiddler.text + text;\n this.tiddler.modifier = config.options.txtUserName;\n this.tiddler.modified = new Date();\n if (version.major < 2)\n store.tiddlers[this.tiddler.tittle] = this.tiddler;\n else {\n store.addTiddler(this.tiddler);\n story.refreshTiddler(this.tiddler.title);\n store.notify(this.tiddler.title, true);\n }\n if (version.major < 2)\n store.notifyAll(); \n};\n//}}}\n////===\n\n////+++!![config.lib.options]\n\n//{{{\nif (!config.lib) config.lib = {};\nif (!config.lib.options) config.lib.options = {\n author: 'BidiX',\n version: {major: 0, minor: 1, revision: 0}, \n date: new Date(2006,3,9)\n};\n\nconfig.lib.options.init = function (name, defaultValue) {\n if (!config.options[name]) {\n config.options[name] = defaultValue;\n saveOptionCookie(name);\n }\n};\n//}}}\n////===\n\n////+++!![PasswordTweak]\n\n//{{{\nversion.extensions.PasswordTweak = {\n major: 1, minor: 0, revision: 3, date: new Date(2006,8,30),\n type: 'tweak',\n source: 'http://tiddlywiki.bidix.info/#PasswordTweak'\n};\n//}}}\n/***\n!!config.macros.option\n***/\n//{{{\nconfig.macros.option.passwordCheckboxLabel = "Save this password on this computer";\nconfig.macros.option.passwordType = "password"; // password | text\n\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 {\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.className = "txtOptionInput "+opt;\n place.appendChild(c);\n c.value = config.options[opt];\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.className = "pasOptionInput "+opt;\n place.appendChild(c);\n c.value = config.options[opt];\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 c.className = "chkOptionInput "+opt;\n place.appendChild(c);\n c.checked = config.options["chk"+opt];\n // text savePasswordCheckboxLabel\n place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));\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 c.className = "chkOptionInput "+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_orig_PasswordTweak = window.loadOptionsCookie;\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_orig_PasswordTweak = window.saveOptionCookie;\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!! Initializations\n***/\n//{{{\n// define config.options.pasPassword\nif (!config.options.pasPassword) {\n config.options.pasPassword = 'defaultPassword';\n window.saveOptionCookie('pasPassword');\n}\n// since loadCookies is first called befor password definition\n// we need to reload cookies\nwindow.loadOptionsCookie();\n//}}}\n////===\n\n////+++!![config.macros.upload]\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 backupFileStored: "Previous file backuped in %0",\n crossDomain: "Certainly a cross-domain isue: access to an other site isn't allowed",\n errorDownloading: "Error downloading",\n errorUploadingContent: "Error uploading content",\n fileLocked: "Files is locked: You are not allowed to Upload",\n fileNotFound: "file to upload not found",\n fileNotUploaded: "File %0 NOT uploaded",\n mainFileUploaded: "Main TiddlyWiki file uploaded to %0",\n passwordEmpty: "Unable to upload, your password is empty",\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 // parameters initialization\n var storeUrl = params[0];\n var toFilename = params[1];\n var backupDir = params[2];\n var uploadDir = params[3];\n var username = params[4];\n var password; // for security reason no password as macro parameter\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([this.toDirUrl(storeUrl, uploadDir, username)]);\n }\n else {\n prompt = this.label.promptOption;\n }\n createTiddlyButton(place, label, prompt, \n function () {\n config.macros.upload.upload(storeUrl, toFilename, uploadDir, backupDir, username, password); \n return false;}, \n null, null, this.accessKey);\n};\nconfig.macros.upload.UploadLog = function() {\n return new config.lib.Log('UploadLog', " !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |" );\n};\nconfig.macros.upload.UploadLog.prototype = config.lib.Log.prototype;\nconfig.macros.upload.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {\n var line = " [[" + config.lib.file.basename(storeUrl) + "|" + storeUrl + "]] | ";\n line += uploadDir + " | " + toFilename + " | " + backupDir + " |";\n this.newLine(line);\n};\nconfig.macros.upload.UploadLog.prototype.endUpload = function() {\n this.addToLine(" Ok |");\n};\nconfig.macros.upload.basename = config.lib.file.basename;\nconfig.macros.upload.dirname = config.lib.file.dirname;\nconfig.macros.upload.toRootUrl = function (storeUrl, username)\n{\n return root = (this.dirname(storeUrl)?this.dirname(storeUrl):this.dirname(document.location.toString()));\n}\nconfig.macros.upload.toDirUrl = function (storeUrl, uploadDir, username)\n{\n var root = this.toRootUrl(storeUrl, username);\n if (uploadDir && uploadDir != '.')\n root = root + '/' + uploadDir;\n return root;\n}\nconfig.macros.upload.toFileUrl = function (storeUrl, toFilename, uploadDir, username)\n{\n return this.toDirUrl(storeUrl, uploadDir, username) + '/' + toFilename;\n}\nconfig.macros.upload.upload = function(storeUrl, toFilename, uploadDir, backupDir, username, password)\n{\n // parameters initialization\n storeUrl = (storeUrl ? storeUrl : config.options.txtUploadStoreUrl);\n toFilename = (toFilename ? toFilename : config.options.txtUploadFilename);\n backupDir = (backupDir ? backupDir : config.options.txtUploadBackupDir);\n uploadDir = (uploadDir ? uploadDir : config.options.txtUploadDir);\n username = (username ? username : config.options.txtUploadUserName);\n password = config.options.pasUploadPassword; // for security reason no password as macro parameter\n if (!password || password === '') {\n alert(config.macros.upload.messages.passwordEmpty);\n return;\n }\n if (storeUrl === '') {\n storeUrl = config.macros.upload.defaultStoreScript;\n }\n if (config.lib.file.dirname(storeUrl) === '') {\n storeUrl = config.lib.file.dirname(document.location.toString())+'/'+storeUrl;\n }\n if (toFilename === '') {\n toFilename = config.lib.file.basename(document.location.toString());\n }\n\n clearMessage();\n // only for forcing the message to display\n if (version.major < 2)\n store.notifyAll();\n if (!storeUrl) {\n alert(config.macros.upload.messages.urlParamMissing);\n return;\n }\n // Check that file is not locked\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n if (BidiX.GroupAuthoring.lock.isLocked() && !BidiX.GroupAuthoring.lock.isMyLock()) {\n alert(config.macros.upload.messages.fileLocked);\n return;\n }\n }\n \n var log = new this.UploadLog();\n log.startUpload(storeUrl, toFilename, uploadDir, backupDir);\n if (document.location.toString().substr(0,5) == "file:") {\n saveChanges();\n }\n var toDir = config.macros.upload.toDirUrl(storeUrl, toFilename, uploadDir, username);\n displayMessage(config.macros.upload.messages.aboutToUpload.format([toDir]), toDir);\n this.uploadChanges(storeUrl, toFilename, uploadDir, backupDir, username, password);\n if(config.options.chkGenerateAnRssFeed) {\n //var rssContent = convertUnicodeToUTF8(generateRss());\n var rssContent = generateRss();\n var rssPath = toFilename.substr(0,toFilename.lastIndexOf(".")) + ".xml";\n this.uploadContent(rssContent, storeUrl, rssPath, uploadDir, '', username, password, \n function (responseText) {\n if (responseText.substring(0,1) != '0') {\n displayMessage(config.macros.upload.messages.rssFileNotUploaded.format([rssPath]));\n }\n else {\n var toFileUrl = config.macros.upload.toFileUrl(storeUrl, rssPath, uploadDir, username);\n displayMessage(config.macros.upload.messages.rssFileUploaded.format(\n [toFileUrl]), toFileUrl);\n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n });\n }\n return;\n};\n\nconfig.macros.upload.uploadChanges = function(storeUrl, toFilename, uploadDir, backupDir, \n username, password) {\n var original;\n if (document.location.toString().substr(0,4) == "http") {\n original = this.download(storeUrl, toFilename, uploadDir, backupDir, username, password);\n return;\n }\n else {\n // standard way : Local file\n \n original = loadFile(getLocalPath(document.location.toString()));\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 = "UTF-8";\n original = converter.ConvertToUnicode(original);\n }\n catch(e) {\n }\n }\n }\n //DEBUG alert(original);\n this.uploadChangesFrom(original, storeUrl, toFilename, uploadDir, backupDir, \n username, password);\n};\n\nconfig.macros.upload.uploadChangesFrom = function(original, storeUrl, toFilename, uploadDir, backupDir, \n username, password) {\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 var revised = original.substr(0,posOpeningDiv + startSaveArea.length) + \n allTiddlersAsHtml() + "\sn\st\st" +\n original.substr(posClosingDiv);\n var newSiteTitle;\n if(version.major < 2){\n newSiteTitle = (getElementText("siteTitle") + " - " + getElementText("siteSubtitle")).htmlEncode();\n } else {\n newSiteTitle = (wikifyPlain ("SiteTitle") + " - " + wikifyPlain ("SiteSubtitle")).htmlEncode();\n }\n\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\n var response = this.uploadContent(revised, storeUrl, toFilename, uploadDir, backupDir, \n username, password, function (responseText) {\n if (responseText.substring(0,1) != '0') {\n alert(responseText);\n displayMessage(config.macros.upload.messages.fileNotUploaded.format([getLocalPath(document.location.toString())]));\n }\n else {\n if (uploadDir !== '') {\n toFilename = uploadDir + "/" + config.macros.upload.basename(toFilename);\n } else {\n toFilename = config.macros.upload.basename(toFilename);\n }\n var toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);\n if (responseText.indexOf("destfile:") > 0) {\n var destfile = responseText.substring(responseText.indexOf("destfile:")+9, \n responseText.indexOf("\sn", responseText.indexOf("destfile:")));\n toFileUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + destfile;\n }\n else {\n toFileUrl = config.macros.upload.toFileUrl(storeUrl, toFilename, uploadDir, username);\n }\n displayMessage(config.macros.upload.messages.mainFileUploaded.format(\n [toFileUrl]), toFileUrl);\n if (backupDir && responseText.indexOf("backupfile:") > 0) {\n var backupFile = responseText.substring(responseText.indexOf("backupfile:")+11, \n responseText.indexOf("\sn", responseText.indexOf("backupfile:")));\n toBackupUrl = config.macros.upload.toRootUrl(storeUrl, username) + '/' + backupFile;\n displayMessage(config.macros.upload.messages.backupFileStored.format(\n [toBackupUrl]), toBackupUrl);\n }\n var log = new config.macros.upload.UploadLog();\n log.endUpload();\n store.setDirty(false);\n // erase local lock\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n BidiX.GroupAuthoring.lock.eraseLock();\n // change mtime with new mtime after upload\n var mtime = responseText.substr(responseText.indexOf("mtime:")+6);\n BidiX.GroupAuthoring.lock.mtime = mtime;\n }\n \n \n }\n // for debugging store.php uncomment last line\n //DEBUG alert(responseText);\n }\n );\n};\n\nconfig.macros.upload.uploadContent = function(content, storeUrl, toFilename, uploadDir, backupDir, \n username, password, callbackFn) {\n var boundary = "---------------------------"+"AaB03x"; \n var request;\n try {\n request = new XMLHttpRequest();\n } \n catch (e) { \n request = new ActiveXObject("Msxml2.XMLHTTP"); \n }\n if (window.netscape){\n try {\n if (document.location.toString().substr(0,4) != "http") {\n netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');}\n }\n catch (e) {}\n } \n //DEBUG alert("user["+config.options.txtUploadUserName+"] password[" + config.options.pasUploadPassword + "]");\n // compose headers data\n var sheader = "";\n sheader += "--" + boundary + "\sr\snContent-disposition: form-data; name=\s"";\n sheader += config.macros.upload.formName +"\s"\sr\sn\sr\sn";\n sheader += "backupDir="+backupDir\n +";user=" + username \n +";password=" + password\n +";uploaddir=" + uploadDir;\n // add lock attributes to sheader\n if (window.BidiX && BidiX.GroupAuthoring && BidiX.GroupAuthoring.lock) {\n var l = BidiX.GroupAuthoring.lock.myLock;\n sheader += ";lockuser=" + l.user\n + ";mtime=" + l.mtime\n + ";locktime=" + l.locktime;\n }\n sheader += ";;\sr\sn"; \n sheader += "\sr\sn" + "--" + boundary + "\sr\sn";\n sheader += "Content-disposition: form-data; name=\s"userfile\s"; filename=\s""+toFilename+"\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 //strailer = "--" + boundary + "--\sr\sn";\n var data;\n data = sheader + content + strailer;\n //request.open("POST", storeUrl, true, username, password);\n try {\n request.open("POST", storeUrl, true); \n }\n catch(e) {\n alert(config.macros.upload.messages.crossDomain + "\snError:" +e);\n exit;\n }\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 + "\snStatus: "+request.status.statusText);\n }\n };\n request.setRequestHeader("Content-Length",data.length);\n request.setRequestHeader("Content-Type","multipart/form-data; boundary="+boundary);\n request.send(data); \n};\n\n\nconfig.macros.upload.download = function(uploadUrl, uploadToFilename, uploadDir, uploadBackupDir, \n username, password) {\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 //request.open("GET", document.location.toString(), true, username, password);\n try {\n request.open("GET", document.location.toString(), true);\n }\n catch(e) {\n alert(config.macros.upload.messages.crossDomain + "\snError:" +e);\n exit;\n }\n \n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n if(request.status == 200) {\n config.macros.upload.uploadChangesFrom(request.responseText, uploadUrl, \n uploadToFilename, uploadDir, uploadBackupDir, username, password);\n }\n else\n alert(config.macros.upload.messages.errorDownloading.format(\n [document.location.toString()]) + "\snStatus: "+request.status.statusText);\n }\n };\n request.send(null);\n};\n\n//}}}\n////===\n\n////+++!![Initializations]\n\n//{{{\nconfig.lib.options.init('txtUploadStoreUrl','store.php');\nconfig.lib.options.init('txtUploadFilename','');\nconfig.lib.options.init('txtUploadDir','');\nconfig.lib.options.init('txtUploadBackupDir','');\nconfig.lib.options.init('txtUploadUserName',config.options.txtUserName);\nconfig.lib.options.init('pasUploadPassword','');\nsetStylesheet(\n ".pasOptionInput {width: 11em;}\sn"+\n ".txtOptionInput.txtUploadStoreUrl {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadFilename {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadDir {width: 25em;}\sn"+\n ".txtOptionInput.txtUploadBackupDir {width: 25em;}\sn"+\n "",\n "UploadOptionsStyles");\nif (document.location.toString().substr(0,4) == "http") {\n config.options.chkAutoSave = false; \n saveOptionCookie('chkAutoSave');\n}\nconfig.shadowTiddlers.UploadDoc = "[[Full Documentation|http://tiddlywiki.bidix.info/l#UploadDoc ]]\sn"; \n\n//}}}\n////===\n\n////+++!![Core Hijacking]\n\n//{{{\nconfig.macros.saveChanges.label_orig_UploadPlugin = config.macros.saveChanges.label;\nconfig.macros.saveChanges.label = config.macros.upload.label.saveToDisk;\n\nconfig.macros.saveChanges.handler_orig_UploadPlugin = config.macros.saveChanges.handler;\n\nconfig.macros.saveChanges.handler = function(place)\n{\n if ((!readOnly) && (document.location.toString().substr(0,4) != "http"))\n createTiddlyButton(place,this.label,this.prompt,this.onClick,null,null,this.accessKey);\n};\n\n//}}}\n////===\n\n
<!--{{{-->\n<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler permalink references jump'></div>\n<div class='title' macro='view title'></div>\n<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date [[YYYY-0MM-0DD 0hh:0mm]]'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date [[YYYY-0MM-0DD]]'></span>)</div>\n<div class='tagging' macro='tagging'></div>\n<div class='tagged' macro='tags'></div>\n<div class='viewer' macro='view text wikified'><div macro='ToC'></div></div>\n<div class='tagClear'></div>\n<!--}}}-->
/***\n|''Name''|eMailMacro|\n|''Source''|[[FND's DevPad|http://devpad.tiddlyspot.com/#eMailMacro]]|\n|''Version''|0.97|\n|''Status''|stable|\n|''Author''|Rick Magers, FND|\n|''Contributors''|HeX|\n|''License''|public domain|\n|''~CoreVersion''|2.1|\n|''Type''|macro|\n|''Requires''|N/A|\n|''Overrides''|N/A|\n|''Description''|create an e-mail from tiddler contents|\n!Usage\n{{{\n<<email\n [tiddler:"name"]\n [to:"address"]\n [cc:"address"]\n [bcc:"address"]\n [subject:"text"]\n [maxChars:"number"]\n [filterMacro:"true"]\n [label:"text"]\n [tooltip:"text"]\n [permalink:"true"]\n [class:"customClass"]\n>>\n}}}\nAll parameters are optional.\nMultiple recipients can be added by separating the addresses with a comma.\n!!Example\n<<email subject:"Hello World" to:"foo@bar.baz,bar@foo.baz" label:"mail to Foo" tooltip:"send this tiddler to Foo" permalink:"true">>\n!!Adding the macro to the toolbar\nAfter importing this plugin tiddler, the [[ViewTemplate]] needs to be modified by adding {{{<span macro='email'></span>}}} to the toolbar:\n{{{\n<div class='toolbar'>\n<span macro='toolbar newHere +editTiddler deleteTiddler permalink references jump closeOthers -closeTiddler'>\n<span macro='email'></span>\n</div>\n}}}\n(The respective version of the ViewTemplate might differ from the one displayed here.)\n!Limitations\n* limited number of characters for the message body (due to [[inherent limitations|http://www.boutell.com/newfaq/misc/urllength.html]] of {{{mailto:}}} links)\n* the user's combination of browser and e-mail client needs to support the respective features of the mailto protocol\n!Revision History\n!!v0.1 (2007-06-16)\n* initial release [[by Rick Magers|http://groups.google.com/group/TiddlyWiki/browse_thread/thread/ff7ae93cbe94345e/f6699532351f0802?#f6699532351f0802]]\n!!v0.8 (2007-07-05)\n* various modifications to enhance support for special characters ([[by FND and HeX|http://groups.google.com/group/TiddlyWikiDev/browse_thread/thread/ed196a32b295d2c9]])\n!!v0.9 (2007-10-08)\n* code refactoring\n* added parameters for various fields\n!!v0.91 (2007-10-10)\n* fixed malformed mailto string (additional ampersand in some cases)\n!!v0.95 (2007-12-27)\n* added parameter for removing {{{<<email>>}}} macro calls from output (thanks [[ELS|http://www.tiddlytools.com]])\n* using custom {{{escapeHTML()}}} function instead of {{{htmlDecode()}}}\n!!v0.96 (2007-12-28)\n* added parameter for specifying a target tiddler\n* added parameter for limiting the number of characters returned from the tiddler body (default: 2000)\n* some code refactoring\n!!v0.97 (2009-03-19)\n* added permalink parameter\n!To Do\n* documentation\n* further enhance handling of special characters\n!Code\n***/\n//{{{\n(function() {\n\nconfig.macros.email = {\n subject: "default title",\n body: "default contents",\n label: "e-mail",\n tooltip: "e-mail this tiddler",\n btnClass: "button",\n maxChars: 2000\n};\n\nconfig.macros.email.handler = function(place, macroName, params, wikifier, paramString, tiddler) {\n // process parameters\n var prms = paramString.parseParams(null, null, true);\n var label = getParam(prms, "label") || this.label;\n var tooltip = getParam(prms, "tooltip") || this.tooltip;\n var btnClass = getParam(prms, "class") || this.btnClass;\n var msgTo = getParam(prms, "to");\n var msgCC = getParam(prms, "cc");\n var msgBCC = getParam(prms, "bcc");\n var msgSubject = getParam(prms, "subject");\n var title = getParam(prms, "tiddler") || tiddler.title;\n var filterMacro = getParam(prms, "filterMacro") == "true";\n var permalink = getParam(prms, "permalink") == "true";\n var maxChars = getParam(prms, "maxChars") || this.maxChars;\n // retrieve tiddler contents\n if(!msgSubject) {\n if(store.getTiddler(title) || store.isShadowTiddler(title)) {\n msgSubject = strEscape(title);\n } else {\n msgSubject = this.subject;\n }\n }\n var msgBody = store.getTiddlerText(title, this.body);\n if(permalink) {\n config.commands.permalink.handler(null, null, tiddler.title); // XXX: hacky\n msgBody = window.location.toString() + "\sn\sn" + msgBody;\n }\n if(filterMacro) {\n msgBody = msgBody.replace(/<<email(.*|\sn)?\s>\s>/gi, "");\n }\n msgBody = strEscape(msgBody);\n // compose message\n var msg = "";\n if(msgTo) {\n msg += msgTo;\n }\n msg += "?";\n msg += "subject=" + msgSubject;\n if(msgCC) {\n msg += "&cc=" + msgCC;\n }\n if(msgBCC) {\n msg += "&bcc=" + msgBCC;\n }\n msg += "&body=" + msgBody;\n if(msg.length > maxChars) {\n msg = msg.substr(0, maxChars);\n }\n // create link\n wikify("[[" + label + "|" + "mailto:" + msg + "]]", place);\n place.lastChild.className = btnClass;\n place.lastChild.title = tooltip;\n};\n\nvar strEscape = function(str) {\n return entitify(escape(escapeHTML(str)));\n};\n\n/* inspired by the Prototype library (http://prototype.conio.net) */\nvar escapeHTML = function(str) {\n var div = document.createElement("div");\n var text = document.createTextNode(str);\n div.appendChild(text);\n return div.innerHTML;\n};\n\n// handle special characters\nvar entitify = function(str) {\n return str\n .replace(/%A2/g, "¢")\n .replace(/%A3/g, "£")\n .replace(/%A5/g, "¥")\n .replace(/%AB/g, "«")\n .replace(/%BB/g, "»")\n .replace(/%B5/g, "µ")\n .replace(/%C4/g, "Ä")\n .replace(/%C5/g, "Å")\n .replace(/%C6/g, "Æ")\n .replace(/%D6/g, "Ö")\n .replace(/%D8/g, "Ø")\n .replace(/%DC/g, "Ü")\n .replace(/%DF/g, "ß")\n .replace(/%E4/g, "ä")\n .replace(/%E5/g, "å")\n .replace(/%E6/g, "æ")\n .replace(/%F0/g, "ð")\n .replace(/%F6/g, "ö")\n .replace(/%F8/g, "ø")\n .replace(/%FC/g, "ü")\n .replace(/%u20AC/g, "€");\n};\n\n})();\n//}}}
/***\n!Usage\n{{{\n<<newJournalHere>>\n}}}\n<<newJournalHere>>\n***/\n//{{{\nconfig.macros.newJournalHere = {\n label: "new journal",\n prompt: "Create a new tiddler from the current date and time",\n accessKey: "J"\n}\n\nconfig.macros.newJournalHere.handler = function(place, macroName, params, wikifier, paramString, tiddler)\n{\n if(!readOnly) {\n params = paramString.parseParams("anon", null, true, false, false);\n var title = params[1] && params[1].name == "anon" ? params[1].value : config.macros.timeline.dateFormat;\n title = getParam(params,"title",title);\n title = tiddler.title + title;\n config.macros.newTiddler.createNewTiddlerButton(place,title,params,this.label,this.prompt,this.accessKey,"text",true);\n }\n};\n//}}}
/%\n|Name|ShowPopup|\n|Source|http://www.TiddlyTools.com/#ShowPopup|\n|Version|1.0.2|\n|Author|Eric Shulman - ELS Design Studios|\n|License|http://www.TiddlyTools.com/#LegalStatements <<br>>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|transcluded html|\n|Requires||\n|Overrides||\n|Description|display tiddler content in a TW popup|\n\nusage: <<tiddler ShowPopup with: TiddlerName label tooltip buttonClass width popupClass>>\n\n%/<html><a href="javascript:;" class="$4" title="$3" onclick="var p=Popup.create(this); if (!p) return; var t=store.getTiddler('$1'); if (!t) return; p.className+=' $6'; var d=createTiddlyElement(p,'div'); d.style.whiteSpace='normal'; d.style.width='$5'; d.style.padding='2px'; wikify(t.text,d); Popup.show(p,false); event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); return(false);">$2</a></html>
dropdownPopup: <<tiddler [[templatePopup]] with: [[MainMenu]] "MainMenu" "MainMenu" "tiddlyLinkExisting" "" "dropdownPopup">>\ninfoPopup: <<tiddler [[templatePopup]] with: [[TiddlyWiki]] "TiddlyWiki" "TiddlyWiki" "tiddlyLinkExisting" "" "infoPopup">>
Type the text for 'New Tiddler'