<>
{ "tiddlers": { "$:/config/EditorTypeMappings/image/gif": { "title": "$:/config/EditorTypeMappings/image/gif", "text": "bitmap" }, "$:/config/EditorTypeMappings/image/jpeg": { "title": "$:/config/EditorTypeMappings/image/jpeg", "text": "bitmap" }, "$:/config/EditorTypeMappings/image/jpg": { "title": "$:/config/EditorTypeMappings/image/jpg", "text": "bitmap" }, "$:/config/EditorTypeMappings/image/png": { "title": "$:/config/EditorTypeMappings/image/png", "text": "bitmap" }, "$:/config/EditorTypeMappings/image/x-icon": { "title": "$:/config/EditorTypeMappings/image/x-icon", "text": "bitmap" }, "$:/config/EditorTypeMappings/text/vnd.tiddlywiki": { "title": "$:/config/EditorTypeMappings/text/vnd.tiddlywiki", "text": "text" }, "$:/core/copyright.txt": { "title": "$:/core/copyright.txt", "type": "text/plain", "text": "TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)nnCopyright © Jeremy Ruston 2004-2007nCopyright © UnaMesa Association 2007-2014nnRedistribution and use in source and binary forms, with or without modification,nare permitted provided that the following conditions are met:nnRedistributions of source code must retain the above copyright notice, thisnlist of conditions and the following disclaimer.nnRedistributions in binary form must reproduce the above copyright notice, thisnlist of conditions and the following disclaimer in the documentation and/or othernmaterials provided with the distribution.nnNeither the name of the UnaMesa Association nor the names of its contributors may benused to endorse or promote products derived from this software without specificnprior written permission.nnTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANYnEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIESnOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENTnSHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITEDnTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; ORnBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER INnCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING INnANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCHnDAMAGE.n" }, "$:/docs/fields/bag": { "title": "$:/docs/fields/bag", "text": "The name of the bag from which a tiddler came" }, "$:/docs/fields/color": { "title": "$:/docs/fields/color", "text": "The CSS color value associated with a tiddler" }, "$:/docs/fields/created": { "title": "$:/docs/fields/created", "text": "The date a tiddler was created" }, "$:/docs/fields/creator": { "title": "$:/docs/fields/creator", "text": "The name of the person who created a tiddler" }, "$:/docs/fields/description": { "title": "$:/docs/fields/description", "text": "The descriptive text for a wizard" }, "$:/docs/fields/draft.of": { "title": "$:/docs/fields/draft.of", "text": "For draft tiddlers, contains the title of the tiddler of which this is a draft" }, "$:/docs/fields/draft.title": { "title": "$:/docs/fields/draft.title", "text": "For draft tiddlers, contains the proposed new title of the tiddler" }, "$:/docs/fields/footer": { "title": "$:/docs/fields/footer", "text": "The footer text for a wizard" }, "$:/docs/fields/icon": { "title": "$:/docs/fields/icon", "text": "The title of the tiddler containing the icon associated with a tiddler" }, "$:/docs/fields/library": { "title": "$:/docs/fields/library", "text": "If set to "yes" indicates that a tiddler should be saved as a JavaScript library" }, "$:/docs/fields/list": { "title": "$:/docs/fields/list", "text": "An ordered list of tiddler titles associated with a tiddler" }, "$:/docs/fields/modified": { "title": "$:/docs/fields/modified", "text": "The date and time at which a tiddler was last modified" }, "$:/docs/fields/modifier": { "title": "$:/docs/fields/modifier", "text": "The tiddler title associated with the person who last modified a tiddler" }, "$:/docs/fields/name": { "title": "$:/docs/fields/name", "text": "The human readable name associated with a plugin tiddler" }, "$:/docs/fields/plugin-priority": { "title": "$:/docs/fields/plugin-priority", "text": "A numerical value indicating the priority of a plugin tiddler" }, "$:/docs/fields/plugin-type": { "title": "$:/docs/fields/plugin-type", "text": "The type of plugin in a plugin tiddler" }, "$:/docs/fields/revision": { "title": "$:/docs/fields/revision", "text": "The revision of the tiddler held at the server" }, "$:/docs/fields/source": { "title": "$:/docs/fields/source", "text": "The source URL associated with a tiddler" }, "$:/docs/fields/subtitle": { "title": "$:/docs/fields/subtitle", "text": "The subtitle text for a wizard" }, "$:/docs/fields/tags": { "title": "$:/docs/fields/tags", "text": "A list of tags associated with a tiddler" }, "$:/docs/fields/text": { "title": "$:/docs/fields/text", "text": "The body text of a tiddler" }, "$:/docs/fields/title": { "title": "$:/docs/fields/title", "text": "The unique name of a tiddler" }, "$:/docs/fields/type": { "title": "$:/docs/fields/type", "text": "The content type of a tiddler" }, "$:/docs/moduletypes/animation": { "title": "$:/docs/moduletypes/animation", "text": "Animation modules contain animations that may be used with the RevealWidget." }, "$:/docs/types/application/json": { "title": "$:/docs/types/application/json", "description": "JSON data", "name": "application/json", "text": "" }, "$:/docs/types/application/x-tiddler-dictionary": { "title": "$:/docs/types/application/x-tiddler-dictionary", "description": "Data dictionary", "name": "application/x-tiddler-dictionary", "text": "" }, "$:/docs/types/image/gif": { "title": "$:/docs/types/image/gif", "description": "GIF image", "name": "image/gif", "text": "" }, "$:/docs/types/image/jpeg": { "title": "$:/docs/types/image/jpeg", "description": "JPEG image", "name": "image/jpeg", "text": "" }, "$:/docs/types/image/png": { "title": "$:/docs/types/image/png", "description": "PNG image", "name": "image/png", "text": "" }, "$:/docs/types/image/svg+xml": { "title": "$:/docs/types/image/svg+xml", "description": "Structured Vector Graphics image", "name": "image/svg+xml", "text": "" }, "$:/docs/types/image/x-icon": { "title": "$:/docs/types/image/x-icon", "description": "ICO format icon file", "name": "image/x-icon", "text": "" }, "$:/docs/types/text/plain": { "title": "$:/docs/types/text/plain", "description": "Plain text", "name": "text/plain", "text": "" }, "$:/docs/types/text/vnd.tiddlywiki": { "title": "$:/docs/types/text/vnd.tiddlywiki", "description": "TiddlyWiki version 5 wikitext", "name": "text/vnd.tiddlywiki", "text": "" }, "$:/docs/types/text/x-tiddlywiki": { "title": "$:/docs/types/text/x-tiddlywiki", "description": "TiddlyWiki Classic wikitext", "name": "text/x-tiddlywiki", "text": "" }, "$:/core/images/cancel-button": { "title": "$:/core/images/cancel-button", "text": "" }, "$:/core/images/close-button": { "title": "$:/core/images/close-button", "text": "n" }, "$:/core/images/delete-button": { "title": "$:/core/images/delete-button", "text": "n" }, "$:/core/images/done-button": { "title": "$:/core/images/done-button", "text": "n" }, "$:/core/images/down-arrow": { "title": "$:/core/images/down-arrow", "text": "n" }, "$:/core/images/edit-button": { "title": "$:/core/images/edit-button", "text": "n" }, "$:/core/images/info-button": { "title": "$:/core/images/info-button", "text": "n" }, "$:/core/images/new-button": { "title": "$:/core/images/new-button", "text": "n" }, "$:/core/images/options-button": { "title": "$:/core/images/options-button", "text": "n" }, "$:/core/images/save-button": { "title": "$:/core/images/save-button", "text": "n" }, "$:/messages/Download": { "title": "$:/messages/Download", "type": "text/vnd.tiddlywiki", "subtitle": "Download changes", "footer": "<$button message="tw-close-tiddler" class="btn btn-primary">Close$button>", "help": "http://five.tiddlywiki.com/static/DownloadingChanges.html", "text": "Your browser only supports manual saving.nnTo save your modified wiki, right click on the download link below and select "Download file" or "Save file", and then choose the folder and filename.nn//You can marginally speed things up by clicking the link with the control key (Windows) or the options/alt key (Mac OS X). You will not be prompted for the folder or filename, but your browser is likely to give it an unrecognisable name -- you may need to rename the file to include an `.html` extension before you can do anything useful with it.//nnOn smartphones that do not allow files to be downloaded you can instead bookmark the link, and then sync your bookmarks to a desktop computer from where the wiki can be saved normally.n" }, "$:/messages/EnterEditMode": { "title": "$:/messages/EnterEditMode", "type": "text/vnd.tiddlywiki", "subtitle": "Editing this wiki", "footer": "<
nnNote that the field attributes are HTML encoded, but that the body of the
tag is not encoded.nnWhen these tiddler DIVs are encountered within a TiddlyWiki HTML file then the body is encoded in the usual way.n*/nvar parseTiddlerDiv = function(text /* [,fields] */) {nt// Slot together the default resultsntvar result = {};ntif(arguments.length > 1) {nttfor(var f=1; f]*)>(\s*
)?/gi,nttendRegExp,nttmatch = startRegExp.exec(text);ntif(match) {ntt// Old-style DIVs don't have the
tagnttif(match[2]) {ntttendRegExp = /<\/pre>\s*<\/div>\s*$/gi;ntt} else {ntttendRegExp = /<\/div>\s*$/gi;ntt}nttvar endMatch = endRegExp.exec(text);nttif(endMatch) {nttt// Extract the textntttresult.text = text.substring(match.index + match[0].length,endMatch.index);nttt// Process the attributesntttvar attrRegExp = /\s*([^=\s]+)\s*=\s*"([^"]*)"/gi,nttttattrMatch;ntttdo {nttttattrMatch = attrRegExp.exec(match[1]);nttttif(attrMatch) {ntttttvar name = attrMatch[1];ntttttvar value = attrMatch[2];ntttttresult[name] = value;ntttt}nttt} while(attrMatch);ntttreturn result;ntt}nt}ntreturn undefined;n};nnexports["application/x-tiddler-html-div"] = function(text,fields) {ntreturn [parseTiddlerDiv(text,fields)];n};nnexports["application/json"] = function(text,fields) {ntvar tiddlers = JSON.parse(text),nttresult = [],nttgetKnownFields = function(tid) {ntttvar fields = {};nttt"title text created creator modified modifier type tags".split(" ").forEach(function(value) {nttttif(tid[value] !== null) {ntttttfields[value] = tid[value];ntttt}nttt});ntttreturn fields;ntt};ntfor(var t=0; t/gi,nttmatch = storeAreaMarkerRegExp.exec(text);ntif(match) {ntt// If so, it's either a classic TiddlyWiki file or an unencrypted TW5 filentt// First read the normal tiddlersnttvar results = deserializeTiddlyWikiFile(text,storeAreaMarkerRegExp.lastIndex,!!match[1],fields);ntt// Then any system tiddlersnttvar systemAreaMarkerRegExp = / /gi,ntttsysMatch = systemAreaMarkerRegExp.exec(text);nttif(sysMatch) {ntttresults.push.apply(results,deserializeTiddlyWikiFile(text,systemAreaMarkerRegExp.lastIndex,!!sysMatch[1],fields));ntt}nttreturn resultsnt} else {ntt// Check whether we've got an encrypted filenttvar encryptedStoreArea = $tw.utils.extractEncryptedStoreArea(text);nttif(encryptedStoreArea) {nttt// If so, attempt to decrypt it using the current passwordntttreturn $tw.utils.decryptStoreArea(encryptedStoreArea);ntt} else {nttt// It's not a TiddlyWiki so we'll return the entire HTML file as a tiddlerntttreturn deserializeHtmlFile(text,fields);ntt}nt}n};nnfunction deserializeHtmlFile(text,fields) {ntvar result = {};nt$tw.utils.each(fields,function(value,name) {nttresult[name] = value;nt});ntresult.text = text;ntresult.type = "text/html";ntreturn [result];n}nnfunction deserializeTiddlyWikiFile(text,storeAreaEnd,isTiddlyWiki5,fields) {ntvar results = [],nttendOfDivRegExp = /(<\/div>\s*)/gi,nttstartPos = storeAreaEnd,nttdefaultType = isTiddlyWiki5 ? undefined : "text/x-tiddlywiki";ntendOfDivRegExp.lastIndex = startPos;ntvar match = endOfDivRegExp.exec(text);ntwhile(match) {nttvar endPos = endOfDivRegExp.lastIndex,nttttiddlerFields = parseTiddlerDiv(text.substring(startPos,endPos),fields,{type: defaultType});nttif(!tiddlerFields) {ntttbreak;ntt}ntt$tw.utils.each(tiddlerFields,function(value,name) {ntttif(typeof value === "string") {ntttttiddlerFields[name] = $tw.utils.htmlDecode(value);nttt}ntt});nttif(tiddlerFields.text !== null) {ntttresults.push(tiddlerFields);ntt}nttstartPos = endPos;nttmatch = endOfDivRegExp.exec(text);nt}ntreturn results;n}nn})();n", "title": "$:/core/modules/deserializers.js", "type": "application/javascript", "module-type": "tiddlerdeserializer" }, "$:/core/modules/filters/backlinks.js": { "text": "/*\ntitle: $:/core/modules/filters/backlinks.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for returning all the backlinks from a tiddlernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.backlinks = function(source,operator,options) {ntvar results = [];nt// Function to check an individual titlentfunction checkTiddler(title) {ntt$tw.utils.pushTop(results,options.wiki.getTiddlerBacklinks(title));nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/backlinks.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/each.js": { "text": "/*\ntitle: $:/core/modules/filters/each.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator that selects one tiddler for each unique value of the specified fieldnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.each = function(source,operator,options) {nt// Convert the source to an array if necessaryntif(!$tw.utils.isArray(source)) {nttvar copy = [];ntt$tw.utils.each(source,function(element,title) {ntttcopy.push(title);ntt});nttsource = copy;nt}nt// Collect up the first tiddler with each unique value of the specified fieldntvar results = [],values = {};nt$tw.utils.each(source,function(title) {nttvar tiddler = options.wiki.getTiddler(title);nttif(tiddler) {ntttvar value = tiddler.getFieldString(operator.operand);ntttif(!$tw.utils.hop(values,value)) {nttttvalues[value] = true;nttttresults.push(title);nttt}ntt}nt});ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/each.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/eachday.js": { "text": "/*\ntitle: $:/core/modules/filters/eachday.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator that selects one tiddler for each unique day covered by the specified date fieldnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.eachday = function(source,operator,options) {nt// Function to convert a date/time to a date integerntvar toDate = function(value) {nttvalue = (new Date(value)).setHours(0,0,0,0);nttreturn value+0;nt};nt// Convert the source to an array if necessaryntif(!$tw.utils.isArray(source)) {nttvar copy = [];ntt$tw.utils.each(source,function(element,title) {ntttcopy.push(title);ntt});nttsource = copy;nt}nt// Collect up the first tiddler with each unique day value of the specified fieldntvar results = [],values = [];nt$tw.utils.each(source,function(title) {nttvar tiddler = options.wiki.getTiddler(title);nttif(tiddler && tiddler.fields[operator.operand]) {ntttvar value = toDate(tiddler.fields[operator.operand]);ntttif(values.indexOf(value) === -1) {nttttvalues.push(value);nttttresults.push(title);nttt}ntt}nt});ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/eachday.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/field.js": { "text": "/*\ntitle: $:/core/modules/filters/field.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for comparing fields for equalitynn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.field = function(source,operator,options) {ntvar results = [],nttfieldname = (operator.suffix || operator.operator).toLowerCase();nt// Function to check an individual titlentfunction checkTiddler(title) {nttvar tiddler = options.wiki.getTiddler(title);nttif(tiddler) {ntttvar match,ntttttext = tiddler.getFieldString(fieldname);ntttif(operator.regexp) {nttttmatch = !!operator.regexp.exec(text);nttt} else {nttttmatch = text === operator.operand;nttt}ntttif(operator.prefix === "!") {nttttmatch = !match;nttt}ntttif(match) {nttttresults.push(title);nttt}ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/field.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/fields.js": { "text": "/*\ntitle: $:/core/modules/filters/fields.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for returning the names of the fields on the selected tiddlersnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.fields = function(source,operator,options) {ntvar self = this,nttresults = [];nt// Function to check an individual titlentfunction checkTiddler(title) {ntt// Return the fields on the specified tiddlernttvar tiddler = options.wiki.getTiddler(title);nttif(tiddler) {ntttfor(var fieldName in tiddler.fields) {ntttt$tw.utils.pushTop(results,fieldName);nttt}ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/fields.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/has.js": { "text": "/*\ntitle: $:/core/modules/filters/has.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for checking if a tiddler has the specified fieldnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.has = function(source,operator,options) {ntvar results = [];nt// Function to check an individual titlentfunction checkTiddler(title) {nttvar tiddler = options.wiki.getTiddler(title);nttif(tiddler) {ntttvar match = $tw.utils.hop(tiddler.fields,operator.operand) && tiddler.fields[operator.operand] !== "";ntttif(operator.prefix === "!") {nttttmatch = !match;nttt}ntttif(match) {nttttresults.push(title);nttt}ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/has.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/is/current.js": { "text": "/*\ntitle: $:/core/modules/filters/is/current.jsntype: application/javascriptnmodule-type: isfilteroperatornnFilter function for [is[current]]nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.current = function(source,prefix,options) {ntvar results = [];nt// Function to check a tiddlerntfunction checkTiddler(title) {nttif(title !== options.currTiddlerTitle) {ntttresults.push(title);ntt}nt};nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {nttif(prefix === "!") {nttt$tw.utils.each(source,function(title) {nttttcheckTiddler(title);nttt});ntt} else {ntttif(source.indexOf(options.currTiddlerTitle) !== -1) {nttttresults.push(options.currTiddlerTitle);nttt}ntt}nt} else {nttif(prefix === "!") {nttt$tw.utils.each(source,function(element,title) {nttttcheckTiddler(title);nttt});ntt} else {ntttresults.push(options.currTiddlerTitle);ntt}nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/is/current.js", "type": "application/javascript", "module-type": "isfilteroperator" }, "$:/core/modules/filters/is/missing.js": { "text": "/*\ntitle: $:/core/modules/filters/is/missing.jsntype: application/javascriptnmodule-type: isfilteroperatornnFilter function for [is[missing]]nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.missing = function(source,prefix,options) {ntvar results = [],nttmissingTitles;nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {nttmissingTitles = options.wiki.getMissingTitles();ntt$tw.utils.each(source,function(title) {ntttvar match = missingTitles.indexOf(title) !== -1;ntttif(prefix === "!") {nttttmatch = !match;nttt}ntttif(match) {nttttresults.push(title);nttt}ntt});nt} else {nttif(prefix !== "!") {ntttmissingTitles = options.wiki.getMissingTitles();nttt$tw.utils.each(missingTitles,function(title) {nttttresults.push(title);nttt});ntt} else {nttt$tw.utils.each(source,function(element,title) {nttttresults.push(title);nttt});ntt}nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/is/missing.js", "type": "application/javascript", "module-type": "isfilteroperator" }, "$:/core/modules/filters/is/orphan.js": { "text": "/*\ntitle: $:/core/modules/filters/is/orphan.jsntype: application/javascriptnmodule-type: isfilteroperatornnFilter function for [is[orphan]]nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.orphan = function(source,prefix,options) {ntvar results = [],nttorphanTitles = options.wiki.getOrphanTitles();nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttvar match = orphanTitles.indexOf(title) !== -1;ntttif(prefix === "!") {nttttmatch = !match;nttt}ntttif(match) {nttttresults.push(title);nttt}ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttvar match = orphanTitles.indexOf(title) !== -1;ntttif(prefix === "!") {nttttmatch = !match;nttt}ntttif(match) {nttttresults.push(title);nttt}ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/is/orphan.js", "type": "application/javascript", "module-type": "isfilteroperator" }, "$:/core/modules/filters/is/shadow.js": { "text": "/*\ntitle: $:/core/modules/filters/is/shadow.jsntype: application/javascriptnmodule-type: isfilteroperatornnFilter function for [is[shadow]]nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.shadow = function(source,prefix,options) {ntvar results = [];nt// Function to check a tiddlerntfunction checkTiddler(title) {nttvar match = options.wiki.isShadowTiddler(title);nttif(prefix === "!") {ntttmatch = !match;ntt}nttif(match) {ntttresults.push(title);ntt}nt};nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {nttif(prefix !== "!") {nttt$tw.utils.each(options.wiki.shadowTiddlers,function(tiddler,title) {nttttresults.push(title);nttt});ntt} else {nttt$tw.utils.each(source,function(element,title) {nttttcheckTiddler(title);nttt});ntt}nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/is/shadow.js", "type": "application/javascript", "module-type": "isfilteroperator" }, "$:/core/modules/filters/is/system.js": { "text": "/*\ntitle: $:/core/modules/filters/is/system.jsntype: application/javascriptnmodule-type: isfilteroperatornnFilter function for [is[system]]nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.system = function(source,prefix,options) {ntvar results = [];nt// Function to check a tiddlerntfunction checkTiddler(title) {nttvar match = options.wiki.isSystemTiddler(title);nttif(prefix === "!") {ntttmatch = !match;ntt}nttif(match) {ntttresults.push(title);ntt}nt};nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/is/system.js", "type": "application/javascript", "module-type": "isfilteroperator" }, "$:/core/modules/filters/is/tiddler.js": { "text": "/*\ntitle: $:/core/modules/filters/is/tiddler.jsntype: application/javascriptnmodule-type: isfilteroperatornnFilter function for [is[tiddler]]nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.tiddler = function(source,prefix,options) {ntvar results = [];nt// Function to check a tiddlerntfunction checkTiddler(title) {nttvar match = options.wiki.tiddlerExists(title);nttif(prefix === "!") {ntttmatch = !match;ntt}nttif(match) {ntttresults.push(title);ntt}nt};nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/is/tiddler.js", "type": "application/javascript", "module-type": "isfilteroperator" }, "$:/core/modules/filters/is.js": { "text": "/*\ntitle: $:/core/modules/filters/is.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for checking tiddler propertiesnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnvar isFilterOperators;nnfunction getIsFilterOperators() {ntif(!isFilterOperators) {nttisFilterOperators = {};ntt$tw.modules.applyMethods("isfilteroperator",isFilterOperators);nt}ntreturn isFilterOperators;n};nn/*nExport our filter functionn*/nexports.is = function(source,operator,options) {nt// Dispatch to the correct isfilteroperatorntvar isFilterOperators = getIsFilterOperators();ntvar isFilterOperator = isFilterOperators[operator.operand];ntif(isFilterOperator) {nttreturn isFilterOperator(source,operator.prefix,options);nt} else {nttreturn ["Filter Error: Unknown operand for the 'is' filter operator"];nt}n};nn})();n", "title": "$:/core/modules/filters/is.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/limit.js": { "text": "/*\ntitle: $:/core/modules/filters/limit.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for chopping the results to a specified maximum number of entriesnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.limit = function(source,operator,options) {ntvar results = [];nt// Convert to an array if necessaryntif(!$tw.utils.isArray(source)) {nttvar copy = [];ntt$tw.utils.each(source,function(element,title) {ntttcopy.push(title);ntt});nttsource = copy;nt}nt// Slice the array if necessaryntvar limit = Math.min(source.length,parseInt(operator.operand,10));ntif(operator.prefix === "!") {nttresults = source.slice(source.length - limit);nt} else {nttresults = source.slice(0,limit);nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/limit.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/links.js": { "text": "/*\ntitle: $:/core/modules/filters/links.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for returning all the links from a tiddlernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.links = function(source,operator,options) {ntvar results = [];nt// Function to check an individual titlentfunction checkTiddler(title) {ntt$tw.utils.pushTop(results,options.wiki.getTiddlerLinks(title));nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/links.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/list.js": { "text": "/*\ntitle: $:/core/modules/filters/list.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator returning the tiddlers whose title is listed in the operand tiddlernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.list = function(source,operator,options) {ntvar results = [],ntttr = $tw.utils.parseTextReference(operator.operand),nttlist = options.wiki.getTiddlerList(tr.title,tr.field,tr.index);ntfunction checkTiddler(title) {nttvar match = list.indexOf(title) !== -1;nttif(operator.prefix === "!") {ntttmatch = !match;ntt}nttif(match) {ntttresults.push(title);ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {nttif(operator.prefix !== "!") {ntttresults = list;ntt} else {nttt$tw.utils.each(source,function(element,title) {nttttcheckTiddler(title);nttt});ntt}nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/list.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/listed.js": { "text": "/*\ntitle: $:/core/modules/filters/listed.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator returning all tiddlers that have the selected tiddlers in a listnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.listed = function(source,operator,options) {ntvar results = [];nt// Function to check an individual titlentfunction checkTiddler(title) {ntt$tw.utils.pushTop(results,options.wiki.findListingsOfTiddler(title));nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/listed.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/listops.js": { "text": "/*\ntitle: $:/core/modules/filters/listops.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operators for manipulating the current selection listnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nReverse listn*/nexports.reverse = function(source,operator,options) {ntvar results = [];ntif(!$tw.utils.isArray(source)) {nttsource = Object.keys(source).sort();nt}nt$tw.utils.each(source,function(title) {nttresults.unshift(title);nt});ntreturn results;n};nn/*nFirst entry/entries in listn*/nexports.first = function(source,operator,options) {ntvar count = parseInt(operator.operand) || 1;ntif(!$tw.utils.isArray(source)) {nttsource = Object.keys(source).sort();nt}ntreturn source.slice(0,Math.min(count,source.length));n};nn/*nLast entry/entries in listn*/nexports.last = function(source,operator,options) {ntvar count = parseInt(operator.operand) || 1;ntif(!$tw.utils.isArray(source)) {nttsource = Object.keys(source).sort();nt}ntreturn source.slice(-count);n};nn/*nAll but the first entry/entries of the listn*/nexports.rest = function(source,operator,options) {ntvar count = parseInt(operator.operand) || 1;ntif(!$tw.utils.isArray(source)) {nttsource = Object.keys(source).sort();nt}ntreturn source.slice(count);n};nexports.butfirst = exports.rest;nexports.bf = exports.rest;nn/*nAll but the last entry/entries of the listn*/nexports.butlast = function(source,operator,options) {ntvar count = parseInt(operator.operand) || 1;ntif(!$tw.utils.isArray(source)) {nttsource = Object.keys(source).sort();nt}ntreturn source.slice(0,-count);n};nexports.bl = exports.butlast;nn/*nThe nth member of the listn*/nexports.nth = function(source,operator,options) {ntvar count = parseInt(operator.operand) || 1;ntif(!$tw.utils.isArray(source)) {nttsource = Object.keys(source).sort();nt}ntreturn source.slice(count-1,count);n};nn})();n", "title": "$:/core/modules/filters/listops.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/modules.js": { "text": "/*\ntitle: $:/core/modules/filters/modules.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for returning the titles of the modules of a given type in this wikinn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.modules = function(source,operator,options) {ntvar results = [],nttpushModules = function(type) {nttt$tw.utils.each($tw.modules.types[type],function(moduleInfo,moduleName) {nttttresults.push(moduleName);nttt});ntt};nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttpushModules(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttpushModules(title);ntt});nt}ntresults.sort();ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/modules.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/moduletypes.js": { "text": "/*\ntitle: $:/core/modules/filters/moduletypes.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for returning the names of the module types in this wikinn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.moduletypes = function(source,operator,options) {ntvar results = [];nt$tw.utils.each($tw.modules.types,function(moduleInfo,type) {nttresults.push(type);nt});ntresults.sort();ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/moduletypes.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/next.js": { "text": "/*\ntitle: $:/core/modules/filters/next.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator returning the tiddler whose title occurs next in the list supplied in the operand tiddlernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.next = function(source,operator,options) {ntvar results = [],nttlist = options.wiki.getTiddlerList(operator.operand);nntfunction checkTiddler(title) {nttvar match = list.indexOf(title);ntt// increment match and then test if result is in rangenttmatch++;nttif(match > 0 && match < list.length) {ntttresults.push(list[match]);ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/next.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/prefix.js": { "text": "/*\ntitle: $:/core/modules/filters/prefix.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for checking if a title starts with a prefixnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.prefix = function(source,operator,options) {ntvar results = [];nt// Function to check an individual titlentfunction checkTiddler(title) {nttvar match = title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase();nttif(operator.prefix === "!") {ntttmatch = !match;ntt}nttif(match) {ntttresults.push(title);ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/prefix.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/previous.js": { "text": "/*\ntitle: $:/core/modules/filters/previous.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator returning the tiddler whose title occurs immediately prior in the list supplied in the operand tiddlernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.previous = function(source,operator,options) {ntvar results = [],nttlist = options.wiki.getTiddlerList(operator.operand);nntfunction checkTiddler(title) {nttvar match = list.indexOf(title);ntt// decrement match and then test if result is in rangenttmatch--;nttif( match >= 0 ) {ntttresults.push(list[match]);ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/previous.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/sameday.js": { "text": "/*\ntitle: $:/core/modules/filters/sameday.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator that selects tiddlers with a modified date field on the same day as the provided value.nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.sameday = function(source,operator,options) {ntvar results = [],nttisSameDay = function(dateField,dateString) {ntttvar date1 = (new Date(dateField)).setHours(0,0,0,0),nttttdate2 = (new Date($tw.utils.parseDate(dateString))).setHours(0,0,0,0);ntttreturn date1 === date2;ntt};nt// Function to check an individual titlentfunction checkTiddler(title) {nttvar tiddler = options.wiki.getTiddler(title);nttif(tiddler) {ntttvar match = isSameDay(tiddler.fields.modified,operator.operand);ntttif(operator.prefix === "!") {nttttmatch = !match;nttt}ntttif(match) {nttttresults.push(title);nttt}ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/sameday.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/search.js": { "text": "/*\ntitle: $:/core/modules/filters/search.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for searching for the text in the operand tiddlernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.search = function(source,operator,options) {ntvar invert = operator.prefix === "!";ntreturn options.wiki.search(operator.operand,{ntttitles: source,nttinvert: invertnt});n};nn})();n", "title": "$:/core/modules/filters/search.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/sort.js": { "text": "/*\ntitle: $:/core/modules/filters/sort.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for sortingnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.sort = function(source,operator,options) {ntvar results = prepare_results(source);ntoptions.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!",false,false);ntreturn results;n};nnexports.nsort = function(source,operator,options) {ntvar results = prepare_results(source);ntoptions.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!",false,true);ntreturn results;n};nnexports.sortcs = function(source,operator,options) {ntvar results = prepare_results(source);ntoptions.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!",true,false);ntreturn results;n};nnexports.nsortcs = function(source,operator,options) {ntvar results = prepare_results(source);ntoptions.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!",true,true);ntreturn results;n};nnvar prepare_results = function (source) {ntvar results;ntif($tw.utils.isArray(source)) {nttresults = source;nt} else {nttresults = [];ntt$tw.utils.each(source,function(element,title) {ntttresults.push(title);ntt});nt}ntreturn results;n}nn})();n", "title": "$:/core/modules/filters/sort.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/tag.js": { "text": "/*\ntitle: $:/core/modules/filters/tag.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for checking for the presence of a tagnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.tag = function(source,operator,options) {ntvar results = [];nt// Function to check an individual titlentfunction checkTiddler(title) {nttvar tiddler = options.wiki.getTiddler(title);nttif(tiddler) {ntttvar match = tiddler.hasTag(operator.operand);ntttif(operator.prefix === "!") {nttttmatch = !match;nttt}ntttif(match) {nttttresults.push(title);nttt}ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}nt// Sort the results if we are matching a tagntif(operator.prefix !== "!") {nttresults = options.wiki.sortByList(results,operator.operand);nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/tag.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/tagging.js": { "text": "/*\ntitle: $:/core/modules/filters/tagging.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator returning all tiddlers that are tagged with the selected tiddlersnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.tagging = function(source,operator,options) {ntvar results = [];nt// Function to check an individual titlentfunction checkTiddler(title) {ntt$tw.utils.pushTop(results,options.wiki.getTiddlersWithTag(title));nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/tagging.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/tags.js": { "text": "/*\ntitle: $:/core/modules/filters/tags.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator returning all the tags of the selected tiddlersnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.tags = function(source,operator,options) {ntvar results = [];nt// Function to check an individual titlentfunction checkTiddler(title) {nttvar tiddler = options.wiki.getTiddler(title);nttif(tiddler && tiddler.fields.tags) {nttt$tw.utils.pushTop(results,tiddler.fields.tags);ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/tags.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/title.js": { "text": "/*\ntitle: $:/core/modules/filters/title.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator for comparing title fields for equalitynn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.title = function(source,operator,options) {ntvar results = [];nt// Function to check an individual titlentfunction checkTiddler(title) {nttvar tiddler = options.wiki.getTiddler(title);nttif(tiddler) {ntttvar match = tiddler.fields[operator.operator] === operator.operand;ntttif(operator.prefix === "!") {nttttmatch = !match;nttt}ntttif(match) {nttttresults.push(title);nttt}ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt// If we're filtering a hashmap we change the behaviour to pass through missing tiddlersnttif(operator.prefix !== "!") {ntttresults.push(operator.operand);ntt} else {nttt$tw.utils.each(source,function(element,title) {nttttif(title !== operator.operand) {ntttttcheckTiddler(title);ntttt}nttt});ntt}nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/title.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters/untagged.js": { "text": "/*\ntitle: $:/core/modules/filters/untagged.jsntype: application/javascriptnmodule-type: filteroperatornnFilter operator returning all the selected tiddlers that are untaggednn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nExport our filter functionn*/nexports.untagged = function(source,operator,options) {ntvar results = [];nt// Function to check an individual titlentfunction checkTiddler(title) {nttvar tiddler = options.wiki.getTiddler(title),ntttmatch = tiddler && $tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length > 0;nttif(operator.prefix !== "!") {ntttmatch = !match;ntt}nttif(match) {nttt$tw.utils.pushTop(results,title);ntt}nt}nt// Iterate through the source tiddlersntif($tw.utils.isArray(source)) {ntt$tw.utils.each(source,function(title) {ntttcheckTiddler(title);ntt});nt} else {ntt$tw.utils.each(source,function(element,title) {ntttcheckTiddler(title);ntt});nt}ntreturn results;n};nn})();n", "title": "$:/core/modules/filters/untagged.js", "type": "application/javascript", "module-type": "filteroperator" }, "$:/core/modules/filters.js": { "text": "/*\ntitle: $:/core/modules/filters.jsntype: application/javascriptnmodule-type: wikimethodnnAdds tiddler filtering to the $tw.Wiki object.nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nParses an operation within a filter stringntresults: Array of array of operator nodes into which results should be insertedntfilterString: filter stringntp: start position within the stringnReturns the new start position, after the parsed operationn*/nfunction parseFilterOperation(operators,filterString,p) {ntvar operator, operand, bracketPos, curlyBracketPos;nt// Skip the starting square bracketntif(filterString.charAt(p++) !== "[") {nttthrow "Missing [ in filter expression";nt}nt// Process each operator in turnntdo {nttoperator = {};ntt// Check for an operator prefixnttif(filterString.charAt(p) === "!") {ntttoperator.prefix = filterString.charAt(p++);ntt}ntt// Get the operator namenttvar nextBracketPos = filterString.substring(p).search(/[\[\{\/]/);nttif(nextBracketPos === -1) {ntttthrow "Missing [ in filter expression";ntt}nttnextBracketPos += p;nttvar bracket = filterString.charAt(nextBracketPos);nttoperator.operator = filterString.substring(p,nextBracketPos);nttntt// Any suffix?nttvar colon = operator.operator.indexOf(':');nttif(colon > -1) {ntttoperator.suffix = operator.operator.substring(colon + 1);ntttoperator.operator = operator.operator.substring(0,colon) || "field";ntt}ntt// Empty operator means: titlenttelse if(operator.operator === "") {ntttoperator.operator = "title";ntt}nnttp = nextBracketPos + 1;nttswitch (bracket) {nttcase '{': // Curly bracketsntttoperator.indirect = true;ntttnextBracketPos = filterString.indexOf('}',p);ntttbreak;nttcase '[': // Square bracketsntttnextBracketPos = filterString.indexOf(']',p);ntttbreak;nttcase '/': // regexp bracketsntttvar rex = /^((?:[^\\\/]*|\\.))*\/(?:\(([mygi]+)\))?/g,nttttrexMatch = rex.exec(filterString.substring(p));ntttif(rexMatch) {nttttoperator.regexp = new RegExp(rexMatch[1], rexMatch[2]);nttttnextBracketPos = p + rex.lastIndex - 1;nttt}ntttelse {nttttthrow "Unterminated regular expression in filter expression";nttt}ntttbreak;ntt}nttnttif(nextBracketPos === -1) {ntttthrow "Missing closing bracket in filter expression";ntt}nttif(!operator.regexp) {ntttoperator.operand = filterString.substring(p,nextBracketPos);ntt}nttp = nextBracketPos + 1;ntttntt// Push this operatornttoperators.push(operator);nt} while(filterString.charAt(p) !== "]");nt// Skip the ending square bracketntif(filterString.charAt(p++) !== "]") {nttthrow "Missing ] in filter expression";nt}nt// Return the parsing positionntreturn p;n}nn/*nParse a filter stringn*/nexports.parseFilter = function(filterString) {ntfilterString = filterString || "";ntvar results = [], // Array of arrays of operator nodes {operator:,operand:}nttp = 0, // Current position in the filter stringnttmatch;ntvar whitespaceRegExp = /(\s+)/mg,nttoperandRegExp = /((?:\+|\-)?)(?:(\[)|("(?:[^"])*")|('(?:[^'])*')|([^\s\[\]]+))/mg;ntwhile(p < filterString.length) {ntt// Skip any whitespacenttwhitespaceRegExp.lastIndex = p;nttmatch = whitespaceRegExp.exec(filterString);nttif(match && match.index === p) {ntttp = p + match[0].length;ntt}ntt// Match the start of the operationnttif(p < filterString.length) {ntttoperandRegExp.lastIndex = p;ntttmatch = operandRegExp.exec(filterString);ntttif(!match || match.index !== p) {nttttthrow "Syntax error in filter expression";nttt}ntttvar operation = {nttttprefix: "",nttttoperators: []nttt};ntttif(match[1]) {nttttoperation.prefix = match[1];nttttp++;nttt}ntttif(match[2]) { // Opening square bracketnttttp = parseFilterOperation(operation.operators,filterString,p);nttt} else {nttttp = match.index + match[0].length;nttt}ntttif(match[3] || match[4] || match[5]) { // Double quoted string, single quoted string or unquoted titlenttttoperation.operators.push(nttttt{operator: "title", operand: match[3] || match[4] || match[5]}ntttt);nttt}ntttresults.push(operation);ntt}nt}ntreturn results;n};nnexports.getFilterOperators = function() {ntif(!this.filterOperators) {ntt$tw.Wiki.prototype.filterOperators = {};ntt$tw.modules.applyMethods("filteroperator",this.filterOperators);nt}ntreturn this.filterOperators;n};nnexports.filterTiddlers = function(filterString,currTiddlerTitle,tiddlerList) {ntvar fn = this.compileFilter(filterString);ntreturn fn.call(this,tiddlerList || this.tiddlers,currTiddlerTitle);n};nnexports.compileFilter = function(filterString) {ntvar filterParseTree;nttry {nttfilterParseTree = this.parseFilter(filterString);nt} catch(e) {nttreturn function(source,currTiddlerTitle) {ntttreturn ["Filter error: " + e];ntt};nt}nt// Get the hashmap of filter operator functionsntvar filterOperators = this.getFilterOperators();nt// Assemble array of functions, one for each operationntvar operationFunctions = [];nt// Step through the operationsntvar self = this;nt$tw.utils.each(filterParseTree,function(operation) {ntt// Create a function for the chain of operators in the operationnttvar operationSubFunction = function(source,currTiddlerTitle) {ntttvar accumulator = source,nttttresults = [];nttt$tw.utils.each(operation.operators,function(operator) {nttttvar operatorFunction = filterOperators[operator.operator] || filterOperators.field || function(source,operator,operations) {nttttttreturn ["Filter Error: unknown operator '" + operator.operator + "'"];nttttt},ntttttoperand = operator.operand;nttttif(operator.indirect) {ntttttoperand = self.getTextReference(operator.operand,"",currTiddlerTitle);ntttt}nttttresults = operatorFunction(accumulator,{ntttttttoperator: operator.operator,ntttttttoperand: operand,ntttttttprefix: operator.prefix,ntttttttsuffix: operator.suffix,ntttttttregexp: operator.regexpntttttt},{ntttttttwiki: self,ntttttttcurrTiddlerTitle: currTiddlerTitlentttttt});nttttaccumulator = results;nttt});ntttreturn results;ntt};ntt// Wrap the operator functions in a wrapper function that depends on the prefixnttoperationFunctions.push((function() {ntttswitch(operation.prefix || "") {nttttcase "": // No prefix means that the operation is unioned into the resultntttttreturn function(results,source,currTiddlerTitle) {ntttttt$tw.utils.pushTop(results,operationSubFunction(source,currTiddlerTitle));nttttt};nttttcase "-": // The results of this operation are removed from the main resultntttttreturn function(results,source,currTiddlerTitle) {ntttttt$tw.utils.removeArrayEntries(results,operationSubFunction(source,currTiddlerTitle));nttttt};nttttcase "+": // This operation is applied to the main results so farntttttreturn function(results,source,currTiddlerTitle) {ntttttt// This replaces all the elements of the array, but keeps the actual array so that references to it are preservednttttttsource = results.slice(0);nttttttresults.splice(0,results.length);ntttttt$tw.utils.pushTop(results,operationSubFunction(source,currTiddlerTitle));nttttt};nttt}ntt})());nt});nt// Return a function that applies the operations to a source array/hashmap of tiddler titlesntreturn function(source,currTiddlerTitle) {nttvar results = [];ntt$tw.utils.each(operationFunctions,function(operationFunction) {ntttoperationFunction(results,source,currTiddlerTitle);ntt});nttreturn results;nt};n};nn})();n", "title": "$:/core/modules/filters.js", "type": "application/javascript", "module-type": "wikimethod" }, "$:/core/modules/macros/changecount.js": { "text": "/*\ntitle: $:/core/modules/macros/changecount.jsntype: application/javascriptnmodule-type: macronnMacro to return the changecount for the current tiddlernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nInformation about this macron*/nnexports.name = "changecount";nnexports.params = [];nn/*nRun the macron*/nexports.run = function() {ntreturn this.wiki.getChangeCount(this.getVariable("currentTiddler")) + "";n};nn})();n", "title": "$:/core/modules/macros/changecount.js", "type": "application/javascript", "module-type": "macro" }, "$:/core/modules/macros/makedatauri.js": { "text": "/*\ntitle: $:/core/modules/macros/makedatauri.jsntype: application/javascriptnmodule-type: macronnMacro to convert the content of a tiddler to a data URInn<>nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nInformation about this macron*/nnexports.name = "makedatauri";nnexports.params = [nt{name: "text"},nt{name: "type"}n];nn/*nRun the macron*/nexports.run = function(text,type) {nttype = type || "text/vnd.tiddlywiki";ntvar typeInfo = $tw.config.contentTypeInfo[type] || $tw.config.contentTypeInfo["text/plain"],nttisBase64 = typeInfo.encoding === "base64",nttparts = [];ntparts.push("data:");ntparts.push(type);ntparts.push(isBase64 ? ";base64" : "");ntparts.push(",");ntparts.push(isBase64 ? text : encodeURIComponent(text));ntreturn parts.join("");n};nn})();n", "title": "$:/core/modules/macros/makedatauri.js", "type": "application/javascript", "module-type": "macro" }, "$:/core/modules/macros/qualify.js": { "text": "/*\ntitle: $:/core/modules/macros/qualify.jsntype: application/javascriptnmodule-type: macronnMacro to qualify a state tiddler title accordingnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nInformation about this macron*/nnexports.name = "qualify";nnexports.params = [nt{name: "title"}n];nn/*nRun the macron*/nexports.run = function(title) {ntreturn title + "-" + this.getStateQualifier();n};nn})();n", "title": "$:/core/modules/macros/qualify.js", "type": "application/javascript", "module-type": "macro" }, "$:/core/modules/macros/version.js": { "text": "/*\ntitle: $:/core/modules/macros/version.jsntype: application/javascriptnmodule-type: macronnMacro to return the TiddlyWiki core version numbernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nInformation about this macron*/nnexports.name = "version";nnexports.params = [];nn/*nRun the macron*/nexports.run = function() {ntreturn $tw.version;n};nn})();n", "title": "$:/core/modules/macros/version.js", "type": "application/javascript", "module-type": "macro" }, "$:/core/modules/parsers/htmlparser.js": { "text": "/*\ntitle: $:/core/modules/parsers/htmlparser.jsntype: application/javascriptnmodule-type: parsernnThe HTML parser displays text as raw HTMLnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnvar HtmlParser = function(type,text,options) {ntthis.tree = [{ntttype: "raw",ntthtml: textnt}];n};nnexports["text/html"] = HtmlParser;nn})();nn", "title": "$:/core/modules/parsers/htmlparser.js", "type": "application/javascript", "module-type": "parser" }, "$:/core/modules/parsers/imageparser.js": { "text": "/*\ntitle: $:/core/modules/parsers/imageparser.jsntype: application/javascriptnmodule-type: parsernnThe image parser parses an image into an embeddable HTML elementnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnvar ImageParser = function(type,text,options) {ntvar element = "img",nttsrc;ntif(type === "application/pdf" || type === ".pdf") {nttsrc = "data:application/pdf;base64," + text;nttelement = "embed";nt} else if(type === "image/svg+xml" || type === ".svg") {nttsrc = "data:image/svg+xml," + encodeURIComponent(text);nt} else {nttsrc = "data:" + type + ";base64," + text;nt}ntthis.tree = [{ntttype: "element",ntttag: element,nttattributes: {nttt"src": {type: "string", value: src}ntt}nt}];n};nnexports["image/svg+xml"] = ImageParser;nexports["image/jpg"] = ImageParser;nexports["image/jpeg"] = ImageParser;nexports["image/png"] = ImageParser;nexports["image/gif"] = ImageParser;nexports["application/pdf"] = ImageParser;nexports["image/x-icon"] = ImageParser;nn})();nn", "title": "$:/core/modules/parsers/imageparser.js", "type": "application/javascript", "module-type": "parser" }, "$:/core/modules/parsers/textparser.js": { "text": "/*\ntitle: $:/core/modules/parsers/textparser.jsntype: application/javascriptnmodule-type: parsernnThe plain text parser processes blocks of source text into a degenerate parse tree consisting of a single text nodenn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnvar TextParser = function(type,text,options) {ntthis.tree = [{ntttype: "element",ntttag: "pre",nttchildren: [{nttttype: "text",nttttext: textntt}]nt}];n};nnexports["text/plain"] = TextParser;nexports["text/x-tiddlywiki"] = TextParser;nexports["application/javascript"] = TextParser;nexports["application/json"] = TextParser;nexports["text/css"] = TextParser;nexports["application/x-tiddler-dictionary"] = TextParser;nn})();nn", "title": "$:/core/modules/parsers/textparser.js", "type": "application/javascript", "module-type": "parser" }, "$:/core/modules/parsers/wikiparser/rules/codeblock.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/codeblock.jsntype: application/javascriptnmodule-type: wikirulennWiki text rule for code blocks. For example:nn```nt```ntThis text will not be //wikified//nt```n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "codeblock";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to match and get language if definedntthis.matchRegExp = /```([\w-]*)\r?\n/mg;n};nnexports.parse = function() {ntvar reEnd = /(\r?\n```$)/mg;nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nnt// Look for the end of the blockntreEnd.lastIndex = this.parser.pos;ntvar match = reEnd.exec(this.parser.source),ntttext;nt// Process the blockntif(match) {ntttext = this.parser.source.substring(this.parser.pos,match.index);nttthis.parser.pos = match.index + match[0].length;nt} else {ntttext = this.parser.source.substr(this.parser.pos);nttthis.parser.pos = this.parser.sourceLength;nt}nt// Return the $codeblock widgetntreturn [{nttttype: "element",nttttag: "$codeblock",ntttattributes: {ntttttcode: {type: "string", value: text},ntttttlanguage: {type: "string", value: this.match[1]}nttt}nt}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/codeblock.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/codeinline.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/codeinline.jsntype: application/javascriptnmodule-type: wikirulennWiki text inline rule for code runs. For example:nn```ntThis is a `code run`.ntThis is another ``code run``n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "codeinline";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /(``?)/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;ntvar reEnd = new RegExp(this.match[1], "mg");nt// Look for the end markerntreEnd.lastIndex = this.parser.pos;ntvar match = reEnd.exec(this.parser.source),ntttext;nt// Process the textntif(match) {ntttext = this.parser.source.substring(this.parser.pos,match.index);nttthis.parser.pos = match.index + match[0].length;nt} else {ntttext = this.parser.source.substr(this.parser.pos);nttthis.parser.pos = this.parser.sourceLength;nt}ntreturn [{ntttype: "element",ntttag: "code",nttchildren: [{nttttype: "text",nttttext: textntt}]nt}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/codeinline.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/commentblock.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/commentblock.jsntype: application/javascriptnmodule-type: wikirulennWiki text block rule for HTML comments. For example:nn```nn```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "commentblock";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to match - HTML comment regexp by Stephen Ostermiller, http://ostermiller.org/findhtmlcomment.htmlntthis.matchRegExp = /\\r?\n/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Don't return any elementsntreturn [];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/commentblock.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/commentinline.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/commentinline.jsntype: application/javascriptnmodule-type: wikirulennWiki text inline rule for HTML comments. For example:nn```nn```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "commentinline";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to match - HTML comment regexp by Stephen Ostermiller, http://ostermiller.org/findhtmlcomment.htmlntthis.matchRegExp = /\/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Don't return any elementsntreturn [];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/commentinline.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/dash.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/dash.jsntype: application/javascriptnmodule-type: wikirulennWiki text inline rule for dashes. For example:nn```nThis is an en-dash: --nnThis is an em-dash: ---n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "dash";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /-{2,3}(?!-)/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;ntvar dash = this.match[0].length === 2 ? "–" : "—";ntreturn [{ntttype: "entity",nttentity: dashnt}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/dash.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/emphasis.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis.jsntype: application/javascriptnmodule-type: wikirulennWiki text inline rule for emphasis. For example:nn```ntThis is ''bold'' textnntThis is //italic// textnntThis is __underlined__ textnntThis is ^^superscript^^ textnntThis is ,,subscript,, textnntThis is ~~strikethrough~~ textn```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "emphasis";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /''|\/\/|__|\^\^|,,|~~/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Figure out which element and closing regexp to usentvar tag,reEnd;ntswitch(this.match[0]) {nttcase "''": // Boldnttttag = "strong";ntttreEnd = /''/mg;ntttbreak;nttcase "//": // Italicsnttttag = "em";ntttreEnd = /\/\//mg;ntttbreak;nttcase "__": // Underlinenttttag = "u";ntttreEnd = /__/mg;ntttbreak;nttcase "^^": // Superscriptnttttag = "sup";ntttreEnd = /\^\^/mg;ntttbreak;nttcase ",,": // Subscriptnttttag = "sub";ntttreEnd = /,,/mg;ntttbreak;nttcase "~~": // Strikethroughnttttag = "strike";ntttreEnd = /~~/mg;ntttbreak;nt}nt// Parse the run including the terminatorntvar tree = this.parser.parseInlineRun(reEnd,{eatTerminator: true});nt// Return the classed spanntreturn [{ntttype: "element",ntttag: tag,nttchildren: treent}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/emphasis.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/entity.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/entity.jsntype: application/javascriptnmodule-type: wikirulennWiki text inline rule for HTML entities. For example:nn```ntThis is a copyright symbol: ©n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "entity";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /(?[a-zA-Z0-9]{2,8};)/mg;n};nn/*nParse the most recent matchn*/nexports.parse = function() {nt// Get all the details of the matchntvar entityString = this.match[1];nt// Move past the macro callntthis.parser.pos = this.matchRegExp.lastIndex;nt// Return the entityntreturn [{type: "entity", entity: this.match[0]}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/entity.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/extlink.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/extlink.jsntype: application/javascriptnmodule-type: wikirulennWiki text inline rule for external links. For example:nn```nAn external link: http://www.tiddlywiki.com/nnA suppressed external link: ~http://www.tiddlyspace.com/n```nnExternal links can be suppressed by preceding them with `~`.nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "extlink";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /~?(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s'"<>]+(?:\/|\b)/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Create the link unless it is suppressedntif(this.match[0].substr(0,1) === "~") {nttreturn [{type: "text", text: this.match[0].substr(1)}];nt} else {nttreturn [{nttttype: "element",nttttag: "a",ntttattributes: {ntttthref: {type: "string", value: this.match[0]},ntttt"class": {type: "string", value: "tw-tiddlylink-external"},ntttttarget: {type: "string", value: "_blank"}nttt},ntttchildren: [{ntttttype: "text", text: this.match[0]nttt}]ntt}];nt}n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/extlink.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.jsntype: application/javascriptnmodule-type: wikirulennWiki text rule for block-level filtered transclusion. For example:nn```n{{{ [tag[docs]] }}}n{{{ [tag[docs]] |tooltip}}}n{{{ [tag[docs]] ||TemplateTitle}}}n{{{ [tag[docs]] |tooltip||TemplateTitle}}}n{{{ [tag[docs]] }}width:40;height:50;}.class.classn```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "filteredtranscludeblock";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /\{\{\{([^\|]+?)(?:\|([^\|\{\}]+))?(?:\|\|([^\|\{\}]+))?\}\}([^\}]*)\}(?:\.(\S+))?(?:\r?\n|$)/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Get the match detailsntvar filter = this.match[1],ntttooltip = this.match[2],ntttemplate = $tw.utils.trim(this.match[3]),nttstyle = this.match[4],nttclasses = this.match[5];nt// Return the list widgetntvar node = {ntttype: "element",ntttag: "$list",nttattributes: {ntttfilter: {type: "string", value: filter}ntt},nttisBlock: truent};ntif(tooltip) {nttnode.attributes.tooltip = {type: "string", value: tooltip};nt}ntif(template) {nttnode.attributes.template = {type: "string", value: template};nt}ntif(style) {nttnode.attributes.style = {type: "string", value: style};nt}ntif(classes) {nttnode.attributes["itemClass"] = {type: "string", value: classes.split(".").join(" ")};nt}ntreturn [node];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.jsntype: application/javascriptnmodule-type: wikirulennWiki text rule for inline filtered transclusion. For example:nn```n{{{ [tag[docs]] }}}n{{{ [tag[docs]] |tooltip}}}n{{{ [tag[docs]] ||TemplateTitle}}}n{{{ [tag[docs]] |tooltip||TemplateTitle}}}n{{{ [tag[docs]] }}width:40;height:50;}.class.classn```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "filteredtranscludeinline";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /\{\{\{([^\|]+?)(?:\|([^\|\{\}]+))?(?:\|\|([^\|\{\}]+))?\}\}([^\}]*)\}(?:\.(\S+))?/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Get the match detailsntvar filter = this.match[1],ntttooltip = this.match[2],ntttemplate = $tw.utils.trim(this.match[3]),nttstyle = this.match[4],nttclasses = this.match[5];nt// Return the list widgetntvar node = {ntttype: "element",ntttag: "$list",nttattributes: {ntttfilter: {type: "string", value: filter}ntt}nt};ntif(tooltip) {nttnode.attributes.tooltip = {type: "string", value: tooltip};nt}ntif(template) {nttnode.attributes.template = {type: "string", value: template};nt}ntif(style) {nttnode.attributes.style = {type: "string", value: style};nt}ntif(classes) {nttnode.attributes["itemClass"] = {type: "string", value: classes.split(".").join(" ")};nt}ntreturn [node];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/hardlinebreaks.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/hardlinebreaks.jsntype: application/javascriptnmodule-type: wikirulennWiki text inline rule for marking areas with hard line breaks. For example:nn```n"""nThis is some textnThat is set likenIt is a PoemnWhen it isnClearlynNotn"""n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "hardlinebreaks";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /"""(?:\r?\n)?/mg;n};nnexports.parse = function() {ntvar reEnd = /(""")|(\r?\n)/mg,ntttree = [];nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;ntdo {ntt// Parse the run up to the terminatorntttree.push.apply(tree,this.parser.parseInlineRun(reEnd,{eatTerminator: false}));ntt// Redo the terminator matchnttreEnd.lastIndex = this.parser.pos;nttvar match = reEnd.exec(this.parser.source);nttif(match) {ntttthis.parser.pos = reEnd.lastIndex;nttt// Add a line break if the terminator was a line breakntttif(match[2]) {ntttttree.push({type: "element", tag: "br"});nttt}ntt}nt} while(match && !match[1]);nt// Return the nodesntreturn tree;n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/hardlinebreaks.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/heading.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/heading.jsntype: application/javascriptnmodule-type: wikirulennWiki text block rule for headingsnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "heading";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /(!{1,6})/mg;n};nn/*nParse the most recent matchn*/nexports.parse = function() {nt// Get all the details of the matchntvar headingLevel = this.match[1].length;nt// Move past the !sntthis.parser.pos = this.matchRegExp.lastIndex;nt// Parse any classes, whitespace and then the heading itselfntvar classes = this.parser.parseClasses();ntthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});ntvar tree = this.parser.parseInlineRun(/(\r?\n)/mg);nt// Return the headingntreturn [{ntttype: "element",ntttag: "h" + this.match[1].length, nttattributes: {nttt"class": {type: "string", value: classes.join(" ")}ntt},nttchildren: treent}];n};n})();n", "title": "$:/core/modules/parsers/wikiparser/rules/heading.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/horizrule.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/horizrule.jsntype: application/javascriptnmodule-type: wikirulennWiki text block rule for rules. For example:nn```n---n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "horizrule";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /-{3,}\r?(?:\n|$)/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;ntreturn [{type: "element", tag: "hr"}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/horizrule.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/html.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/html.jsntype: application/javascriptnmodule-type: wikirulennWiki rule for HTML elements and widgets. For example:nn{{{nnn<$slider target="MyTiddler">nThis is a widget invocationn$slider>nn}}}nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "html";nexports.types = {inline: true, block: true};nnexports.init = function(parser) {ntthis.parser = parser;n};nnexports.findNextMatch = function(startPos) {nt// Find the next tagntthis.nextTag = this.findNextTag(this.parser.source,startPos,{nttrequireLineBreak: this.is.blocknt});ntreturn this.nextTag ? this.nextTag.start : undefined;n};nn/*nParse the most recent matchn*/nexports.parse = function() {nt// Retrieve the most recent match so that recursive calls don't overwrite itntvar tag = this.nextTag;ntthis.nextTag = null;nt// Advance the parser position to past the tagntthis.parser.pos = tag.end;nt// Check for a following linebreakntvar hasLineBreak = !tag.isSelfClosing && !!this.parseTokenRegExp(this.parser.source,this.parser.pos,/(\r?\n)/g);nt// Set whether we're in block modenttag.isBlock = this.is.block || hasLineBreak;nt// Parse the body if we need tontif(!tag.isSelfClosing && $tw.config.htmlVoidElements.indexOf(tag.tag) === -1) {ntttvar reEndString = "" + $tw.utils.escapeRegExp(tag.tag) + ">",nttttreEnd = new RegExp("(" + reEndString + ")","mg");nttif(hasLineBreak) {nttttag.children = this.parser.parseBlocks(reEndString);ntt} else {nttttag.children = this.parser.parseInlineRun(reEnd);ntt}nttreEnd.lastIndex = this.parser.pos;nttvar endMatch = reEnd.exec(this.parser.source);nttif(endMatch && endMatch.index === this.parser.pos) {ntttthis.parser.pos = endMatch.index + endMatch[0].length;ntt}nt}nt// Return the tagntreturn [tag];n};nn/*nLook for a whitespace token. Returns null if not found, otherwise returns {type: "whitespace", start:, end:,}n*/nexports.parseWhiteSpace = function(source,pos) {ntvar node = {ntttype: "whitespace",nttstart: posnt};ntvar re = /(\s)+/g;ntre.lastIndex = pos;ntvar match = re.exec(source);ntif(match && match.index === pos) {nttnode.end = pos + match[0].length;nttreturn node;nt}ntreturn null;n};nn/*nConvenience wrapper for parseWhiteSpacen*/nexports.skipWhiteSpace = function(source,pos) {ntvar whitespace = this.parseWhiteSpace(source,pos);ntif(whitespace) {nttreturn whitespace.end;nt}ntreturn pos;n};nn/*nLook for a given string token. Returns null if not found, otherwise returns {type: "token", value:, start:, end:,}n*/nexports.parseTokenString = function(source,pos,token) {ntvar match = source.indexOf(token,pos) === pos;ntif(match) {nttreturn {nttttype: "token",ntttvalue: token,ntttstart: pos,ntttend: pos + token.lengthntt};nt}ntreturn null;n};nn/*nLook for a token matching a regex. Returns null if not found, otherwise returns {type: "regexp", match:, start:, end:,}n*/nexports.parseTokenRegExp = function(source,pos,reToken) {ntvar node = {ntttype: "regexp",nttstart: posnt};ntreToken.lastIndex = pos;ntnode.match = reToken.exec(source);ntif(node.match && node.match.index === pos) {nttnode.end = pos + node.match[0].length;nttreturn node;nt} else {nttreturn null;nt}n};nn/*nLook for a string literal. Returns null if not found, otherwise returns {type: "string", value:, start:, end:,}n*/nexports.parseStringLiteral = function(source,pos) {ntvar node = {ntttype: "string",nttstart: posnt};ntvar reString = /(?:"([^"]*)")|(?:'([^']*)')/g;ntreString.lastIndex = pos;ntvar match = reString.exec(source);ntif(match && match.index === pos) {nttnode.value = match[1] === undefined ? match[2] : match[1];nttnode.end = pos + match[0].length;nttreturn node;nt} else {nttreturn null;nt}n};nn/*nLook for a macro invocation parameter. Returns null if not found, or {type: "macro-parameter", name:, value:, start:, end:}n*/nexports.parseMacroParameter = function(source,pos) {ntvar node = {ntttype: "macro-parameter",nttstart: posnt};nt// Define our regexpntvar reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^\s>"'=]+)))/g;nt// Skip whitespacentpos = this.skipWhiteSpace(source,pos);nt// Look for the parameterntvar token = this.parseTokenRegExp(source,pos,reMacroParameter);ntif(!token) {nttreturn null;nt}ntpos = token.end;nt// Get the parameter detailsntnode.value = token.match[2] !== undefined ? token.match[2] : (nttttttoken.match[3] !== undefined ? token.match[3] : (ntttttttoken.match[4] !== undefined ? token.match[4] : (nttttttttoken.match[5] !== undefined ? token.match[5] : (ntttttttt""nttttttt)ntttttt)nttttt)ntttt);ntif(token.match[1]) {nttnode.name = token.match[1];nt}nt// Update the end positionntnode.end = pos;ntreturn node;n};nn/*nLook for a macro invocation. Returns null if not found, or {type: "macrocall", name:, parameters:, start:, end:}n*/nexports.parseMacroInvocation = function(source,pos) {ntvar node = {ntttype: "macrocall",nttstart: pos,nttparams: []nt};nt// Define our regexpsntvar reMacroName = /([^\s>"'=]+)/g;nt// Skip whitespacentpos = this.skipWhiteSpace(source,pos);nt// Look for a double less than signntvar token = this.parseTokenString(source,pos,"<<");ntif(!token) {nttreturn null;nt}ntpos = token.end;nt// Get the macro namentvar name = this.parseTokenRegExp(source,pos,reMacroName);ntif(!name) {nttreturn null;nt}ntnode.name = name.match[1];ntpos = name.end;nt// Process parametersntvar parameter = this.parseMacroParameter(source,pos);ntwhile(parameter) {nttnode.params.push(parameter);nttpos = parameter.end;ntt// Get the next parameternttparameter = this.parseMacroParameter(source,pos);nt}nt// Skip whitespacentpos = this.skipWhiteSpace(source,pos);nt// Look for a double greater than signnttoken = this.parseTokenString(source,pos,">>");ntif(!token) {nttreturn null;nt}ntpos = token.end;nt// Update the end positionntnode.end = pos;ntreturn node;n};nn/*nLook for an HTML attribute definition. Returns null if not found, otherwise returns {type: "attribute", name:, valueType: "string|indirect|macro", value:, start:, end:,}n*/nexports.parseAttribute = function(source,pos) {ntvar node = {nttstart: posnt};nt// Define our regexpsntvar reAttributeName = /([^\/\s>"'=]+)/g,nttreUnquotedAttribute = /([^\/\s<>"'=]+)/g,nttreIndirectValue = /\{\{([^\}]+)\}\}/g;nt// Skip whitespacentpos = this.skipWhiteSpace(source,pos);nt// Get the attribute namentvar name = this.parseTokenRegExp(source,pos,reAttributeName);ntif(!name) {nttreturn null;nt}ntnode.name = name.match[1];ntpos = name.end;nt// Skip whitespacentpos = this.skipWhiteSpace(source,pos);nt// Look for an equals signntvar token = this.parseTokenString(source,pos,"=");ntif(token) {nttpos = token.end;ntt// Skip whitespacenttpos = this.skipWhiteSpace(source,pos);ntt// Look for a string literalnttvar stringLiteral = this.parseStringLiteral(source,pos);nttif(stringLiteral) {ntttpos = stringLiteral.end;ntttnode.type = "string";ntttnode.value = stringLiteral.value;ntt} else {nttt// Look for an indirect valuentttvar indirectValue = this.parseTokenRegExp(source,pos,reIndirectValue);ntttif(indirectValue) {nttttpos = indirectValue.end;nttttnode.type = "indirect";nttttnode.textReference = indirectValue.match[1];nttt} else {ntttt// Look for a unquoted valuenttttvar unquotedValue = this.parseTokenRegExp(source,pos,reUnquotedAttribute);nttttif(unquotedValue) {ntttttpos = unquotedValue.end;ntttttnode.type = "string";ntttttnode.value = unquotedValue.match[1];ntttt} else {nttttt// Look for a macro invocation valuentttttvar macroInvocation = this.parseMacroInvocation(source,pos);ntttttif(macroInvocation) {nttttttpos = macroInvocation.end;nttttttnode.type = "macro";nttttttnode.value = macroInvocation;nttttt} else {nttttttnode.type = "string";nttttttnode.value = "true";nttttt}ntttt}nttt}ntt}nt} else {nttnode.type = "string";nttnode.value = "true";nt}nt// Update the end positionntnode.end = pos;ntreturn node;n};nn/*nLook for an HTML tag. Returns null if not found, otherwise returns {type: "tag", name:, attributes: [], isSelfClosing:, start:, end:,}n*/nexports.parseTag = function(source,pos,options) {ntoptions = options || {};ntvar token,nttnode = {nttttype: "element",ntttstart: pos,ntttattributes: {}ntt};nt// Define our regexpsntvar reTagName = /([a-zA-Z0-9\-\$]+)/g;nt// Skip whitespacentpos = this.skipWhiteSpace(source,pos);nt// Look for a less than signnttoken = this.parseTokenString(source,pos,"<");ntif(!token) {nttreturn null;nt}ntpos = token.end;nt// Get the tag namenttoken = this.parseTokenRegExp(source,pos,reTagName);ntif(!token) {nttreturn null;nt}ntnode.tag = token.match[1];ntpos = token.end;nt// Process attributesntvar attribute = this.parseAttribute(source,pos);ntwhile(attribute) {nttnode.attributes[attribute.name] = attribute;nttpos = attribute.end;ntt// Get the next attributenttattribute = this.parseAttribute(source,pos);nt}nt// Skip whitespacentpos = this.skipWhiteSpace(source,pos);nt// Look for a closing slashnttoken = this.parseTokenString(source,pos,"/");ntif(token) {nttpos = token.end;nttnode.isSelfClosing = true;nt}nt// Look for a greater than signnttoken = this.parseTokenString(source,pos,">");ntif(!token) {nttreturn null;nt}ntpos = token.end;nt// Check for a required line breakntif(options.requireLineBreak) {ntttoken = this.parseTokenRegExp(source,pos,/(\r?\n)/g);nttif(!token) {ntttreturn null;ntt}nt}nt// Update the end positionntnode.end = pos;ntreturn node;n};nnexports.findNextTag = function(source,pos,options) {nt// A regexp for finding candidate HTML tagsntvar reLookahead = /<([a-zA-Z\-\$]+)/g;nt// Find the next candidatentreLookahead.lastIndex = pos;ntvar match = reLookahead.exec(source);ntwhile(match) {ntt// Try to parse the candidate as a tagnttvar tag = this.parseTag(source,match.index,options);ntt// Return successnttif(tag && this.isLegalTag(tag.tag)) {ntttreturn tag;ntt}ntt// Look for the next matchnttreLookahead.lastIndex = match.index + 1;nttmatch = reLookahead.exec(source);nt}nt// Failedntreturn null;n};nnexports.isLegalTag = function(tag) {nt// If it starts with a $ then we'll let anything gontif(tag.charAt(0) === "$") {nttreturn true;nt// If it starts with a dash then it's not legalnt} else if(tag.charAt(0) === "-") {nttreturn false;nt} else {ntt// Otherwise it's OKnttreturn true;nt}n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/html.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/list.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/list.jsntype: application/javascriptnmodule-type: wikirulennWiki text block rule for lists. For example:nn```n* This is an unordered listn* It has two itemsnn# This is a numbered listn## With a subitemn# And a third itemnn; This is a term that is being definedn: This is the definition of that termn```nnNote that lists can be nested arbitrarily:nn```n#** Onen#* Twon#** Threen#**** Fourn#**# Fiven#**## Sixn## Sevenn### Eightn## Ninen```nnA CSS class can be applied to a list item as follows:nn```n* List item onen*.active List item two has the class `active`n* List item threen```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "list";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /([\*#;:>]+)/mg;n};nnvar listTypes = {nt"*": {listTag: "ul", itemTag: "li"},nt"#": {listTag: "ol", itemTag: "li"},nt";": {listTag: "dl", itemTag: "dt"},nt":": {listTag: "dl", itemTag: "dd"},nt">": {listTag: "blockquote", itemTag: "p"}n};nn/*nParse the most recent matchn*/nexports.parse = function() {nt// Array of parse tree nodes for the previous row of the listntvar listStack = [];nt// Cycle through the items in the listntwhile(true) {ntt// Match the list markernttvar reMatch = /([\*#;:>]+)/mg;nttreMatch.lastIndex = this.parser.pos;nttvar match = reMatch.exec(this.parser.source);nttif(!match || match.index !== this.parser.pos) {ntttbreak;ntt}ntt// Check whether the list type of the top level matchesnttvar listInfo = listTypes[match[0].charAt(0)];nttif(listStack.length > 0 && listStack[0].tag !== listInfo.listTag) {ntttbreak;ntt}ntt// Move past the list markernttthis.parser.pos = match.index + match[0].length;ntt// Walk through the list markers for the current rownttfor(var t=0; t t && listStack[t].tag !== listInfo.listTag) {nttttlistStack.splice(t,listStack.length - t);nttt}nttt// Construct the list element or reuse the previous one at this levelntttif(listStack.length <= t) {nttttvar listElement = {type: "element", tag: listInfo.listTag, children: [nttttt{type: "element", tag: listInfo.itemTag, children: []}ntttt]};ntttt// Link this list element into the last child item of the parent list itemnttttif(t) {ntttttvar prevListItem = listStack[t-1].children[listStack[t-1].children.length-1];ntttttprevListItem.children.push(listElement);ntttt}ntttt// Save this element in the stacknttttlistStack[t] = listElement;nttt} else if(t === (match[0].length - 1)) {nttttlistStack[t].children.push({type: "element", tag: listInfo.itemTag, children: []});nttt}ntt}nttif(listStack.length > match[0].length) {ntttlistStack.splice(match[0].length,listStack.length - match[0].length);ntt}ntt// Process the body of the list item into the last list itemnttvar lastListChildren = listStack[listStack.length-1].children,ntttlastListItem = lastListChildren[lastListChildren.length-1],ntttclasses = this.parser.parseClasses();nttthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});nttvar tree = this.parser.parseInlineRun(/(\r?\n)/mg);nttlastListItem.children.push.apply(lastListItem.children,tree);nttif(classes.length > 0) {nttt$tw.utils.addClassToParseTreeNode(lastListItem,classes.join(" "));ntt}ntt// Consume any whitespace following the list itemnttthis.parser.skipWhitespace();nt}nt// Return the root element of the listntreturn [listStack[0]];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/list.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/macrocallblock.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/macrocallblock.jsntype: application/javascriptnmodule-type: wikirulennWiki rule for block macro callsnn```n< >n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "macrocallblock";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /<<([^>\s]+)(?:\s*)((?:[^>]|(?:>(?!>)))*?)>>(?:\r?\n|$)/mg;n};nn/*nParse the most recent matchn*/nexports.parse = function() {nt// Get all the details of the matchntvar macroName = this.match[1],nttparamString = this.match[2];nt// Move past the macro callntthis.parser.pos = this.matchRegExp.lastIndex;ntvar params = [],nttreParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg,nttparamMatch = reParam.exec(paramString);ntwhile(paramMatch) {ntt// Process this parameternttvar paramInfo = {ntttvalue: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]ntt};nttif(paramMatch[1]) {ntttparamInfo.name = paramMatch[1];ntt}nttparams.push(paramInfo);ntt// Find the next matchnttparamMatch = reParam.exec(paramString);nt}ntreturn [{ntttype: "macrocall",nttname: macroName,nttparams: params,nttisBlock: truent}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/macrocallblock.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/macrocallinline.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/macrocallinline.jsntype: application/javascriptnmodule-type: wikirulennWiki rule for macro callsnn```n< >n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "macrocallinline";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /<<([^\s>]+)\s*([\s\S]*?)>>/mg;n};nn/*nParse the most recent matchn*/nexports.parse = function() {nt// Get all the details of the matchntvar macroName = this.match[1],nttparamString = this.match[2];nt// Move past the macro callntthis.parser.pos = this.matchRegExp.lastIndex;ntvar params = [],nttreParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg,nttparamMatch = reParam.exec(paramString);ntwhile(paramMatch) {ntt// Process this parameternttvar paramInfo = {ntttvalue: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]ntt};nttif(paramMatch[1]) {ntttparamInfo.name = paramMatch[1];ntt}nttparams.push(paramInfo);ntt// Find the next matchnttparamMatch = reParam.exec(paramString);nt}ntreturn [{ntttype: "macrocall",nttname: macroName,nttparams: paramsnt}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/macrocallinline.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/macrodef.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/macrodef.jsntype: application/javascriptnmodule-type: wikirulennWiki pragma rule for macro definitionsnn```n\define name(param:defaultvalue,param2:defaultvalue)ndefinition text, including $param$ markersn\endn```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "macrodef";nexports.types = {pragma: true};nn/*nInstantiate parse rulen*/nexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /^\\define\s+([^(\s]+)\(\s*([^)]*)\)(\r?\n)?/mg;n};nn/*nParse the most recent matchn*/nexports.parse = function() {nt// Move past the macro name and parametersntthis.parser.pos = this.matchRegExp.lastIndex;nt// Parse the parametersntvar paramString = this.match[2],nttparams = [];ntif(paramString !== "") {nttvar reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))?/mg,ntttparamMatch = reParam.exec(paramString);nttwhile(paramMatch) {nttt// Save the parameter detailsntttvar paramInfo = {name: paramMatch[1]},nttttdefaultValue = paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5];ntttif(defaultValue) {nttttparamInfo["default"] = defaultValue;nttt}ntttparams.push(paramInfo);nttt// Look for the next parameterntttparamMatch = reParam.exec(paramString);ntt}nt}nt// Is this a multiline definition?ntvar reEnd;ntif(this.match[3]) {ntt// If so, the end of the body is marked with \endnttreEnd = /(\r?\n\\end\r?\n)/mg;nt} else {ntt// Otherwise, the end of the definition is marked by the end of the linenttreEnd = /(\r?\n)/mg;nt}nt// Find the end of the definitionntreEnd.lastIndex = this.parser.pos;ntvar text,nttendMatch = reEnd.exec(this.parser.source);ntif(endMatch) {ntttext = this.parser.source.substring(this.parser.pos,endMatch.index);nttthis.parser.pos = endMatch.index + endMatch[0].length;nt} else {ntt// We didn't find the end of the definition, so we'll make it blankntttext = "";nt}nt// Save the macro definitionntreturn [{ntttype: "macrodef",nttname: this.match[1],nttparams: params,ntttext: textnt}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/macrodef.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/prettylink.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/prettylink.jsntype: application/javascriptnmodule-type: wikirulennWiki text inline rule for pretty links. For example:nn```n[[Introduction]]nn[[Link description|TiddlerTitle]]n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "prettylink";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /\[\[(.*?)(?:\|(.*?))?\]\]/mg;n};nnvar isLinkExternal = function(to) {ntvar externalRegExp = /(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\s'"]+(?:\/|\b)/i;ntreturn externalRegExp.test(to);n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Process the linkntvar text = this.match[1],nttlink = this.match[2] || text;ntif(isLinkExternal(link)) {nttreturn [{nttttype: "element",nttttag: "a",ntttattributes: {ntttthref: {type: "string", value: link},ntttt"class": {type: "string", value: "tw-tiddlylink-external"},ntttttarget: {type: "string", value: "_blank"}nttt},ntttchildren: [{ntttttype: "text", text: textnttt}]ntt}];nt} else {nttreturn [{nttttype: "element",nttttag: "$link",ntttattributes: {nttttto: {type: "string", value: link}nttt},ntttchildren: [{ntttttype: "text", text: textnttt}]ntt}];nt}n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/prettylink.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/quoteblock.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/quoteblock.jsntype: application/javascriptnmodule-type: wikirulennWiki text rule for quote blocks. For example:nn```nt<<<.optionalClass(es) optional cited fromnta quotent<< 0) {ntttree.unshift({nttttype: "element",nttttag: "cite",ntttchildren: citentt});nt}nnt// Parse any optional citentthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});ntvar cite = this.parser.parseInlineRun(/(\r?\n)/mg);nt// If we got a cite, push itntif(cite.length > 0) {ntttree.push({nttttype: "element",nttttag: "cite",ntttchildren: citentt});nt}nnt// Return the blockquote elementntreturn [{ntttype: "element",ntttag: "blockquote",nttattributes: {ntttclass: { type: "string", value: classes.join(" ") },ntt},nttchildren: treent}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/quoteblock.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/rules.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/rules.jsntype: application/javascriptnmodule-type: wikirulennWiki pragma rule for rules specificationsnn```n\rules except ruleone ruletwo rulethreen\rules only ruleone ruletwo rulethreen```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "rules";nexports.types = {pragma: true};nn/*nInstantiate parse rulen*/nexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /^\\rules[^\S\n]/mg;n};nn/*nParse the most recent matchn*/nexports.parse = function() {nt// Move past the pragma invocationntthis.parser.pos = this.matchRegExp.lastIndex;nt// Parse whitespace delimited tokens terminated by a line breakntvar reMatch = /[^\S\n]*(\S+)|(\r?\n)/mg,ntttokens = [];ntreMatch.lastIndex = this.parser.pos;ntvar match = reMatch.exec(this.parser.source);ntwhile(match && match.index === this.parser.pos) {nttthis.parser.pos = reMatch.lastIndex;ntt// Exit if we've got the line breaknttif(match[2]) {ntttbreak;ntt}ntt// Process the tokennttif(match[1]) {nttttokens.push(match[1]);ntt}ntt// Match the next tokennttmatch = reMatch.exec(this.parser.source);nt}nt// Process the tokensntif(tokens.length > 0) {nttthis.parser.amendRules(tokens[0],tokens.slice(1));nt}nt// No parse tree nodes to returnntreturn [];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/rules.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/styleblock.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/styleblock.jsntype: application/javascriptnmodule-type: wikirulennWiki text block rule for assigning styles and classes to paragraphs and other blocks. For example:nn```n@@.myClassn@@background-color:red;nThis paragraph will have the CSS class `myClass`.nn* The ` ` around this list will also have the class `myClass`n* List item 2nn@@n```nnNote that classes and styles can be mixed subject to the rule that styles must precede classes. For examplenn```n@@.myFirstClass.mySecondClassn@@width:100px;.myThirdClassnThis is a paragraphn@@n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "styleblock";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /@@((?:[^\.\r\n\s:]+:[^\r\n;]+;)+)?(?:\.([^\r\n\s]+))?\r?\n/mg;n};nnexports.parse = function() {ntvar reEndString = "^@@(?:\\r?\\n)?";ntvar classes = [], styles = [];ntdo {ntt// Get the class and stylenttif(this.match[1]) {ntttstyles.push(this.match[1]);ntt}nttif(this.match[2]) {ntttclasses.push(this.match[2].split(".").join(" "));ntt}ntt// Move past the matchnttthis.parser.pos = this.matchRegExp.lastIndex;ntt// Look for another line of classes and stylesnttthis.match = this.matchRegExp.exec(this.parser.source);nt} while(this.match && this.match.index === this.parser.pos);nt// Parse the bodyntvar tree = this.parser.parseBlocks(reEndString);ntfor(var t=0; t
0) {nttt$tw.utils.addClassToParseTreeNode(tree[t],classes.join(" "));ntt}nttif(styles.length > 0) {nttt$tw.utils.addAttributeToParseTreeNode(tree[t],"style",styles.join(""));ntt}nt}ntreturn tree;n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/styleblock.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/styleinline.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/styleinline.jsntype: application/javascriptnmodule-type: wikirulennWiki text inline rule for assigning styles and classes to inline runs. For example:nn```n@@.myClass This is some text with a class@@n@@background-color:red;This is some text with a background colour@@n@@width:100px;.myClass This is some text with a class and a width@@n```nnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "styleinline";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /@@((?:[^\.\r\n\s:]+:[^\r\n;]+;)+)?(\.(?:[^\r\n\s]+)\s+)?/mg;n};nnexports.parse = function() {ntvar reEnd = /@@/g;nt// Get the styles and classntvar stylesString = this.match[1],nttclassString = this.match[2] ? this.match[2].split(".").join(" ") : undefined;nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Parse the run up to the terminatorntvar tree = this.parser.parseInlineRun(reEnd,{eatTerminator: true});nt// Return the classed spanntvar node = {ntttype: "element",ntttag: "span",nttattributes: {nttt"class": {type: "string", value: "tw-inline-style"}ntt},nttchildren: treent};ntif(classString) {ntt$tw.utils.addClassToParseTreeNode(node,classString);nt}ntif(stylesString) {ntt$tw.utils.addAttributeToParseTreeNode(node,"style",stylesString);nt}ntreturn [node];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/styleinline.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/table.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/table.jsntype: application/javascriptnmodule-type: wikirulennWiki text block rule for tables.nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "table";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /^\|(?:[^\n]*)\|(?:[fhck]?)\r?(?:\n|$)/mg;n};nnvar processRow = function(prevColumns) {ntvar cellRegExp = /(?:\|([^\n\|]*)\|)|(\|[fhck]?\r?(?:\n|$))/mg,nttcellTermRegExp = /((?:\x20*)\|)/mg,ntttree = [],nttcol = 0,nttcolSpanCount = 1,nttprevCell;nt// Match a single cellntcellRegExp.lastIndex = this.parser.pos;ntvar cellMatch = cellRegExp.exec(this.parser.source);ntwhile(cellMatch && cellMatch.index === this.parser.pos) {nttif(cellMatch[1] === "~") {nttt// Rowspanntttvar last = prevColumns[col];ntttif(last) {nttttlast.rowSpanCount++;ntttt$tw.utils.addAttributeToParseTreeNode(last.element,"rowspan",last.rowSpanCount);nttttvar vAlign = $tw.utils.getAttributeValueFromParseTreeNode(last.element,"valign","center");ntttt$tw.utils.addAttributeToParseTreeNode(last.element,"valign",vAlign);nttttif(colSpanCount > 1) {nttttt$tw.utils.addAttributeToParseTreeNode(last.element,"colspan",colSpanCount);ntttttcolSpanCount = 1;ntttt}nttt}nttt// Move to just before the `|` terminating the cellntttthis.parser.pos = cellRegExp.lastIndex - 1;ntt} else if(cellMatch[1] === ">") {nttt// ColspanntttcolSpanCount++;nttt// Move to just before the `|` terminating the cellntttthis.parser.pos = cellRegExp.lastIndex - 1;ntt} else if(cellMatch[1] === "<" && prevCell) {ntttcolSpanCount = 1 + $tw.utils.getAttributeValueFromParseTreeNode(prevCell,"colspan",1);nttt$tw.utils.addAttributeToParseTreeNode(prevCell,"colspan",colSpanCount);ntttcolSpanCount = 1;nttt// Move to just before the `|` terminating the cellntttthis.parser.pos = cellRegExp.lastIndex - 1;ntt} else if(cellMatch[2]) {nttt// End of rowntttif(prevCell && colSpanCount > 1) {nttttif(prevCell.attributes && prevCell.attributes && prevCell.attributes.colspan) {nttttttcolSpanCount += prevCell.attributes.colspan.value;ntttt} else {ntttttcolSpanCount -= 1;ntttt}ntttt$tw.utils.addAttributeToParseTreeNode(prevCell,"colspan",colSpanCount);nttt}ntttthis.parser.pos = cellRegExp.lastIndex - 1;ntttbreak;ntt} else {nttt// For ordinary cells, step beyond the opening `|`ntttthis.parser.pos++;nttt// Look for a space at the start of the cellntttvar spaceLeft = false,nttttvAlign = null;ntttif(this.parser.source.substr(this.parser.pos).search(/^\^([^\^]|\^\^)/) === 0) {nttttvAlign = "top";nttt} else if(this.parser.source.substr(this.parser.pos).search(/^,([^,]|,,)/) === 0) {nttttvAlign = "bottom";nttt}ntttif(vAlign) {nttttthis.parser.pos++;nttt}ntttvar chr = this.parser.source.substr(this.parser.pos,1);ntttwhile(chr === " ") {nttttspaceLeft = true;nttttthis.parser.pos++;nttttchr = this.parser.source.substr(this.parser.pos,1);nttt}nttt// Check whether this is a heading cellntttvar cell;ntttif(chr === "!") {nttttthis.parser.pos++;nttttcell = {type: "element", tag: "th", children: []};nttt} else {nttttcell = {type: "element", tag: "td", children: []};nttt}nttttree.push(cell);nttt// Record information about this cellntttprevCell = cell;ntttprevColumns[col] = {rowSpanCount:1,element:cell};nttt// Check for a colspanntttif(colSpanCount > 1) {ntttt$tw.utils.addAttributeToParseTreeNode(cell,"colspan",colSpanCount);nttttcolSpanCount = 1;nttt}nttt// Parse the cellntttcell.children = this.parser.parseInlineRun(cellTermRegExp,{eatTerminator: true});nttt// Set the alignment for the cellntttif(vAlign) {ntttt$tw.utils.addAttributeToParseTreeNode(cell,"valign",vAlign);nttt}ntttif(this.parser.source.substr(this.parser.pos - 2,1) === " ") { // spaceRightntttt$tw.utils.addAttributeToParseTreeNode(cell,"align",spaceLeft ? "center" : "left");nttt} else if(spaceLeft) {ntttt$tw.utils.addAttributeToParseTreeNode(cell,"align","right");nttt}nttt// Move back to the closing `|`ntttthis.parser.pos--;ntt}nttcol++;nttcellRegExp.lastIndex = this.parser.pos;nttcellMatch = cellRegExp.exec(this.parser.source);nt}ntreturn tree;n};nnexports.parse = function() {ntvar rowContainerTypes = {"c":"caption", "h":"thead", "":"tbody", "f":"tfoot"},ntttable = {type: "element", tag: "table", children: []},nttrowRegExp = /^\|([^\n]*)\|([fhck]?)\r?(?:\n|$)/mg,nttrowTermRegExp = /(\|(?:[fhck]?)\r?(?:\n|$))/mg,nttprevColumns = [],nttcurrRowType,nttrowContainer,nttrowCount = 0;nt// Match the rowntrowRegExp.lastIndex = this.parser.pos;ntvar rowMatch = rowRegExp.exec(this.parser.source);ntwhile(rowMatch && rowMatch.index === this.parser.pos) {nttvar rowType = rowMatch[2];ntt// Check if it is a class assignmentnttif(rowType === "k") {nttt$tw.utils.addClassToParseTreeNode(table,rowMatch[1]);ntttthis.parser.pos = rowMatch.index + rowMatch[0].length;ntt} else {nttt// Otherwise, create a new row if this one is of a different typentttif(rowType !== currRowType) {nttttrowContainer = {type: "element", tag: rowContainerTypes[rowType], children: []};ntttttable.children.push(rowContainer);nttttcurrRowType = rowType;nttt}nttt// Is this a caption row?ntttif(currRowType === "c") {ntttt// If so, move past the opening `|` of the rownttttthis.parser.pos++;ntttt// Move the caption to the first row if it isn't alreadynttttif(table.children.length !== 1) {nttttttable.children.pop(); // Take rowContainer out of the children arraynttttttable.children.splice(0,0,rowContainer); // Insert it at the bottomttttttntttt}ntttt// Set the alignment - TODO: figure out why TW did thisn//ttttrowContainer.attributes.align = rowCount === 0 ? "top" : "bottom";ntttt// Parse the captionnttttrowContainer.children = this.parser.parseInlineRun(rowTermRegExp,{eatTerminator: true});nttt} else {ntttt// Create the rownttttvar theRow = {type: "element", tag: "tr", children: []};ntttt$tw.utils.addClassToParseTreeNode(theRow,rowCount%2 ? "oddRow" : "evenRow");nttttrowContainer.children.push(theRow);ntttt// Process the rowntttttheRow.children = processRow.call(this,prevColumns);nttttthis.parser.pos = rowMatch.index + rowMatch[0].length;ntttt// Increment the row countnttttrowCount++;nttt}ntt}nttrowMatch = rowRegExp.exec(this.parser.source);nt}ntreturn [table];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/table.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/transcludeblock.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/transcludeblock.jsntype: application/javascriptnmodule-type: wikirulennWiki text rule for block-level transclusion. For example:nn```n{{MyTiddler}}n{{MyTiddler||TemplateTitle}}n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "transcludeblock";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /\{\{([^\{\}\|]+)(?:\|\|([^\|\{\}]+))?\}\}(?:\r?\n|$)/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Get the match detailsntvar textRef = $tw.utils.trim(this.match[1]),ntttr = $tw.utils.parseTextReference(textRef),ntttargetTitle = tr.title,ntttargetField = tr.field,ntttargetIndex = tr.index,ntttemplate = $tw.utils.trim(this.match[2]);nt// Prepare the transclude widgetntvar transcludeNode = {nttttype: "element",nttttag: "$transclude",ntttattributes: {},ntttisBlock: truentt};ntvar tiddlerNode = {ntttype: "element",ntttag: "$tiddler",nttattributes: {nttttiddler: {type: "string", value: targetTitle}ntt},nttisBlock: true,nttchildren: [transcludeNode]nt};ntif(template) {ntttranscludeNode.attributes.tiddler = {type: "string", value: template};nt} else {ntttranscludeNode.attributes.tiddler = {type: "string", value: targetTitle};nttif(targetField) {nttttranscludeNode.attributes.field = {type: "string", value: targetField};ntt}nttif(targetIndex) {nttttranscludeNode.attributes.index = {type: "string", value: targetIndex};ntt}nt}ntreturn [tiddlerNode];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/transcludeblock.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/transcludeinline.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/transcludeinline.jsntype: application/javascriptnmodule-type: wikirulennWiki text rule for inline-level transclusion. For example:nn```n{{MyTiddler}}n{{MyTiddler||TemplateTitle}}n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "transcludeinline";nexports.types = {inline: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /\{\{([^\{\}\|]+)(?:\|\|([^\|\{\}]+))?\}\}/mg;n};nnexports.parse = function() {nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Get the match detailsntvar textRef = $tw.utils.trim(this.match[1]),ntttr = $tw.utils.parseTextReference(textRef),ntttargetTitle = tr.title,ntttargetField = tr.field,ntttargetIndex = tr.index,ntttemplate = $tw.utils.trim(this.match[2]);nt// Prepare the transclude widgetntvar transcludeNode = {nttttype: "element",nttttag: "$transclude",ntttattributes: {}ntt};ntvar tiddlerNode = {ntttype: "element",ntttag: "$tiddler",nttattributes: {nttttiddler: {type: "string", value: targetTitle}ntt},nttchildren: [transcludeNode]nt};ntif(template) {ntttranscludeNode.attributes.tiddler = {type: "string", value: template};nt} else {ntttranscludeNode.attributes.tiddler = {type: "string", value: targetTitle};nttif(targetField) {nttttranscludeNode.attributes.field = {type: "string", value: targetField};ntt}nttif(targetIndex) {nttttranscludeNode.attributes.index = {type: "string", value: targetIndex};ntt}nt}ntreturn [tiddlerNode];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/transcludeinline.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/typedblock.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/typedblock.jsntype: application/javascriptnmodule-type: wikirulennWiki text rule for typed blocks. For example:nn```n$$$.jsnThis will be rendered as JavaScriptn$$$nn$$$.svgnn$$$nn$$$text/vnd.tiddlywiki>text/htmlnThis will be rendered as an //HTML representation// of WikiTextn$$$n```nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnvar widget = require("$:/core/modules/widgets/widget.js");nnexports.name = "typedblock";nexports.types = {block: true};nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = /\$\$\$([^ >\r\n]*)(?: *> *([^ \r\n]+))?\r?\n/mg;n};nnexports.parse = function() {ntvar reEnd = /\r?\n\$\$\$\r?(?:\n|$)/mg;nt// Save the typentvar parseType = this.match[1],nttrenderType = this.match[2];nt// Move past the matchntthis.parser.pos = this.matchRegExp.lastIndex;nt// Look for the end of the blockntreEnd.lastIndex = this.parser.pos;ntvar match = reEnd.exec(this.parser.source),ntttext;nt// Process the blockntif(match) {ntttext = this.parser.source.substring(this.parser.pos,match.index);nttthis.parser.pos = match.index + match[0].length;nt} else {ntttext = this.parser.source.substr(this.parser.pos);nttthis.parser.pos = this.parser.sourceLength;nt}nt// Parse the block according to the specified typentvar parser = this.parser.wiki.parseText(parseType,text,{defaultType: "text/plain"});nt// If there's no render type, just return the parse treentif(!renderType) {nttreturn parser.tree;nt} else {ntt// Otherwise, render to the rendertype and return in a tagnttvar widgetNode = this.parser.wiki.makeWidget(parser),ntttcontainer = $tw.fakeDocument.createElement("div");nttwidgetNode.render(container,null);nttvar text = renderType === "text/html" ? container.innerHTML : container.textContent;nttreturn [{nttttype: "element",nttttag: "pre",ntttchildren: [{ntttttype: "text",ntttttext: textnttt}]ntt}];nt}n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/typedblock.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/rules/wikilink.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/wikilink.jsntype: application/javascriptnmodule-type: wikirulennWiki text inline rule for wiki links. For example:nn```nAWikiLinknAnotherLinkn~SuppressedLinkn```nnPrecede a camel case word with `~` to prevent it from being recognised as a link.nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.name = "wikilink";nexports.types = {inline: true};nnvar textPrimitives = {ntupperLetter: "[A-Z\u00c0-\u00de\u0150\u0170]",ntlowerLetter: "[a-z0-9_\\-\u00df-\u00ff\u0151\u0171]",ntanyLetter: "[A-Za-z0-9_\\-\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]",ntanyLetterStrict: "[A-Za-z0-9\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]"n};nntextPrimitives.unWikiLink = "~";ntextPrimitives.wikiLink = textPrimitives.upperLetter + "+" +nttextPrimitives.lowerLetter + "+" +nttextPrimitives.upperLetter +nttextPrimitives.anyLetter + "*";nnexports.init = function(parser) {ntthis.parser = parser;nt// Regexp to matchntthis.matchRegExp = new RegExp(textPrimitives.unWikiLink + "?" + textPrimitives.wikiLink,"mg");n};nn/*nParse the most recent matchn*/nexports.parse = function() {nt// Get the details of the matchntvar linkText = this.match[0];nt// Move past the macro callntthis.parser.pos = this.matchRegExp.lastIndex;nt// If the link starts with the unwikilink character then just output it as plain textntif(linkText.substr(0,1) === textPrimitives.unWikiLink) {nttreturn [{type: "text", text: linkText.substr(1)}];nt}nt// If the link has been preceded with a letter then don't treat it as a linkntif(this.match.index > 0) {nttvar preRegExp = new RegExp(textPrimitives.anyLetterStrict,"mg");nttpreRegExp.lastIndex = this.match.index-1;nttvar preMatch = preRegExp.exec(this.parser.source);nttif(preMatch && preMatch.index === this.match.index-1) {ntttreturn [{type: "text", text: linkText}];ntt}nt}ntreturn [{ntttype: "element",ntttag: "$link",nttattributes: {ntttto: {type: "string", value: linkText}ntt},nttchildren: [{nttttype: "text",nttttext: linkTextntt}]nt}];n};nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/wikilink.js", "type": "application/javascript", "module-type": "wikirule" }, "$:/core/modules/parsers/wikiparser/wikiparser.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/wikiparser.jsntype: application/javascriptnmodule-type: parsernnThe wiki text parser processes blocks of source text into a parse tree.nnThe parse tree is made up of nested arrays of these JavaScript objects:nnt{type: "element", tag:, attributes: {}, children: []} - an HTML elementnt{type: "text", text: } - a text nodent{type: "entity", value: } - an entitynt{type: "raw", html: } - raw HTMLnnAttributes are stored as hashmaps of the following objects:nnt{type: "string", value: } - literal stringnt{type: "indirect", textReference: } - indirect through a text referencenn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnvar WikiParser = function(type,text,options) {ntthis.wiki = options.wiki;nt// Initialise the classes if we don't have them alreadyntif(!this.pragmaRuleClasses) {nttWikiParser.prototype.pragmaRuleClasses = $tw.modules.createClassesFromModules("wikirule","pragma",$tw.WikiRuleBase);nt}ntif(!this.blockRuleClasses) {nttWikiParser.prototype.blockRuleClasses = $tw.modules.createClassesFromModules("wikirule","block",$tw.WikiRuleBase);nt}ntif(!this.inlineRuleClasses) {nttWikiParser.prototype.inlineRuleClasses = $tw.modules.createClassesFromModules("wikirule","inline",$tw.WikiRuleBase);nt}nt// Save the parse textntthis.type = type || "text/vnd.tiddlywiki";ntthis.source = text || "";ntthis.sourceLength = this.source.length;nt// Set current parse positionntthis.pos = 0;nt// Instantiate the pragma parse rulesntthis.pragmaRules = this.instantiateRules(this.pragmaRuleClasses,"pragma",0);nt// Instantiate the parser block and inline rulesntthis.blockRules = this.instantiateRules(this.blockRuleClasses,"block",0);ntthis.inlineRules = this.instantiateRules(this.inlineRuleClasses,"inline",0);nt// Parse any pragmasntthis.tree = this.parsePragmas();nt// Parse the text into inline runs or blocksntif(options.parseAsInline) {nttthis.tree.push.apply(this.tree,this.parseInlineRun());nt} else {nttthis.tree.push.apply(this.tree,this.parseBlocks());nt}nt// Return the parse treen};nn/*nInstantiate an array of parse rulesn*/nWikiParser.prototype.instantiateRules = function(classes,type,startPos) {ntvar rulesInfo = [],nttself = this;nt$tw.utils.each(classes,function(RuleClass) {ntt// Instantiate the rulenttvar rule = new RuleClass(self);nttrule.is = {};nttrule.is[type] = true;nttrule.init(self);nttvar matchIndex = rule.findNextMatch(startPos);nttif(matchIndex !== undefined) {ntttrulesInfo.push({nttttrule: rule,nttttmatchIndex: matchIndexnttt});ntt}nt});ntreturn rulesInfo;n};nn/*nSkip any whitespace at the current position. Options are:nttreatNewlinesAsNonWhitespace: true if newlines are NOT to be treated as whitespacen*/nWikiParser.prototype.skipWhitespace = function(options) {ntoptions = options || {};ntvar whitespaceRegExp = options.treatNewlinesAsNonWhitespace ? /([^\S\n]+)/mg : /(\s+)/mg;ntwhitespaceRegExp.lastIndex = this.pos;ntvar whitespaceMatch = whitespaceRegExp.exec(this.source);ntif(whitespaceMatch && whitespaceMatch.index === this.pos) {nttthis.pos = whitespaceRegExp.lastIndex;nt}n};nn/*nGet the next match out of an array of parse rule instancesn*/nWikiParser.prototype.findNextMatch = function(rules,startPos) {nt// Find the best matching rule by finding the closest match positionntvar matchingRule = undefined,nttmatchingRulePos = this.sourceLength;nt// Step through each rulentfor(var t=0; t = this.sourceLength) {ntttbreak;ntt}ntt// Check if we've arrived at a pragma rule matchnttvar nextMatch = this.findNextMatch(this.pragmaRules,this.pos);ntt// If not, just exitnttif(!nextMatch || nextMatch.matchIndex !== this.pos) {ntttbreak;ntt}ntt// Process the pragma rulentttree.push.apply(tree,nextMatch.rule.parse());nt}ntreturn tree;n};nn/*nParse a block from the current positionntterminatorRegExpString: optional regular expression string that identifies the end of plain paragraphs. Must not include capturing parenthesisn*/nWikiParser.prototype.parseBlock = function(terminatorRegExpString) {ntvar terminatorRegExp = terminatorRegExpString ? new RegExp("(" + terminatorRegExpString + "|\\r?\\n\\r?\\n)","mg") : /(\r?\n\r?\n)/mg;ntthis.skipWhitespace();ntif(this.pos >= this.sourceLength) {nttreturn [];nt}nt// Look for a block rule that applies at the current positionntvar nextMatch = this.findNextMatch(this.blockRules,this.pos);ntif(nextMatch && nextMatch.matchIndex === this.pos) {nttreturn nextMatch.rule.parse();nt}nt// Treat it as a paragraph if we didn't find a block rulentreturn [{type: "element", tag: "p", children: this.parseInlineRun(terminatorRegExp)}];n};nn/*nParse a series of blocks of text until a terminating regexp is encountered or the end of the textntterminatorRegExpString: terminating regular expressionn*/nWikiParser.prototype.parseBlocks = function(terminatorRegExpString) {ntif(terminatorRegExpString) {nttreturn this.parseBlocksTerminated(terminatorRegExpString);nt} else {nttreturn this.parseBlocksUnterminated();nt}n};nn/*nParse a block from the current position to the end of the textn*/nWikiParser.prototype.parseBlocksUnterminated = function() {ntvar tree = [];ntwhile(this.pos < this.sourceLength) {ntttree.push.apply(tree,this.parseBlock());nt}ntreturn tree;n};nn/*nParse blocks of text until a terminating regexp is encounteredn*/nWikiParser.prototype.parseBlocksTerminated = function(terminatorRegExpString) {ntvar terminatorRegExp = new RegExp("(" + terminatorRegExpString + ")","mg"),ntttree = [];nt// Skip any whitespacentthis.skipWhitespace();nt// Check if we've got the end markerntterminatorRegExp.lastIndex = this.pos;ntvar match = terminatorRegExp.exec(this.source);nt// Parse the text into blocksntwhile(this.pos < this.sourceLength && !(match && match.index === this.pos)) {nttvar blocks = this.parseBlock(terminatorRegExpString);ntttree.push.apply(tree,blocks);ntt// Skip any whitespacenttthis.skipWhitespace();ntt// Check if we've got the end markernttterminatorRegExp.lastIndex = this.pos;nttmatch = terminatorRegExp.exec(this.source);nt}ntif(match && match.index === this.pos) {nttthis.pos = match.index + match[0].length;nt}ntreturn tree;n};nn/*nParse a run of text at the current positionntterminatorRegExp: a regexp at which to stop the runntoptions: see belownOptions available:nteatTerminator: move the parse position past any encountered terminator (default false)n*/nWikiParser.prototype.parseInlineRun = function(terminatorRegExp,options) {ntif(terminatorRegExp) {nttreturn this.parseInlineRunTerminated(terminatorRegExp,options);nt} else {nttreturn this.parseInlineRunUnterminated(options);nt}n};nnWikiParser.prototype.parseInlineRunUnterminated = function(options) {ntvar tree = [];nt// Find the next occurrence of an inline rulentvar nextMatch = this.findNextMatch(this.inlineRules,this.pos);nt// Loop around the matches until we've reached the end of the textntwhile(this.pos < this.sourceLength && nextMatch) {ntt// Process the text preceding the run rulenttif(nextMatch.matchIndex > this.pos) {nttttree.push({type: "text", text: this.source.substring(this.pos,nextMatch.matchIndex)});ntttthis.pos = nextMatch.matchIndex;ntt}ntt// Process the run rulentttree.push.apply(tree,nextMatch.rule.parse());ntt// Look for the next run rulenttnextMatch = this.findNextMatch(this.inlineRules,this.pos);nt}nt// Process the remaining textntif(this.pos < this.sourceLength) {ntttree.push({type: "text", text: this.source.substr(this.pos)});nt}ntthis.pos = this.sourceLength;ntreturn tree;n};nnWikiParser.prototype.parseInlineRunTerminated = function(terminatorRegExp,options) {ntoptions = options || {};ntvar tree = [];nt// Find the next occurrence of the terminatorntterminatorRegExp.lastIndex = this.pos;ntvar terminatorMatch = terminatorRegExp.exec(this.source);nt// Find the next occurrence of a inlinerulentvar inlineRuleMatch = this.findNextMatch(this.inlineRules,this.pos);nt// Loop around until we've reached the end of the textntwhile(this.pos < this.sourceLength && (terminatorMatch || inlineRuleMatch)) {ntt// Return if we've found the terminator, and it precedes any inline rule matchnttif(terminatorMatch) {ntttif(!inlineRuleMatch || inlineRuleMatch.matchIndex >= terminatorMatch.index) {nttttif(terminatorMatch.index > this.pos) {nttttttree.push({type: "text", text: this.source.substring(this.pos,terminatorMatch.index)});ntttt}nttttthis.pos = terminatorMatch.index;nttttif(options.eatTerminator) {ntttttthis.pos += terminatorMatch[0].length;ntttt}nttttreturn tree;nttt}ntt}ntt// Process any inline rule, along with the text preceding itnttif(inlineRuleMatch) {nttt// Preceding textntttif(inlineRuleMatch.matchIndex > this.pos) {ntttttree.push({type: "text", text: this.source.substring(this.pos,inlineRuleMatch.matchIndex)});nttttthis.pos = inlineRuleMatch.matchIndex;nttt}nttt// Process the inline rulenttttree.push.apply(tree,inlineRuleMatch.rule.parse());nttt// Look for the next inline rulentttinlineRuleMatch = this.findNextMatch(this.inlineRules,this.pos);nttt// Look for the next terminator matchntttterminatorRegExp.lastIndex = this.pos;ntttterminatorMatch = terminatorRegExp.exec(this.source);ntt}nt}nt// Process the remaining textntif(this.pos < this.sourceLength) {ntttree.push({type: "text", text: this.source.substr(this.pos)});nt}ntthis.pos = this.sourceLength;ntreturn tree;n};nn/*nParse zero or more class specifiers `.classname`n*/nWikiParser.prototype.parseClasses = function() {ntvar classRegExp = /\.([^\s\.]+)/mg,nttclassNames = [];ntclassRegExp.lastIndex = this.pos;ntvar match = classRegExp.exec(this.source);ntwhile(match && match.index === this.pos) {nttthis.pos = match.index + match[0].length;nttclassNames.push(match[1]);nttvar match = classRegExp.exec(this.source);nt}ntreturn classNames;n};nn/*nAmend the rules used by this instance of the parsernttype: `only` keeps just the named rules, `except` keeps all but the named rulesntnames: array of rule namesn*/nWikiParser.prototype.amendRules = function(type,names) {ntnames = names || [];nt// Define the filter functionntvar keepFilter;ntif(type === "only") {nttkeepFilter = function(name) {ntttreturn names.indexOf(name) !== -1;ntt};nt} else if(type === "except") {nttkeepFilter = function(name) {ntttreturn names.indexOf(name) === -1;ntt};nt} else {nttreturn;nt}nt// Define a function to process each of our rule arraysntvar processRuleArray = function(ruleArray) {nttfor(var t=ruleArray.length-1; t>=0; t--) {ntttif(!keepFilter(ruleArray[t].rule.name)) {nttttruleArray.splice(t,1);nttt}ntt}nt};nt// Process each rule arrayntprocessRuleArray(this.pragmaRules);ntprocessRuleArray(this.blockRules);ntprocessRuleArray(this.inlineRules);n}nnexports["text/vnd.tiddlywiki"] = WikiParser;nn})();nn", "title": "$:/core/modules/parsers/wikiparser/wikiparser.js", "type": "application/javascript", "module-type": "parser" }, "$:/core/modules/parsers/wikiparser/rules/wikirulebase.js": { "text": "/*\ntitle: $:/core/modules/parsers/wikiparser/rules/wikirulebase.jsntype: application/javascriptnmodule-type: globalnnBase class for wiki parser rulesnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nThis constructor is always overridden with a blank constructor, and so shouldn't be usedn*/nvar WikiRuleBase = function() {n};nn/*nTo be overridden by individual rulesn*/nWikiRuleBase.prototype.init = function(parser) {ntthis.parser = parser;n};nn/*nDefault implementation of findNextMatch uses RegExp matchingn*/nWikiRuleBase.prototype.findNextMatch = function(startPos) {ntthis.matchRegExp.lastIndex = startPos;ntthis.match = this.matchRegExp.exec(this.parser.source);ntreturn this.match ? this.match.index : undefined;n};nnexports.WikiRuleBase = WikiRuleBase;nn})();n", "title": "$:/core/modules/parsers/wikiparser/rules/wikirulebase.js", "type": "application/javascript", "module-type": "global" }, "$:/core/modules/savers/andtidwiki.js": { "text": "/*\ntitle: $:/core/modules/savers/andtidwiki.jsntype: application/javascriptnmodule-type: savernnHandles saving changes via the AndTidWiki Android appnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false, netscape: false, Components: false */n"use strict";nnvar AndTidWiki = function(wiki) {n};nnAndTidWiki.prototype.save = function(text,method,callback) {nt// Bail out unless this is a save (rather than a download)ntif(method !== "save") {nttreturn false;nt}nt// Get the pathname of this documentntvar pathname = decodeURIComponent(document.location.toString());nt// Strip the file://ntif(pathname.indexOf("file://") === 0) {nttpathname = pathname.substr(7);nt}nt// Strip any query or location partntvar p = pathname.indexOf("?");ntif(p !== -1) {nttpathname = pathname.substr(0,p);nt}ntp = pathname.indexOf("#");ntif(p !== -1) {nttpathname = pathname.substr(0,p);nt}nt// Save the filentwindow.twi.saveFile(pathname,text)nt// Call the callbackntcallback(null);ntreturn true;n};nn/*nInformation about this savern*/nAndTidWiki.prototype.info = {ntname: "andtidwiki",ntpriority: 1600n};nn/*nStatic method that returns true if this saver is capable of workingn*/nexports.canSave = function(wiki) {ntreturn !!window.twi && !!window.twi.saveFile;n};nn/*nCreate an instance of this savern*/nexports.create = function(wiki) {ntreturn new AndTidWiki(wiki);n};nn})();n", "title": "$:/core/modules/savers/andtidwiki.js", "type": "application/javascript", "module-type": "saver" }, "$:/core/modules/savers/download.js": { "text": "/*\ntitle: $:/core/modules/savers/download.jsntype: application/javascriptnmodule-type: savernnHandles saving changes via HTML5's download APIsnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nSelect the appropriate saver module and set it upn*/nvar DownloadSaver = function(wiki) {n};nnDownloadSaver.prototype.save = function(text,method,callback) {nt// Get the current filenamentvar filename = "tiddlywiki.html",nttp = document.location.pathname.lastIndexOf("/");ntif(p !== -1) {nttfilename = document.location.pathname.substr(p+1);nt}nt// Set up the linkntvar link = document.createElement("a");ntlink.setAttribute("target","_blank");ntif(Blob !== undefined) {nttvar blob = new Blob([text], {type: "text/html"});nttlink.setAttribute("href", URL.createObjectURL(blob));nt} else {nttlink.setAttribute("href","data:text/html," + encodeURIComponent(text));nt}ntlink.setAttribute("download",filename);ntdocument.body.appendChild(link);ntlink.click();ntdocument.body.removeChild(link);ntreturn true;n};nn/*nInformation about this savern*/nDownloadSaver.prototype.info = {ntname: "download",ntpriority: 100n};nn/*nStatic method that returns true if this saver is capable of workingn*/nexports.canSave = function(wiki) {ntreturn document.createElement("a").download !== undefined;n};nn/*nCreate an instance of this savern*/nexports.create = function(wiki) {ntreturn new DownloadSaver(wiki);n};nn})();n", "title": "$:/core/modules/savers/download.js", "type": "application/javascript", "module-type": "saver" }, "$:/core/modules/savers/fsosaver.js": { "text": "/*\ntitle: $:/core/modules/savers/fsosaver.jsntype: application/javascriptnmodule-type: savernnHandles saving changes via MS FileSystemObject ActiveXObjectnnNote: Since TiddlyWiki's markup contains the MOTW, the FileSystemObject normally won't be available. nHowever, if the wiki is loaded as an .HTA file (Windows HTML Applications) then the FSO can be used.nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nSelect the appropriate saver module and set it upn*/nvar FSOSaver = function(wiki) {n};nnFSOSaver.prototype.save = function(text,method,callback) {nt// Bail out unless this is a save (rather than a download)ntif(method !== "save") {nttreturn false;nt}nt// Get the pathname of this documentntvar pathname = unescape(document.location.pathname);nt// Test for a Windows path of the form /x:\blah...ntif(/^\/[A-Z]\:\\[^\\]+/i.test(pathname)) {t// ie: ^/[a-z]:/[^/]+ntt// Remove the leading slashnttpathname = pathname.substr(1);nt} else if(document.location.hostname !== "" && /^\/\\[^\\]+\\[^\\]+/i.test(pathname)) {t// test for \\server\share\blah... - ^/[^/]+/[^/]+ntt// Remove the leading slashnttpathname = pathname.substr(1);ntt// reconstruct UNC pathnttpathname = "\\\\" + document.location.hostname + pathname;nt} else return false;ntnt// Save the file (as UTF-16)ntvar fso = new ActiveXObject("Scripting.FileSystemObject");ntvar file = fso.OpenTextFile(pathname,2,-1,-1);ntntfile.Write(text);ntfile.Close();ntreturn true;n};nn/*nInformation about this savern*/nFSOSaver.prototype.info = {ntname: "FSOSaver",ntpriority: 120n};nn/*nStatic method that returns true if this saver is capable of workingn*/nexports.canSave = function(wiki) {nttry {nttreturn (window.location.protocol === "file:") && !!(new ActiveXObject("Scripting.FileSystemObject"));nt} catch(e) { return false; }n};nn/*nCreate an instance of this savern*/nexports.create = function(wiki) {ntreturn new FSOSaver(wiki);n};nn})();n", "title": "$:/core/modules/savers/fsosaver.js", "type": "application/javascript", "module-type": "saver" }, "$:/core/modules/savers/manualdownload.js": { "text": "/*\ntitle: $:/core/modules/savers/manualdownload.jsntype: application/javascriptnmodule-type: savernnHandles saving changes via HTML5's download APIsnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn// Title of the tiddler containing the download messagenvar downloadInstructionsTitle = "$:/messages/Download"nn/*nSelect the appropriate saver module and set it upn*/nvar ManualDownloadSaver = function(wiki) {n};nnManualDownloadSaver.prototype.save = function(text,method,callback) {nt$tw.modal.display(downloadInstructionsTitle,{nttdownloadLink: "data:text/html," + encodeURIComponent(text)nt});ntreturn true;n};nn/*nInformation about this savern*/nManualDownloadSaver.prototype.info = {ntname: "manualdownload",ntpriority: 0n};nn/*nStatic method that returns true if this saver is capable of workingn*/nexports.canSave = function(wiki) {ntreturn true;n};nn/*nCreate an instance of this savern*/nexports.create = function(wiki) {ntreturn new ManualDownloadSaver(wiki);n};nn})();n", "title": "$:/core/modules/savers/manualdownload.js", "type": "application/javascript", "module-type": "saver" }, "$:/core/modules/savers/msdownload.js": { "text": "/*\ntitle: $:/core/modules/savers/msdownload.jsntype: application/javascriptnmodule-type: savernnHandles saving changes via window.navigator.msSaveBlob()nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nSelect the appropriate saver module and set it upn*/nvar MsDownloadSaver = function(wiki) {n};nnMsDownloadSaver.prototype.save = function(text,method,callback) {nt// Get the current filenamentvar filename = "tiddlywiki.html",nttp = document.location.pathname.lastIndexOf("/");ntif(p !== -1) {nttfilename = document.location.pathname.substr(p+1);nt}nt// Set up the linkntvar blob = new Blob([text], {type: "text/html"});ntwindow.navigator.msSaveBlob(blob,filename);ntreturn true;n};nn/*nInformation about this savern*/nMsDownloadSaver.prototype.info = {ntname: "msdownload",ntpriority: 110n};nn/*nStatic method that returns true if this saver is capable of workingn*/nexports.canSave = function(wiki) {ntreturn !!window.navigator.msSaveBlob;n};nn/*nCreate an instance of this savern*/nexports.create = function(wiki) {ntreturn new MsDownloadSaver(wiki);n};nn})();n", "title": "$:/core/modules/savers/msdownload.js", "type": "application/javascript", "module-type": "saver" }, "$:/core/modules/savers/tiddlyfox.js": { "text": "/*\ntitle: $:/core/modules/savers/tiddlyfox.jsntype: application/javascriptnmodule-type: savernnHandles saving changes via the TiddlyFox file extensionnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false, netscape: false, Components: false */n"use strict";nnvar TiddlyFoxSaver = function(wiki) {n};nnTiddlyFoxSaver.prototype.save = function(text,method,callback) {nt// Bail out unless this is a save (rather than a download)ntif(method !== "save") {nttreturn false;nt}ntvar messageBox = document.getElementById("tiddlyfox-message-box");ntif(messageBox) {ntt// Get the pathname of this documentnttvar pathname = document.location.pathname;ntt// Test for a Windows path of the form /x:/blah/blahnttif(/^\/[A-Z]\:\//i.test(pathname)) {nttt// Remove the leading slashntttpathname = pathname.substr(1);nttt// Convert slashes to backslashesntttpathname = pathname.replace(/\//g,"\\");ntt}ntt// Create the message element and put it in the message boxnttvar message = document.createElement("div");nttmessage.setAttribute("data-tiddlyfox-path",decodeURIComponent(pathname));nttmessage.setAttribute("data-tiddlyfox-content",text);nttmessageBox.appendChild(message);ntt// Add an event handler for when the file has been savednttmessage.addEventListener("tiddlyfox-have-saved-file",function(event) {ntttcallback(null);ntt}, false);ntt// Create and dispatch the custom event to the extensionnttvar event = document.createEvent("Events");nttevent.initEvent("tiddlyfox-save-file",true,false);nttmessage.dispatchEvent(event);nttreturn true;nt} else {nttreturn false;nt}n};nn/*nInformation about this savern*/nTiddlyFoxSaver.prototype.info = {ntname: "tiddlyfox",ntpriority: 1500n};nn/*nStatic method that returns true if this saver is capable of workingn*/nexports.canSave = function(wiki) {ntreturn (window.location.protocol === "file:");n};nn/*nCreate an instance of this savern*/nexports.create = function(wiki) {ntreturn new TiddlyFoxSaver(wiki);n};nn})();n", "title": "$:/core/modules/savers/tiddlyfox.js", "type": "application/javascript", "module-type": "saver" }, "$:/core/modules/savers/tiddlyie.js": { "text": "/*\ntitle: $:/core/modules/savers/tiddlyie.jsntype: application/javascriptnmodule-type: savernnHandles saving changes via Internet Explorer BHO extenion (TiddlyIE)nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nSelect the appropriate saver module and set it upn*/nvar TiddlyIESaver = function(wiki) {n};nnTiddlyIESaver.prototype.save = function(text,method,callback) {nt// Bail out unless this is a save (rather than a download)ntif(method !== "save") {nttreturn false;nt}nt// check existence of TiddlyIE BHO extension (note: only works after document is complete)ntif(typeof(window.TiddlyIE) != "undefined") {ntt// Get the pathname of this documentnttvar pathname = unescape(document.location.pathname);ntt// Test for a Windows path of the form /x:/blah...nttif(/^\/[A-Z]\:\/[^\/]+/i.test(pathname)) {t// ie: ^/[a-z]:/[^/]+ (is this better?: ^/[a-z]:/[^/]+(/[^/]+)*\.[^/]+ )nttt// Remove the leading slashntttpathname = pathname.substr(1);nttt// Convert slashes to backslashesntttpathname = pathname.replace(/\//g,"\\");ntt} else if(document.hostname !== "" && /^\/[^\/]+\/[^\/]+/i.test(pathname)) {t// test for \\server\share\blah... - ^/[^/]+/[^/]+nttt// Convert slashes to backslashesntttpathname = pathname.replace(/\//g,"\\");nttt// reconstruct UNC pathntttpathname = "\\\\" + document.location.hostname + pathname;ntt} else return false;nttntt// Prompt the user to save the filenttwindow.TiddlyIE.save(pathname, text);nttreturn true;nt} else {nttreturn false;nt}n};nn/*nInformation about this savern*/nTiddlyIESaver.prototype.info = {ntname: "tiddlyiesaver",ntpriority: 1500n};nn/*nStatic method that returns true if this saver is capable of workingn*/nexports.canSave = function(wiki) {ntreturn (window.location.protocol === "file:");n};nn/*nCreate an instance of this savern*/nexports.create = function(wiki) {ntreturn new TiddlyIESaver(wiki);n};nn})();n", "title": "$:/core/modules/savers/tiddlyie.js", "type": "application/javascript", "module-type": "saver" }, "$:/core/modules/savers/twedit.js": { "text": "/*\ntitle: $:/core/modules/savers/twedit.jsntype: application/javascriptnmodule-type: savernnHandles saving changes via the TWEdit iOS appnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false, netscape: false, Components: false */n"use strict";nnvar TWEditSaver = function(wiki) {n};nnTWEditSaver.prototype.save = function(text,method,callback) {nt// Bail out unless this is a save (rather than a download)ntif(method !== "save") {nttreturn false;nt}nt// Bail if we're not running under TWEditntif(typeof DeviceInfo !== "object") {nttreturn false;nt}nt// Get the pathname of this documentntvar pathname = decodeURIComponent(document.location.pathname);nt// Strip any query or location partntvar p = pathname.indexOf("?");ntif(p !== -1) {nttpathname = pathname.substr(0,p);nt}ntp = pathname.indexOf("#");ntif(p !== -1) {nttpathname = pathname.substr(0,p);nt}nt// Remove the leading "/Documents" from pathntvar prefix = "/Documents";ntif(pathname.indexOf(prefix) === 0) {nttpathname = pathname.substr(prefix.length);nt}nt// Error handlerntvar errorHandler = function(event) {n t// Errorn tcallback("Error saving to TWEdit: " + event.target.error.code);n };nt// Get the file systemn window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) {n t// Now we've got the filesystem, get the fileEntryn fileSystem.root.getFile(pathname, {create: true}, function(fileEntry) {n t// Now we've got the fileEntry, create the writern tfileEntry.createWriter(function(writer) {ntt writer.onerror = errorHandler;ntt writer.onwrite = function() {ntt tcallback(null);ntt };ntt writer.position = 0;ntt writer.write(text);n t},errorHandler);n }, errorHandler);n }, errorHandler);n return true;n};nn/*nInformation about this savern*/nTWEditSaver.prototype.info = {ntname: "twedit",ntpriority: 1600n};nn/*nStatic method that returns true if this saver is capable of workingn*/nexports.canSave = function(wiki) {ntreturn true;n};nn/*nCreate an instance of this savern*/nexports.create = function(wiki) {ntreturn new TWEditSaver(wiki);n};nn/////////////////////////// Hackn// HACK: This ensures that TWEdit recognises us as a TiddlyWiki documentnif($tw.browser) {ntwindow.version = {title: "TiddlyWiki"};n}nn})();n", "title": "$:/core/modules/savers/twedit.js", "type": "application/javascript", "module-type": "saver" }, "$:/core/modules/savers/upload.js": { "text": "/*\ntitle: $:/core/modules/savers/upload.jsntype: application/javascriptnmodule-type: savernnHandles saving changes via upload to a server.nnDesigned to be compatible with BidiX's UploadPlugin at http://tiddlywiki.bidix.info/#UploadPluginnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nSelect the appropriate saver module and set it upn*/nvar UploadSaver = function(wiki) {ntthis.wiki = wiki;n};nnUploadSaver.prototype.save = function(text,method,callback) {nt// Bail out unless this is a save (rather than a download)ntif(method !== "save") {nttreturn false;nt}nt// Get the various parameters we needntvar backupDir = this.wiki.getTextReference("$:/UploadBackupDir") || ".",nttusername = this.wiki.getTextReference("$:/UploadName"),nttpassword = $tw.utils.getPassword("upload"),nttuploadDir = this.wiki.getTextReference("$:/UploadDir") || ".",nttuploadFilename = this.wiki.getTextReference("$:/UploadFilename") || "index.html",ntturl = this.wiki.getTextReference("$:/UploadURL");nt// Bail out if we don't have the bits we needntif(!username || username.toString().trim() === "" || !password || password.toString().trim() === "") {nttreturn false;nt}nt// Construct the url if not providedntif(!url) {ntturl = "http://" + username + ".tiddlyspot.com/store.cgi";nt}nt// Assemble the headerntvar boundary = "---------------------------" + "AaB03x";tntvar uploadFormName = "UploadPlugin";ntvar head = [];nthead.push("--" + boundary + "\r\nContent-disposition: form-data; name=\"UploadPlugin\"\r\n");nthead.push("backupDir=" + backupDir + ";user=" + username + ";password=" + password + ";uploaddir=" + uploadDir + ";;"); nthead.push("\r\n" + "--" + boundary);nthead.push("Content-disposition: form-data; name=\"userfile\"; filename=\"" + uploadFilename + "\"");nthead.push("Content-Type: text/html;charset=UTF-8");nthead.push("Content-Length: " + text.length + "\r\n");nthead.push("");nt// Assemble the tail and the data itselfntvar tail = "\r\n--" + boundary + "--\r\n",nttdata = head.join("\r\n") + text + tail;nt// Do the HTTP postntvar http = new XMLHttpRequest();nthttp.open("POST",url,true,username,password);nthttp.setRequestHeader("Content-Type","multipart/form-data; ;charset=UTF-8; boundary=" + boundary);nthttp.onreadystatechange = function() {nttif(http.readyState == 4 && http.status == 200) {ntttif(http.responseText.substr(0,4) === "0 - ") {nttttcallback(null);nttt} else {nttttcallback(http.responseText);nttt}ntt}nt};nthttp.send(data);nt$tw.notifier.display("$:/messages/StartingSave");ntreturn true;n};nn/*nInformation about this savern*/nUploadSaver.prototype.info = {ntname: "upload",ntpriority: 2000n};nn/*nStatic method that returns true if this saver is capable of workingn*/nexports.canSave = function(wiki) {ntreturn true;n};nn/*nCreate an instance of this savern*/nexports.create = function(wiki) {ntreturn new UploadSaver(wiki);n};nn})();n", "title": "$:/core/modules/savers/upload.js", "type": "application/javascript", "module-type": "saver" }, "$:/core/modules/startup.js": { "text": "/*\ntitle: $:/core/modules/startup.jsntype: application/javascriptnmodule-type: startupnnThis is the main application logic for both the client and servernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnvar widget = require("$:/core/modules/widgets/widget.js");nnexports.startup = function() {ntvar modules,n,m,f,commander;nt// Load utility modules and initialise the loggernt$tw.modules.applyMethods("utils",$tw.utils);nt$tw.logger = new $tw.utils.Logger();nt$tw.log = $tw.logger.log;nt// Load other modulesnt$tw.modules.applyMethods("global",$tw);nt$tw.modules.applyMethods("config",$tw.config);ntif($tw.browser) {ntt$tw.utils.getBrowserInfo($tw.browser);nt}nt$tw.version = $tw.utils.extractVersionInfo();nt$tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap("tiddlerfield");nt$tw.modules.applyMethods("tiddlermethod",$tw.Tiddler.prototype);nt$tw.modules.applyMethods("wikimethod",$tw.Wiki.prototype);nt$tw.modules.applyMethods("tiddlerdeserializer",$tw.Wiki.tiddlerDeserializerModules);nt$tw.macros = $tw.modules.getModulesByTypeAsHashmap("macro");nt// Set up the parsersnt$tw.wiki.initParsers();nt// Set up the syncer objectnt$tw.syncer = new $tw.Syncer({wiki: $tw.wiki});nt// Set up the command modulesnt$tw.Commander.initCommands();nt// Kick off the theme managernt$tw.themeManager = new $tw.ThemeManager($tw.wiki);nt// Get the default tiddlersntvar defaultTiddlersTitle = "$:/DefaultTiddlers",nttdefaultTiddlersTiddler = $tw.wiki.getTiddler(defaultTiddlersTitle),nttdefaultTiddlers = [];ntif(defaultTiddlersTiddler) {nttdefaultTiddlers = $tw.wiki.filterTiddlers(defaultTiddlersTiddler.fields.text);nt}nt// Initialise the story and historyntvar storyTitle = "$:/StoryList",nttstory = [];ntfor(var t=0; t 0) {nttttthis.triggerTimeout();nttt}ntt}nt}n};nn/*nChoose the next applicable taskn*/nSyncer.prototype.chooseNextTask = function() {ntvar self = this,nttcandidateTask = null,nttnow = new Date();nt// Select the best candidate tasknt$tw.utils.each(this.taskQueue,function(task,title) {ntt// Exclude the task if there's one of the same name in progressnttif($tw.utils.hop(self.taskInProgress,title)) {ntttreturn;ntt}ntt// Exclude the task if it is a save and the tiddler has been modified recently, but not hit the fallback timenttif(task.type === "save" && (now - task.lastModificationTime) < self.throttleInterval &&nttt(now - task.queueTime) < self.fallbackInterval) {ntttreturn;tntt}ntt// Exclude the task if it is newer than the current best candidatenttif(candidateTask && candidateTask.queueTime < task.queueTime) {ntttreturn;ntt}ntt// Now this is our best candidatenttcandidateTask = task;nt});ntreturn candidateTask;n};nn/*nDispatch a task and invoke the callbackn*/nSyncer.prototype.dispatchTask = function(task,callback) {ntvar self = this;ntif(task.type === "save") {nttvar changeCount = this.wiki.getChangeCount(task.title),nttttiddler = this.wiki.getTiddler(task.title);nttthis.log("Dispatching 'save' task:",task.title);nttif(tiddler) {ntttthis.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {nttttif(err) {ntttttreturn callback(err);ntttt}ntttt// Adjust the info stored about this tiddlernttttself.tiddlerInfo[task.title] = {ntttttchangeCount: changeCount,ntttttadaptorInfo: adaptorInfo,ntttttrevision: revisionntttt};ntttt// Invoke the callbacknttttcallback(null);nttt});ntt}nt} else if(task.type === "load") {ntt// Load the tiddlernttthis.log("Dispatching 'load' task:",task.title);nttthis.syncadaptor.loadTiddler(task.title,function(err,tiddlerFields) {ntttif(err) {nttttreturn callback(err);nttt}nttt// Store the tiddlerntttif(tiddlerFields) {nttttself.storeTiddler(tiddlerFields);nttt}nttt// Invoke the callbackntttcallback(null);ntt});nt} else if(task.type === "delete") {ntt// Delete the tiddlernttthis.log("Dispatching 'delete' task:",task.title);nttthis.syncadaptor.deleteTiddler(task.title,function(err) {ntttif(err) {nttttreturn callback(err);nttt}nttt// Invoke the callbackntttcallback(null);ntt});nt}n};nnexports.Syncer = Syncer;nn})();n", "title": "$:/core/modules/syncer.js", "type": "application/javascript", "module-type": "global" }, "$:/core/modules/themes.js": { "text": "/*\ntitle: $:/core/modules/themes.jsntype: application/javascriptnmodule-type: globalnnManages themes and styling.nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnvar THEME_PLUGIN_TITLE = "$:/theme", // This tiddler contains the title of the current theme pluginntDEFAULT_THEME_PLUGINS = [ntt"$:/themes/tiddlywiki/snowwhite",ntt"$:/themes/tiddlywiki/vanilla"nt];nnfunction ThemeManager(wiki) {ntthis.wiki = wiki;nt// There's no theme to start withntthis.currentThemeTitle = undefined;nt// Switch to the current thementthis.switchTheme();nt// Listen for changes to the thementvar self = this;ntthis.wiki.addEventListener("change",function(changes) {nttif($tw.utils.hop(changes,THEME_PLUGIN_TITLE)) {ntttself.switchTheme();ntt}nt});n}nnThemeManager.prototype.switchTheme = function() {nt// Get the name of the current thementvar themePluginTitle = this.wiki.getTiddlerText(THEME_PLUGIN_TITLE);nt// If it doesn't exist, then fallback to one of the default themesntvar index = 0;ntwhile(!this.wiki.getTiddler(themePluginTitle) && index < DEFAULT_THEME_PLUGINS.length) {nttthemePluginTitle = DEFAULT_THEME_PLUGINS[index++];nt}nt// Accumulate the titles of the plugins that we need to loadntvar themePlugins = [],nttself = this,nttaccumulatePlugin = function(title) {ntttvar tiddler = self.wiki.getTiddler(title);ntttif(tiddler && tiddler.isPlugin() && themePlugins.indexOf(title) === -1) {nttttthemePlugins.push(title);nttttvar pluginInfo = JSON.parse(self.wiki.getTiddlerText(title)),ntttttdependents = $tw.utils.parseStringArray(tiddler.fields.dependents || "");ntttt$tw.utils.each(dependents,function(title) {ntttttaccumulatePlugin(title);ntttt});nttt}ntt};ntaccumulatePlugin(themePluginTitle);nt// Unregister any existing theme tiddlersntvar unregisteredThemeTiddlers = $tw.wiki.unregisterPluginTiddlers("theme");nt// Accumulate the titles of shadow tiddlers that have changed as a result of this switchntvar changedTiddlers = {};nt$tw.utils.each(this.wiki.shadowTiddlers,function(shadowInfo,title) {nttif(unregisteredThemeTiddlers.indexOf(shadowInfo.source) !== -1) {ntttchangedTiddlers[title] = true; // isDeleted?ntt}nt});nt// Register any new theme tiddlersntvar registeredThemeTiddlers = $tw.wiki.registerPluginTiddlers("theme",themePlugins);nt// Unpack the current theme tiddlersnt$tw.wiki.unpackPluginTiddlers();nt// Accumulate the affected shadow tiddlersnt$tw.utils.each(this.wiki.shadowTiddlers,function(shadowInfo,title) {nttif(registeredThemeTiddlers.indexOf(shadowInfo.source) !== -1) {ntttchangedTiddlers[title] = false; // isDeleted?ntt}nt});nt// Issue change events for the modified tiddlersnt$tw.utils.each(changedTiddlers,function(status,title) {nttself.wiki.enqueueTiddlerEvent(title,status);nt});n};nnexports.ThemeManager = ThemeManager;nn})();n", "title": "$:/core/modules/themes.js", "type": "application/javascript", "module-type": "global" }, "$:/core/modules/tiddler.js": { "text": "/*\ntitle: $:/core/modules/tiddler.jsntype: application/javascriptnmodule-type: tiddlermethodnnExtension methods for the $tw.Tiddler object (constructor and methods required at boot time are in boot/boot.js)nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnexports.hasTag = function(tag) {ntreturn this.fields.tags && this.fields.tags.indexOf(tag) !== -1;n};nnexports.isPlugin = function() {ntreturn this.fields.type === "application/json" && this.hasField("plugin-type");n}nnexports.getFieldString = function(field) {ntvar value = this.fields[field];nt// Check for a missing fieldntif(value === undefined || value === null) {nttreturn "";nt}nt// Parse the field with the associated module (if any)ntvar fieldModule = $tw.Tiddler.fieldModules[field];ntif(fieldModule && fieldModule.stringify) {nttreturn fieldModule.stringify.call(this,value);nt} else {nttreturn value.toString();nt}n};nn/*nGet all the fields as a name:value block. Options:ntexclude: an array of field names to excluden*/nexports.getFieldStringBlock = function(options) {ntoptions = options || {};ntvar exclude = options.exclude || [];ntvar fields = [];ntfor(var field in this.fields) {nttif($tw.utils.hop(this.fields,field)) {ntttif(exclude.indexOf(field) === -1) {nttttfields.push(field + ": " + this.getFieldString(field));nttt}ntt}nt}ntreturn fields.join("\n");n};nn})();n", "title": "$:/core/modules/tiddler.js", "type": "application/javascript", "module-type": "tiddlermethod" }, "$:/core/modules/utils/crypto.js": { "text": "/*\ntitle: $:/core/modules/utils/crypto.jsntype: application/javascriptnmodule-type: utilsnnUtility functions related to crypto.nn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nLook for an encrypted store area in the text of a TiddlyWiki filen*/nexports.extractEncryptedStoreArea = function(text) {ntvar encryptedStoreAreaStartMarker = " ",nttencryptedStoreAreaStart = text.indexOf(encryptedStoreAreaStartMarker);ntif(encryptedStoreAreaStart !== -1) {nttvar encryptedStoreAreaEnd = text.indexOf("",encryptedStoreAreaStart);nttif(encryptedStoreAreaEnd !== -1) {ntttreturn $tw.utils.htmlDecode(text.substring(encryptedStoreAreaStart + encryptedStoreAreaStartMarker.length,encryptedStoreAreaEnd-1));ntt}nt}ntreturn null;n};nn/*nAttempt to extract the tiddlers from an encrypted store area using the current password. If the password is not provided then the password in the password store will be usedn*/nexports.decryptStoreArea = function(encryptedStoreArea,password) {ntvar decryptedText = $tw.crypto.decrypt(encryptedStoreArea,password);ntif(decryptedText) {nttvar json = JSON.parse(decryptedText),nttttiddlers = [];nttfor(var title in json) {ntttif(title !== "$:/isEncrypted") {ntttttiddlers.push(json[title]);nttt}ntt}nttreturn tiddlers;nt} else {nttreturn null;nt}n};nnexports.decryptStoreAreaInteractive = function(encryptedStoreArea,callback) {nt// Try to decrypt with the current passwordntvar tiddlers = $tw.utils.decryptStoreArea(encryptedStoreArea);ntif(tiddlers) {nttcallback(tiddlers);nt} else {ntt// Prompt for a new password and keep tryingntt$tw.passwordPrompt.createPrompt({ntttserviceName: "Enter a password to decrypt the imported TiddlyWiki",ntttnoUserName: true,ntttcanCancel: true,ntttsubmitText: "Decrypt",ntttcallback: function(data) {ntttt// Exit if the user cancellednttttif(!data) {ntttttreturn false;ntttt}ntttt// Attempt to decrypt the tiddlersnttttvar tiddlers = $tw.utils.decryptStoreArea(encryptedStoreArea,data.password);nttttif(tiddlers) {ntttttcallback(tiddlers);nttttt// Exit and remove the password promptntttttreturn true;ntttt} else {nttttt// We didn't decrypt everything, so continue to prompt for passwordntttttreturn false;ntttt}nttt}ntt});nt}n};nn})();n",
"title": "$:/core/modules/utils/crypto.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/animations/slide.js": {
"text": "/*\ntitle: $:/core/modules/utils/dom/animations/slide.jsntype: application/javascriptnmodule-type: animationnnA simple slide animation that varies the height of the elementnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnfunction slideOpen(domNode,options) {ntoptions = options || {};ntvar duration = options.duration || $tw.utils.getAnimationDuration();nt// Get the current height of the domNodentvar computedStyle = window.getComputedStyle(domNode),nttcurrMarginBottom = parseInt(computedStyle.marginBottom,10),nttcurrMarginTop = parseInt(computedStyle.marginTop,10),nttcurrPaddingBottom = parseInt(computedStyle.paddingBottom,10),nttcurrPaddingTop = parseInt(computedStyle.paddingTop,10),nttcurrHeight = domNode.offsetHeight;nt// Reset the margin once the transition is overntsetTimeout(function() {ntt$tw.utils.setStyle(domNode,[nttt{transition: "none"},nttt{marginBottom: ""},nttt{marginTop: ""},nttt{paddingBottom: ""},nttt{paddingTop: ""},nttt{height: "auto"},nttt{opacity: ""}ntt]);nttif(options.callback) {ntttoptions.callback();ntt}nt},duration);nt// Set up the initial position of the elementnt$tw.utils.setStyle(domNode,[ntt{transition: "none"},ntt{marginTop: "0px"},ntt{marginBottom: "0px"},ntt{paddingTop: "0px"},ntt{paddingBottom: "0px"},ntt{height: "0px"},ntt{opacity: "0"}nt]);nt$tw.utils.forceLayout(domNode);nt// Transition to the final positionnt$tw.utils.setStyle(domNode,[ntt{transition: "margin-top " + duration + "ms ease-in-out, " +nttttt"margin-bottom " + duration + "ms ease-in-out, " +nttttt"padding-top " + duration + "ms ease-in-out, " +nttttt"padding-bottom " + duration + "ms ease-in-out, " +nttttt"height " + duration + "ms ease-in-out, " +nttttt"opacity " + duration + "ms ease-in-out"},ntt{marginBottom: currMarginBottom + "px"},ntt{marginTop: currMarginTop + "px"},ntt{paddingBottom: currPaddingBottom + "px"},ntt{paddingTop: currPaddingTop + "px"},ntt{height: currHeight + "px"},ntt{opacity: "1"}nt]);n}nnfunction slideClosed(domNode,options) {ntoptions = options || {};ntvar duration = options.duration || $tw.utils.getAnimationDuration(),nttcurrHeight = domNode.offsetHeight;nt// Clear the properties we've set when the animation is overntsetTimeout(function() {ntt$tw.utils.setStyle(domNode,[nttt{transition: "none"},nttt{marginBottom: ""},nttt{marginTop: ""},nttt{paddingBottom: ""},nttt{paddingTop: ""},nttt{height: "auto"},nttt{opacity: ""}ntt]);nttif(options.callback) {ntttoptions.callback();ntt}nt},duration);nt// Set up the initial position of the elementnt$tw.utils.setStyle(domNode,[ntt{height: currHeight + "px"},ntt{opacity: "1"}nt]);nt$tw.utils.forceLayout(domNode);nt// Transition to the final positionnt$tw.utils.setStyle(domNode,[ntt{transition: "margin-top " + duration + "ms ease-in-out, " +nttttt"margin-bottom " + duration + "ms ease-in-out, " +nttttt"padding-top " + duration + "ms ease-in-out, " +nttttt"padding-bottom " + duration + "ms ease-in-out, " +nttttt"height " + duration + "ms ease-in-out, " +nttttt"opacity " + duration + "ms ease-in-out"},ntt{marginTop: "0px"},ntt{marginBottom: "0px"},ntt{paddingTop: "0px"},ntt{paddingBottom: "0px"},ntt{height: "0px"},ntt{opacity: "0"}nt]);n}nnexports.slide = {ntopen: slideOpen,ntclose: slideClosedn};nn})();n",
"title": "$:/core/modules/utils/dom/animations/slide.js",
"type": "application/javascript",
"module-type": "animation"
},
"$:/core/modules/utils/dom/animator.js": {
"text": "/*\ntitle: $:/core/modules/utils/dom/animator.jsntype: application/javascriptnmodule-type: utilsnnOrchestrates animations and transitionsnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnfunction Animator() {nt// Get the registered animation modulesntthis.animations = {};nt$tw.modules.applyMethods("animation",this.animations);n}nnAnimator.prototype.perform = function(type,domNode,options) {ntoptions = options || {};nt// Find an animation that can handle this typentvar chosenAnimation;nt$tw.utils.each(this.animations,function(animation,name) {nttif($tw.utils.hop(animation,type)) {ntttchosenAnimation = animation[type];ntt}nt});ntif(!chosenAnimation) {nttchosenAnimation = function(domNode,options) {ntttif(options.callback) {nttttoptions.callback();nttt}ntt};nt}nt// Call the animationntchosenAnimation(domNode,options);n};nnexports.Animator = Animator;nn})();n",
"title": "$:/core/modules/utils/dom/animator.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/browser.js": {
"text": "/*\ntitle: $:/core/modules/utils/dom/browser.jsntype: application/javascriptnmodule-type: utilsnnBrowser feature detectionnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nSet style properties of an elementntelement: dom nodentstyles: ordered array of {name: value} pairsn*/nexports.setStyle = function(element,styles) {ntif(element.nodeType === 1) { // Element.ELEMENT_NODEnttfor(var t=0; t'); // fails without nt} else { // Modern browsersnttif(el) {ntttel.replaceChild(document.createTextNode(css), el.firstChild);ntt} else {ntttel = document.createElement("style");ntttel.type = "text/css";ntttel.id = id;ntttel.appendChild(document.createTextNode(css));ntttdocument.getElementsByTagName("head")[0].appendChild(el);ntt}nt}n};nn/*nGet the scroll position of the viewportnReturns:nt{nttx: horizontal scroll position in pixels,ntty: vertical scroll position in pixelsnt}n*/nexports.getScrollPosition = function() {ntif("scrollX" in window) {nttreturn {x: window.scrollX, y: window.scrollY};nt} else {nttreturn {x: document.documentElement.scrollLeft, y: document.documentElement.scrollTop};nt}n};nn/*nGets the bounding rectangle of an element in absolute page coordinatesn*/nexports.getBoundingPageRect = function(element) {ntvar scrollPos = $tw.utils.getScrollPosition(),nttclientRect = element.getBoundingClientRect();ntreturn {nttleft: clientRect.left + scrollPos.x,nttwidth: clientRect.width,nttright: clientRect.right + scrollPos.x,ntttop: clientRect.top + scrollPos.y,nttheight: clientRect.height,nttbottom: clientRect.bottom + scrollPos.ynt};n};nn/*nSaves a named password in the browsern*/nexports.savePassword = function(name,password) {ntif(window.localStorage) {nttlocalStorage.setItem("tw5-password-" + name,password);nt}n};nn/*nRetrieve a named password from the browsern*/nexports.getPassword = function(name) {ntreturn window.localStorage ? localStorage.getItem("tw5-password-" + name) : "";n};nn/*nForce layout of a dom node and its descendentsn*/nexports.forceLayout = function(element) {ntvar dummy = element.offsetWidth;n};nn/*nPulse an element for debugging purposesn*/nexports.pulseElement = function(element) {nt// Event handler to remove the class at the endntelement.addEventListener($tw.browser.animationEnd,function handler(event) {nttelement.removeEventListener($tw.browser.animationEnd,handler,false);ntt$tw.utils.removeClass(element,"pulse");nt},false);nt// Apply the pulse classnt$tw.utils.removeClass(element,"pulse");nt$tw.utils.forceLayout(element);nt$tw.utils.addClass(element,"pulse");n};nn/*nAttach specified event handlers to a DOM nodendomNode: where to attach the event handlersnevents: array of event handlers to be added (see below)nEach entry in the events array is an object with these properties:nhandlerFunction: optional event handler functionnhandlerObject: optional event handler objectnhandlerMethod: optionally specifies object handler method name (defaults to `handleEvent`)n*/nexports.addEventListeners = function(domNode,events) {nt$tw.utils.each(events,function(eventInfo) {nttvar handler;nttif(eventInfo.handlerFunction) {nttthandler = eventInfo.handlerFunction;ntt} else if(eventInfo.handlerObject) {ntttif(eventInfo.handlerMethod) {ntttthandler = function(event) {nttttteventInfo.handlerObject[eventInfo.handlerMethod].call(eventInfo.handlerObject,event);ntttt};tnttt} else {ntttthandler = eventInfo.handlerObject;nttt}ntt}nttdomNode.addEventListener(eventInfo.name,handler,false);nt});n};nn/*nConstruct and dispatch a custom eventn*/nexports.dispatchCustomEvent = function(target,name,members) {ntvar event = document.createEvent("Event");ntevent.initEvent(name,true,true);nt$tw.utils.each(members,function(member,name) {nttevent[name] = member;nt});nttarget.dispatchEvent(event); n};nnn})();n", "title": "$:/core/modules/utils/dom.js", "type": "application/javascript", "module-type": "utils" }, "$:/core/modules/utils/dom/http.js": { "text": "/*\ntitle: $:/core/modules/utils/dom/http.jsntype: application/javascriptnmodule-type: utilsnnBrowser HTTP supportnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nA quick and dirty HTTP function; to be refactored later. Options are:nturl: URL to retrieventtype: GET, PUT, POST etcntcallback: function invoked with (err,data)n*/nexports.httpRequest = function(options) {ntvar type = options.type || "GET",nttheaders = options.headers || {accept: "application/json"},nttrequest = new XMLHttpRequest(),nttdata = "",nttf,results;nt// Massage the data hashmap into a stringntif(options.data) {nttif(typeof options.data === "string") { // Already a stringntttdata = options.data;ntt} else { // A hashmap of stringsntttresults = [];nttt$tw.utils.each(options.data,function(dataItem,dataItemTitle) {nttttresults.push(dataItemTitle + "=" + encodeURIComponent(dataItem));nttt});ntttdata = results.join("&");ntt}nt}nt// Set up the state change handlerntrequest.onreadystatechange = function() {nttif(this.readyState === 4) {ntttif(this.status === 200 || this.status === 204) {ntttt// Success!nttttoptions.callback(null,this.responseText,this);nttttreturn;nttt}ntt// Something went wrongnttoptions.callback(new Error("XMLHttpRequest error: " + this.status));ntt}nt};nt// Make the requestntrequest.open(type,options.url,true);ntif(headers) {ntt$tw.utils.each(headers,function(header,headerTitle,object) {ntttrequest.setRequestHeader(headerTitle,header);ntt});nt}ntif(data && !$tw.utils.hop(headers,"Content-type")) {nttrequest.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8");nt}ntrequest.send(data);ntreturn request;n};nn})();n", "title": "$:/core/modules/utils/dom/http.js", "type": "application/javascript", "module-type": "utils" }, "$:/core/modules/utils/dom/modal.js": { "text": "/*\ntitle: $:/core/modules/utils/dom/modal.jsntype: application/javascriptnmodule-type: utilsnnModal message mechanismnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnvar widget = require("$:/core/modules/widgets/widget.js");nnvar Modal = function(wiki) {ntthis.wiki = wiki;ntthis.modalCount = 0;n};nn/*nDisplay a modal dialoguenttitle: Title of tiddler to displayntoptions: see belownOptions include:ntdownloadLink: Text of a big download link to includen*/nModal.prototype.display = function(title,options) {ntoptions = options || {};ntvar self = this,nttduration = $tw.utils.getAnimationDuration(),ntttiddler = this.wiki.getTiddler(title);nt// Don't do anything if the tiddler doesn't existntif(!tiddler) {nttreturn;nt}nt// Create the wrapper divsntvar wrapper = document.createElement("div"),nttmodalBackdrop = document.createElement("div"),nttmodalWrapper = document.createElement("div"),nttmodalHeader = document.createElement("div"),nttheaderTitle = document.createElement("h3"),nttmodalBody = document.createElement("div"),nttmodalLink = document.createElement("a"),nttmodalFooter = document.createElement("div"),nttmodalFooterHelp = document.createElement("span"),nttmodalFooterButtons = document.createElement("span");nt// Up the modal count and adjust the body classntthis.modalCount++;ntthis.adjustPageClass();nt// Add classesnt$tw.utils.addClass(wrapper,"modal-wrapper");nt$tw.utils.addClass(modalBackdrop,"modal-backdrop");nt$tw.utils.addClass(modalWrapper,"modal");nt$tw.utils.addClass(modalHeader,"modal-header");nt$tw.utils.addClass(modalBody,"modal-body");nt$tw.utils.addClass(modalLink,"btn btn-large btn-block btn-success");nt$tw.utils.addClass(modalFooter,"modal-footer");nt// Join them togetherntwrapper.appendChild(modalBackdrop);ntwrapper.appendChild(modalWrapper);ntmodalHeader.appendChild(headerTitle);ntmodalWrapper.appendChild(modalHeader);ntmodalWrapper.appendChild(modalBody);ntmodalFooter.appendChild(modalFooterHelp);ntmodalFooter.appendChild(modalFooterButtons);ntmodalWrapper.appendChild(modalFooter);nt// Render the title of the messagentvar titleText;ntif(tiddler && tiddler.fields && tiddler.fields.subtitle) {ntttitleText = tiddler.fields.subtitle;nt} else {ntttitleText = title;nt}ntvar headerParser = this.wiki.parseText("text/vnd.tiddlywiki",titleText,{parseAsInline: true}),nttheaderWidgetNode = this.wiki.makeWidget(headerParser,{parentWidget: $tw.rootWidget, document: document});ntheaderWidgetNode.render(headerTitle,null);ntthis.wiki.addEventListener("change",function(changes) {nttheaderWidgetNode.refresh(changes,modalHeader,null);nt});nt// Render the body of the messagentvar bodyParser = this.wiki.parseTiddler(title),nttbodyWidgetNode = this.wiki.makeWidget(bodyParser,{parentWidget: $tw.rootWidget, document: document});ntbodyWidgetNode.render(modalBody,null);ntthis.wiki.addEventListener("change",function(changes) {nttbodyWidgetNode.refresh(changes,modalBody,null);nt});nt// Setup the link if presentntif(options.downloadLink) {nttmodalLink.href = options.downloadLinknttmodalLink.appendChild(document.createTextNode("Right-click to save changes"));nttmodalBody.appendChild(modalLink);nt}nt// Render the footer of the messagentif(tiddler && tiddler.fields && tiddler.fields.help) {nttvar link = document.createElement("a");nttlink.setAttribute("href",tiddler.fields.help);nttlink.setAttribute("target","_blank");nttlink.appendChild(document.createTextNode("Help"));nttmodalFooterHelp.appendChild(link);nttmodalFooterHelp.style.float = "left";nt}ntvar footerText;ntif(tiddler && tiddler.fields && tiddler.fields.footer) {nttfooterText = tiddler.fields.footer;nt} else {nttfooterText = '<$button message="tw-close-tiddler" class="btn btn-primary">Close$button>';nt}ntvar footerParser = this.wiki.parseText("text/vnd.tiddlywiki",footerText,{parseAsInline: true}),nttfooterWidgetNode = this.wiki.makeWidget(footerParser,{parentWidget: $tw.rootWidget, document: document});ntfooterWidgetNode.render(modalFooterButtons,null);ntthis.wiki.addEventListener("change",function(changes) {nttfooterWidgetNode.refresh(changes,modalFooterButtons,null);nt});nt// Add the close event handlerntvar closeHandler = function(event) {ntt// Decrease the modal count and adjust the body classnttself.modalCount--;nttself.adjustPageClass();ntt// Force layout and animate the modal message awayntt$tw.utils.forceLayout(modalBackdrop);ntt$tw.utils.forceLayout(modalWrapper);ntt$tw.utils.setStyle(modalBackdrop,[nttt{opacity: "0"}ntt]);ntt$tw.utils.setStyle(modalWrapper,[nttt{transform: "translateY(" + window.innerHeight + "px)"}ntt]);ntt// Set up an event for the transition endnttwindow.setTimeout(function() {ntttif(wrapper.parentNode) {ntttt// Remove the modal message from the DOMnttttdocument.body.removeChild(wrapper);nttt}ntt},duration);ntt// Don't let anyone else handle the tw-close-tiddler messagenttreturn false;nt};ntheaderWidgetNode.addEventListener("tw-close-tiddler",closeHandler,false);ntbodyWidgetNode.addEventListener("tw-close-tiddler",closeHandler,false);ntfooterWidgetNode.addEventListener("tw-close-tiddler",closeHandler,false);nt// Set the initial styles for the messagent$tw.utils.setStyle(modalBackdrop,[ntt{opacity: "0"}nt]);nt$tw.utils.setStyle(modalWrapper,[ntt{transformOrigin: "0% 0%"},ntt{transform: "translateY(" + (-window.innerHeight) + "px)"}nt]);nt// Put the message into the documentntdocument.body.appendChild(wrapper);nt// Set up animation for the stylesnt$tw.utils.setStyle(modalBackdrop,[ntt{transition: "opacity " + duration + "ms ease-out"}nt]);nt$tw.utils.setStyle(modalWrapper,[ntt{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms ease-in-out"}nt]);nt// Force layoutnt$tw.utils.forceLayout(modalBackdrop);nt$tw.utils.forceLayout(modalWrapper);nt// Set final animated stylesnt$tw.utils.setStyle(modalBackdrop,[ntt{opacity: "0.7"}nt]);nt$tw.utils.setStyle(modalWrapper,[ntt{transform: "translateY(0px)"}nt]);n};nnModal.prototype.adjustPageClass = function() {ntif($tw.pageContainer) {ntt$tw.utils.toggleClass($tw.pageContainer,"tw-modal-displayed",this.modalCount > 0);nt}n};nnexports.Modal = Modal;nn})();n", "title": "$:/core/modules/utils/dom/modal.js", "type": "application/javascript", "module-type": "utils" }, "$:/core/modules/utils/dom/notifier.js": { "text": "/*\ntitle: $:/core/modules/utils/dom/notifier.jsntype: application/javascriptnmodule-type: utilsnnNotifier mechanismnn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nnvar widget = require("$:/core/modules/widgets/widget.js");nnvar Notifier = function(wiki) {ntthis.wiki = wiki;n};nn/*nDisplay a notificationnttitle: Title of tiddler containing the notification textntoptions: see belownOptions include:n*/nNotifier.prototype.display = function(title,options) {ntoptions = options || {};nt// Create the wrapper divsntvar notification = document.createElement("div"),ntttiddler = this.wiki.getTiddler(title),nttduration = $tw.utils.getAnimationDuration();nt// Don't do anything if the tiddler doesn't existntif(!tiddler) {nttreturn;nt}nt// Add classesnt$tw.utils.addClass(notification,"tw-notification");nt// Render the body of the notificationntvar parser = this.wiki.parseTiddler(title),nttwidgetNode = this.wiki.makeWidget(parser,{parentWidget: $tw.rootWidget, document: document});ntwidgetNode.render(notification,null);ntthis.wiki.addEventListener("change",function(changes) {nttwidgetNode.refresh(changes,notification,null);nt});nt// Set the initial styles for the notificationnt$tw.utils.setStyle(notification,[ntt{opacity: "0"},ntt{transformOrigin: "0% 0%"},ntt{transform: "translateY(" + (-window.innerHeight) + "px)"},ntt{transition: "opacity " + duration + "ms ease-out, " + $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms ease-in-out"}nt]);nt// Add the notification to the DOMntdocument.body.appendChild(notification);nt// Force layoutnt$tw.utils.forceLayout(notification);nt// Set final animated stylesnt$tw.utils.setStyle(notification,[ntt{opacity: "1.0"},ntt{transform: "translateY(0px)"}nt]);nt// Set a timer to remove the notificationntwindow.setTimeout(function() {ntt// Force layout and animate the notification awayntt$tw.utils.forceLayout(notification);ntt$tw.utils.setStyle(notification,[nttt{opacity: "0.0"},nttt{transform: "translateX(" + (notification.offsetWidth) + "px)"}ntt]);ntt// Remove the modal message from the DOM once the transition endsnttsetTimeout(function() {ntttif(notification.parentNode) {nttttdocument.body.removeChild(notification);nttt}ntt},duration);nt},$tw.config.preferences.notificationDuration);n};nnexports.Notifier = Notifier;nn})();n", "title": "$:/core/modules/utils/dom/notifier.js", "type": "application/javascript", "module-type": "utils" }, "$:/core/modules/utils/dom/popup.js": { "text": "/*\ntitle: $:/core/modules/utils/dom/popup.jsntype: application/javascriptnmodule-type: utilsnnModule that creates a $tw.utils.Popup object prototype that manages popups in the browsernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nCreates a Popup object with these options:ntrootElement: the DOM element to which the popup zapper should be attachedn*/nvar Popup = function(options) {ntoptions = options || {};ntthis.rootElement = options.rootElement || document.body;n};nnPopup.prototype.show = function(options) {ntthis.cancel();ntthis.title = options.title;ntthis.wiki = options.wiki;ntthis.anchorDomNode = options.domNode;nt$tw.utils.addClass(this.anchorDomNode,"tw-popup");ntthis.rootElement.addEventListener("click",this,false);n};nnPopup.prototype.handleEvent = function(event) {nt// Dismiss the popup if we get a click on an element that doesn't have .tw-popup classntif(event.type === "click") {nttvar node = event.target;nttwhile(node && !$tw.utils.hasClass(node,"tw-popup")) {ntttnode = node.parentNode;ntt}nttif(!node) {ntttthis.cancel();ntt}nt}n};nnPopup.prototype.cancel = function() {ntif(this.anchorDomNode) {ntt$tw.utils.removeClass(this.anchorDomNode,"tw-popup");nttthis.anchorDomNode = null;ttnt}ntthis.rootElement.removeEventListener("click",this,false);ntif(this.title) {nttthis.wiki.deleteTiddler(this.title);nttthis.title = null;nt}n};nn/*nTrigger a popup open or closed. Parameters are in a hashmap:nttitle: title of the tiddler where the popup details are storedntdomNode: dom node to which the popup will be positionedntwiki: wikintforce: if specified, forces the popup state to true or falsen*/nPopup.prototype.triggerPopup = function(options) {nt// Get the current popup state tiddlerntvar value = options.wiki.getTextReference(options.title,"");nt// Check if the popup is open by checking whether it matches "(, $button>$button>,nttencryptedStoreAreaStart=text.indexOf(encryptedStoreAreaStartMarker);ntif(encryptedStoreAreaStart!==-1){nttvarencryptedStoreAreaEnd=text.indexOf(pre>0){nttttthis.triggerTimeout();nttt}ntt}nt}n};nn*nChoosethenextapplicabletaskn*nSyncer.prototype.chooseNextTask=function(){ntvarself=this,nttcandidateTask=null,nttnow=newDate();ntSelectthebestcandidatetasknt$tw.utils.each(this.taskQueue,function(task,title){nttExcludethetaskiftheresoneofthesamenameinprogressnttif($tw.utils.hop(self.taskInProgress,title)){ntttreturn;ntt}nttExcludethetaskifitisasaveandthetiddlerhasbeenmodifiedrecently,butnothitthefallbacktimenttif(task.type===save&&(now-task.lastModificationTime)self.throttleInterval&&nttt(now-task.queueTime)self.fallbackInterval){ntttreturn;tntt}nttExcludethetaskifitisnewerthanthecurrentbestcandidatenttif(candidateTask&&candidateTask.queueTimetask.queueTime){ntttreturn;ntt}nttNowthisisourbestcandidatenttcandidateTask=task;nt});ntreturncandidateTask;n};nn*nDispatchataskandinvokethecallbackn*nSyncer.prototype.dispatchTask=function(task,callback){ntvarself=this;ntif(task.type===save){nttvarchangeCount=this.wiki.getChangeCount(task.title),nttttiddler=this.wiki.getTiddler(task.title);nttthis.log(Dispatchingsavetask:,task.title);nttif(tiddler){ntttthis.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision){nttttif(err){ntttttreturncallback(err);ntttt}nttttAdjusttheinfostoredaboutthistiddlernttttself.tiddlerInfo[task.title]={ntttttchangeCount:changeCount,ntttttadaptorInfo:adaptorInfo,ntttttrevision:revisionntttt};nttttInvokethecallbacknttttcallback(null);nttt});ntt}nt}elseif(task.type===load){nttLoadthetiddlernttthis.log(Dispatchingloadtask:,task.title);nttthis.syncadaptor.loadTiddler(task.title,function(err,tiddlerFields){ntttif(err){nttttreturncallback(err);nttt}ntttStorethetiddlerntttif(tiddlerFields){nttttself.storeTiddler(tiddlerFields);nttt}ntttInvokethecallbackntttcallback(null);ntt});nt}elseif(task.type===delete){nttDeletethetiddlernttthis.log(Dispatchingdeletetask:,task.title);nttthis.syncadaptor.deleteTiddler(task.title,function(err){ntttif(err){nttttreturncallback(err);nttt}ntttInvokethecallbackntttcallback(null);ntt});nt}n};nnexports.Syncer=Syncer;nn})();n, title:$:coremodulessyncer.js, type:applicationjavascript, module-type:global }, $:coremodulesthemes.js:{ text:*\ntitle:$:coremodulesthemes.jsntype:applicationjavascriptnmodule-type:globalnnManagesthemesandstyling.nn\*n(function(){nn*jslintnode:true,browser:true*n*global$tw:false*nusestrict;nnvarTHEME_PLUGIN_TITLE=$:theme,ThistiddlercontainsthetitleofthecurrentthemepluginntDEFAULT_THEME_PLUGINS=[ntt$:themestiddlywikisnowwhite,ntt$:themestiddlywikivanilla\nt];nnfunctionThemeManager(wiki){ntthis.wiki=wiki;ntTheresnothemetostartwithntthis.currentThemeTitle=undefined;ntSwitchtothecurrentthementthis.switchTheme();ntListenforchangestothethementvarself=this;ntthis.wiki.addEventListener(change,function(changes){nttif($tw.utils.hop(changes,THEME_PLUGIN_TITLE)){ntttself.switchTheme();ntt}nt});n}nnThemeManager.prototype.switchTheme=function(){ntGetthenameofthecurrentthementvarthemePluginTitle=this.wiki.getTiddlerText(THEME_PLUGIN_TITLE);ntIfitdoesntexist,thenfallbacktooneofthedefaultthemesntvarindex=0;ntwhile(!this.wiki.getTiddler(themePluginTitle)&&indexDEFAULT_THEME_PLUGINS.length){nttthemePluginTitle=DEFAULT_THEME_PLUGINS[index++];nt}ntAccumulatethetitlesofthepluginsthatweneedtoloadntvarthemePlugins=[],nttself=this,nttaccumulatePlugin=function(title){ntttvartiddler=self.wiki.getTiddler(title);ntttif(tiddler&&tiddler.isPlugin()&&themePlugins.indexOf(title)===-1){nttttthemePlugins.push(title);nttttvarpluginInfo=JSON.parse(self.wiki.getTiddlerText(title)),ntttttdependents=$tw.utils.parseStringArray(tiddler.fields.dependents||\);ntttt$tw.utils.each(dependents,function(title){ntttttaccumulatePlugin(title);ntttt});nttt}ntt};ntaccumulatePlugin(themePluginTitle);ntUnregisteranyexistingthemetiddlersntvarunregisteredThemeTiddlers=$tw.wiki.unregisterPluginTiddlers(theme);ntAccumulatethetitlesofshadowtiddlersthathavechangedasaresultofthisswitchntvarchangedTiddlers={};nt$tw.utils.each(this.wiki.shadowTiddlers,function(shadowInfo,title){nttif(unregisteredThemeTiddlers.indexOf(shadowInfo.source)!==-1){ntttchangedTiddlers[title]=true;isDeleted?ntt}nt});ntRegisteranynewthemetiddlersntvarregisteredThemeTiddlers=$tw.wiki.registerPluginTiddlers(theme,themePlugins);ntUnpackthecurrentthemetiddlersnt$tw.wiki.unpackPluginTiddlers();ntAccumulatetheaffectedshadowtiddlersnt$tw.utils.each(this.wiki.shadowTiddlers,function(shadowInfo,title){nttif(registeredThemeTiddlers.indexOf(shadowInfo.source)!==-1){ntttchangedTiddlers[title]=false;isDeleted?ntt}nt});ntIssuechangeeventsforthemodifiedtiddlersnt$tw.utils.each(changedTiddlers,function(status,title){nttself.wiki.enqueueTiddlerEvent(title,status);nt});n};nnexports.ThemeManager=ThemeManager;nn})();n, title:$:coremodulesthemes.js, type:applicationjavascript, module-type:global }, $:coremodulestiddler.js:{ text:*\ntitle:$:coremodulestiddler.jsntype:applicationjavascriptnmodule-type:tiddlermethodnnExtensionmethodsforthe$tw.Tiddlerobject(constructorandmethodsrequiredatboottimeareinbootboot.js)nn\*n(function(){nn*jslintnode:true,browser:true*n*global$tw:false*nusestrict;nnexports.hasTag=function(tag){ntreturnthis.fields.tags&&this.fields.tags.indexOf(tag)!==-1;n};nnexports.isPlugin=function(){ntreturnthis.fields.type===applicationjson&&this.hasField(plugin-type);n}nnexports.getFieldString=function(field){ntvarvalue=this.fields[field];ntCheckforamissingfieldntif(value===undefined||value===null){nttreturn\;nt}ntParsethefieldwiththeassociatedmodule(ifany)ntvarfieldModule=$tw.Tiddler.fieldModules[field];ntif(fieldModule&&fieldModule.stringify){nttreturnfieldModule.stringify.call(this,value);nt}else{nttreturnvalue.toString();nt}n};nn*nGetallthefieldsasaname:valueblock.Options:ntexclude:anarrayoffieldnamestoexcluden*nexports.getFieldStringBlock=function(options){ntoptions=options||{};ntvarexclude=options.exclude||[];ntvarfields=[];ntfor(varfieldinthis.fields){nttif($tw.utils.hop(this.fields,field)){ntttif(exclude.indexOf(field)===-1){nttttfields.push(field+:+this.getFieldString(field));nttt}ntt}nt}ntreturnfields.join(\n);n};nn})();n, title:$:coremodulestiddler.js, type:applicationjavascript, module-type:tiddlermethod }, $:coremodulesutilscrypto.js:{ text:*\ntitle:$:coremodulesutilscrypto.jsntype:applicationjavascriptnmodule-type:utilsnnUtilityfunctionsrelatedtocrypto.nn\*n(function(){nn*jslintnode:true,browser:true*n*global$tw:false*nusestrict;nn*nLookforanencryptedstoreareainthetextofaTiddlyWikifilen*nexports.extractEncryptedStoreArea=function(text){ntvarencryptedStoreAreaStartMarker=preid=\encryptedStoreArea\type=\textplain\style=\display:none;\>)"ntvar state = !this.readPopupState(options.title,value);ntif("force" in options) {nttstate = options.force;nt}ntif(state) {ntt// Set the position if we're opening itnttthis.cancel();nttoptions.wiki.setTextReference(options.title,nttt"(" + options.domNode.offsetLeft + "," + options.domNode.offsetTop + "," + nttttoptions.domNode.offsetWidth + "," + options.domNode.offsetHeight + ")");nttthis.show(options);nt} else {nttthis.cancel();nt}n};nn/*nReturns true if the specified title and text identifies an active popupn*/nPopup.prototype.readPopupState = function(title,text) {ntvar popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/,nttresult = false;ntif(this.title === title) {nttresult = popupLocationRegExp.test(text);nt}ntreturn result;n};nnexports.Popup = Popup;nn})();n", "title": "$:/core/modules/utils/dom/popup.js", "type": "application/javascript", "module-type": "utils" }, "$:/core/modules/utils/dom/scroller.js": { "text": "/*\ntitle: $:/core/modules/utils/dom/scroller.jsntype: application/javascriptnmodule-type: utilsnnModule that creates a $tw.utils.Scroller object prototype that manages scrolling in the browsernn\*/n(function(){nn/*jslint node: true, browser: true */n/*global $tw: false */n"use strict";nn/*nEvent handler for when the `tw-scroll` event hits the document bodyn*/nvar PageScroller = function() {ntthis.idRequestFrame = null;ntthis.requestAnimationFrame = window.requestAnimationFrame ||nttwindow.webkitRequestAnimationFrame ||nttwindow.mozRequestAnimationFrame ||nttfunction(callback) {ntttreturn window.setTimeout(callback, 1000/60);ntt};ntthis.cancelAnimationFrame = window.cancelAnimationFrame ||nttwindow.webkitCancelAnimationFrame ||nttwindow.webkitCancelRequestAnimationFrame ||nttwindow.mozCancelAnimationFrame ||nttwindow.mozCancelRequestAnimationFrame ||nttfunction(id) {ntttwindow.clearTimeout(id);ntt};n};nnPageScroller.prototype.cancelScroll = function() {ntif(this.idRequestFrame) {nttthis.cancelAnimationFrame.call(window,this.idRequestFrame);nttthis.idRequestFrame = null;nt}n};nn/*nHandle an