Merge branch 'master' of github.com:Jermolene/TiddlyWiki5
This commit is contained in:
commit
116e6d55a2
|
@ -5,7 +5,7 @@
|
|||
# Default to the current version number for building the plugin library
|
||||
|
||||
if [ -z "$TW5_BUILD_VERSION" ]; then
|
||||
TW5_BUILD_VERSION=v5.3.0
|
||||
TW5_BUILD_VERSION=v5.3.2
|
||||
fi
|
||||
|
||||
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"
|
||||
|
@ -104,13 +104,15 @@ node $TW5_BUILD_TIDDLYWIKI \
|
|||
--build favicon static index \
|
||||
|| exit 1
|
||||
|
||||
# /empty.html Empty
|
||||
# /empty.hta For Internet Explorer
|
||||
# /empty.html Empty
|
||||
# /empty.hta For Internet Explorer
|
||||
# /empty-external-core.html External core empty
|
||||
# /tiddlywikicore-<version>.js Core plugin javascript
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/empty \
|
||||
--verbose \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--build empty \
|
||||
--build empty emptyexternalcore \
|
||||
|| exit 1
|
||||
|
||||
|
||||
|
|
25
boot/boot.js
25
boot/boot.js
|
@ -575,9 +575,8 @@ var globalCheck =[
|
|||
" configurable: true",
|
||||
" });",
|
||||
" if(Object.keys(__temp__).length){",
|
||||
" console.log(Object.keys(__temp__));",
|
||||
" console.log(\"Warning: Global assignment detected\",Object.keys(__temp__));",
|
||||
" delete Object.prototype.__temp__;",
|
||||
" throw \"Global assignment is not allowed within modules on node.\";",
|
||||
" }",
|
||||
" delete Object.prototype.__temp__;",
|
||||
].join('\n');
|
||||
|
@ -596,11 +595,11 @@ $tw.utils.evalGlobal = function(code,context,filename,sandbox,allowGlobals) {
|
|||
// Add the code prologue and epilogue
|
||||
code = [
|
||||
"(function(" + contextNames.join(",") + ") {",
|
||||
" (function(){\n" + code + "\n;})();",
|
||||
" (function(){" + code + "\n;})();\n",
|
||||
(!$tw.browser && sandbox && !allowGlobals) ? globalCheck : "",
|
||||
" return exports;\n",
|
||||
"\nreturn exports;\n",
|
||||
"})"
|
||||
].join("\n");
|
||||
].join("");
|
||||
|
||||
// Compile the code into a function
|
||||
var fn;
|
||||
|
@ -926,7 +925,7 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
|
|||
}
|
||||
} else {
|
||||
// line number should be included in e.stack for runtime errors
|
||||
$tw.utils.error("Error executing boot module " + name + ": " + JSON.stringify(e) + "\n\n" + e.stack);
|
||||
$tw.utils.error("Error executing boot module " + name + ": " + String(e) + "\n\n" + e.stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1150,7 +1149,7 @@ $tw.Wiki = function(options) {
|
|||
shadowTiddlerTitles = null,
|
||||
getShadowTiddlerTitles = function() {
|
||||
if(!shadowTiddlerTitles) {
|
||||
shadowTiddlerTitles = Object.keys(shadowTiddlers);
|
||||
shadowTiddlerTitles = Object.keys(shadowTiddlers).sort(function(a,b) {return a.localeCompare(b);});
|
||||
}
|
||||
return shadowTiddlerTitles;
|
||||
},
|
||||
|
@ -2675,6 +2674,18 @@ $tw.hooks.addHook = function(hookName,definition) {
|
|||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Delete hooks from the hashmap
|
||||
*/
|
||||
$tw.hooks.removeHook = function(hookName,definition) {
|
||||
if($tw.utils.hop($tw.hooks.names,hookName)) {
|
||||
var p = $tw.hooks.names[hookName].indexOf(definition);
|
||||
if(p !== -1) {
|
||||
$tw.hooks.names[hookName].splice(p, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Invoke the hook by key
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
title: $:/core/images/new-journal-button
|
||||
tags: $:/tags/Image
|
||||
|
||||
<$parameters size="22pt" day=<<now "DD">>>
|
||||
<svg width=<<size>> height=<<size>> class="tc-image-new-journal-button tc-image-button" viewBox="0 0 128 128"><g fill-rule="evenodd"><path d="M102.545 112.818v11.818c0 1.306 1.086 2.364 2.425 2.364h6.06c1.34 0 2.425-1.058 2.425-2.364v-11.818h12.12c1.34 0 2.425-1.058 2.425-2.363v-5.91c0-1.305-1.085-2.363-2.424-2.363h-12.121V90.364c0-1.306-1.086-2.364-2.425-2.364h-6.06c-1.34 0-2.425 1.058-2.425 2.364v11.818h-12.12c-1.34 0-2.425 1.058-2.425 2.363v5.91c0 1.305 1.085 2.363 2.424 2.363h12.121zM60.016 4.965c-4.781-2.76-10.897-1.118-13.656 3.66L5.553 79.305A9.993 9.993 0 009.21 92.963l51.04 29.468c4.78 2.76 10.897 1.118 13.655-3.66l40.808-70.681a9.993 9.993 0 00-3.658-13.656L60.016 4.965zm-3.567 27.963a6 6 0 106-10.393 6 6 0 00-6 10.393zm31.697 17.928a6 6 0 106-10.392 6 6 0 00-6 10.392z"/><text class="tc-fill-background" font-family="Helvetica" font-size="47.172" font-weight="bold" transform="rotate(30 25.742 95.82)"><tspan x="42" y="77.485" text-anchor="middle"><$text text=<<day>>/></tspan></text></g></svg>
|
||||
</$parameters>
|
||||
<$parameters size="22pt" day=<<now "DD">>><svg width=<<size>> height=<<size>> class="tc-image-new-journal-button tc-image-button" viewBox="0 0 128 128"><g fill-rule="evenodd"><path d="M102.545 112.818v11.818c0 1.306 1.086 2.364 2.425 2.364h6.06c1.34 0 2.425-1.058 2.425-2.364v-11.818h12.12c1.34 0 2.425-1.058 2.425-2.363v-5.91c0-1.305-1.085-2.363-2.424-2.363h-12.121V90.364c0-1.306-1.086-2.364-2.425-2.364h-6.06c-1.34 0-2.425 1.058-2.425 2.364v11.818h-12.12c-1.34 0-2.425 1.058-2.425 2.363v5.91c0 1.305 1.085 2.363 2.424 2.363h12.121zM60.016 4.965c-4.781-2.76-10.897-1.118-13.656 3.66L5.553 79.305A9.993 9.993 0 009.21 92.963l51.04 29.468c4.78 2.76 10.897 1.118 13.655-3.66l40.808-70.681a9.993 9.993 0 00-3.658-13.656L60.016 4.965zm-3.567 27.963a6 6 0 106-10.393 6 6 0 00-6 10.393zm31.697 17.928a6 6 0 106-10.392 6 6 0 00-6 10.392z"/><text class="tc-fill-background" font-family="Helvetica" font-size="47.172" font-weight="bold" transform="rotate(30 25.742 95.82)"><tspan x="42" y="77.485" text-anchor="middle"><$text text=<<day>>/></tspan></text></g></svg></$parameters>
|
|
@ -4,7 +4,7 @@ description: Saves a wiki to a new wiki folder
|
|||
<<.from-version "5.1.20">> Saves the current wiki as a wiki folder, including tiddlers, plugins and configuration:
|
||||
|
||||
```
|
||||
--savewikifolder <wikifolderpath> [<filter>]
|
||||
--savewikifolder <wikifolderpath> [<filter>] [ [<name>=<value>] ]*
|
||||
```
|
||||
|
||||
* The target wiki folder must be empty or non-existent
|
||||
|
@ -12,8 +12,23 @@ description: Saves a wiki to a new wiki folder
|
|||
* Plugins from the official plugin library are replaced with references to those plugins in the `tiddlywiki.info` file
|
||||
* Custom plugins are unpacked into their own folder
|
||||
|
||||
The following options are supported:
|
||||
|
||||
* ''filter'': a filter expression that defines the tiddlers to include in the output.
|
||||
* ''explodePlugins'': defaults to "yes"
|
||||
** ''yes'' will "explode" plugins into separate tiddler files and save them to the plugin directory within the wiki folder
|
||||
** ''no'' will suppress exploding plugins into their constituent tiddler files. It will save the plugin as a single JSON tiddler in the tiddlers folder
|
||||
|
||||
Note that both ''explodePlugins'' options will produce wiki folders that build the exact same original wiki. The difference lies in how plugins are represented in the wiki folder.
|
||||
|
||||
A common usage is to convert a TiddlyWiki HTML file into a wiki folder:
|
||||
|
||||
```
|
||||
tiddlywiki --load ./mywiki.html --savewikifolder ./mywikifolder
|
||||
```
|
||||
|
||||
Save the plugin to the tiddlers directory of the target wiki folder:
|
||||
|
||||
```
|
||||
tiddlywiki --load ./mywiki.html --savewikifolder ./mywikifolder explodePlugins=no
|
||||
```
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
title: $:/language/Help/server
|
||||
description: Provides an HTTP server interface to TiddlyWiki (deprecated in favour of the new listen command)
|
||||
description: (deprecated: see 'listen' command) Provides an HTTP server interface to TiddlyWiki
|
||||
|
||||
Legacy command to serve a wiki over HTTP.
|
||||
|
||||
|
|
|
@ -5,7 +5,14 @@ module-type: command
|
|||
|
||||
Command to save the current wiki as a wiki folder
|
||||
|
||||
--savewikifolder <wikifolderpath> [<filter>]
|
||||
--savewikifolder <wikifolderpath> [ [<name>=<value>] ]*
|
||||
|
||||
The following options are supported:
|
||||
|
||||
* ''filter'': a filter expression defining the tiddlers to be included in the output
|
||||
* ''explodePlugins'': set to "no" to suppress exploding plugins into their constituent shadow tiddlers (defaults to "yes")
|
||||
|
||||
Supports backward compatibility with --savewikifolder <wikifolderpath> [<filter>] [ [<name>=<value>] ]*
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
@ -35,14 +42,28 @@ Command.prototype.execute = function() {
|
|||
if(this.params.length < 1) {
|
||||
return "Missing wiki folder path";
|
||||
}
|
||||
var wikifoldermaker = new WikiFolderMaker(this.params[0],this.params[1],this.commander);
|
||||
var regFilter = /^[a-zA-Z0-9\.\-_]+=/g, // dynamic parameters
|
||||
namedParames,
|
||||
tiddlerFilter,
|
||||
options = {};
|
||||
if (regFilter.test(this.params[1])) {
|
||||
namedParames = this.commander.extractNamedParameters(this.params.slice(1));
|
||||
tiddlerFilter = namedParames.filter || "[all[tiddlers]]";
|
||||
} else {
|
||||
namedParames = this.commander.extractNamedParameters(this.params.slice(2));
|
||||
tiddlerFilter = this.params[1];
|
||||
}
|
||||
tiddlerFilter = tiddlerFilter || "[all[tiddlers]]";
|
||||
options.explodePlugins = namedParames.explodePlugins || "yes";
|
||||
var wikifoldermaker = new WikiFolderMaker(this.params[0],tiddlerFilter,this.commander,options);
|
||||
return wikifoldermaker.save();
|
||||
};
|
||||
|
||||
function WikiFolderMaker(wikiFolderPath,wikiFilter,commander) {
|
||||
function WikiFolderMaker(wikiFolderPath,wikiFilter,commander,options) {
|
||||
this.wikiFolderPath = wikiFolderPath;
|
||||
this.wikiFilter = wikiFilter || "[all[tiddlers]]";
|
||||
this.wikiFilter = wikiFilter;
|
||||
this.commander = commander;
|
||||
this.explodePlugins = options.explodePlugins;
|
||||
this.wiki = commander.wiki;
|
||||
this.savedPaths = []; // So that we can detect filename clashes
|
||||
}
|
||||
|
@ -93,10 +114,13 @@ WikiFolderMaker.prototype.save = function() {
|
|||
self.log("Adding built-in plugin: " + libraryDetails.name);
|
||||
newWikiInfo[libraryDetails.type] = newWikiInfo[libraryDetails.type] || [];
|
||||
$tw.utils.pushTop(newWikiInfo[libraryDetails.type],libraryDetails.name);
|
||||
} else {
|
||||
} else if(self.explodePlugins !== "no") {
|
||||
// A custom plugin
|
||||
self.log("Processing custom plugin: " + title);
|
||||
self.saveCustomPlugin(tiddler);
|
||||
} else if(self.explodePlugins === "no") {
|
||||
self.log("Processing custom plugin to tiddlders folder: " + title);
|
||||
self.saveTiddler("tiddlers", tiddler);
|
||||
}
|
||||
} else {
|
||||
// Ordinary tiddler
|
||||
|
|
|
@ -60,7 +60,7 @@ function FramedEngine(options) {
|
|||
this.domNode.value = this.value;
|
||||
}
|
||||
// Set the attributes
|
||||
if(this.widget.editType) {
|
||||
if(this.widget.editType && this.widget.editTag !== "textarea") {
|
||||
this.domNode.setAttribute("type",this.widget.editType);
|
||||
}
|
||||
if(this.widget.editPlaceholder) {
|
||||
|
|
|
@ -34,7 +34,7 @@ function SimpleEngine(options) {
|
|||
this.domNode.value = this.value;
|
||||
}
|
||||
// Set the attributes
|
||||
if(this.widget.editType) {
|
||||
if(this.widget.editType && this.widget.editTag !== "textarea") {
|
||||
this.domNode.setAttribute("type",this.widget.editType);
|
||||
}
|
||||
if(this.widget.editPlaceholder) {
|
||||
|
|
|
@ -28,12 +28,8 @@ function getAllFilterOperators() {
|
|||
Export our filter function
|
||||
*/
|
||||
exports.all = function(source,operator,options) {
|
||||
// Get our suboperators
|
||||
var allFilterOperators = getAllFilterOperators();
|
||||
// Cycle through the suboperators accumulating their results
|
||||
var results = new $tw.utils.LinkedList(),
|
||||
subops = operator.operand.split("+");
|
||||
// Check for common optimisations
|
||||
var subops = operator.operand.split("+");
|
||||
if(subops.length === 1 && subops[0] === "") {
|
||||
return source;
|
||||
} else if(subops.length === 1 && subops[0] === "tiddlers") {
|
||||
|
@ -46,6 +42,10 @@ exports.all = function(source,operator,options) {
|
|||
return options.wiki.eachShadowPlusTiddlers;
|
||||
}
|
||||
// Do it the hard way
|
||||
// Get our suboperators
|
||||
var allFilterOperators = getAllFilterOperators();
|
||||
// Cycle through the suboperators accumulating their results
|
||||
var results = new $tw.utils.LinkedList();
|
||||
for(var t=0; t<subops.length; t++) {
|
||||
var subop = allFilterOperators[subops[t]];
|
||||
if(subop) {
|
||||
|
|
|
@ -35,7 +35,7 @@ Instantiate parse rule
|
|||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /^\\(function|procedure|widget)\s+([^(\s]+)\((\s*([^)]*))?\)(\s*\r?\n)?/mg;
|
||||
this.matchRegExp = /\\(function|procedure|widget)\s+([^(\s]+)\((\s*([^)]*))?\)(\s*\r?\n)?/mg;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -53,7 +53,7 @@ exports.parse = function() {
|
|||
var reEnd;
|
||||
if(this.match[5]) {
|
||||
// If so, the end of the body is marked with \end
|
||||
reEnd = new RegExp("(\\r?\\n\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[2]) + ")?(?:$|\\r?\\n))","mg");
|
||||
reEnd = new RegExp("(\\r?\\n[^\\S\\n\\r]*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[2]) + ")?(?:$|\\r?\\n))","mg");
|
||||
} else {
|
||||
// Otherwise, the end of the definition is marked by the end of the line
|
||||
reEnd = /($|\r?\n)/mg;
|
||||
|
|
|
@ -26,7 +26,7 @@ Instantiate parse rule
|
|||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /^\\parameters\s*\(([^)]*)\)(\s*\r?\n)?/mg;
|
||||
this.matchRegExp = /\\parameters\s*\(([^)]*)\)(\s*\r?\n)?/mg;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -15,6 +15,7 @@ Startup logic concerned with managing plugins
|
|||
// Export name and synchronous status
|
||||
exports.name = "plugins";
|
||||
exports.after = ["load-modules"];
|
||||
exports.before = ["startup"];
|
||||
exports.synchronous = true;
|
||||
|
||||
var TITLE_REQUIRE_RELOAD_DUE_TO_PLUGIN_CHANGE = "$:/status/RequireReloadDueToPluginChange";
|
||||
|
|
|
@ -38,6 +38,7 @@ exports.startup = function() {
|
|||
url: params.url,
|
||||
method: params.method,
|
||||
body: params.body,
|
||||
binary: params.binary,
|
||||
oncompletion: params.oncompletion,
|
||||
onprogress: params.onprogress,
|
||||
bindStatus: params["bind-status"],
|
||||
|
|
|
@ -27,6 +27,11 @@ exports.startup = function() {
|
|||
if($tw.browser) {
|
||||
$tw.browser.isIE = (/msie|trident/i.test(navigator.userAgent));
|
||||
$tw.browser.isFirefox = !!document.mozFullScreenEnabled;
|
||||
// 2023-07-21 Edge returns UA below. So we use "isChromeLike"
|
||||
//'mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/114.0.0.0 safari/537.36 edg/114.0.1823.82'
|
||||
$tw.browser.isChromeLike = navigator.userAgent.toLowerCase().indexOf("chrome") > -1;
|
||||
$tw.browser.hasTouch = !!window.matchMedia && window.matchMedia("(pointer: coarse)").matches;
|
||||
$tw.browser.isMobileChrome = $tw.browser.isChromeLike && $tw.browser.hasTouch;
|
||||
}
|
||||
// Platform detection
|
||||
$tw.platform = {};
|
||||
|
|
|
@ -80,7 +80,7 @@ exports.makeDraggable = function(options) {
|
|||
if(dataTransfer.setDragImage) {
|
||||
if(dragImageType === "pill") {
|
||||
dataTransfer.setDragImage(dragImage.firstChild,-16,-16);
|
||||
} else if (dragImageType === "blank") {
|
||||
} else if(dragImageType === "blank") {
|
||||
dragImage.removeChild(dragImage.firstChild);
|
||||
dataTransfer.setDragImage(dragImage,0,0);
|
||||
} else {
|
||||
|
@ -106,7 +106,9 @@ exports.makeDraggable = function(options) {
|
|||
dataTransfer.setData("text/vnd.tiddler",jsonData);
|
||||
dataTransfer.setData("text/plain",titleString);
|
||||
dataTransfer.setData("text/x-moz-url","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
|
||||
} else {
|
||||
}
|
||||
// If browser is Chrome-like and has a touch-input device do NOT .setData
|
||||
if(!($tw.browser.isMobileChrome)) {
|
||||
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
|
||||
}
|
||||
dataTransfer.setData("Text",titleString);
|
||||
|
|
|
@ -90,6 +90,7 @@ wiki: wiki to be used for executing action strings
|
|||
url: URL for request
|
||||
method: method eg GET, POST
|
||||
body: text of request body
|
||||
binary: set to "yes" to force binary processing of response payload
|
||||
oncompletion: action string to be invoked on completion
|
||||
onprogress: action string to be invoked on progress updates
|
||||
bindStatus: optional title of tiddler to which status ("pending", "complete", "error") should be written
|
||||
|
@ -106,10 +107,11 @@ function HttpClientRequest(options) {
|
|||
this.wiki = options.wiki;
|
||||
this.completionActions = options.oncompletion;
|
||||
this.progressActions = options.onprogress;
|
||||
this.bindStatus = options["bind-status"];
|
||||
this.bindProgress = options["bind-progress"];
|
||||
this.bindStatus = options["bindStatus"];
|
||||
this.bindProgress = options["bindProgress"];
|
||||
this.method = options.method || "GET";
|
||||
this.body = options.body || "";
|
||||
this.binary = options.binary || "";
|
||||
this.variables = options.variables;
|
||||
var url = options.url;
|
||||
$tw.utils.each(options.queryStrings,function(value,name) {
|
||||
|
@ -132,7 +134,7 @@ HttpClientRequest.prototype.send = function(callback) {
|
|||
var self = this,
|
||||
setBinding = function(title,text) {
|
||||
if(title) {
|
||||
this.wiki.addTiddler(new $tw.Tiddler({title: title, text: text}));
|
||||
self.wiki.addTiddler(new $tw.Tiddler({title: title, text: text}));
|
||||
}
|
||||
};
|
||||
if(this.url) {
|
||||
|
@ -156,6 +158,8 @@ HttpClientRequest.prototype.send = function(callback) {
|
|||
type: this.method,
|
||||
headers: this.requestHeaders,
|
||||
data: this.body,
|
||||
returnProp: this.binary === "" ? "responseText" : "response",
|
||||
responseType: this.binary === "" ? "text" : "arraybuffer",
|
||||
callback: function(err,data,xhr) {
|
||||
var hasSucceeded = xhr.status >= 200 && xhr.status < 300,
|
||||
completionCode = hasSucceeded ? "complete" : "error",
|
||||
|
@ -175,6 +179,16 @@ HttpClientRequest.prototype.send = function(callback) {
|
|||
data: (data || "").toString(),
|
||||
headers: JSON.stringify(headers)
|
||||
};
|
||||
/* Convert data from binary to base64 */
|
||||
if (xhr.responseType === "arraybuffer") {
|
||||
var binary = "",
|
||||
bytes = new Uint8Array(data),
|
||||
len = bytes.byteLength;
|
||||
for (var i=0; i<len; i++) {
|
||||
binary += String.fromCharCode(bytes[i]);
|
||||
}
|
||||
resultVariables.data = window.btoa(binary);
|
||||
}
|
||||
self.wiki.addTiddler(new $tw.Tiddler(self.wiki.getTiddler(requestTrackerTitle),{
|
||||
status: completionCode,
|
||||
}));
|
||||
|
@ -212,6 +226,7 @@ Make an HTTP request. Options are:
|
|||
callback: function invoked with (err,data,xhr)
|
||||
progress: optional function invoked with (lengthComputable,loaded,total)
|
||||
returnProp: string name of the property to return as first argument of callback
|
||||
responseType: "text" or "arraybuffer"
|
||||
*/
|
||||
exports.httpRequest = function(options) {
|
||||
var type = options.type || "GET",
|
||||
|
@ -264,6 +279,7 @@ exports.httpRequest = function(options) {
|
|||
}
|
||||
}
|
||||
}
|
||||
request.responseType = options.responseType || "text";
|
||||
// Set up the state change handler
|
||||
request.onreadystatechange = function() {
|
||||
if(this.readyState === 4) {
|
||||
|
|
|
@ -116,7 +116,7 @@ CheckboxWidget.prototype.getValue = function() {
|
|||
} else {
|
||||
list = $tw.utils.parseStringArray(this.checkboxDefault || "") || [];
|
||||
}
|
||||
} else if (this.checkboxListIndex) {
|
||||
} else if(this.checkboxListIndex) {
|
||||
list = $tw.utils.parseStringArray(this.wiki.extractTiddlerDataItem(tiddler,this.checkboxListIndex,this.checkboxDefault || "")) || [];
|
||||
} else {
|
||||
list = this.wiki.filterTiddlers(this.checkboxFilter,this) || [];
|
||||
|
@ -215,6 +215,8 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
|
|||
if($tw.utils.isArray(fieldContents)) {
|
||||
// Make a copy so we can modify it without changing original that's refrenced elsewhere
|
||||
listContents = fieldContents.slice(0);
|
||||
} else if(fieldContents === undefined) {
|
||||
listContents = [];
|
||||
} else if(typeof fieldContents === "string") {
|
||||
listContents = $tw.utils.parseStringArray(fieldContents);
|
||||
// No need to copy since parseStringArray returns a fresh array, not refrenced elsewhere
|
||||
|
|
|
@ -49,7 +49,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
|
|||
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
|
||||
// Accumulate the <$set> widgets from each tiddler
|
||||
$tw.utils.each(this.tiddlerList,function(title) {
|
||||
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true});
|
||||
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:true});
|
||||
if(parser) {
|
||||
var parseTreeNode = parser.tree[0];
|
||||
while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) {
|
||||
|
|
|
@ -225,6 +225,8 @@ ListWidget.prototype.handleListChanges = function(changedTiddlers) {
|
|||
// If we are providing an counter variable then we must refresh the items, otherwise we can rearrange them
|
||||
var hasRefreshed = false,t;
|
||||
if(this.counterName) {
|
||||
var mustRefreshOldLast = false;
|
||||
var oldLength = this.children.length;
|
||||
// Cycle through the list and remove and re-insert the first item that has changed, and all the remaining items
|
||||
for(t=0; t<this.list.length; t++) {
|
||||
if(hasRefreshed || !this.children[t] || this.children[t].parseTreeNode.itemTitle !== this.list[t]) {
|
||||
|
@ -232,6 +234,9 @@ ListWidget.prototype.handleListChanges = function(changedTiddlers) {
|
|||
this.removeListItem(t);
|
||||
}
|
||||
this.insertListItem(t,this.list[t]);
|
||||
if(!hasRefreshed && t === oldLength) {
|
||||
mustRefreshOldLast = true;
|
||||
}
|
||||
hasRefreshed = true;
|
||||
} else {
|
||||
// Refresh the item we're reusing
|
||||
|
@ -239,6 +244,12 @@ ListWidget.prototype.handleListChanges = function(changedTiddlers) {
|
|||
hasRefreshed = hasRefreshed || refreshed;
|
||||
}
|
||||
}
|
||||
// If items were inserted then we must recreate the item that used to be at the last position as it is no longer last
|
||||
if(mustRefreshOldLast && oldLength > 0) {
|
||||
var oldLastIdx = oldLength-1;
|
||||
this.removeListItem(oldLastIdx);
|
||||
this.insertListItem(oldLastIdx,this.list[oldLastIdx]);
|
||||
}
|
||||
// If there are items to remove and we have not refreshed then recreate the item that will now be at the last position
|
||||
if(!hasRefreshed && this.children.length > this.list.length) {
|
||||
this.removeListItem(this.list.length-1);
|
||||
|
|
|
@ -145,6 +145,7 @@ SelectWidget.prototype.execute = function() {
|
|||
this.selectDefault = this.getAttribute("default");
|
||||
this.selectMultiple = this.getAttribute("multiple", false);
|
||||
this.selectSize = this.getAttribute("size");
|
||||
this.selectTabindex = this.getAttribute("tabindex");
|
||||
this.selectTooltip = this.getAttribute("tooltip");
|
||||
this.selectFocus = this.getAttribute("focus");
|
||||
// Make the child widgets
|
||||
|
@ -162,6 +163,9 @@ SelectWidget.prototype.execute = function() {
|
|||
if(this.selectSize) {
|
||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"size",this.selectSize);
|
||||
}
|
||||
if(this.selectTabindex) {
|
||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"tabindex",this.selectTabindex);
|
||||
}
|
||||
if(this.selectTooltip) {
|
||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"title",this.selectTooltip);
|
||||
}
|
||||
|
|
|
@ -41,27 +41,43 @@ TranscludeWidget.prototype.execute = function() {
|
|||
this.collectAttributes();
|
||||
this.collectStringParameters();
|
||||
this.collectSlotFillParameters();
|
||||
// Get the parse tree nodes that we are transcluding
|
||||
var target = this.getTransclusionTarget(),
|
||||
parseTreeNodes = target.parseTreeNodes;
|
||||
this.sourceText = target.text;
|
||||
this.parserType = target.type;
|
||||
this.parseAsInline = target.parseAsInline;
|
||||
// Determine whether we're being used in inline or block mode
|
||||
var parseAsInline = !this.parseTreeNode.isBlock;
|
||||
if(this.transcludeMode === "inline") {
|
||||
parseAsInline = true;
|
||||
} else if(this.transcludeMode === "block") {
|
||||
parseAsInline = false;
|
||||
}
|
||||
// Set 'thisTiddler'
|
||||
this.setVariable("thisTiddler",this.transcludeTitle);
|
||||
var parseTreeNodes, target;
|
||||
// Process the transclusion according to the output type
|
||||
switch(this.transcludeOutput || "text/html") {
|
||||
case "text/html":
|
||||
// No further processing required
|
||||
// Return the parse tree nodes of the target
|
||||
target = this.parseTransclusionTarget(parseAsInline);
|
||||
this.parseAsInline = target.parseAsInline;
|
||||
parseTreeNodes = target.parseTreeNodes;
|
||||
break;
|
||||
case "text/raw":
|
||||
// Just return the raw text
|
||||
parseTreeNodes = [{type: "text", text: this.sourceText}];
|
||||
target = this.getTransclusionTarget();
|
||||
parseTreeNodes = [{type: "text", text: target.text}];
|
||||
break;
|
||||
default:
|
||||
// text/plain
|
||||
var plainText = this.wiki.renderText("text/plain",this.parserType,this.sourceText,{parentWidget: this});
|
||||
parseTreeNodes = [{type: "text", text: plainText}];
|
||||
// "text/plain" is the plain text result of wikifying the text
|
||||
target = this.parseTransclusionTarget(parseAsInline);
|
||||
var widgetNode = this.wiki.makeWidget(target.parser,{
|
||||
parentWidget: this,
|
||||
document: $tw.fakeDocument
|
||||
});
|
||||
var container = $tw.fakeDocument.createElement("div");
|
||||
widgetNode.render(container,null);
|
||||
parseTreeNodes = [{type: "text", text: container.textContent}];
|
||||
break;
|
||||
}
|
||||
this.sourceText = target.text;
|
||||
this.parserType = target.type;
|
||||
// Set the legacy transclusion context variables only if we're not transcluding a variable
|
||||
if(!this.transcludeVariable) {
|
||||
var recursionMarker = this.makeRecursionMarker();
|
||||
|
@ -158,17 +174,44 @@ TranscludeWidget.prototype.collectSlotFillParameters = function() {
|
|||
};
|
||||
|
||||
/*
|
||||
Get transcluded parse tree nodes as an object {parser:,text:,type:}
|
||||
Get transcluded details as an object {text:,type:}
|
||||
*/
|
||||
TranscludeWidget.prototype.getTransclusionTarget = function() {
|
||||
var self = this;
|
||||
// Determine whether we're being used in inline or block mode
|
||||
var parseAsInline = !this.parseTreeNode.isBlock;
|
||||
if(this.transcludeMode === "inline") {
|
||||
parseAsInline = true;
|
||||
} else if(this.transcludeMode === "block") {
|
||||
parseAsInline = false;
|
||||
var text;
|
||||
// Return the text and type of the target
|
||||
if(this.hasAttribute("$variable")) {
|
||||
if(this.transcludeVariable) {
|
||||
// Transcluding a variable
|
||||
var variableInfo = this.getVariableInfo(this.transcludeVariable,{params: this.getOrderedTransclusionParameters()});
|
||||
text = variableInfo.text;
|
||||
return {
|
||||
text: variableInfo.text,
|
||||
type: this.transcludeType
|
||||
};
|
||||
}
|
||||
} else {
|
||||
// Transcluding a text reference
|
||||
var parserInfo = this.wiki.getTextReferenceParserInfo(
|
||||
this.transcludeTitle,
|
||||
this.transcludeField,
|
||||
this.transcludeIndex,
|
||||
{
|
||||
subTiddler: this.transcludeSubTiddler,
|
||||
defaultType: this.transcludeType
|
||||
});
|
||||
return {
|
||||
text: parserInfo.text,
|
||||
type: parserInfo.type
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Get transcluded parse tree nodes as an object {text:,type:,parseTreeNodes:,parseAsInline:}
|
||||
*/
|
||||
TranscludeWidget.prototype.parseTransclusionTarget = function(parseAsInline) {
|
||||
var self = this;
|
||||
var parser;
|
||||
// Get the parse tree
|
||||
if(this.hasAttribute("$variable")) {
|
||||
|
@ -177,7 +220,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||
var variableInfo = this.getVariableInfo(this.transcludeVariable,{params: this.getOrderedTransclusionParameters()}),
|
||||
srcVariable = variableInfo && variableInfo.srcVariable;
|
||||
if(variableInfo.text) {
|
||||
if(srcVariable.isFunctionDefinition) {
|
||||
if(srcVariable && srcVariable.isFunctionDefinition) {
|
||||
var result = (variableInfo.resultList ? variableInfo.resultList[0] : variableInfo.text) || "";
|
||||
parser = {
|
||||
tree: [{
|
||||
|
@ -207,7 +250,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||
if(variableInfo.isCacheable && srcVariable[cacheKey]) {
|
||||
parser = srcVariable[cacheKey];
|
||||
} else {
|
||||
parser = this.wiki.parseText(this.transcludeType,variableInfo.text || "",{parseAsInline: parseAsInline, configTrimWhiteSpace: srcVariable.configTrimWhiteSpace});
|
||||
parser = this.wiki.parseText(this.transcludeType,variableInfo.text || "",{parseAsInline: parseAsInline, configTrimWhiteSpace: srcVariable && srcVariable.configTrimWhiteSpace});
|
||||
if(variableInfo.isCacheable) {
|
||||
srcVariable[cacheKey] = parser;
|
||||
}
|
||||
|
@ -215,7 +258,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||
}
|
||||
if(parser) {
|
||||
// Add parameters widget for procedures and custom widgets
|
||||
if(srcVariable.isProcedureDefinition || srcVariable.isWidgetDefinition) {
|
||||
if(srcVariable && (srcVariable.isProcedureDefinition || srcVariable.isWidgetDefinition)) {
|
||||
parser = {
|
||||
tree: [
|
||||
{
|
||||
|
@ -234,7 +277,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||
}
|
||||
$tw.utils.addAttributeToParseTreeNode(parser.tree[0],name,param["default"])
|
||||
});
|
||||
} else if(srcVariable.isMacroDefinition || !srcVariable.isFunctionDefinition) {
|
||||
} else if(srcVariable && !srcVariable.isFunctionDefinition) {
|
||||
// For macros and ordinary variables, wrap the parse tree in a vars widget assigning the parameters to variables named "__paramname__"
|
||||
parser = {
|
||||
tree: [
|
||||
|
@ -265,27 +308,14 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||
defaultType: this.transcludeType
|
||||
});
|
||||
}
|
||||
// Set 'thisTiddler'
|
||||
this.setVariable("thisTiddler",this.transcludeTitle);
|
||||
// Return the parse tree
|
||||
if(parser) {
|
||||
return {
|
||||
parser: parser,
|
||||
parseTreeNodes: parser.tree,
|
||||
parseAsInline: parseAsInline,
|
||||
text: parser.source,
|
||||
type: parser.type
|
||||
};
|
||||
} else {
|
||||
// If there's no parse tree then return the missing slot value
|
||||
return {
|
||||
parser: null,
|
||||
parseTreeNodes: (this.slotFillParseTrees["ts-missing"] || []),
|
||||
parseAsInline: parseAsInline,
|
||||
text: null,
|
||||
type: null
|
||||
};
|
||||
}
|
||||
return {
|
||||
parser: parser,
|
||||
parseTreeNodes: parser ? parser.tree : (this.slotFillParseTrees["ts-missing"] || []),
|
||||
parseAsInline: parseAsInline,
|
||||
text: parser && parser.source,
|
||||
type: parser && parser.type
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -182,8 +182,7 @@ Widget.prototype.getVariableInfo = function(name,options) {
|
|||
}
|
||||
return {
|
||||
text: text,
|
||||
resultList: [text],
|
||||
srcVariable: {}
|
||||
resultList: [text]
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -720,44 +719,23 @@ Widget.prototype.findFirstDomNode = function() {
|
|||
};
|
||||
|
||||
/*
|
||||
Entry into destroy procedure
|
||||
*/
|
||||
Widget.prototype.destroyChildren = function() {
|
||||
$tw.utils.each(this.children,function(childWidget) {
|
||||
childWidget.destroy();
|
||||
});
|
||||
};
|
||||
/*
|
||||
Legacy entry into destroy procedure
|
||||
Remove any DOM nodes created by this widget or its children
|
||||
*/
|
||||
Widget.prototype.removeChildDomNodes = function() {
|
||||
this.destroy();
|
||||
};
|
||||
/*
|
||||
Default destroy
|
||||
*/
|
||||
Widget.prototype.destroy = function() {
|
||||
// call children to remove their resources
|
||||
this.destroyChildren();
|
||||
// remove our resources
|
||||
this.children = [];
|
||||
this.removeLocalDomNodes();
|
||||
};
|
||||
|
||||
/*
|
||||
Remove any DOM nodes created by this widget
|
||||
*/
|
||||
Widget.prototype.removeLocalDomNodes = function() {
|
||||
// If this widget has directly created DOM nodes, delete them and exit.
|
||||
// If this widget has directly created DOM nodes, delete them and exit. This assumes that any child widgets are contained within the created DOM nodes, which would normally be the case
|
||||
if(this.domNodes.length > 0) {
|
||||
$tw.utils.each(this.domNodes,function(domNode) {
|
||||
domNode.parentNode.removeChild(domNode);
|
||||
});
|
||||
this.domNodes = [];
|
||||
} else {
|
||||
// Otherwise, ask the child widgets to delete their DOM nodes
|
||||
$tw.utils.each(this.children,function(childWidget) {
|
||||
childWidget.removeChildDomNodes();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Invoke the action widgets that are descendents of the current widget.
|
||||
*/
|
||||
|
|
|
@ -1086,7 +1086,7 @@ exports.getSubstitutedText = function(text,widget,options) {
|
|||
output = $tw.utils.replaceString(output,new RegExp("\\$" + $tw.utils.escapeRegExp(substitute.name) + "\\$","mg"),substitute.value);
|
||||
});
|
||||
// Substitute any variable references with their values
|
||||
return output.replace(/\$\((\w+)\)\$/g, function(match,varname) {
|
||||
return output.replace(/\$\(([^\)\$]+)\)\$/g, function(match,varname) {
|
||||
return widget.getVariable(varname,{defaultValue: ""})
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
code-body: yes
|
||||
title: $:/core/ui/AlertTemplate
|
||||
|
||||
\whitespace trim
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
code-body: yes
|
||||
title: $:/core/ui/EditTemplate
|
||||
|
||||
\define delete-edittemplate-state-tiddlers()
|
||||
|
|
|
@ -10,7 +10,7 @@ first-search-filter: [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]sort[d
|
|||
<em class="tc-edit tc-small-gap-right"><<lingo Type/Prompt>></em>
|
||||
<div class="tc-type-selector-dropdown-wrapper">
|
||||
<div class="tc-type-selector"><$fieldmangler>
|
||||
<$macrocall $name="keyboard-driven-input" tiddler=<<currentTiddler>> storeTitle=<<typeInputTiddler>> refreshTitle=<<refreshTitle>> selectionStateTitle=<<typeSelectionTiddler>> field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/popup/type-dropdown">> class="tc-edit-typeeditor tc-edit-texteditor tc-popup-handle" tabindex={{$:/config/EditTabIndex}} focus={{{ [{$:/config/AutoFocus}match[type]then[true]] ~[[false]] }}} cancelPopups="yes" configTiddlerFilter="[[$:/core/ui/EditTemplate/type]]" inputCancelActions=<<input-cancel-actions>>/><$button popup=<<qualify "$:/state/popup/type-dropdown">> class="tc-btn-invisible tc-btn-dropdown tc-small-gap" tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Type/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button><$button message="tm-remove-field" param="type" class="tc-btn-invisible tc-btn-icon" tooltip={{$:/language/EditTemplate/Type/Delete/Hint}} aria-label={{$:/language/EditTemplate/Type/Delete/Caption}}>{{$:/core/images/delete-button}}<$action-deletetiddler $filter="[<storeTitle>] [<refreshTitle>] [<selectionStateTitle>]"/></$button>
|
||||
<$macrocall $name="keyboard-driven-input" tiddler=<<currentTiddler>> storeTitle=<<typeInputTiddler>> refreshTitle=<<refreshTitle>> selectionStateTitle=<<typeSelectionTiddler>> field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/popup/type-dropdown">> class="tc-edit-typeeditor tc-edit-texteditor tc-popup-handle" tabindex={{$:/config/EditTabIndex}} focus={{{ [{$:/config/AutoFocus}match[type]then[true]] ~[[false]] }}} cancelPopups="yes" configTiddlerFilter="[[$:/core/ui/EditTemplate/type]]" inputCancelActions=<<input-cancel-actions>>/><$button popup=<<qualify "$:/state/popup/type-dropdown">> class="tc-btn-invisible tc-btn-dropdown tc-small-gap" tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Type/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button><$button message="tm-remove-field" param="type" class="tc-btn-invisible tc-btn-icon" tooltip={{$:/language/EditTemplate/Type/Delete/Hint}} aria-label={{$:/language/EditTemplate/Type/Delete/Caption}}>{{$:/core/images/delete-button}}<$action-deletetiddler $filter="[<typeInputTiddler>] [<storeTitle>] [<refreshTitle>] [<selectionStateTitle>]"/></$button>
|
||||
</$fieldmangler></div>
|
||||
|
||||
<div class="tc-block-dropdown-wrapper">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
title: $:/core/ui/ImportPreviews/Text
|
||||
tags: $:/tags/ImportPreview
|
||||
caption: {{$:/language/Import/Listing/Preview/Text}}
|
||||
code-body: yes
|
||||
|
||||
<$transclude tiddler=<<currentTiddler>> subtiddler=<<payloadTiddler>> mode="block"/>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
title: $:/core/ui/PageStylesheet
|
||||
code-body: yes
|
||||
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
\whitespace trim
|
||||
|
|
|
@ -2,6 +2,7 @@ title: $:/core/ui/PageTemplate
|
|||
name: {{$:/language/PageTemplate/Name}}
|
||||
description: {{$:/language/PageTemplate/Description}}
|
||||
icon: $:/core/images/layout-button
|
||||
code-body: yes
|
||||
|
||||
\whitespace trim
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
|
@ -19,7 +20,7 @@ icon: $:/core/images/layout-button
|
|||
|
||||
<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
|
||||
|
||||
<$dropzone enable=<<tv-enable-drag-and-drop>>>
|
||||
<$dropzone enable=<<tv-enable-drag-and-drop>> class="tc-dropzone tc-page-container-inner">
|
||||
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageTemplate]!has[draft.of]]" variable="listItem">
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
title: $:/core/ui/RootTemplate
|
||||
code-body: yes
|
||||
|
||||
<$transclude tiddler={{{ [{$:/layout}has[text]] ~[[$:/core/ui/PageTemplate]] }}} mode="inline"/>
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
title: $:/core/ui/StoryTiddlerTemplate
|
||||
code-body: yes
|
||||
|
||||
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/StoryTiddlerTemplateFilter]!is[draft]get[text]] :and[has[title]else[$:/core/ui/ViewTemplate]] }}} />
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
title: $:/core/ui/ViewTemplate
|
||||
code-body: yes
|
||||
|
||||
\whitespace trim
|
||||
\define folded-state()
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
title: $:/core/ui/ViewTemplate/body/default
|
||||
code-body: yes
|
||||
|
||||
<$transclude>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/library/v5.2.8/index.html
|
||||
url: https://tiddlywiki.com/library/v5.3.2/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}}
|
||||
|
||||
{{$:/language/OfficialPluginLibrary/Hint}}
|
||||
|
|
|
@ -2,7 +2,8 @@ title: $:/config/ViewTemplateBodyFilters/
|
|||
tags: $:/tags/ViewTemplateBodyFilter
|
||||
|
||||
stylesheet: [tag[$:/tags/Stylesheet]then[$:/core/ui/ViewTemplate/body/rendered-plain-text]]
|
||||
system: [prefix[$:/boot/]] [prefix[$:/config/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/core/ui/]split[/]count[]compare:number:eq[4]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/info/]] [prefix[$:/temp/]] +[!is[image]limit[1]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
core-ui-tags: [tag[$:/tags/PageTemplate]] [tag[$:/tags/EditTemplate]] [tag[$:/tags/ViewTemplate]] [tag[$:/tags/KeyboardShortcut]] [tag[$:/tags/ImportPreview]] [tag[$:/tags/EditPreview]][tag[$:/tags/EditorToolbar]] [tag[$:/tags/Actions]] :then[[$:/core/ui/ViewTemplate/body/code]]
|
||||
system: [prefix[$:/boot/]] [prefix[$:/config/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/info/]] [prefix[$:/temp/]] +[!is[image]limit[1]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
code-body: [field:code-body[yes]then[$:/core/ui/ViewTemplate/body/code]]
|
||||
import: [field:plugin-type[import]then[$:/core/ui/ViewTemplate/body/import]]
|
||||
plugin: [has[plugin-type]then[$:/core/ui/ViewTemplate/body/plugin]]
|
||||
|
|
|
@ -10,7 +10,7 @@ color:$(foregroundColor)$;
|
|||
<!-- This has no whitespace trim to avoid modifying $actions$. Closing tags omitted for brevity. -->
|
||||
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
|
||||
\whitespace trim
|
||||
<$vars
|
||||
<$let
|
||||
foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">>
|
||||
backgroundColor=<<__colour__>>
|
||||
>
|
||||
|
@ -23,6 +23,7 @@ color:$(foregroundColor)$;
|
|||
<$transclude tiddler=<<__icon__>>/>
|
||||
<$view tiddler=<<__tag__>> field="title" format="text" />
|
||||
</$element-tag$>
|
||||
</$let>
|
||||
\end
|
||||
|
||||
\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
|
||||
|
|
|
@ -7,7 +7,7 @@ tags: $:/tags/Macro
|
|||
|
||||
\define toc-caption()
|
||||
\whitespace trim
|
||||
<span class="tc-toc-caption">
|
||||
<span class="tc-toc-caption tc-tiny-gap-left">
|
||||
<$set name="tv-wikilinks" value="no">
|
||||
<$transclude field="caption">
|
||||
<$view field="title"/>
|
||||
|
@ -145,7 +145,7 @@ tags: $:/tags/Macro
|
|||
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
|
||||
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item-selected" value="toc-item">
|
||||
<li class=<<toc-item-class>>>
|
||||
<$list filter="[all[current]tagging[]$sort$limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <$view field='caption'><$view field='title'/></$view>">
|
||||
<$list filter="[all[current]tagging[]$sort$limit[1]]" variable="ignore" emptyMessage="""<$button class="tc-btn-invisible">{{$:/core/images/blank}}</$button><span class="toc-item-muted"><<toc-caption>></span>""">
|
||||
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
||||
<$transclude tiddler=<<toc-closed-icon>> />
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
title: $:/tags/ViewTemplateBodyFilter
|
||||
list: $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/stylesheet $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/default
|
||||
|
||||
list: $:/config/ViewTemplateBodyFilters/hide-body $:/config/ViewTemplateBodyFilters/code-body $:/config/ViewTemplateBodyFilters/stylesheet $:/config/ViewTemplateBodyFilters/core-ui-advanced-search $:/config/ViewTemplateBodyFilters/core-ui-tags $:/config/ViewTemplateBodyFilters/system $:/config/ViewTemplateBodyFilters/import $:/config/ViewTemplateBodyFilters/plugin $:/config/ViewTemplateBodyFilters/default
|
|
@ -3,7 +3,7 @@
|
|||
{
|
||||
"file": "../../../tw5.com/tiddlers/images/New Release Banner.png",
|
||||
"fields": {
|
||||
"type": "image/jpg",
|
||||
"type": "image/jpeg",
|
||||
"title": "New Release Banner",
|
||||
"tags": "picture"
|
||||
}
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
created: 20141122200310516
|
||||
modified: 20201213161842776
|
||||
modified: 20230923031318421
|
||||
tags: Mechanisms
|
||||
title: HookMechanism
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The hook mechanism provides a way for plugins to intercept and modify default functionality. Hooks are added as follows:
|
||||
The hook mechanism provides a way for plugins to intercept and modify default functionality.
|
||||
|
||||
!! Add a hook
|
||||
|
||||
Hooks are added as follows:
|
||||
|
||||
```js
|
||||
/*
|
||||
|
@ -13,6 +18,8 @@ handler: function to be called when hook is invoked
|
|||
$tw.hooks.addHook(name,handler);
|
||||
```
|
||||
|
||||
!!! Params and return
|
||||
|
||||
The handler function will be called with parameters that depend on the specific hook in question, but they always follow the pattern `handler(value,params...)`
|
||||
|
||||
* ''value'': an optional value that is to be transformed by the hook function
|
||||
|
@ -20,11 +27,29 @@ The handler function will be called with parameters that depend on the specific
|
|||
|
||||
If required by the hook in question, the handler function must return the modified ''value''.
|
||||
|
||||
!!! Multiple handlers
|
||||
|
||||
Multiple handlers can be assigned to the same name using repeated calls. When a hook is invoked by name all registered functions will be called sequentially in their order of addition.
|
||||
|
||||
Note that the ''value'' passed to the subsequent hook function will be the return value of the previous hook function.
|
||||
|
||||
Though not essential care should be taken to ensure that hooks are added before they are invoked. For example: [[Hook: th-opening-default-tiddlers-list]] should ideally be added before the story startup module is invoked otherwise any hook specified additions to the default tiddlers will not be seen on the initial loading of the page, though will be visible if the user clicks the home button.
|
||||
Be careful not to `addHook` in widget's `render` method, which will be call several times. You could `addHook` in methods that only called once, e.g. the constructor of widget class. Otherwise you should `removeHook` then add it again.
|
||||
|
||||
!!! Timing of registration
|
||||
|
||||
Though not essential care should be taken to ensure that hooks are added before they are invoked.
|
||||
|
||||
For example: [[Hook: th-opening-default-tiddlers-list]] should ideally be added before the story startup module is invoked. Otherwise any hook specified additions to the default tiddlers will not be seen on the initial loading of the page, though will be visible if the user clicks the home button.
|
||||
|
||||
!! Remove a hook
|
||||
|
||||
You should clean up the callback when your widget is going to unmount.
|
||||
|
||||
```js
|
||||
$tw.hooks.removeHook(handler)
|
||||
```
|
||||
|
||||
The `handler` should be the same function instance you used in `addHook` (check by `===`). You can save it to `this.xxxHookHandler` on your widget, and call `removeHook` in [[destroy method|Widget `destroy` method examples]].
|
||||
|
||||
!! Example
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
"empty": [
|
||||
"--render","$:/core/save/all","empty.html","text/plain",
|
||||
"--render","$:/core/save/all","empty.hta","text/plain"],
|
||||
"emptyexternalcore": [
|
||||
"--render","$:/core/save/offline-external-js","empty-external-core.html","text/plain",
|
||||
"--render","$:/core/templates/tiddlywiki5.js","[[tiddlywikicore-]addsuffix<version>addsuffix[.js]]","text/plain"],
|
||||
"externalimages": [
|
||||
"--savetiddlers","[is[image]]","images",
|
||||
"--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
|
||||
|
@ -20,7 +23,7 @@
|
|||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
],
|
||||
"library": [
|
||||
"--makelibrary","$:/UpgradeLibrary",
|
||||
"--savelibrarytiddlers","$:/UpgradeLibrary","[prefix[$:/]] -[[$:/plugins/tiddlywiki/upgrade]] -[[$:/plugins/tiddlywiki/translators]] -[[$:/plugins/tiddlywiki/pluginlibrary]] -[[$:/plugins/tiddlywiki/jasmine]]","recipes/library/tiddlers/","$:/UpgradeLibrary/List",
|
||||
"--savetiddler","$:/UpgradeLibrary/List","recipes/library/tiddlers.json",
|
||||
"--savelibrarytiddlers","$:/UpgradeLibrary","[prefix[$:/]] -[[$:/plugins/tiddlywiki/upgrade]] -[[$:/plugins/tiddlywiki/translators]] -[[$:/plugins/tiddlywiki/pluginlibrary]] -[[$:/plugins/tiddlywiki/jasmine]]","recipes/library/tiddlers/","$:/UpgradeLibrary/List",
|
||||
"--savetiddler","$:/UpgradeLibrary/List","recipes/library/tiddlers.json",
|
||||
"--rendertiddler","$:/plugins/tiddlywiki/pluginlibrary/library.template.html","index.html","text/plain"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
caption: 5.3.2
|
||||
created: 20230820114855583
|
||||
modified: 20230820114855583
|
||||
tags: ReleaseNotes
|
||||
title: Release 5.3.2
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.3.1...master]]//
|
||||
|
||||
! Translation improvement
|
||||
|
||||
Improvements to the following translations:
|
||||
|
||||
*
|
||||
|
||||
! Widget Improvements
|
||||
|
||||
*
|
||||
|
||||
! Hackability Improvements
|
||||
|
||||
*
|
||||
|
||||
! Bug Fixes
|
||||
|
||||
*
|
||||
|
||||
! Node.js Improvements
|
||||
|
||||
*
|
||||
|
||||
! Developer Improvements
|
||||
|
||||
*
|
||||
|
||||
! Acknowledgements
|
||||
|
||||
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
|
||||
|
||||
<<.contributors """
|
||||
AnthonyMuscio
|
||||
btheado
|
||||
catter-fly
|
||||
cmo-pomerium
|
||||
CrossEye
|
||||
flibbles
|
||||
hffqyd
|
||||
lilscribby
|
||||
linonetwo
|
||||
Marxsal
|
||||
mateuszwilczek
|
||||
pille1842
|
||||
pmario
|
||||
rmunn
|
||||
saqimtiaz
|
||||
stevesunypoly
|
||||
TiddlyTweeter
|
||||
twMat
|
||||
yaisog
|
||||
""">>
|
|
@ -1,6 +1,6 @@
|
|||
title: $:/config/LocalPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: http://127.0.0.1:8080/prerelease/library/v5.2.2/index.html
|
||||
url: http://127.0.0.1:8080/prerelease/library/v5.3.2/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease Local)
|
||||
|
||||
A locally installed version of the official ~TiddlyWiki plugin library at tiddlywiki.com for testing and debugging. //Requires a local web server to share the library//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.2.8/index.html
|
||||
url: https://tiddlywiki.com/prerelease/library/v5.3.2/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease)
|
||||
|
||||
The prerelease version of the official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
title: TiddlyWiki Pre-release
|
||||
modified: 20150428204930183
|
||||
modified: 20230731122156493
|
||||
|
||||
This is a pre-release build of TiddlyWiki provided for testing and review purposes. ''Please don't try to depend on the pre-release for anything important'' -- you should use the latest official release from https://tiddlywiki.com.
|
||||
|
||||
|
|
|
@ -20,4 +20,4 @@
|
|||
"favicon": [
|
||||
"--savetiddler","$:/favicon.ico","favicon.ico"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"],
|
||||
"tiddlywikicore": [
|
||||
"--render","$:/core/templates/tiddlywiki5.js","[[tiddlywikicore-]addsuffix<version>addsuffix[.js]]","text/plain"]
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
title: Functions/Function/Indented
|
||||
description: Indented function definition
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\function .dividebysomething(factor:0.5)
|
||||
[divide<factor>]
|
||||
\end
|
||||
|
||||
\function multiplebysomething(first:ignored,factor:2)
|
||||
[multiply<factor>multiply[2].dividebysomething[0.25]]
|
||||
\end
|
||||
|
||||
<$text text={{{ [[4]function[multiplebysomething]] }}}/>
|
||||
|
|
||||
<$text text={{{ [[6]function[multiplebysomething],[ignored],[4]] }}}/>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>64|192</p>
|
|
@ -33,4 +33,4 @@ $param$ with a ''buffalo''
|
|||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Going to lunch with a ''buffalo''</p><p>Going to breakfastwith a<strong>buffalo</strong></p><p>Going to dinner with a <strong>buffalo</strong></p>Going to lunch with a buffalo with a buffaloGoing to dinner with a buffalo
|
||||
<p>Going to lunch with a ''buffalo''</p><p>Going to breakfastwith a<strong>buffalo</strong></p><p>Going to dinner with a <strong>buffalo</strong></p>Going to lunch with a ''buffalo''Going to breakfastwith abuffaloGoing to dinner with a buffalo
|
|
@ -0,0 +1,23 @@
|
|||
title: ImportVariables/WithSetWidgets
|
||||
description: Import variables defined with a set widget
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\import Definitions
|
||||
<$text text=<<one>>/>,
|
||||
<$text text=<<two>>/>
|
||||
+
|
||||
title: Definitions
|
||||
|
||||
\whitespace trim
|
||||
<$set name="one" value="elephant">
|
||||
<$set name="two" value="giraffe">
|
||||
</$set>
|
||||
</$set>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>elephant,giraffe</p>
|
|
@ -0,0 +1,22 @@
|
|||
title: ImportVariables/WithSetWidgets2
|
||||
description: Import variables defined with a set widget without whitespace pragma
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\import Definitions
|
||||
<$text text=<<one>>/>,
|
||||
<$text text=<<two>>/>
|
||||
+
|
||||
title: Definitions
|
||||
|
||||
<$set name="one" value="elephant">
|
||||
<$set name="two" value="giraffe">
|
||||
</$set>
|
||||
</$set>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>elephant,giraffe</p>
|
|
@ -0,0 +1,29 @@
|
|||
title: ImportVariables/WithSetWidgetsAndMacros
|
||||
description: Import variables defined with a set widget without whitespace pragma
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\import Definitions
|
||||
<$text text=<<name>>/>,
|
||||
<$text text=<<address>>/>,
|
||||
<$text text=<<one>>/>,
|
||||
<$text text=<<two>>/>
|
||||
+
|
||||
title: Definitions
|
||||
|
||||
\define name() Bugs Bunny
|
||||
\procedure address()
|
||||
Bunny Hill
|
||||
\end
|
||||
|
||||
<$set name="one" value="elephant">
|
||||
<$set name="two" value="giraffe">
|
||||
</$set>
|
||||
</$set>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Bugs Bunny,Bunny Hill,elephant,giraffe</p>
|
|
@ -0,0 +1,20 @@
|
|||
title: Procedures/Nested/Indented
|
||||
description: Nested Procedures that are indented
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\procedure alpha(x)
|
||||
\procedure beta(y)
|
||||
<$text text=<<y>>/>
|
||||
\end beta
|
||||
<$transclude $variable="beta" y={{{ [<x>addprefix<x>] }}}/>
|
||||
\end alpha
|
||||
|
||||
<<alpha "Elephant">>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>ElephantElephant</p>
|
|
@ -0,0 +1,22 @@
|
|||
title: Procedures/TrailingNewlines
|
||||
description: Trailing newlines in procedures must not be dropped
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\procedure inner()
|
||||
Paragraph 1
|
||||
|
||||
Paragraph 2
|
||||
\end
|
||||
\procedure outer()
|
||||
<$macrocall $name=inner />
|
||||
|
||||
\end
|
||||
<<outer>>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Paragraph 1</p><p>Paragraph 2</p>
|
|
@ -0,0 +1,33 @@
|
|||
title: Transclude/CustomWidget/Simple/Indented
|
||||
description: Custom widget definition indented
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$transclude $tiddler='TiddlerOne' one='Ferret'>
|
||||
</$transclude>
|
||||
+
|
||||
title: TiddlerOne
|
||||
|
||||
\whitespace trim
|
||||
<!-- Define the <$my.widget> widget by defining a transcludable variable with that name -->
|
||||
\widget $my.widget(one:'Jaguar')
|
||||
\whitespace trim
|
||||
<$text text=<<one>>/>
|
||||
<$slot $name="ts-raw">
|
||||
Whale
|
||||
</$slot>
|
||||
\end
|
||||
<$my.widget one="Dingo">
|
||||
Crocodile
|
||||
</$my.widget>
|
||||
<$my.widget one="BumbleBee">
|
||||
Squirrel
|
||||
</$my.widget>
|
||||
<$my.widget/>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>DingoCrocodileBumbleBeeSquirrelJaguarWhale</p>
|
|
@ -0,0 +1,20 @@
|
|||
title: Transclude/Parameterised/Shortcut/ParametersIndented
|
||||
description: Simple parameterised transclusion using the parameters pragma (indented)
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$transclude $tiddler='TiddlerOne' one='Ferret'/>
|
||||
<$transclude $tiddler='TiddlerOne'/>
|
||||
+
|
||||
title: TiddlerOne
|
||||
|
||||
\whitespace trim
|
||||
\parameters(one:'Jaguar')
|
||||
<$text text=<<one>>/>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>FerretJaguar</p>
|
|
@ -0,0 +1,26 @@
|
|||
title: Procedures/Double/Underscore
|
||||
description: Checking that procedures don't expose parameters as variables wrapped in double underscores
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
\procedure mamacro(one:"red",two:"green")
|
||||
It is $one$ and $two$<<__one__>><<__two__>>.
|
||||
\end
|
||||
|
||||
<$macrocall $name="mamacro"/>
|
||||
|
||||
<$transclude $variable="mamacro"/>
|
||||
|
||||
<$transclude $variable="mamacro" one="orange"/>
|
||||
|
||||
<$transclude $variable="mamacro" 0="pink"/>
|
||||
|
||||
<$transclude $variable="mamacro" one="purple" 1="pink"/>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p><p>It is $one$ and $two$.</p>
|
|
@ -6,14 +6,16 @@ tags: [[$:/tags/wiki-test-spec]]
|
|||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$let project="TiddlyWiki" disabled="true">
|
||||
<$set name="var with spaces" value="spaces">
|
||||
<$let project="TiddlyWiki" disabled="true" var-with-dashes="dashes">
|
||||
<div class=`$(project)$
|
||||
${ [[Hello]addsuffix[There]] }$` attrib=`myvalue` otherattrib=`$(1)$` blankattrib=`` quoted="here" disabled=```$(disabled)$```>
|
||||
${ [[Hello]addsuffix[There]] }$` attrib=`myvalue` otherattrib=`$(1)$` blankattrib=`` quoted="here" disabled=```$(disabled)$``` dashes=`$(var-with-dashes)$` spaces=`$(var with spaces)$`>
|
||||
</div>
|
||||
</$let>
|
||||
</$set>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p><div attrib="myvalue" blankattrib="" class="TiddlyWiki
|
||||
HelloThere" disabled="true" otherattrib="" quoted="here"></div></p>
|
||||
HelloThere" dashes="dashes" disabled="true" otherattrib="" quoted="here" spaces="spaces"></div></p>
|
|
@ -397,8 +397,8 @@ Tests the filtering mechanism.
|
|||
expect(wiki.filterTiddlers("[all[shadows]tag[two]]").join(",")).toBe("$:/TiddlerFive");
|
||||
expect(wiki.filterTiddlers("[all[shadows+tiddlers]tag[two]]").join(",")).toBe("$:/TiddlerFive,$:/TiddlerTwo,Tiddler Three");
|
||||
expect(wiki.filterTiddlers("[all[tiddlers+shadows]tag[two]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three,$:/TiddlerFive");
|
||||
expect(wiki.filterTiddlers("[all[shadows+tiddlers]]").join(",")).toBe("$:/TiddlerFive,TiddlerSix,TiddlerSeventh,Tiddler8,$:/ShadowPlugin,$:/TiddlerTwo,a fourth tiddler,filter regexp test,has filter,hasList,one,Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[all[tiddlers+shadows]]").join(",")).toBe("$:/ShadowPlugin,$:/TiddlerTwo,a fourth tiddler,filter regexp test,has filter,hasList,one,Tiddler Three,TiddlerOne,$:/TiddlerFive,TiddlerSix,TiddlerSeventh,Tiddler8");
|
||||
expect(wiki.filterTiddlers("[all[shadows+tiddlers]]").join(",")).toBe("$:/TiddlerFive,Tiddler8,TiddlerSeventh,TiddlerSix,$:/ShadowPlugin,$:/TiddlerTwo,a fourth tiddler,filter regexp test,has filter,hasList,one,Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[all[tiddlers+shadows]]").join(",")).toBe("$:/ShadowPlugin,$:/TiddlerTwo,a fourth tiddler,filter regexp test,has filter,hasList,one,Tiddler Three,TiddlerOne,$:/TiddlerFive,Tiddler8,TiddlerSeventh,TiddlerSix");
|
||||
expect(wiki.filterTiddlers("[all[tiddlers]tag[two]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three");
|
||||
expect(wiki.filterTiddlers("[all[orphans+tiddlers+tags]]").join(",")).toBe("$:/ShadowPlugin,$:/TiddlerTwo,a fourth tiddler,filter regexp test,has filter,hasList,Tiddler Three,TiddlerOne,two,one");
|
||||
});
|
||||
|
@ -420,10 +420,10 @@ Tests the filtering mechanism.
|
|||
|
||||
it("should handle the tagging operator", function() {
|
||||
expect(wiki.filterTiddlers("[[one]tagging[]sort[title]]").join(",")).toBe("Tiddler Three,Tiddler8,TiddlerOne,TiddlerSeventh");
|
||||
expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne,TiddlerSeventh,Tiddler8");
|
||||
expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne,Tiddler8,TiddlerSeventh");
|
||||
expect(wiki.filterTiddlers("[[two]tagging[]sort[title]]").join(",")).toBe("$:/TiddlerFive,$:/TiddlerTwo,Tiddler Three");
|
||||
var fakeWidget = {wiki: wiki, getVariable: function(name) {return name === "currentTiddler" ? "one": undefined;}};
|
||||
expect(wiki.filterTiddlers("[all[current]tagging[]]",fakeWidget).join(",")).toBe("Tiddler Three,TiddlerOne,TiddlerSeventh,Tiddler8");
|
||||
expect(wiki.filterTiddlers("[all[current]tagging[]]",fakeWidget).join(",")).toBe("Tiddler Three,TiddlerOne,Tiddler8,TiddlerSeventh");
|
||||
});
|
||||
|
||||
it("should handle the untagged operator", function() {
|
||||
|
|
|
@ -527,6 +527,29 @@ describe("Widget module", function() {
|
|||
expect(wrapper.children[0].children[15].sequenceNumber).toBe(53);
|
||||
});
|
||||
|
||||
var testCounterLast = function(oldList, newList) {
|
||||
return function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
// Add some tiddlers
|
||||
wiki.addTiddler({title: "Numbers", text: "", list: oldList});
|
||||
var text = "<$list filter='[list[Numbers]]' variable='item' counter='c'><<item>><$text text={{{ [<c-last>match[no]then[, ]] }}} /></$list>";
|
||||
var widgetNode = createWidgetNode(parseText(text,wiki),wiki);
|
||||
// Render the widget node to the DOM
|
||||
var wrapper = renderWidgetNode(widgetNode);
|
||||
// Test the rendering
|
||||
expect(wrapper.innerHTML).toBe("<p>" + oldList.split(' ').join(', ') + "</p>");
|
||||
// Append a number
|
||||
wiki.addTiddler({title: "Numbers", text: "", list: newList});
|
||||
refreshWidgetNode(widgetNode,wrapper,["Numbers"]);
|
||||
expect(wrapper.innerHTML).toBe("<p>" + newList.split(' ').join(', ') + "</p>");
|
||||
}
|
||||
}
|
||||
|
||||
it("the list widget with counter-last should update correctly when list is appended", testCounterLast("1 2 3 4", "1 2 3 4 5"));
|
||||
it("the list widget with counter-last should update correctly when last item is removed", testCounterLast("1 2 3 4", "1 2 3"));
|
||||
it("the list widget with counter-last should update correctly when first item is inserted", testCounterLast("1 2 3 4", "0 1 2 3 4"));
|
||||
it("the list widget with counter-last should update correctly when first item is removed", testCounterLast("1 2 3 4", "2 3 4"));
|
||||
|
||||
it("should deal with the list widget followed by other widgets", function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
// Add some tiddlers
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
"static": [
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
},
|
||||
"config": {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
created: 20140129085406905
|
||||
modified: 20210106151027268
|
||||
modified: 20230805140720289
|
||||
tags: [[Other Resources]] Articles
|
||||
title: "TiddlyWiki Posts" by Jeffrey Kishner
|
||||
type: text/vnd.tiddlywiki
|
||||
url: http://blog.jeffreykishner.com/tiddlywiki/
|
||||
url: https://web.archive.org/web/20221015011644/http://blog.jeffreykishner.com/tiddlywiki/
|
||||
|
||||
A collection of articles covering integration with Fargo, Font Awesome and Google Calendar, and tips for managing task lists.
|
||||
A collection of articles covering integration with Fargo, Font Awesome and Google Calendar, and tips for managing task lists. The original site is missing, but a link to an archive is provided.
|
||||
|
||||
{{!!url}}
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@ url: https://ibnishak.github.io/Timimi/
|
|||
|
||||
Timimi is a web-extension accompanied by a native host that allows you to save and backup your standalone HTML tiddlywiki files ''anywhere in your hard-drive''. Once installed, you can save the tiddlywiki files without any extra steps, like the original Tiddlyfox addon.
|
||||
|
||||
* The native host requires a component installed on the host computer, outside the browser.
|
||||
|
||||
{{!!url}}
|
||||
|
||||
As of version 2.1, Timimi supports the following browsers
|
||||
|
@ -29,4 +31,4 @@ Timimi also provides users with 4 backup strategies, viz:
|
|||
* Create a backup Every n^^th^^ save
|
||||
* Create a backup every n^^th^^ minute
|
||||
* Customised Tower of Hanoi
|
||||
* First in First Out
|
||||
* First in First Out
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
created: 20201117163027900
|
||||
modified: 20210106151027459
|
||||
modified: 20230723074506632
|
||||
tags: Tutorials
|
||||
title: GitHub Saver Tutorial by Mohammad
|
||||
type: text/vnd.tiddlywiki
|
||||
url: https://kookma.github.io/TW5-GitHub-Saver/
|
||||
|
||||
GitHub Saver is a step by step tutorial shows how to integrate Tiddlywiki 5 and GitHub Pages to create websites hosted on https://github.com/.
|
||||
GitHub Saver is a step by step tutorial that shows how to integrate Tiddlywiki 5 and ~GitHub Pages to create websites hosted on https://github.com/.
|
||||
|
||||
{{!!url}}
|
||||
|
||||
|
@ -13,11 +13,11 @@ This instruction is based on Tiddlywiki single html file model, while it can use
|
|||
|
||||
!! Other tutorials
|
||||
|
||||
;Tiddlywiki, Travis-CI and GitHub Pages
|
||||
;Tiddlywiki, Travis-CI and ~GitHub Pages
|
||||
:https://kookma.github.io/Tiddlywiki-Travis-CI/
|
||||
:This wiki shows how to set up websites hosted on [[GitHub Pages|https://pages.github.com/]] using [[Travis-CI|https://travis-ci.org]] and [[Tiddlywiki 5|https://tiddlywiki.com]] on Node.js.
|
||||
|
||||
|
||||
;Tiddlywiki and GitHub Pages
|
||||
;Tiddlywiki and ~GitHub Pages
|
||||
:https://kookma.github.io/Tiddlywiki-and-GitHub-Pages/
|
||||
:This instruction is based on local edit, save and push to GitHub. It does NOT use the new GitHub Saver mechanism (requires TW 5.1.20+) which lets edit and save directly from Tiddlywiki!
|
||||
:This instruction is based on local edit, save and push to ~GitHub. It does NOT use the new ~GitHub Saver mechanism (requires TW 5.1.20+) which lets edit and save directly from Tiddlywiki!
|
|
@ -1,16 +0,0 @@
|
|||
created: 20140312085406905
|
||||
modified: 20140312084543862
|
||||
tags: Tutorials
|
||||
title: "Install and run TiddlyWiki on a CentOS 6 VPS using Nginx" from RoseHosting
|
||||
type: text/vnd.tiddlywiki
|
||||
url: http://www.rosehosting.com/blog/install-and-run-tiddlywiki-on-a-centoos-6-vps-using-nginx/
|
||||
|
||||
A step by step guide to running TiddlyWiki on a ~CentOS Virtual Private Server.
|
||||
|
||||
{{!!url}}
|
||||
|
||||
<<<
|
||||
In this tutorial we will guide you through the steps of installing and running TiddlyWiki on a ~CentOS 6 VPS.
|
||||
|
||||
We will also install and configure Nginx as a reverse proxy, so you can run TiddlyWiki behind Nginx.
|
||||
<<<
|
|
@ -0,0 +1,9 @@
|
|||
created: 20230723073000469
|
||||
modified: 20230723073046462
|
||||
tags: Definitions
|
||||
title: Git
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
>Git (/ɡɪt/) is a distributed version control system that tracks changes in any set of computer files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different computers).
|
||||
>
|
||||
>https://en.wikipedia.org/wiki/Git
|
|
@ -1,13 +1,15 @@
|
|||
created: 20140910212609354
|
||||
modified: 20190408173002622
|
||||
modified: 20230723074351846
|
||||
tags: Definitions
|
||||
title: GitHub
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
GitHub is a hosting service for distributed projects that use git as their version-control system. It allows free hosting and management of open-source projects and facilitates collaborative development on the source code. Using GitHub for non-open-source endeavours requires additional fees.
|
||||
GitHub is a hosting service for distributed projects that use git as their version-control system. It allows free hosting and management of open-source projects and facilitates collaborative development on the source code. Using ~GitHub for non-open-source endeavours requires additional fees.
|
||||
|
||||
The code and documentation of TiddlyWiki is hosted on GitHub at:
|
||||
The code and documentation of TiddlyWiki is hosted on ~GitHub at:
|
||||
|
||||
https://github.com/Jermolene/TiddlyWiki5
|
||||
|
||||
GitHub also offer a free web hosting service called [[GitHub Pages|https://pages.github.com/]] that can be used directly from the single file configuration. See [[Saving to a Git service]].
|
||||
~GitHub also offer a free web hosting service called [[GitHub Pages|https://pages.github.com/]] that can be used directly from the single file configuration. See [[Saving to a Git service]].
|
||||
|
||||
An alternative to ~GitHub is GitLab
|
|
@ -0,0 +1,13 @@
|
|||
created: 20230723072527781
|
||||
modified: 20230723073955715
|
||||
tags: Definitions
|
||||
title: GitLab
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
>GitLab Inc. is an open-core company that operates ~GitLab, a ~DevOps software package which can develop, secure, and operate software. The open source software project was created by Ukrainian developer Dmytro Zaporozhets and Dutch developer Sytse Sijbrandij
|
||||
>
|
||||
>https://en.wikipedia.org/wiki/GitLab
|
||||
|
||||
Both GitLab and GitHub use [[Git]] a distributed version control system, that can be used to store, view and edit TiddlyWiki wikis using [[GitLab Pages|https://docs.gitlab.com/ee/user/project/pages/]]
|
||||
|
||||
Learn more at: [[Saving to a Git service]]
|
|
@ -1,6 +1,8 @@
|
|||
caption: Fourth-Caption
|
||||
created: 20150221194405000
|
||||
modified: 20211114013601188
|
||||
tags: Contents [[Table-of-Contents Demonstrations]]
|
||||
title: Fourth
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.toc-lorem>>
|
||||
|
|
|
@ -2,5 +2,15 @@ created: 20150221194423000
|
|||
modified: 20211114013601189
|
||||
tags: SecondThree [[Table-of-Contents Demonstrations]]
|
||||
title: SecondThreeThree
|
||||
toc-link: no
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
''Important''
|
||||
|
||||
It's important that this tiddler has no "child" to be able to visually test every possible toc code-path.
|
||||
|
||||
* This tiddler has a field ''toc-link: no''
|
||||
* Do not tag any other tiddler with the title of this one
|
||||
|
||||
|
||||
|
||||
<<.toc-lorem>>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
caption: Third-Caption
|
||||
created: 20150221194436000
|
||||
list: ThirdOne ThirdTwo ThirdThree
|
||||
modified: 20211114013601191
|
||||
tags: Contents [[Table-of-Contents Demonstrations]]
|
||||
title: Third
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.toc-lorem>>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
created: 20230627093650105
|
||||
modified: 20230627094356394
|
||||
tags: Features
|
||||
title: Deserializers
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Deserializer [[modules|Modules]] parse text in various formats into their JSON representation as tiddlers. The deserializer modules available in a wiki can be seen using the [[deserializers operator|deserializers Operator]] and can be used with the [[deserialize Operator]].
|
||||
|
||||
The TiddlyWiki core provides the following deserializers:
|
||||
|
||||
|!Deserializer |!Description |
|
||||
|(DOM)|Extracts tiddlers from a DOM node, should not be used with the <<.op deserialize[]>> operator |
|
||||
|application/javascript|Parses a JavaScript module as a tiddler extracting fields from the header comment|
|
||||
|application/json|Parses [[JSON|JSON in TiddlyWiki]] into tiddlers|
|
||||
|application/x-tiddler|Parses the [[.tid file format|TiddlerFiles]] as a tiddler|
|
||||
|application/x-tiddler-html-div|Parses the [[<DIV>.tiddler file format|TiddlerFiles]] as a tiddler|
|
||||
|application/x-tiddlers|Parses the [[MultiTiddlerFile format|MultiTiddlerFiles]] as tiddlers|
|
||||
|text/css|Parses CSS as a tiddler extracting fields from the header comment|
|
||||
|text/html|Parses an HTML file into tiddlers. Supports ~TiddlyWiki Classic HTML files, ~TiddlyWiki5 HTML files and ordinary HTML files|
|
||||
|text/plain|Parses plain text as a tiddler|
|
|
@ -1,7 +1,7 @@
|
|||
caption: deserialize
|
||||
created: 20230601195749377
|
||||
from-version: 5.3.0
|
||||
modified: 20230602105513132
|
||||
modified: 20230627094109762
|
||||
op-input: a selection of strings
|
||||
op-output: JSON representations of tiddlers extracted from input titles.
|
||||
op-parameter: the deserializer module to be used to extract tiddlers from the input
|
||||
|
@ -10,17 +10,8 @@ tags: [[Filter Operators]] [[Special Operators]]
|
|||
title: deserialize Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.tip "Deserializer modules parse text in various formats into their JSON representation as tiddlers. You can see the deserializers available in a wiki using the [[deserializers operator|deserializers Operator]].">>
|
||||
{{Deserializers}}
|
||||
|
||||
|
||||
|!Deserializer |!Description |
|
||||
|(DOM)|Extracts tiddlers from a DOM node, should not be used with the <<.op deserialize[]>> operator |
|
||||
|application/javascript|Parses a JavaScript module as a tiddler extracting fields from the header comment|
|
||||
|application/json|Parses [[JSON|JSON in TiddlyWiki]] into tiddlers|
|
||||
|application/x-tiddler|Parses the [[.tid file format|TiddlerFiles]] as a tiddler|
|
||||
|application/x-tiddler-html-div|Parses the [[<DIV>.tiddler file format|TiddlerFiles]] as a tiddler|
|
||||
|application/x-tiddlers|Parses the [[MultiTiddlerFile format|MultiTiddlerFiles]] as tiddlers|
|
||||
|text/css|Parses CSS as a tiddler extracting fields from the header comment|
|
||||
|text/html|Parses an HTML file into tiddlers. Supports ~TiddlyWiki Classic HTML files, ~TiddlyWiki5 HTML files and ordinary HTML files|
|
||||
|text/plain|Parses plain text as a tiddler|
|
||||
|
||||
<<.operator-examples "deserialize">>
|
|
@ -1,14 +1,14 @@
|
|||
caption: deserializers
|
||||
created: 20210506115203172
|
||||
from-version: 5.2.0
|
||||
modified: 20210506130322593
|
||||
modified: 20230627094238610
|
||||
op-input: ignored
|
||||
op-output: the title of each available deserializer
|
||||
op-parameter: none
|
||||
tags: [[Filter Operators]] [[Special Operators]] [[Selection Constructors]]
|
||||
tags: [[Filter Operators]] [[Special Operators]] [[Selection Constructors]]
|
||||
title: deserializers Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.tip "You can specify a specific deserializer for a DropzoneWidget to use">>
|
||||
<<.tip "You can specify a specific [[deserializer|Deserializers]] for a DropzoneWidget to use">>
|
||||
|
||||
<<.operator-examples "deserializers">>
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
created: 20171029155046637
|
||||
modified: 20171029155227382
|
||||
tags: [[Operator Examples]] [[stringify Operator]]
|
||||
title: jsonstringify Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-example 1 """[[Title with "double quotes" and single ' and \backslash]] +[jsonstringify[]]""">>
|
||||
<<.operator-example 2 """[[Accents and emojis -> äñøßπ ⌛🎄🍪🍓 without suffix]] +[jsonstringify[]]""">>
|
||||
<<.operator-example 3 """[[Accents and emojis -> äñøßπ ⌛🎄🍪🍓 with rawunicode suffix]] +[jsonstringify:rawunicode[]]""">>
|
|
@ -1,9 +1,9 @@
|
|||
created: 20161017154944352
|
||||
modified: 20171029155233487
|
||||
modified: 20230919124059118
|
||||
tags: [[Operator Examples]] [[stringify Operator]]
|
||||
title: stringify Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-example 1 """[[Title with "double quotes" and single ' and \backslash]] +[stringify[]]""">>
|
||||
<<.operator-example 2 """[[Accents and emojis -> äñøßπ ⌛🎄🍪🍓 without suffix]] +[stringify[]]""">>
|
||||
<<.operator-example 3 """[[Accents and emojis -> äñøßπ ⌛🎄🍪🍓 with rawunicode suffix]] +[stringify:rawunicode[]]""">>
|
||||
<<.operator-example 3 """[[Accents and emojis -> äñøßπ ⌛🎄🍪🍓 with rawunicode suffix]] +[stringify:rawunicode[]]""">>
|
|
@ -1,36 +1,12 @@
|
|||
caption: jsonstringify
|
||||
created: 20171029155051467
|
||||
from-version: 5.1.14
|
||||
modified: 20171029155143797
|
||||
op-input: a [[selection of titles|Title Selection]]
|
||||
op-output: the input with JSON string encodings applied
|
||||
modified: 20230919124826880
|
||||
op-parameter:
|
||||
op-parameter-name:
|
||||
op-purpose: apply JSON string encoding to a string
|
||||
op-suffix: <<.from-version "5.1.23">> optionally, the keyword `rawunicode`
|
||||
op-purpose: deprecated, use <<.olink stringify>> instead
|
||||
op-suffix-name: R
|
||||
tags: [[Filter Operators]] [[String Operators]]
|
||||
title: jsonstringify Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The following substitutions are made:
|
||||
|
||||
|!Character |!Replacement |!Condition |
|
||||
|`\` |`\\` |Always |
|
||||
|`"` |`\"` |Always |
|
||||
|Carriage return (0x0d) |`\\r` |Always |
|
||||
|Line feed (0x0a) |`\\n` |Always |
|
||||
|Backspace (0x08) |`\\b` |Always |
|
||||
|Form field (0x0c) |`\\f` |Always |
|
||||
|Tab (0x09) |`\\t` |Always |
|
||||
|Characters from 0x00 to 0x1f |`\\u####` where #### is four hex digits |Always |
|
||||
|Characters from 0x80 to 0xffff|`\\u####` where #### is four hex digits |If `rawunicode` suffix is not present (default) |
|
||||
|Characters from 0x80 to 0xffff|Unchanged |If `rawunicode` suffix is present <<.from-version "5.1.23">> |
|
||||
|
||||
<<.from-version "5.1.23">> If the suffix `rawunicode` is present, Unicode characters above 0x80 (such as ß, ä, ñ or 🎄) will be passed through unchanged. Without the suffix, they will be substituted with `\\u` codes, which was the default behavior before 5.1.23.
|
||||
|
||||
<<.note """Technical note: Characters outside the Basic Multilingual Plane, such as 🎄 and other emojis, will be encoded as a UTF-16 surrogate pair, i.e. with two `\u` sequences.""">>
|
||||
|
||||
Also see the [[stringify Operator]].
|
||||
|
||||
<<.operator-examples "jsonstringify">>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
caption: stringify
|
||||
created: 20161017153038029
|
||||
modified: 20171029155143797
|
||||
from-version: 5.1.14
|
||||
modified: 20230919130847809
|
||||
op-input: a [[selection of titles|Title Selection]]
|
||||
op-output: the input with ~JavaScript string encodings applied
|
||||
op-parameter:
|
||||
|
@ -11,26 +12,25 @@ op-suffix-name: R
|
|||
tags: [[Filter Operators]] [[String Operators]]
|
||||
title: stringify Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
from-version: 5.1.14
|
||||
|
||||
The following substitutions are made:
|
||||
|
||||
|!Character |!Replacement |!Condition |
|
||||
|`\` |`\\` |Always |
|
||||
|`"` |`\"` |Always |
|
||||
|Carriage return (0x0d) |`\\r` |Always |
|
||||
|Line feed (0x0a) |`\\n` |Always |
|
||||
|Backspace (0x08) |`\\b` |Always |
|
||||
|Form field (0x0c) |`\\f` |Always |
|
||||
|Tab (0x09) |`\\t` |Always |
|
||||
|Characters from 0x00 to 0x1f |`\\x##` where ## is two hex digits |Always |
|
||||
|Characters from 0x80 to 0xffff|`\\u####` where #### is four hex digits |If `rawunicode` suffix is not present (default) |
|
||||
|Carriage return (0x0d) |`\r` |Always |
|
||||
|Line feed (0x0a) |`\n` |Always |
|
||||
|Backspace (0x08) |`\b` |Always |
|
||||
|Form field (0x0c) |`\f` |Always |
|
||||
|Tab (0x09) |`\t` |Always |
|
||||
|Characters from 0x00 to 0x1f |`\x##` where ## is two hex digits |Always |
|
||||
|Characters from 0x80 to 0xffff|`\u####` where #### is four hex digits |If `rawunicode` suffix is not present (default) |
|
||||
|Characters from 0x80 to 0xffff|<<.from-version "5.1.23">> Unchanged |If `rawunicode` suffix is present |
|
||||
|
||||
<<.from-version "5.1.23">> If the suffix `rawunicode` is present, Unicode characters above 0x80 (such as ß, ä, ñ or 🎄) will be passed through unchanged. Without the suffix, they will be substituted with `\\u` codes, which was the default behavior before 5.1.23.
|
||||
<<.from-version "5.1.23">> If the suffix `rawunicode` is present, Unicode characters above 0x80 (such as ß, ä, ñ or 🎄) will be passed through unchanged. Without the suffix, they will be substituted with `\u` codes, which was the default behavior before 5.1.23.
|
||||
|
||||
<<.note """Technical note: Characters outside the Basic Multilingual Plane, such as 🎄 and other emojis, will be encoded as a UTF-16 surrogate pair, i.e. with two `\u` sequences.""">>
|
||||
<<.note """Characters outside the Basic Multilingual Plane, such as 🎄 and other emojis, will be encoded as a UTF-16 surrogate pair, i.e. with two `\u` sequences.""">>
|
||||
|
||||
Also see the [[jsonstringify Operator]].
|
||||
<<.olink jsonstringify>> is considered deprecated, as it duplicates the functionality of <<.op stringify>>.
|
||||
|
||||
<<.operator-examples "stringify">>
|
||||
<<.operator-examples "stringify">>
|
|
@ -18,9 +18,9 @@ The <<.op substitute>> operator replaces any placeholders in the input titles in
|
|||
# variables
|
||||
|
||||
|placeholder syntax|description|h
|
||||
|`$n$`|Text substitution of a parameter provided to the operator, where n is the position of the parameter starting with 1 for the first parameter. Unmatched placeholders pass through unchanged.|
|
||||
|`$(varname)$`|Text substitution of a variable. Undefined variables are replaced with an empty string.|
|
||||
|`${ filter expression }$`|Text substitution with the first result of evaluating the filter expression. |
|
||||
|`$n$`|Text substitution of a parameter provided to the operator, where n is the position of the parameter starting with 1 for the first parameter. Unmatched placeholders pass through unchanged. |
|
||||
|`$(varname)$`|Text substitution of a variable. Undefined variables are replaced with an empty string. |
|
||||
|`${ filter expression }$`|Text substitution of the first result of evaluating a filter expression. In other words, if the filter returns multiple titles only the first one will be used. |
|
||||
|
||||
<<.tip """Placeholders that contain square bracket characters are not valid filter syntax when used directly in a filter expression. However they can be provided as input to the <$macrocall $name=".op" _="substitute"/> operator as text references or variables""">>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
created: 20130822170200000
|
||||
list: [[A Gentle Guide to TiddlyWiki]] [[Discover TiddlyWiki]] [[Some of the things you can do with TiddlyWiki]] [[Ten reasons to switch to TiddlyWiki]] Examples [[What happened to the original TiddlyWiki?]]
|
||||
modified: 20230624100932287
|
||||
modified: 20230820112855583
|
||||
tags: TableOfContents
|
||||
title: HelloThere
|
||||
type: text/vnd.tiddlywiki
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
title: Constructing JSON tiddlers
|
||||
tags: [[JSON in TiddlyWiki]] [[Learning]]
|
||||
created: 20220427174702859
|
||||
modified: 20220427174702859
|
||||
modified: 20230809113620964
|
||||
tags: [[JSON in TiddlyWiki]] Learning
|
||||
title: Constructing JSON tiddlers
|
||||
|
||||
See [[JSON in TiddlyWiki]] for an overview of using JSON in TiddlyWiki.
|
||||
|
||||
|
@ -13,4 +13,4 @@ At a high level, we have several ways to generate JSON data in TiddlyWiki's own
|
|||
* [[jsontiddler Macro]]
|
||||
* [[jsontiddlers Macro]]
|
||||
|
||||
When constructing JSON data manually, the [[jsonstringify Operator]] is needed to ensure that any special characters are properly escaped.
|
||||
When constructing JSON data manually, the [[stringify Operator]] is needed to ensure that any special characters are properly escaped.
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 102 KiB |
|
@ -1,3 +1,3 @@
|
|||
title: New Release Banner
|
||||
type: image/jpeg
|
||||
type: image/png
|
||||
tags: picture
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
caption: tag
|
||||
created: 20141206130540337
|
||||
modified: 20150221224326000
|
||||
modified: 20230725201240201
|
||||
tags: Macros [[Core Macros]]
|
||||
title: tag Macro
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The <<.def tag>> [[macro|Macros]] generates a tag pill for a specified tag. Clicking the tag pill opens a dropdown. This can be compared to the [[tag-pill Macro]] which also features other parameters.
|
||||
|
||||
<<.tip """If a [[list widget|ListWidget]] generates multiple tag macros for the same tag, clicking on one of them will open dropdowns on all of them. The simplest way to prevent this is to add the `counter="transclusion"` attribute to the list widget. See the examples below for more details.""">>
|
||||
|
||||
!! Parameters
|
||||
|
||||
;tag
|
||||
|
|
|
@ -1,8 +1,29 @@
|
|||
created: 20150221211317000
|
||||
modified: 20150221224519000
|
||||
modified: 20230725203751870
|
||||
tags: [[tag Macro]] [[Macro Examples]]
|
||||
title: tag Macro (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<$macrocall $name=".example" n="1" eg="""<<tag>>"""/>
|
||||
<$macrocall $name=".example" n="2" eg="""<<tag Concepts>>"""/>
|
||||
|
||||
If a [[list widget|ListWidget]] generates multiple tag macros for the same tag, clicking any of them opens dropdowns on all of them, as in the example below. This is usually unwanted.
|
||||
<$macrocall $name=".example" n="3" eg="""<$list filter="[tag[HelloThere]]">
|
||||
|
||||
* <$link/> is tagged with: <$list filter="[<currentTiddler>tags[]]"> <<tag>> </$list>
|
||||
|
||||
</$list>"""/>
|
||||
|
||||
Adding the `counter="transclusion"` attribute to the list widget that generates multiple identical tag macros causes each of them to be identified as a unique one. Clicking on any of them opens only a single dropdown.
|
||||
<$macrocall $name=".example" n="4" eg="""<$list filter="[tag[HelloThere]]" counter="transclusion">
|
||||
|
||||
* <$link/> is tagged with: <$list filter="[<currentTiddler>tags[]]"> <<tag>> </$list>
|
||||
|
||||
</$list>"""/>
|
||||
|
||||
A slightly more performant option is to use the `variable="transclusion"` attribute in the list widget. In this case, the variable `<<transclusion>>` has to be used inside the list widget instead of the `<<currentTiddler>>` .
|
||||
<$macrocall $name=".example" n="5" eg="""<$list filter="[tag[HelloThere]]" variable="transclusion">
|
||||
|
||||
* <$link to=<<transclusion>>/> is tagged with: <$list filter="[<transclusion>tags[]]"> <<tag>> </$list>
|
||||
|
||||
</$list>"""/>
|
|
@ -1,6 +1,6 @@
|
|||
caption: tm-open-window
|
||||
created: 20220228140417116
|
||||
modified: 20220409092811188
|
||||
modified: 20230723220539648
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-close-window
|
||||
type: text/vnd.tiddlywiki
|
||||
|
@ -29,7 +29,7 @@ src="""
|
|||
width="400"
|
||||
height="500"
|
||||
windowID="window1"
|
||||
something="I just in over in a variable, and boy is my Hashmap tired." />
|
||||
something="I just flew in on a variable, and boy is my Hashmap tired." />
|
||||
</$button>
|
||||
<$button>Close Window
|
||||
<$action-sendmessage
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
caption: tm-download-file
|
||||
created: 20140811112201235
|
||||
modified: 20220123141646321
|
||||
modified: 20230723214745520
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-download-file
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tm-download-file
|
||||
|
||||
The download file message causes the current saver module to prompt the user to download the result of parsing a specified template tiddler as a file. It requires the following properties on the `event` object:
|
||||
|
||||
|!Name |!Description |
|
||||
|param |Title of a tiddler to use as a template for the new tiddler |
|
||||
|paramObject |Optional hashmap of variable values to use for the rendering |
|
||||
|//{any other params}// |Any other parameters are made available as variables within the context of the widget message. |
|
||||
|
||||
The following variable names have special behaviour:
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
caption: tm-edit-bitmap-operation
|
||||
created: 20160424204236050
|
||||
modified: 20160424215219517
|
||||
modified: 20230723214716576
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-edit-bitmap-operation
|
||||
type: text/vnd.tiddlywiki
|
||||
|
@ -30,12 +30,12 @@ Clears the contents of the image and fills it with a solid colour. Parameters in
|
|||
\end
|
||||
|
||||
|
||||
|
||||
A `tm-edit-bitmap-operation` invokes one of the available operations on a __surrounding__ bitmap editor. Therefore the message has to be dispatched within the editor in order for it to catch it. The following properties on the `event` object are required:
|
||||
|
||||
|!Name |!Description |
|
||||
|param |Name of the operation to be executed, see ''below'' for a list of possible operations |
|
||||
|paramObject| Hashmap of additional parameters required by the operation top be executed |
|
||||
|//{any other params}// |Any other parameters are made available as variables within the context of the widget message. |
|
||||
|
||||
|
||||
The `tm-edit-bitmap-operation` message is usually generated by a ButtonWidget or an ActionWidget and is handled by the surrounding bitmap editor.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
caption: tm-edit-text-operation
|
||||
created: 20160424211339792
|
||||
modified: 20210520053923011
|
||||
modified: 20230723214636245
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-edit-text-operation
|
||||
type: text/vnd.tiddlywiki
|
||||
|
@ -121,7 +121,7 @@ A `tm-edit-text-operation` invokes one of the available operations on a __surrou
|
|||
|
||||
|!Name |!Description |
|
||||
|param |Name of the operation to be executed, see ''below'' for a list of possible operations |
|
||||
|paramObject|Hashmap of additional parameters required by the operation top be executed |
|
||||
|//{any other params}// |Any other parameters are made available as variables within the context of the widget message. |
|
||||
|
||||
The `tm-edit-text-operation` message is usually generated by a ButtonWidget or an ActionWidget and is handled by the surrounding text editor.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
caption: tm-focus-selector
|
||||
created: 20190628162542132
|
||||
modified: 20190628162542132
|
||||
modified: 20230723215122038
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-focus-selector
|
||||
type: text/vnd.tiddlywiki
|
||||
|
@ -9,6 +9,6 @@ The `tm-focus-selector` message sets the focus to the DOM element identified by
|
|||
|
||||
|!Name |!Description |
|
||||
|param |Selector identifying the DOM element to be focussed |
|
||||
|paramObject |Optional hashmap of additional parameters to be passed to the [[focus()|https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus]] method |
|
||||
|//{any other params}// |Any other parameters to be passed to the [[focus()|https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus]] method as variables.|
|
||||
|
||||
<<.tip """Use preventScroll="true" to prevent the browser from scrolling to the focused element""">>
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
title: WidgetMessage: tm-http-request Example - Random Dog
|
||||
tags: $:/tags/Global
|
||||
|
||||
\procedure download-dog(url)
|
||||
|
||||
\procedure completion-download-dog()
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
<$action-log msg="In completion-download-dog"/>
|
||||
<$action-log/>
|
||||
<!-- Success -->
|
||||
<$list filter="[<status>compare:number:gteq[200]compare:number:lteq[299]]" variable="ignore">
|
||||
<!-- Create the dog tiddler -->
|
||||
<$action-createtiddler
|
||||
$basetitle=`$:/RandomDog/$(title)$`
|
||||
text=<<data>>
|
||||
tags="$:/tags/RandomDog"
|
||||
type={{{ [<headers>jsonget[content-type]] }}}
|
||||
credits="https://random.dog/"
|
||||
>
|
||||
<$action-log msg="Created tiddler" title=<<createTiddler-title>>/>
|
||||
</$createtiddler>
|
||||
</$list>
|
||||
\end completion-download-dog
|
||||
|
||||
<$action-sendmessage
|
||||
$message="tm-http-request"
|
||||
url=<<url>>
|
||||
method="GET"
|
||||
binary="yes"
|
||||
oncompletion=<<completion-download-dog>>
|
||||
var-title=<<url>>
|
||||
/>
|
||||
\end download-dog
|
||||
|
||||
\procedure get-random-dog()
|
||||
|
||||
\procedure completion-get-json()
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
<$action-log msg="In completion-get-json"/>
|
||||
<$action-log/>
|
||||
<!-- Success -->
|
||||
<$list filter="[<status>compare:number:gteq[200]compare:number:lteq[299]]" variable="ignore">
|
||||
<!-- Download the dog -->
|
||||
<$macrocall $name="download-dog" url={{{ [<data>jsonget[url]] }}}/>
|
||||
</$list>
|
||||
\end completion-get-json
|
||||
|
||||
<$action-sendmessage
|
||||
$message="tm-http-request"
|
||||
url="https://random.dog/woof.json"
|
||||
method="GET"
|
||||
oncompletion=<<completion-get-json>>
|
||||
/>
|
||||
\end get-random-dog
|
||||
|
||||
!! Random Dogs
|
||||
|
||||
This demo uses the API of the website https://random.dog/ to import a random dog image or video.
|
||||
|
||||
//Note that the images and videos can be quite large, so this demo is not recommended to be used over mobile data connections.//
|
||||
|
||||
<$button actions=<<get-random-dog>>>
|
||||
Import a random dog image or video
|
||||
</$button>
|
||||
|
||||
<$list filter="[tag[$:/tags/RandomDog]limit[1]]" variable="ignore">
|
||||
|
||||
!! Imported Tiddlers
|
||||
|
||||
<$button>
|
||||
<$action-deletetiddler $filter="[tag[$:/tags/RandomDog]]"/>
|
||||
Delete all imported random dogs
|
||||
</$button>
|
||||
|
||||
Export all imported random dogs: <$macrocall $name="exportButton" exportFilter="[tag[$:/tags/RandomDog]]" lingoBase="$:/language/Buttons/ExportTiddlers/"/>
|
||||
|
||||
</$list>
|
||||
|
||||
<ol>
|
||||
<$list filter="[tag[$:/tags/RandomDog]!sort[modified]]">
|
||||
<li>
|
||||
<$link>
|
||||
<$text text=<<currentTiddler>>/>
|
||||
</$link>
|
||||
<div style="width:300px;">
|
||||
<$transclude $tiddler=<<currentTiddler>>/>
|
||||
</div>
|
||||
</li>
|
||||
</$list>
|
||||
</ol>
|
|
@ -1,12 +1,12 @@
|
|||
title: WidgetMessage: tm-http-request Example - Zotero
|
||||
tags: $:/tags/Macro
|
||||
tags: $:/tags/Global
|
||||
|
||||
\procedure select-zotero-group()
|
||||
Specify the Zotero group ID to import
|
||||
<$edit-text tiddler="$:/config/zotero-group" tag="input"/> or
|
||||
<$select tiddler="$:/config/zotero-group">
|
||||
<option value="4813312">com216</option>
|
||||
<option value="4913310">pos252</option>
|
||||
<option value="4914891">steve-sunypoly</option>
|
||||
<option value="4747244">idt575</option>
|
||||
</$select>
|
||||
\end
|
||||
|
@ -16,6 +16,7 @@ Specify the Zotero group ID to import
|
|||
$basetitle={{{ =[[_zotero_import ]] =[<item>jsonget[key]] =[[ ]] =[<item>jsonget[title]] +[join[]] }}}
|
||||
text={{{ [<item>jsonget[title]] }}}
|
||||
tags="$:/tags/ZoteroImport"
|
||||
zotero-group={{$:/config/zotero-group}}
|
||||
>
|
||||
<$action-setmultiplefields $tiddler=<<createTiddler-title>> $fields="[<item>jsonindexes[]addprefix[zotero-]]" $values="[<item>jsonindexes[]] :map[<item>jsonget<currentTiddler>else[.XXXXX.]]"/>
|
||||
<$list filter="[<item>jsonindexes[creators]]" variable="creatorIndex">
|
||||
|
@ -33,7 +34,7 @@ Specify the Zotero group ID to import
|
|||
\procedure zotero-get-items(start:"0",limit:"25")
|
||||
|
||||
\procedure completion()
|
||||
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
<$action-log msg="In completion"/>
|
||||
<$action-log/>
|
||||
<!-- Success -->
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
caption: tm-http-request
|
||||
created: 20230429161453032
|
||||
modified: 20230429161453032
|
||||
modified: 20230723215344887
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-http-request
|
||||
type: text/vnd.tiddlywiki
|
||||
|
@ -11,13 +11,14 @@ It uses the following properties on the `event` object:
|
|||
|
||||
|!Name |!Description |
|
||||
|param |Not used |
|
||||
|paramObject |Hashmap of parameters (see below) |
|
||||
|//{any other params}// |Any other parameters are made available as variables within the context of the widget message. See below. |
|
||||
|
||||
The following parameters are used:
|
||||
|
||||
|!Name |!Description |
|
||||
|method |HTTP method (eg "GET", "POST") |
|
||||
|body |String data to be sent with the request |
|
||||
|binary |<<.from-version "5.3.1">> Set to "yes" to cause the response body to be treated as binary data and returned in base64 format |
|
||||
|query-* |Query string parameters with string values |
|
||||
|header-* |Headers with string values |
|
||||
|password-header-* |Headers with values taken from the password store |
|
||||
|
@ -49,3 +50,4 @@ Note that the state tiddler $:/state/http-requests contains a number representin
|
|||
!! Examples
|
||||
|
||||
* [[Zotero's|https://www.zotero.org/]] API for retrieving reference items: [[WidgetMessage: tm-http-request Example - Zotero]]
|
||||
* [[Random Dog's|https://random.dog/]] API for retrieving random pictures of dogs showing how to retrieve binary data: [[WidgetMessage: tm-http-request Example - Random Dog]]
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
caption: tm-modal
|
||||
created: 20140811112133701
|
||||
modified: 20201117081247738
|
||||
modified: 20230723215434712
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-modal
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
|!Name |!Description |
|
||||
|param |Title of the tiddler to be displayed |
|
||||
|paramObject |Hashmap of variables to be provided to the modal, contains all extra parameters passed to the widget sending the message. |
|
||||
|//{any other params}// |Any other parameters are made available as variables within the context of the widget message. |
|
||||
|rootwindow |<<.from-version 5.1.18>> ''yes'' or ''true'' will always display a modal in the wiki-root-window |
|
||||
|
||||
The modal message is usually generated with the ButtonWidget. The modal message is handled by the TiddlyWiki core.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
caption: tm-new-tiddler
|
||||
created: 20140226194405353
|
||||
modified: 20220521143507491
|
||||
modified: 20230723215831560
|
||||
tags: Messages navigator-message
|
||||
title: WidgetMessage: tm-new-tiddler
|
||||
type: text/vnd.tiddlywiki
|
||||
|
@ -9,12 +9,12 @@ The new tiddler message creates a new draft tiddler and adds it to the current s
|
|||
|
||||
|!Name |!Description |
|
||||
|param |The optional title of a tiddler to use as a template for the new tiddler |
|
||||
|paramObject |Optional hashmap of additional tiddler fields |
|
||||
|//{any other params}// |The names and values of additional tiddler fields. |
|
||||
|navigateFromTitle |Title of the tiddler from which the navigation to the new tiddler was initiated |
|
||||
|
||||
The title for the draft tiddler is chosen according to these rules:
|
||||
|
||||
* If a hashmap was used and a title field was specified, use that title
|
||||
* If additional parameters were used and a title field was specified, use that title
|
||||
* If a template tiddler was used, use the title of the template tiddler, making it unique with a numeric suffix
|
||||
* Otherwise, generate a new title based on the default new tiddler title with a numeric suffix to make it unique
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
caption: tm-notify
|
||||
created: 20140811112304772
|
||||
modified: 20160701140248738
|
||||
modified: 20230723220728382
|
||||
tags: Messages
|
||||
title: WidgetMessage: tm-notify
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tm-notify
|
||||
|
||||
The notify message briefly displays a specified tiddler as a small alert in the upper right corner of the page. It requires the following properties on the `event` object:
|
||||
|
||||
|!Name |!Description |
|
||||
|param |Title of the tiddler to be displayed |
|
||||
|paramObject |Hashmap of variables to be provided to the notification |
|
||||
|//{any other params}// |Any other parameters are made available as variables to the notify message. |
|
||||
|
||||
The notify message is handled by the TiddlyWiki core.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue