mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-02-12 21:19:50 +00:00
Compare commits
173 Commits
google-ana
...
button-wid
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ce2601c10 | ||
|
|
fb57eab2f4 | ||
|
|
ac797734de | ||
|
|
bbda31d2d3 | ||
|
|
142bc19a29 | ||
|
|
f7a94879da | ||
|
|
e43a75ae59 | ||
|
|
65b3b18e1f | ||
|
|
980022a6e7 | ||
|
|
a5d5926534 | ||
|
|
a1bffa7e36 | ||
|
|
793692a4e4 | ||
|
|
08d6560391 | ||
|
|
70774eca83 | ||
|
|
4f0e148bf1 | ||
|
|
b4896d79d8 | ||
|
|
1eceb5f47f | ||
|
|
def508a220 | ||
|
|
d17525ec8e | ||
|
|
5bb8155422 | ||
|
|
bb2973fc29 | ||
|
|
bbaa0890b5 | ||
|
|
b4a862c618 | ||
|
|
1be8f0a933 | ||
|
|
773c1f83f2 | ||
|
|
8effb3f218 | ||
|
|
780e5d33a4 | ||
|
|
526e997aa4 | ||
|
|
e4d8849f22 | ||
|
|
bd99cf3385 | ||
|
|
711d1658e2 | ||
|
|
b82f012c0c | ||
|
|
f383863654 | ||
|
|
697dc8db4c | ||
|
|
49c96901f3 | ||
|
|
7d8766d2b9 | ||
|
|
6255856205 | ||
|
|
6f307ae01e | ||
|
|
213a850715 | ||
|
|
217af20fcd | ||
|
|
6d0b4108a4 | ||
|
|
642f8da6ed | ||
|
|
e16635a5ad | ||
|
|
db79bf2380 | ||
|
|
2b16fa7b5c | ||
|
|
64c9d17181 | ||
|
|
ceee20fd59 | ||
|
|
0889f13fef | ||
|
|
fa9bfa07a0 | ||
|
|
dbe233fc87 | ||
|
|
3965e2c027 | ||
|
|
c22cd3f4c6 | ||
|
|
dc282db31b | ||
|
|
70309c67d1 | ||
|
|
ba5bfd1ad0 | ||
|
|
3c66af9fdc | ||
|
|
6877082090 | ||
|
|
9201d2bedc | ||
|
|
229e681550 | ||
|
|
779ac28bd0 | ||
|
|
78ecc20c5e | ||
|
|
8b6bc6664b | ||
|
|
674bd1822c | ||
|
|
6c67dc8235 | ||
|
|
72a4adbd6b | ||
|
|
aaf0bffb39 | ||
|
|
9bbd8a70c2 | ||
|
|
cc57cf2fe9 | ||
|
|
34bc9c72c6 | ||
|
|
aeb502657b | ||
|
|
48705db21f | ||
|
|
587aa28853 | ||
|
|
b926a33b55 | ||
|
|
44ccfe83c9 | ||
|
|
cef0ac680d | ||
|
|
b8a235697f | ||
|
|
ed82536a55 | ||
|
|
d99b1897c3 | ||
|
|
3684cfd178 | ||
|
|
643819f5f5 | ||
|
|
52f7f6382b | ||
|
|
575930b31d | ||
|
|
73f256a411 | ||
|
|
1b5b8905d8 | ||
|
|
825f4eaae1 | ||
|
|
d0da1ef9d9 | ||
|
|
3e213569e2 | ||
|
|
4bdac09872 | ||
|
|
4c9eaeaaf2 | ||
|
|
c1ff85c205 | ||
|
|
afcbac5e86 | ||
|
|
1a92fd5dc0 | ||
|
|
e60232e0cb | ||
|
|
ad6e09f1cb | ||
|
|
3ddb852a16 | ||
|
|
b000f20283 | ||
|
|
160cc0e9a9 | ||
|
|
fd8b8f62da | ||
|
|
61a08cbd7b | ||
|
|
0fd6b986a0 | ||
|
|
0a4cfa1164 | ||
|
|
04e971c3c6 | ||
|
|
963887c8c4 | ||
|
|
aef76fa25f | ||
|
|
4124bbdfb3 | ||
|
|
98ff6b67fd | ||
|
|
9b2af13596 | ||
|
|
7182dbf244 | ||
|
|
f61d244410 | ||
|
|
284669544b | ||
|
|
b54a88ce83 | ||
|
|
3bd8c5d50d | ||
|
|
3a90c37816 | ||
|
|
ff7214ff56 | ||
|
|
8e9d8d4fef | ||
|
|
a7bafd8840 | ||
|
|
a6779efb1c | ||
|
|
ec00dc5042 | ||
|
|
08bad90e51 | ||
|
|
9a1d7085b8 | ||
|
|
feb797701f | ||
|
|
34ef27fbc0 | ||
|
|
f517497fe7 | ||
|
|
eff158b1ae | ||
|
|
6954fbee51 | ||
|
|
6c7c21a87b | ||
|
|
29b5b064d6 | ||
|
|
02f6d850d5 | ||
|
|
7597f5af77 | ||
|
|
0c64b58cfb | ||
|
|
39f342a943 | ||
|
|
a6722e9735 | ||
|
|
42d4c5d5ab | ||
|
|
04e771ccbf | ||
|
|
57d85d4f64 | ||
|
|
c101e9efe6 | ||
|
|
d893241ba9 | ||
|
|
3ec6c0eaf1 | ||
|
|
47813ae31f | ||
|
|
9589e3df33 | ||
|
|
ee1200bde1 | ||
|
|
419760a8e5 | ||
|
|
04950452fa | ||
|
|
3f4e301a20 | ||
|
|
2db0322a76 | ||
|
|
d6c77f549f | ||
|
|
7dbcab0192 | ||
|
|
823bcd7999 | ||
|
|
c24d1ef4fb | ||
|
|
b5d835e7dd | ||
|
|
5c5543815b | ||
|
|
28aef51855 | ||
|
|
158384867b | ||
|
|
a02d99a4c1 | ||
|
|
16ef1d84cd | ||
|
|
6bb0da07dc | ||
|
|
ebeb1a8956 | ||
|
|
bc07fd731c | ||
|
|
d46aa4ba4d | ||
|
|
f2d6c5a6eb | ||
|
|
4659b893d8 | ||
|
|
c499fff2a9 | ||
|
|
0d723d8b9d | ||
|
|
3825e2579f | ||
|
|
e5566543c9 | ||
|
|
a5c258ecac | ||
|
|
9b8db5dbb1 | ||
|
|
a05302da10 | ||
|
|
5647ad71b0 | ||
|
|
6fd2139376 | ||
|
|
46d0aea0f2 | ||
|
|
5947140b61 | ||
|
|
a66b04f532 |
@@ -5,7 +5,7 @@
|
|||||||
# Default to the current version number for building the plugin library
|
# Default to the current version number for building the plugin library
|
||||||
|
|
||||||
if [ -z "$TW5_BUILD_VERSION" ]; then
|
if [ -z "$TW5_BUILD_VERSION" ]; then
|
||||||
TW5_BUILD_VERSION=v5.3.0
|
TW5_BUILD_VERSION=v5.3.2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"
|
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"
|
||||||
@@ -104,13 +104,15 @@ node $TW5_BUILD_TIDDLYWIKI \
|
|||||||
--build favicon static index \
|
--build favicon static index \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
|
|
||||||
# /empty.html Empty
|
# /empty.html Empty
|
||||||
# /empty.hta For Internet Explorer
|
# /empty.hta For Internet Explorer
|
||||||
|
# /empty-external-core.html External core empty
|
||||||
|
# /tiddlywikicore-<version>.js Core plugin javascript
|
||||||
node $TW5_BUILD_TIDDLYWIKI \
|
node $TW5_BUILD_TIDDLYWIKI \
|
||||||
$TW5_BUILD_MAIN_EDITION \
|
./editions/empty \
|
||||||
--verbose \
|
--verbose \
|
||||||
--output $TW5_BUILD_OUTPUT \
|
--output $TW5_BUILD_OUTPUT \
|
||||||
--build empty \
|
--build empty emptyexternalcore \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
25
boot/boot.js
25
boot/boot.js
@@ -575,9 +575,8 @@ var globalCheck =[
|
|||||||
" configurable: true",
|
" configurable: true",
|
||||||
" });",
|
" });",
|
||||||
" if(Object.keys(__temp__).length){",
|
" if(Object.keys(__temp__).length){",
|
||||||
" console.log(Object.keys(__temp__));",
|
" console.log(\"Warning: Global assignment detected\",Object.keys(__temp__));",
|
||||||
" delete Object.prototype.__temp__;",
|
" delete Object.prototype.__temp__;",
|
||||||
" throw \"Global assignment is not allowed within modules on node.\";",
|
|
||||||
" }",
|
" }",
|
||||||
" delete Object.prototype.__temp__;",
|
" delete Object.prototype.__temp__;",
|
||||||
].join('\n');
|
].join('\n');
|
||||||
@@ -596,11 +595,11 @@ $tw.utils.evalGlobal = function(code,context,filename,sandbox,allowGlobals) {
|
|||||||
// Add the code prologue and epilogue
|
// Add the code prologue and epilogue
|
||||||
code = [
|
code = [
|
||||||
"(function(" + contextNames.join(",") + ") {",
|
"(function(" + contextNames.join(",") + ") {",
|
||||||
" (function(){\n" + code + "\n;})();",
|
" (function(){" + code + "\n;})();\n",
|
||||||
(!$tw.browser && sandbox && !allowGlobals) ? globalCheck : "",
|
(!$tw.browser && sandbox && !allowGlobals) ? globalCheck : "",
|
||||||
" return exports;\n",
|
"\nreturn exports;\n",
|
||||||
"})"
|
"})"
|
||||||
].join("\n");
|
].join("");
|
||||||
|
|
||||||
// Compile the code into a function
|
// Compile the code into a function
|
||||||
var fn;
|
var fn;
|
||||||
@@ -926,7 +925,7 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// line number should be included in e.stack for runtime errors
|
// 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,
|
shadowTiddlerTitles = null,
|
||||||
getShadowTiddlerTitles = function() {
|
getShadowTiddlerTitles = function() {
|
||||||
if(!shadowTiddlerTitles) {
|
if(!shadowTiddlerTitles) {
|
||||||
shadowTiddlerTitles = Object.keys(shadowTiddlers);
|
shadowTiddlerTitles = Object.keys(shadowTiddlers).sort(function(a,b) {return a.localeCompare(b);});
|
||||||
}
|
}
|
||||||
return shadowTiddlerTitles;
|
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
|
Invoke the hook by key
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
title: $:/core/images/new-journal-button
|
title: $:/core/images/new-journal-button
|
||||||
tags: $:/tags/Image
|
tags: $:/tags/Image
|
||||||
|
|
||||||
<$parameters size="22pt" day=<<now "DD">>>
|
<$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>
|
||||||
<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>
|
|
||||||
@@ -3,4 +3,4 @@ title: $:/language/Exporters/
|
|||||||
StaticRiver: Static HTML
|
StaticRiver: Static HTML
|
||||||
JsonFile: JSON file
|
JsonFile: JSON file
|
||||||
CsvFile: CSV file
|
CsvFile: CSV file
|
||||||
TidFile: ".tid" file
|
TidFile: TID text file
|
||||||
|
|||||||
@@ -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:
|
<<.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
|
* 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
|
* 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
|
* 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:
|
A common usage is to convert a TiddlyWiki HTML file into a wiki folder:
|
||||||
|
|
||||||
```
|
```
|
||||||
tiddlywiki --load ./mywiki.html --savewikifolder ./mywikifolder
|
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
|
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.
|
Legacy command to serve a wiki over HTTP.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
title: $:/language/Docs/Types/image/svg+xml
|
title: $:/language/Docs/Types/image/svg+xml
|
||||||
description: Structured Vector Graphics image
|
description: SVG image
|
||||||
name: image/svg+xml
|
name: image/svg+xml
|
||||||
group: Image
|
group: Image
|
||||||
group-sort: 1
|
group-sort: 1
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
title: $:/language/Docs/Types/image/x-icon
|
title: $:/language/Docs/Types/image/x-icon
|
||||||
description: ICO format icon file
|
description: ICO icon
|
||||||
name: image/x-icon
|
name: image/x-icon
|
||||||
group: Image
|
group: Image
|
||||||
group-sort: 1
|
group-sort: 1
|
||||||
|
|||||||
@@ -5,7 +5,14 @@ module-type: command
|
|||||||
|
|
||||||
Command to save the current wiki as a wiki folder
|
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(){
|
(function(){
|
||||||
@@ -35,14 +42,28 @@ Command.prototype.execute = function() {
|
|||||||
if(this.params.length < 1) {
|
if(this.params.length < 1) {
|
||||||
return "Missing wiki folder path";
|
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();
|
return wikifoldermaker.save();
|
||||||
};
|
};
|
||||||
|
|
||||||
function WikiFolderMaker(wikiFolderPath,wikiFilter,commander) {
|
function WikiFolderMaker(wikiFolderPath,wikiFilter,commander,options) {
|
||||||
this.wikiFolderPath = wikiFolderPath;
|
this.wikiFolderPath = wikiFolderPath;
|
||||||
this.wikiFilter = wikiFilter || "[all[tiddlers]]";
|
this.wikiFilter = wikiFilter;
|
||||||
this.commander = commander;
|
this.commander = commander;
|
||||||
|
this.explodePlugins = options.explodePlugins;
|
||||||
this.wiki = commander.wiki;
|
this.wiki = commander.wiki;
|
||||||
this.savedPaths = []; // So that we can detect filename clashes
|
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);
|
self.log("Adding built-in plugin: " + libraryDetails.name);
|
||||||
newWikiInfo[libraryDetails.type] = newWikiInfo[libraryDetails.type] || [];
|
newWikiInfo[libraryDetails.type] = newWikiInfo[libraryDetails.type] || [];
|
||||||
$tw.utils.pushTop(newWikiInfo[libraryDetails.type],libraryDetails.name);
|
$tw.utils.pushTop(newWikiInfo[libraryDetails.type],libraryDetails.name);
|
||||||
} else {
|
} else if(self.explodePlugins !== "no") {
|
||||||
// A custom plugin
|
// A custom plugin
|
||||||
self.log("Processing custom plugin: " + title);
|
self.log("Processing custom plugin: " + title);
|
||||||
self.saveCustomPlugin(tiddler);
|
self.saveCustomPlugin(tiddler);
|
||||||
|
} else if(self.explodePlugins === "no") {
|
||||||
|
self.log("Processing custom plugin to tiddlders folder: " + title);
|
||||||
|
self.saveTiddler("tiddlers", tiddler);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Ordinary tiddler
|
// Ordinary tiddler
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ function FramedEngine(options) {
|
|||||||
this.domNode.value = this.value;
|
this.domNode.value = this.value;
|
||||||
}
|
}
|
||||||
// Set the attributes
|
// Set the attributes
|
||||||
if(this.widget.editType) {
|
if(this.widget.editType && this.widget.editTag !== "textarea") {
|
||||||
this.domNode.setAttribute("type",this.widget.editType);
|
this.domNode.setAttribute("type",this.widget.editType);
|
||||||
}
|
}
|
||||||
if(this.widget.editPlaceholder) {
|
if(this.widget.editPlaceholder) {
|
||||||
@@ -72,9 +72,6 @@ function FramedEngine(options) {
|
|||||||
if(this.widget.editRows) {
|
if(this.widget.editRows) {
|
||||||
this.domNode.setAttribute("rows",this.widget.editRows);
|
this.domNode.setAttribute("rows",this.widget.editRows);
|
||||||
}
|
}
|
||||||
if(this.widget.editDir) {
|
|
||||||
this.domNode.setAttribute("dir",this.widget.editDir);
|
|
||||||
}
|
|
||||||
if(this.widget.editTabIndex) {
|
if(this.widget.editTabIndex) {
|
||||||
this.iframeNode.setAttribute("tabindex",this.widget.editTabIndex);
|
this.iframeNode.setAttribute("tabindex",this.widget.editTabIndex);
|
||||||
}
|
}
|
||||||
@@ -123,7 +120,6 @@ FramedEngine.prototype.copyStyles = function() {
|
|||||||
this.domNode.style["-webkit-text-fill-color"] = "currentcolor";
|
this.domNode.style["-webkit-text-fill-color"] = "currentcolor";
|
||||||
// Ensure we don't force text direction to LTR
|
// Ensure we don't force text direction to LTR
|
||||||
this.domNode.style.removeProperty("direction");
|
this.domNode.style.removeProperty("direction");
|
||||||
this.domNode.style.removeProperty("unicodeBidi");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function SimpleEngine(options) {
|
|||||||
this.domNode.value = this.value;
|
this.domNode.value = this.value;
|
||||||
}
|
}
|
||||||
// Set the attributes
|
// Set the attributes
|
||||||
if(this.widget.editType) {
|
if(this.widget.editType && this.widget.editTag !== "textarea") {
|
||||||
this.domNode.setAttribute("type",this.widget.editType);
|
this.domNode.setAttribute("type",this.widget.editType);
|
||||||
}
|
}
|
||||||
if(this.widget.editPlaceholder) {
|
if(this.widget.editPlaceholder) {
|
||||||
@@ -52,9 +52,6 @@ function SimpleEngine(options) {
|
|||||||
if(this.widget.editTabIndex) {
|
if(this.widget.editTabIndex) {
|
||||||
this.domNode.setAttribute("tabindex",this.widget.editTabIndex);
|
this.domNode.setAttribute("tabindex",this.widget.editTabIndex);
|
||||||
}
|
}
|
||||||
if(this.widget.editDir) {
|
|
||||||
this.domNode.setAttribute("dir",this.widget.editDir);
|
|
||||||
}
|
|
||||||
if(this.widget.editAutoComplete) {
|
if(this.widget.editAutoComplete) {
|
||||||
this.domNode.setAttribute("autocomplete",this.widget.editAutoComplete);
|
this.domNode.setAttribute("autocomplete",this.widget.editAutoComplete);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,6 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
|
|||||||
this.editFocusSelectFromStart = $tw.utils.parseNumber(this.getAttribute("focusSelectFromStart","0"));
|
this.editFocusSelectFromStart = $tw.utils.parseNumber(this.getAttribute("focusSelectFromStart","0"));
|
||||||
this.editFocusSelectFromEnd = $tw.utils.parseNumber(this.getAttribute("focusSelectFromEnd","0"));
|
this.editFocusSelectFromEnd = $tw.utils.parseNumber(this.getAttribute("focusSelectFromEnd","0"));
|
||||||
this.editTabIndex = this.getAttribute("tabindex");
|
this.editTabIndex = this.getAttribute("tabindex");
|
||||||
this.editDir = this.getAttribute("dir");
|
|
||||||
this.editCancelPopups = this.getAttribute("cancelPopups","") === "yes";
|
this.editCancelPopups = this.getAttribute("cancelPopups","") === "yes";
|
||||||
this.editInputActions = this.getAttribute("inputActions");
|
this.editInputActions = this.getAttribute("inputActions");
|
||||||
this.editRefreshTitle = this.getAttribute("refreshTitle");
|
this.editRefreshTitle = this.getAttribute("refreshTitle");
|
||||||
@@ -221,7 +220,7 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
|
|||||||
EditTextWidget.prototype.refresh = function(changedTiddlers) {
|
EditTextWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
var changedAttributes = this.computeAttributes();
|
var changedAttributes = this.computeAttributes();
|
||||||
// Completely rerender if any of our attributes have changed
|
// Completely rerender if any of our attributes have changed
|
||||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.placeholder || changedAttributes.size || changedAttributes.autoHeight || changedAttributes.minHeight || changedAttributes.focusPopup || changedAttributes.rows || changedAttributes.tabindex || changedAttributes.dir || changedAttributes.cancelPopups || changedAttributes.inputActions || changedAttributes.refreshTitle || changedAttributes.autocomplete || changedTiddlers[HEIGHT_MODE_TITLE] || changedTiddlers[ENABLE_TOOLBAR_TITLE] || changedTiddlers["$:/palette"] || changedAttributes.disabled || changedAttributes.fileDrop) {
|
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.placeholder || changedAttributes.size || changedAttributes.autoHeight || changedAttributes.minHeight || changedAttributes.focusPopup || changedAttributes.rows || changedAttributes.tabindex || changedAttributes.cancelPopups || changedAttributes.inputActions || changedAttributes.refreshTitle || changedAttributes.autocomplete || changedTiddlers[HEIGHT_MODE_TITLE] || changedTiddlers[ENABLE_TOOLBAR_TITLE] || changedTiddlers["$:/palette"] || changedAttributes.disabled || changedAttributes.fileDrop) {
|
||||||
this.refreshSelf();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
} else if (changedTiddlers[this.editRefreshTitle]) {
|
} else if (changedTiddlers[this.editRefreshTitle]) {
|
||||||
|
|||||||
32
core/modules/filterrunprefixes/then.js
Normal file
32
core/modules/filterrunprefixes/then.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/filterrunprefixes/then.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: filterrunprefix
|
||||||
|
|
||||||
|
Replace results of previous runs unless empty
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Export our filter prefix function
|
||||||
|
*/
|
||||||
|
exports.then = function(operationSubFunction) {
|
||||||
|
return function(results,source,widget) {
|
||||||
|
if(results.length !== 0) {
|
||||||
|
// Only run if previous run(s) produced results
|
||||||
|
var thisRunResult = operationSubFunction(source,widget);
|
||||||
|
if(thisRunResult.length !== 0) {
|
||||||
|
// Replace results only if this run actually produces a result
|
||||||
|
results.clear();
|
||||||
|
results.pushTop(thisRunResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
||||||
@@ -28,12 +28,8 @@ function getAllFilterOperators() {
|
|||||||
Export our filter function
|
Export our filter function
|
||||||
*/
|
*/
|
||||||
exports.all = function(source,operator,options) {
|
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
|
// Check for common optimisations
|
||||||
|
var subops = operator.operand.split("+");
|
||||||
if(subops.length === 1 && subops[0] === "") {
|
if(subops.length === 1 && subops[0] === "") {
|
||||||
return source;
|
return source;
|
||||||
} else if(subops.length === 1 && subops[0] === "tiddlers") {
|
} else if(subops.length === 1 && subops[0] === "tiddlers") {
|
||||||
@@ -46,6 +42,10 @@ exports.all = function(source,operator,options) {
|
|||||||
return options.wiki.eachShadowPlusTiddlers;
|
return options.wiki.eachShadowPlusTiddlers;
|
||||||
}
|
}
|
||||||
// Do it the hard way
|
// 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++) {
|
for(var t=0; t<subops.length; t++) {
|
||||||
var subop = allFilterOperators[subops[t]];
|
var subop = allFilterOperators[subops[t]];
|
||||||
if(subop) {
|
if(subop) {
|
||||||
|
|||||||
36
core/modules/filters/substitute.js
Normal file
36
core/modules/filters/substitute.js
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/filters/substitute.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: filteroperator
|
||||||
|
|
||||||
|
Filter operator for substituting variables and embedded filter expressions with their corresponding values
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Export our filter function
|
||||||
|
*/
|
||||||
|
exports.substitute = function(source,operator,options) {
|
||||||
|
var results = [],
|
||||||
|
operands = [];
|
||||||
|
$tw.utils.each(operator.operands,function(operand,index){
|
||||||
|
operands.push({
|
||||||
|
name: (index + 1).toString(),
|
||||||
|
value: operand
|
||||||
|
});
|
||||||
|
});
|
||||||
|
source(function(tiddler,title) {
|
||||||
|
if(title) {
|
||||||
|
results.push(options.wiki.getSubstitutedText(title,options.widget,{substitutions:operands}));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return results;
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
@@ -305,10 +305,11 @@ exports.parseAttribute = function(source,pos) {
|
|||||||
start: pos
|
start: pos
|
||||||
};
|
};
|
||||||
// Define our regexps
|
// Define our regexps
|
||||||
var reAttributeName = /([^\/\s>"'=]+)/g,
|
var reAttributeName = /([^\/\s>"'`=]+)/g,
|
||||||
reUnquotedAttribute = /([^\/\s<>"'=]+)/g,
|
reUnquotedAttribute = /([^\/\s<>"'`=]+)/g,
|
||||||
reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/g,
|
reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/g,
|
||||||
reIndirectValue = /\{\{([^\}]+)\}\}/g;
|
reIndirectValue = /\{\{([^\}]+)\}\}/g,
|
||||||
|
reSubstitutedValue = /(?:```([\s\S]*?)```|`([^`]|[\S\s]*?)`)/g;
|
||||||
// Skip whitespace
|
// Skip whitespace
|
||||||
pos = $tw.utils.skipWhiteSpace(source,pos);
|
pos = $tw.utils.skipWhiteSpace(source,pos);
|
||||||
// Get the attribute name
|
// Get the attribute name
|
||||||
@@ -361,8 +362,15 @@ exports.parseAttribute = function(source,pos) {
|
|||||||
node.type = "macro";
|
node.type = "macro";
|
||||||
node.value = macroInvocation;
|
node.value = macroInvocation;
|
||||||
} else {
|
} else {
|
||||||
node.type = "string";
|
var substitutedValue = $tw.utils.parseTokenRegExp(source,pos,reSubstitutedValue);
|
||||||
node.value = "true";
|
if(substitutedValue) {
|
||||||
|
pos = substitutedValue.end;
|
||||||
|
node.type = "substituted";
|
||||||
|
node.rawValue = substitutedValue.match[1] || substitutedValue.match[2];
|
||||||
|
} else {
|
||||||
|
node.type = "string";
|
||||||
|
node.value = "true";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
/*\
|
|
||||||
title: $:/core/modules/parsers/wikiparser/rules/dir.js
|
|
||||||
type: application/javascript
|
|
||||||
module-type: wikirule
|
|
||||||
|
|
||||||
Wiki pragma rule for specifying text direction
|
|
||||||
|
|
||||||
```
|
|
||||||
\dir rtl
|
|
||||||
\dir ltr
|
|
||||||
\dir auto
|
|
||||||
```
|
|
||||||
|
|
||||||
\*/
|
|
||||||
(function(){
|
|
||||||
|
|
||||||
/*jslint node: true, browser: true */
|
|
||||||
/*global $tw: false */
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
exports.name = "dir";
|
|
||||||
exports.types = {pragma: true};
|
|
||||||
|
|
||||||
/*
|
|
||||||
Instantiate parse rule
|
|
||||||
*/
|
|
||||||
exports.init = function(parser) {
|
|
||||||
this.parser = parser;
|
|
||||||
// Regexp to match
|
|
||||||
this.matchRegExp = /^\\dir[^\S\n]*(\S+)\r?\n/mg;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
Parse the most recent match
|
|
||||||
*/
|
|
||||||
exports.parse = function() {
|
|
||||||
var self = this;
|
|
||||||
// Move past the pragma invocation
|
|
||||||
this.parser.pos = this.matchRegExp.lastIndex;
|
|
||||||
// Parse tree nodes to return
|
|
||||||
return [{
|
|
||||||
type: "element",
|
|
||||||
tag: this.parser.parseAsInline ? "span" : "div",
|
|
||||||
attributes: {
|
|
||||||
dir: {type: "string", value: this.match[1]}
|
|
||||||
},
|
|
||||||
children: []
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
|
|
||||||
})();
|
|
||||||
@@ -35,7 +35,7 @@ Instantiate parse rule
|
|||||||
exports.init = function(parser) {
|
exports.init = function(parser) {
|
||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
// Regexp to match
|
// 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;
|
var reEnd;
|
||||||
if(this.match[5]) {
|
if(this.match[5]) {
|
||||||
// If so, the end of the body is marked with \end
|
// 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 {
|
} else {
|
||||||
// Otherwise, the end of the definition is marked by the end of the line
|
// Otherwise, the end of the definition is marked by the end of the line
|
||||||
reEnd = /($|\r?\n)/mg;
|
reEnd = /($|\r?\n)/mg;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Instantiate parse rule
|
|||||||
exports.init = function(parser) {
|
exports.init = function(parser) {
|
||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
// Regexp to match
|
// Regexp to match
|
||||||
this.matchRegExp = /^\\parameters\s*\(([^)]*)\)(\s*\r?\n)?/mg;
|
this.matchRegExp = /\\parameters\s*\(([^)]*)\)(\s*\r?\n)?/mg;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ options: see below:
|
|||||||
*/
|
*/
|
||||||
var WikiParser = function(type,text,options) {
|
var WikiParser = function(type,text,options) {
|
||||||
this.wiki = options.wiki;
|
this.wiki = options.wiki;
|
||||||
this.parseAsInline = options.parseAsInline;
|
|
||||||
var self = this;
|
var self = this;
|
||||||
// Check for an externally linked tiddler
|
// Check for an externally linked tiddler
|
||||||
if($tw.browser && (text || "") === "" && options._canonical_uri) {
|
if($tw.browser && (text || "") === "" && options._canonical_uri) {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ Startup logic concerned with managing plugins
|
|||||||
// Export name and synchronous status
|
// Export name and synchronous status
|
||||||
exports.name = "plugins";
|
exports.name = "plugins";
|
||||||
exports.after = ["load-modules"];
|
exports.after = ["load-modules"];
|
||||||
|
exports.before = ["startup"];
|
||||||
exports.synchronous = true;
|
exports.synchronous = true;
|
||||||
|
|
||||||
var TITLE_REQUIRE_RELOAD_DUE_TO_PLUGIN_CHANGE = "$:/status/RequireReloadDueToPluginChange";
|
var TITLE_REQUIRE_RELOAD_DUE_TO_PLUGIN_CHANGE = "$:/status/RequireReloadDueToPluginChange";
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ exports.startup = function() {
|
|||||||
url: params.url,
|
url: params.url,
|
||||||
method: params.method,
|
method: params.method,
|
||||||
body: params.body,
|
body: params.body,
|
||||||
|
binary: params.binary,
|
||||||
oncompletion: params.oncompletion,
|
oncompletion: params.oncompletion,
|
||||||
onprogress: params.onprogress,
|
onprogress: params.onprogress,
|
||||||
bindStatus: params["bind-status"],
|
bindStatus: params["bind-status"],
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ exports.startup = function() {
|
|||||||
if($tw.browser) {
|
if($tw.browser) {
|
||||||
$tw.browser.isIE = (/msie|trident/i.test(navigator.userAgent));
|
$tw.browser.isIE = (/msie|trident/i.test(navigator.userAgent));
|
||||||
$tw.browser.isFirefox = !!document.mozFullScreenEnabled;
|
$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
|
// Platform detection
|
||||||
$tw.platform = {};
|
$tw.platform = {};
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ exports.makeDraggable = function(options) {
|
|||||||
if(dataTransfer.setDragImage) {
|
if(dataTransfer.setDragImage) {
|
||||||
if(dragImageType === "pill") {
|
if(dragImageType === "pill") {
|
||||||
dataTransfer.setDragImage(dragImage.firstChild,-16,-16);
|
dataTransfer.setDragImage(dragImage.firstChild,-16,-16);
|
||||||
} else if (dragImageType === "blank") {
|
} else if(dragImageType === "blank") {
|
||||||
dragImage.removeChild(dragImage.firstChild);
|
dragImage.removeChild(dragImage.firstChild);
|
||||||
dataTransfer.setDragImage(dragImage,0,0);
|
dataTransfer.setDragImage(dragImage,0,0);
|
||||||
} else {
|
} else {
|
||||||
@@ -106,7 +106,9 @@ exports.makeDraggable = function(options) {
|
|||||||
dataTransfer.setData("text/vnd.tiddler",jsonData);
|
dataTransfer.setData("text/vnd.tiddler",jsonData);
|
||||||
dataTransfer.setData("text/plain",titleString);
|
dataTransfer.setData("text/plain",titleString);
|
||||||
dataTransfer.setData("text/x-moz-url","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
|
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("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
|
||||||
}
|
}
|
||||||
dataTransfer.setData("Text",titleString);
|
dataTransfer.setData("Text",titleString);
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ wiki: wiki to be used for executing action strings
|
|||||||
url: URL for request
|
url: URL for request
|
||||||
method: method eg GET, POST
|
method: method eg GET, POST
|
||||||
body: text of request body
|
body: text of request body
|
||||||
|
binary: set to "yes" to force binary processing of response payload
|
||||||
oncompletion: action string to be invoked on completion
|
oncompletion: action string to be invoked on completion
|
||||||
onprogress: action string to be invoked on progress updates
|
onprogress: action string to be invoked on progress updates
|
||||||
bindStatus: optional title of tiddler to which status ("pending", "complete", "error") should be written
|
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.wiki = options.wiki;
|
||||||
this.completionActions = options.oncompletion;
|
this.completionActions = options.oncompletion;
|
||||||
this.progressActions = options.onprogress;
|
this.progressActions = options.onprogress;
|
||||||
this.bindStatus = options["bind-status"];
|
this.bindStatus = options["bindStatus"];
|
||||||
this.bindProgress = options["bind-progress"];
|
this.bindProgress = options["bindProgress"];
|
||||||
this.method = options.method || "GET";
|
this.method = options.method || "GET";
|
||||||
this.body = options.body || "";
|
this.body = options.body || "";
|
||||||
|
this.binary = options.binary || "";
|
||||||
this.variables = options.variables;
|
this.variables = options.variables;
|
||||||
var url = options.url;
|
var url = options.url;
|
||||||
$tw.utils.each(options.queryStrings,function(value,name) {
|
$tw.utils.each(options.queryStrings,function(value,name) {
|
||||||
@@ -132,7 +134,7 @@ HttpClientRequest.prototype.send = function(callback) {
|
|||||||
var self = this,
|
var self = this,
|
||||||
setBinding = function(title,text) {
|
setBinding = function(title,text) {
|
||||||
if(title) {
|
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) {
|
if(this.url) {
|
||||||
@@ -156,6 +158,8 @@ HttpClientRequest.prototype.send = function(callback) {
|
|||||||
type: this.method,
|
type: this.method,
|
||||||
headers: this.requestHeaders,
|
headers: this.requestHeaders,
|
||||||
data: this.body,
|
data: this.body,
|
||||||
|
returnProp: this.binary === "" ? "responseText" : "response",
|
||||||
|
responseType: this.binary === "" ? "text" : "arraybuffer",
|
||||||
callback: function(err,data,xhr) {
|
callback: function(err,data,xhr) {
|
||||||
var hasSucceeded = xhr.status >= 200 && xhr.status < 300,
|
var hasSucceeded = xhr.status >= 200 && xhr.status < 300,
|
||||||
completionCode = hasSucceeded ? "complete" : "error",
|
completionCode = hasSucceeded ? "complete" : "error",
|
||||||
@@ -175,6 +179,16 @@ HttpClientRequest.prototype.send = function(callback) {
|
|||||||
data: (data || "").toString(),
|
data: (data || "").toString(),
|
||||||
headers: JSON.stringify(headers)
|
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),{
|
self.wiki.addTiddler(new $tw.Tiddler(self.wiki.getTiddler(requestTrackerTitle),{
|
||||||
status: completionCode,
|
status: completionCode,
|
||||||
}));
|
}));
|
||||||
@@ -212,6 +226,7 @@ Make an HTTP request. Options are:
|
|||||||
callback: function invoked with (err,data,xhr)
|
callback: function invoked with (err,data,xhr)
|
||||||
progress: optional function invoked with (lengthComputable,loaded,total)
|
progress: optional function invoked with (lengthComputable,loaded,total)
|
||||||
returnProp: string name of the property to return as first argument of callback
|
returnProp: string name of the property to return as first argument of callback
|
||||||
|
responseType: "text" or "arraybuffer"
|
||||||
*/
|
*/
|
||||||
exports.httpRequest = function(options) {
|
exports.httpRequest = function(options) {
|
||||||
var type = options.type || "GET",
|
var type = options.type || "GET",
|
||||||
@@ -264,6 +279,7 @@ exports.httpRequest = function(options) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
request.responseType = options.responseType || "text";
|
||||||
// Set up the state change handler
|
// Set up the state change handler
|
||||||
request.onreadystatechange = function() {
|
request.onreadystatechange = function() {
|
||||||
if(this.readyState === 4) {
|
if(this.readyState === 4) {
|
||||||
|
|||||||
@@ -104,7 +104,11 @@ TW_Element.prototype.setAttribute = function(name,value) {
|
|||||||
if(this.isRaw) {
|
if(this.isRaw) {
|
||||||
throw "Cannot setAttribute on a raw TW_Element";
|
throw "Cannot setAttribute on a raw TW_Element";
|
||||||
}
|
}
|
||||||
this.attributes[name] = value + "";
|
if(name === "style") {
|
||||||
|
this.style = value;
|
||||||
|
} else {
|
||||||
|
this.attributes[name] = value + "";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TW_Element.prototype.setAttributeNS = function(namespace,name,value) {
|
TW_Element.prototype.setAttributeNS = function(namespace,name,value) {
|
||||||
|
|||||||
@@ -70,6 +70,11 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},false);
|
},false);
|
||||||
|
// Assign data- attributes
|
||||||
|
this.assignAttributes(domNode,{
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
// Insert element
|
// Insert element
|
||||||
parent.insertBefore(domNode,nextSibling);
|
parent.insertBefore(domNode,nextSibling);
|
||||||
this.renderChildren(domNode,null);
|
this.renderChildren(domNode,null);
|
||||||
@@ -95,6 +100,11 @@ BrowseWidget.prototype.execute = function() {
|
|||||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||||
*/
|
*/
|
||||||
BrowseWidget.prototype.refresh = function(changedTiddlers) {
|
BrowseWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
|
var changedAttributes = this.computeAttributes();
|
||||||
|
if($tw.utils.count(changedAttributes) > 0) {
|
||||||
|
this.refreshSelf();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
$tw.utils.pushTop(classes,"tc-popup-handle");
|
$tw.utils.pushTop(classes,"tc-popup-handle");
|
||||||
}
|
}
|
||||||
domNode.className = classes.join(" ");
|
domNode.className = classes.join(" ");
|
||||||
|
// Assign data- attributes
|
||||||
|
this.assignAttributes(domNode,{
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
// Assign other attributes
|
// Assign other attributes
|
||||||
if(this.style) {
|
if(this.style) {
|
||||||
domNode.setAttribute("style",this.style);
|
domNode.setAttribute("style",this.style);
|
||||||
@@ -250,7 +255,7 @@ ButtonWidget.prototype.updateDomNodeClasses = function() {
|
|||||||
//Add new classes from updated class attribute.
|
//Add new classes from updated class attribute.
|
||||||
$tw.utils.pushTop(domNodeClasses,newClasses);
|
$tw.utils.pushTop(domNodeClasses,newClasses);
|
||||||
this.domNode.className = domNodeClasses.join(" ");
|
this.domNode.className = domNodeClasses.join(" ");
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||||
@@ -260,8 +265,15 @@ ButtonWidget.prototype.refresh = function(changedTiddlers) {
|
|||||||
if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.popupAbsCoords || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled || changedAttributes["default"]) {
|
if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.popupAbsCoords || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled || changedAttributes["default"]) {
|
||||||
this.refreshSelf();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
} else if(changedAttributes["class"]) {
|
} else {
|
||||||
this.updateDomNodeClasses();
|
if(changedAttributes["class"]) {
|
||||||
|
this.updateDomNodeClasses();
|
||||||
|
}
|
||||||
|
this.assignAttributes(this.domNodes[0],{
|
||||||
|
changedAttributes: changedAttributes,
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return this.refreshChildren(changedTiddlers);
|
return this.refreshChildren(changedTiddlers);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -53,6 +53,11 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
this.labelDomNode.appendChild(this.inputDomNode);
|
this.labelDomNode.appendChild(this.inputDomNode);
|
||||||
this.spanDomNode = this.document.createElement("span");
|
this.spanDomNode = this.document.createElement("span");
|
||||||
this.labelDomNode.appendChild(this.spanDomNode);
|
this.labelDomNode.appendChild(this.spanDomNode);
|
||||||
|
// Assign data- attributes
|
||||||
|
this.assignAttributes(this.inputDomNode,{
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
// Add a click event handler
|
// Add a click event handler
|
||||||
$tw.utils.addEventListeners(this.inputDomNode,[
|
$tw.utils.addEventListeners(this.inputDomNode,[
|
||||||
{name: "change", handlerObject: this, handlerMethod: "handleChangeEvent"}
|
{name: "change", handlerObject: this, handlerMethod: "handleChangeEvent"}
|
||||||
@@ -116,7 +121,7 @@ CheckboxWidget.prototype.getValue = function() {
|
|||||||
} else {
|
} else {
|
||||||
list = $tw.utils.parseStringArray(this.checkboxDefault || "") || [];
|
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 || "")) || [];
|
list = $tw.utils.parseStringArray(this.wiki.extractTiddlerDataItem(tiddler,this.checkboxListIndex,this.checkboxDefault || "")) || [];
|
||||||
} else {
|
} else {
|
||||||
list = this.wiki.filterTiddlers(this.checkboxFilter,this) || [];
|
list = this.wiki.filterTiddlers(this.checkboxFilter,this) || [];
|
||||||
@@ -215,6 +220,8 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
|
|||||||
if($tw.utils.isArray(fieldContents)) {
|
if($tw.utils.isArray(fieldContents)) {
|
||||||
// Make a copy so we can modify it without changing original that's refrenced elsewhere
|
// Make a copy so we can modify it without changing original that's refrenced elsewhere
|
||||||
listContents = fieldContents.slice(0);
|
listContents = fieldContents.slice(0);
|
||||||
|
} else if(fieldContents === undefined) {
|
||||||
|
listContents = [];
|
||||||
} else if(typeof fieldContents === "string") {
|
} else if(typeof fieldContents === "string") {
|
||||||
listContents = $tw.utils.parseStringArray(fieldContents);
|
listContents = $tw.utils.parseStringArray(fieldContents);
|
||||||
// No need to copy since parseStringArray returns a fresh array, not refrenced elsewhere
|
// No need to copy since parseStringArray returns a fresh array, not refrenced elsewhere
|
||||||
@@ -323,6 +330,11 @@ CheckboxWidget.prototype.refresh = function(changedTiddlers) {
|
|||||||
$tw.utils.removeClass(this.labelDomNode,"tc-checkbox-checked");
|
$tw.utils.removeClass(this.labelDomNode,"tc-checkbox-checked");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.assignAttributes(this.inputDomNode,{
|
||||||
|
changedAttributes: changedAttributes,
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
return this.refreshChildren(changedTiddlers) || refreshed;
|
return this.refreshChildren(changedTiddlers) || refreshed;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -330,3 +342,4 @@ CheckboxWidget.prototype.refresh = function(changedTiddlers) {
|
|||||||
exports.checkbox = CheckboxWidget;
|
exports.checkbox = CheckboxWidget;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -52,6 +52,11 @@ DraggableWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
classes.push("tc-draggable");
|
classes.push("tc-draggable");
|
||||||
}
|
}
|
||||||
domNode.setAttribute("class",classes.join(" "));
|
domNode.setAttribute("class",classes.join(" "));
|
||||||
|
// Assign data- attributes and style. attributes
|
||||||
|
this.assignAttributes(domNode,{
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
// Insert the node into the DOM and render any children
|
// Insert the node into the DOM and render any children
|
||||||
parent.insertBefore(domNode,nextSibling);
|
parent.insertBefore(domNode,nextSibling);
|
||||||
this.renderChildren(domNode,null);
|
this.renderChildren(domNode,null);
|
||||||
@@ -108,13 +113,19 @@ DraggableWidget.prototype.updateDomNodeClasses = function() {
|
|||||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||||
*/
|
*/
|
||||||
DraggableWidget.prototype.refresh = function(changedTiddlers) {
|
DraggableWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
var changedAttributes = this.computeAttributes(),
|
var changedAttributes = this.computeAttributes();
|
||||||
changedAttributesCount = $tw.utils.count(changedAttributes);
|
if(changedAttributes.tag || changedAttributes.selector || changedAttributes.dragimagetype || changedAttributes.enable || changedAttributes.startactions || changedAttributes.endactions) {
|
||||||
if(changedAttributesCount === 1 && changedAttributes["class"]) {
|
|
||||||
this.updateDomNodeClasses();
|
|
||||||
} else if(changedAttributesCount > 0) {
|
|
||||||
this.refreshSelf();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
if(changedAttributes["class"]) {
|
||||||
|
this.assignDomNodeClasses();
|
||||||
|
}
|
||||||
|
this.assignAttributes(this.domNodes[0],{
|
||||||
|
changedAttributes: changedAttributes,
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return this.refreshChildren(changedTiddlers);
|
return this.refreshChildren(changedTiddlers);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ DroppableWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
domNode = this.document.createElement(tag);
|
domNode = this.document.createElement(tag);
|
||||||
this.domNode = domNode;
|
this.domNode = domNode;
|
||||||
this.assignDomNodeClasses();
|
this.assignDomNodeClasses();
|
||||||
|
// Assign data- attributes and style. attributes
|
||||||
|
this.assignAttributes(domNode,{
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
// Add event handlers
|
// Add event handlers
|
||||||
if(this.droppableEnable) {
|
if(this.droppableEnable) {
|
||||||
$tw.utils.addEventListeners(domNode,[
|
$tw.utils.addEventListeners(domNode,[
|
||||||
@@ -166,8 +171,15 @@ DroppableWidget.prototype.refresh = function(changedTiddlers) {
|
|||||||
if(changedAttributes.tag || changedAttributes.enable || changedAttributes.disabledClass || changedAttributes.actions || changedAttributes.effect) {
|
if(changedAttributes.tag || changedAttributes.enable || changedAttributes.disabledClass || changedAttributes.actions || changedAttributes.effect) {
|
||||||
this.refreshSelf();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
} else if(changedAttributes["class"]) {
|
} else {
|
||||||
this.assignDomNodeClasses();
|
if(changedAttributes["class"]) {
|
||||||
|
this.assignDomNodeClasses();
|
||||||
|
}
|
||||||
|
this.assignAttributes(this.domNodes[0],{
|
||||||
|
changedAttributes: changedAttributes,
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return this.refreshChildren(changedTiddlers);
|
return this.refreshChildren(changedTiddlers);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ EditWidget.prototype.execute = function() {
|
|||||||
this.editPlaceholder = this.getAttribute("placeholder");
|
this.editPlaceholder = this.getAttribute("placeholder");
|
||||||
this.editTabIndex = this.getAttribute("tabindex");
|
this.editTabIndex = this.getAttribute("tabindex");
|
||||||
this.editFocus = this.getAttribute("focus","");
|
this.editFocus = this.getAttribute("focus","");
|
||||||
this.editDir = this.getAttribute("dir");
|
|
||||||
this.editCancelPopups = this.getAttribute("cancelPopups","");
|
this.editCancelPopups = this.getAttribute("cancelPopups","");
|
||||||
this.editInputActions = this.getAttribute("inputActions");
|
this.editInputActions = this.getAttribute("inputActions");
|
||||||
this.editRefreshTitle = this.getAttribute("refreshTitle");
|
this.editRefreshTitle = this.getAttribute("refreshTitle");
|
||||||
@@ -91,7 +90,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
|||||||
EditWidget.prototype.refresh = function(changedTiddlers) {
|
EditWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
var changedAttributes = this.computeAttributes();
|
var changedAttributes = this.computeAttributes();
|
||||||
// Refresh if an attribute has changed, or the type associated with the target tiddler has changed
|
// Refresh if an attribute has changed, or the type associated with the target tiddler has changed
|
||||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tabindex || changedAttributes.dir || changedAttributes.cancelPopups || changedAttributes.inputActions || changedAttributes.refreshTitle || changedAttributes.autocomplete || (changedTiddlers[this.editTitle] && this.getEditorType() !== this.editorType)) {
|
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tabindex || changedAttributes.cancelPopups || changedAttributes.inputActions || changedAttributes.refreshTitle || changedAttributes.autocomplete || (changedTiddlers[this.editTitle] && this.getEditorType() !== this.editorType)) {
|
||||||
this.refreshSelf();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
|
|||||||
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
|
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
|
||||||
// Accumulate the <$set> widgets from each tiddler
|
// Accumulate the <$set> widgets from each tiddler
|
||||||
$tw.utils.each(this.tiddlerList,function(title) {
|
$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) {
|
if(parser) {
|
||||||
var parseTreeNode = parser.tree[0];
|
var parseTreeNode = parser.tree[0];
|
||||||
while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) {
|
while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) {
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ LinkWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
} else {
|
} else {
|
||||||
// Just insert the link text
|
// Just insert the link text
|
||||||
var domNode = this.document.createElement("span");
|
var domNode = this.document.createElement("span");
|
||||||
|
// Assign data- attributes
|
||||||
|
this.assignAttributes(domNode,{
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
parent.insertBefore(domNode,nextSibling);
|
parent.insertBefore(domNode,nextSibling);
|
||||||
this.renderChildren(domNode,null);
|
this.renderChildren(domNode,null);
|
||||||
this.domNodes.push(domNode);
|
this.domNodes.push(domNode);
|
||||||
@@ -138,6 +143,11 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
|
|||||||
widget: this
|
widget: this
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Assign data- attributes
|
||||||
|
this.assignAttributes(domNode,{
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
// Insert the link into the DOM and render any children
|
// Insert the link into the DOM and render any children
|
||||||
parent.insertBefore(domNode,nextSibling);
|
parent.insertBefore(domNode,nextSibling);
|
||||||
this.renderChildren(domNode,null);
|
this.renderChildren(domNode,null);
|
||||||
@@ -207,8 +217,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
|||||||
*/
|
*/
|
||||||
LinkWidget.prototype.refresh = function(changedTiddlers) {
|
LinkWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
var changedAttributes = this.computeAttributes();
|
var changedAttributes = this.computeAttributes();
|
||||||
if(changedAttributes.to || changedTiddlers[this.to] || changedAttributes["aria-label"] || changedAttributes.tooltip ||
|
if($tw.utils.count(changedAttributes) > 0) {
|
||||||
changedAttributes["class"] || changedAttributes.tabindex || changedAttributes.draggable || changedAttributes.tag) {
|
|
||||||
this.refreshSelf();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -218,3 +227,4 @@ LinkWidget.prototype.refresh = function(changedTiddlers) {
|
|||||||
exports.link = LinkWidget;
|
exports.link = LinkWidget;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -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
|
// If we are providing an counter variable then we must refresh the items, otherwise we can rearrange them
|
||||||
var hasRefreshed = false,t;
|
var hasRefreshed = false,t;
|
||||||
if(this.counterName) {
|
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
|
// 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++) {
|
for(t=0; t<this.list.length; t++) {
|
||||||
if(hasRefreshed || !this.children[t] || this.children[t].parseTreeNode.itemTitle !== this.list[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.removeListItem(t);
|
||||||
}
|
}
|
||||||
this.insertListItem(t,this.list[t]);
|
this.insertListItem(t,this.list[t]);
|
||||||
|
if(!hasRefreshed && t === oldLength) {
|
||||||
|
mustRefreshOldLast = true;
|
||||||
|
}
|
||||||
hasRefreshed = true;
|
hasRefreshed = true;
|
||||||
} else {
|
} else {
|
||||||
// Refresh the item we're reusing
|
// Refresh the item we're reusing
|
||||||
@@ -239,6 +244,12 @@ ListWidget.prototype.handleListChanges = function(changedTiddlers) {
|
|||||||
hasRefreshed = hasRefreshed || refreshed;
|
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 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) {
|
if(!hasRefreshed && this.children.length > this.list.length) {
|
||||||
this.removeListItem(this.list.length-1);
|
this.removeListItem(this.list.length-1);
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ RadioWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
);
|
);
|
||||||
this.inputDomNode = this.document.createElement("input");
|
this.inputDomNode = this.document.createElement("input");
|
||||||
this.inputDomNode.setAttribute("type","radio");
|
this.inputDomNode.setAttribute("type","radio");
|
||||||
|
this.assignAttributes(this.inputDomNode,{
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
if(isChecked) {
|
if(isChecked) {
|
||||||
this.inputDomNode.checked = true;
|
this.inputDomNode.checked = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ RangeWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
this.inputDomNode.setAttribute("disabled",true);
|
this.inputDomNode.setAttribute("disabled",true);
|
||||||
}
|
}
|
||||||
this.inputDomNode.value = this.getValue();
|
this.inputDomNode.value = this.getValue();
|
||||||
|
this.assignAttributes(this.inputDomNode,{
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
// Add a click event handler
|
// Add a click event handler
|
||||||
$tw.utils.addEventListeners(this.inputDomNode,[
|
$tw.utils.addEventListeners(this.inputDomNode,[
|
||||||
{name:"mousedown", handlerObject:this, handlerMethod:"handleMouseDownEvent"},
|
{name:"mousedown", handlerObject:this, handlerMethod:"handleMouseDownEvent"},
|
||||||
|
|||||||
@@ -42,9 +42,6 @@ RevealWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
if(this.style) {
|
if(this.style) {
|
||||||
domNode.setAttribute("style",this.style);
|
domNode.setAttribute("style",this.style);
|
||||||
}
|
}
|
||||||
if(this.direction) {
|
|
||||||
domNode.setAttribute("dir",this.direction);
|
|
||||||
}
|
|
||||||
parent.insertBefore(domNode,nextSibling);
|
parent.insertBefore(domNode,nextSibling);
|
||||||
this.renderChildren(domNode,null);
|
this.renderChildren(domNode,null);
|
||||||
if(!domNode.isTiddlyWikiFakeDom && this.type === "popup" && this.isOpen) {
|
if(!domNode.isTiddlyWikiFakeDom && this.type === "popup" && this.isOpen) {
|
||||||
@@ -126,7 +123,6 @@ RevealWidget.prototype.execute = function() {
|
|||||||
this["default"] = this.getAttribute("default","");
|
this["default"] = this.getAttribute("default","");
|
||||||
this.animate = this.getAttribute("animate","no");
|
this.animate = this.getAttribute("animate","no");
|
||||||
this.retain = this.getAttribute("retain","no");
|
this.retain = this.getAttribute("retain","no");
|
||||||
this.direction = this.getAttribute("dir");
|
|
||||||
this.openAnimation = this.animate === "no" ? undefined : "open";
|
this.openAnimation = this.animate === "no" ? undefined : "open";
|
||||||
this.closeAnimation = this.animate === "no" ? undefined : "close";
|
this.closeAnimation = this.animate === "no" ? undefined : "close";
|
||||||
this.updatePopupPosition = this.getAttribute("updatePopupPosition","no") === "yes";
|
this.updatePopupPosition = this.getAttribute("updatePopupPosition","no") === "yes";
|
||||||
@@ -218,7 +214,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
|||||||
*/
|
*/
|
||||||
RevealWidget.prototype.refresh = function(changedTiddlers) {
|
RevealWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
var changedAttributes = this.computeAttributes();
|
var changedAttributes = this.computeAttributes();
|
||||||
if(changedAttributes.state || changedAttributes.type || changedAttributes.text || changedAttributes.position || changedAttributes.positionAllowNegative || changedAttributes["default"] || changedAttributes.animate || changedAttributes.stateTitle || changedAttributes.stateField || changedAttributes.stateIndex || changedAttributes.dir) {
|
if(changedAttributes.state || changedAttributes.type || changedAttributes.text || changedAttributes.position || changedAttributes.positionAllowNegative || changedAttributes["default"] || changedAttributes.animate || changedAttributes.stateTitle || changedAttributes.stateField || changedAttributes.stateIndex) {
|
||||||
this.refreshSelf();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -40,7 +40,31 @@ SelectWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
this.parentDomNode = parent;
|
this.parentDomNode = parent;
|
||||||
this.computeAttributes();
|
this.computeAttributes();
|
||||||
this.execute();
|
this.execute();
|
||||||
this.renderChildren(parent,nextSibling);
|
//Create element
|
||||||
|
var domNode = this.document.createElement("select");
|
||||||
|
if(this.selectClass) {
|
||||||
|
domNode.classname = this.selectClass;
|
||||||
|
}
|
||||||
|
// Assign data- attributes
|
||||||
|
this.assignAttributes(domNode,{
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
|
if(this.selectMultiple) {
|
||||||
|
domNode.setAttribute("multiple","multiple");
|
||||||
|
}
|
||||||
|
if(this.selectSize) {
|
||||||
|
domNode.setAttribute("size",this.selectSize);
|
||||||
|
}
|
||||||
|
if(this.selectTabindex) {
|
||||||
|
domNode.setAttribute("tabindex",this.selectTabindex);
|
||||||
|
}
|
||||||
|
if(this.selectTooltip) {
|
||||||
|
domNode.setAttribute("title",this.selectTooltip);
|
||||||
|
}
|
||||||
|
this.renderChildren(domNode,nextSibling);
|
||||||
|
this.parentDomNode.insertBefore(domNode,nextSibling);
|
||||||
|
this.domNodes.push(domNode);
|
||||||
this.setSelectValue();
|
this.setSelectValue();
|
||||||
if(this.selectFocus == "yes") {
|
if(this.selectFocus == "yes") {
|
||||||
this.getSelectDomNode().focus();
|
this.getSelectDomNode().focus();
|
||||||
@@ -113,7 +137,7 @@ SelectWidget.prototype.setSelectValue = function() {
|
|||||||
Get the DOM node of the select element
|
Get the DOM node of the select element
|
||||||
*/
|
*/
|
||||||
SelectWidget.prototype.getSelectDomNode = function() {
|
SelectWidget.prototype.getSelectDomNode = function() {
|
||||||
return this.children[0].domNodes[0];
|
return this.domNodes[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Return an array of the selected opion values
|
// Return an array of the selected opion values
|
||||||
@@ -145,27 +169,11 @@ SelectWidget.prototype.execute = function() {
|
|||||||
this.selectDefault = this.getAttribute("default");
|
this.selectDefault = this.getAttribute("default");
|
||||||
this.selectMultiple = this.getAttribute("multiple", false);
|
this.selectMultiple = this.getAttribute("multiple", false);
|
||||||
this.selectSize = this.getAttribute("size");
|
this.selectSize = this.getAttribute("size");
|
||||||
|
this.selectTabindex = this.getAttribute("tabindex");
|
||||||
this.selectTooltip = this.getAttribute("tooltip");
|
this.selectTooltip = this.getAttribute("tooltip");
|
||||||
this.selectFocus = this.getAttribute("focus");
|
this.selectFocus = this.getAttribute("focus");
|
||||||
// Make the child widgets
|
// Make the child widgets
|
||||||
var selectNode = {
|
this.makeChildWidgets();
|
||||||
type: "element",
|
|
||||||
tag: "select",
|
|
||||||
children: this.parseTreeNode.children
|
|
||||||
};
|
|
||||||
if(this.selectClass) {
|
|
||||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"class",this.selectClass);
|
|
||||||
}
|
|
||||||
if(this.selectMultiple) {
|
|
||||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"multiple","multiple");
|
|
||||||
}
|
|
||||||
if(this.selectSize) {
|
|
||||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"size",this.selectSize);
|
|
||||||
}
|
|
||||||
if(this.selectTooltip) {
|
|
||||||
$tw.utils.addAttributeToParseTreeNode(selectNode,"title",this.selectTooltip);
|
|
||||||
}
|
|
||||||
this.makeChildWidgets([selectNode]);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -174,17 +182,21 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
|||||||
SelectWidget.prototype.refresh = function(changedTiddlers) {
|
SelectWidget.prototype.refresh = function(changedTiddlers) {
|
||||||
var changedAttributes = this.computeAttributes();
|
var changedAttributes = this.computeAttributes();
|
||||||
// If we're using a different tiddler/field/index then completely refresh ourselves
|
// If we're using a different tiddler/field/index then completely refresh ourselves
|
||||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tooltip) {
|
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tooltip || changedAttributes.tabindex) {
|
||||||
this.refreshSelf();
|
this.refreshSelf();
|
||||||
return true;
|
return true;
|
||||||
// If the target tiddler value has changed, just update setting and refresh the children
|
|
||||||
} else {
|
} else {
|
||||||
if(changedAttributes.class) {
|
if(changedAttributes.class) {
|
||||||
this.selectClass = this.getAttribute("class");
|
this.selectClass = this.getAttribute("class");
|
||||||
this.getSelectDomNode().setAttribute("class",this.selectClass);
|
this.getSelectDomNode().setAttribute("class",this.selectClass);
|
||||||
}
|
}
|
||||||
|
this.assignAttributes(this.getSelectDomNode(),{
|
||||||
|
changedAttributes: changedAttributes,
|
||||||
|
sourcePrefix: "data-",
|
||||||
|
destPrefix: "data-"
|
||||||
|
});
|
||||||
var childrenRefreshed = this.refreshChildren(changedTiddlers);
|
var childrenRefreshed = this.refreshChildren(changedTiddlers);
|
||||||
|
// If the target tiddler value has changed, just update setting and refresh the children
|
||||||
if(changedTiddlers[this.selectTitle] || childrenRefreshed) {
|
if(changedTiddlers[this.selectTitle] || childrenRefreshed) {
|
||||||
this.setSelectValue();
|
this.setSelectValue();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,27 +41,43 @@ TranscludeWidget.prototype.execute = function() {
|
|||||||
this.collectAttributes();
|
this.collectAttributes();
|
||||||
this.collectStringParameters();
|
this.collectStringParameters();
|
||||||
this.collectSlotFillParameters();
|
this.collectSlotFillParameters();
|
||||||
// Get the parse tree nodes that we are transcluding
|
// Determine whether we're being used in inline or block mode
|
||||||
var target = this.getTransclusionTarget(),
|
var parseAsInline = !this.parseTreeNode.isBlock;
|
||||||
parseTreeNodes = target.parseTreeNodes;
|
if(this.transcludeMode === "inline") {
|
||||||
this.sourceText = target.text;
|
parseAsInline = true;
|
||||||
this.parserType = target.type;
|
} else if(this.transcludeMode === "block") {
|
||||||
this.parseAsInline = target.parseAsInline;
|
parseAsInline = false;
|
||||||
|
}
|
||||||
|
// Set 'thisTiddler'
|
||||||
|
this.setVariable("thisTiddler",this.transcludeTitle);
|
||||||
|
var parseTreeNodes, target;
|
||||||
// Process the transclusion according to the output type
|
// Process the transclusion according to the output type
|
||||||
switch(this.transcludeOutput || "text/html") {
|
switch(this.transcludeOutput || "text/html") {
|
||||||
case "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;
|
break;
|
||||||
case "text/raw":
|
case "text/raw":
|
||||||
// Just return the raw text
|
// Just return the raw text
|
||||||
parseTreeNodes = [{type: "text", text: this.sourceText}];
|
target = this.getTransclusionTarget();
|
||||||
|
parseTreeNodes = [{type: "text", text: target.text}];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// text/plain
|
// "text/plain" is the plain text result of wikifying the text
|
||||||
var plainText = this.wiki.renderText("text/plain",this.parserType,this.sourceText,{parentWidget: this});
|
target = this.parseTransclusionTarget(parseAsInline);
|
||||||
parseTreeNodes = [{type: "text", text: plainText}];
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
this.sourceText = target.text;
|
||||||
|
this.parserType = target.type;
|
||||||
// Set the legacy transclusion context variables only if we're not transcluding a variable
|
// Set the legacy transclusion context variables only if we're not transcluding a variable
|
||||||
if(!this.transcludeVariable) {
|
if(!this.transcludeVariable) {
|
||||||
var recursionMarker = this.makeRecursionMarker();
|
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() {
|
TranscludeWidget.prototype.getTransclusionTarget = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
// Determine whether we're being used in inline or block mode
|
var text;
|
||||||
var parseAsInline = !this.parseTreeNode.isBlock;
|
// Return the text and type of the target
|
||||||
if(this.transcludeMode === "inline") {
|
if(this.hasAttribute("$variable")) {
|
||||||
parseAsInline = true;
|
if(this.transcludeVariable) {
|
||||||
} else if(this.transcludeMode === "block") {
|
// Transcluding a variable
|
||||||
parseAsInline = false;
|
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;
|
var parser;
|
||||||
// Get the parse tree
|
// Get the parse tree
|
||||||
if(this.hasAttribute("$variable")) {
|
if(this.hasAttribute("$variable")) {
|
||||||
@@ -177,7 +220,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||||||
var variableInfo = this.getVariableInfo(this.transcludeVariable,{params: this.getOrderedTransclusionParameters()}),
|
var variableInfo = this.getVariableInfo(this.transcludeVariable,{params: this.getOrderedTransclusionParameters()}),
|
||||||
srcVariable = variableInfo && variableInfo.srcVariable;
|
srcVariable = variableInfo && variableInfo.srcVariable;
|
||||||
if(variableInfo.text) {
|
if(variableInfo.text) {
|
||||||
if(srcVariable.isFunctionDefinition) {
|
if(srcVariable && srcVariable.isFunctionDefinition) {
|
||||||
var result = (variableInfo.resultList ? variableInfo.resultList[0] : variableInfo.text) || "";
|
var result = (variableInfo.resultList ? variableInfo.resultList[0] : variableInfo.text) || "";
|
||||||
parser = {
|
parser = {
|
||||||
tree: [{
|
tree: [{
|
||||||
@@ -207,7 +250,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||||||
if(variableInfo.isCacheable && srcVariable[cacheKey]) {
|
if(variableInfo.isCacheable && srcVariable[cacheKey]) {
|
||||||
parser = srcVariable[cacheKey];
|
parser = srcVariable[cacheKey];
|
||||||
} else {
|
} 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) {
|
if(variableInfo.isCacheable) {
|
||||||
srcVariable[cacheKey] = parser;
|
srcVariable[cacheKey] = parser;
|
||||||
}
|
}
|
||||||
@@ -215,7 +258,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||||||
}
|
}
|
||||||
if(parser) {
|
if(parser) {
|
||||||
// Add parameters widget for procedures and custom widgets
|
// Add parameters widget for procedures and custom widgets
|
||||||
if(srcVariable.isProcedureDefinition || srcVariable.isWidgetDefinition) {
|
if(srcVariable && (srcVariable.isProcedureDefinition || srcVariable.isWidgetDefinition)) {
|
||||||
parser = {
|
parser = {
|
||||||
tree: [
|
tree: [
|
||||||
{
|
{
|
||||||
@@ -234,7 +277,7 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||||||
}
|
}
|
||||||
$tw.utils.addAttributeToParseTreeNode(parser.tree[0],name,param["default"])
|
$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__"
|
// For macros and ordinary variables, wrap the parse tree in a vars widget assigning the parameters to variables named "__paramname__"
|
||||||
parser = {
|
parser = {
|
||||||
tree: [
|
tree: [
|
||||||
@@ -265,27 +308,14 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||||||
defaultType: this.transcludeType
|
defaultType: this.transcludeType
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Set 'thisTiddler'
|
|
||||||
this.setVariable("thisTiddler",this.transcludeTitle);
|
|
||||||
// Return the parse tree
|
// Return the parse tree
|
||||||
if(parser) {
|
return {
|
||||||
return {
|
parser: parser,
|
||||||
parser: parser,
|
parseTreeNodes: parser ? parser.tree : (this.slotFillParseTrees["ts-missing"] || []),
|
||||||
parseTreeNodes: parser.tree,
|
parseAsInline: parseAsInline,
|
||||||
parseAsInline: parseAsInline,
|
text: parser && parser.source,
|
||||||
text: parser.source,
|
type: parser && parser.type
|
||||||
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
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -182,8 +182,7 @@ Widget.prototype.getVariableInfo = function(name,options) {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
text: text,
|
text: text,
|
||||||
resultList: [text],
|
resultList: [text]
|
||||||
srcVariable: {}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -380,6 +379,8 @@ Widget.prototype.computeAttribute = function(attribute) {
|
|||||||
} else if(attribute.type === "macro") {
|
} else if(attribute.type === "macro") {
|
||||||
var variableInfo = this.getVariableInfo(attribute.value.name,{params: attribute.value.params});
|
var variableInfo = this.getVariableInfo(attribute.value.name,{params: attribute.value.params});
|
||||||
value = variableInfo.text;
|
value = variableInfo.text;
|
||||||
|
} else if(attribute.type === "substituted") {
|
||||||
|
value = this.wiki.getSubstitutedText(attribute.rawValue,this) || "";
|
||||||
} else { // String attribute
|
} else { // String attribute
|
||||||
value = attribute.value;
|
value = attribute.value;
|
||||||
}
|
}
|
||||||
@@ -412,16 +413,34 @@ Widget.prototype.getAttribute = function(name,defaultText) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Assign the computed attributes of the widget to a domNode
|
Assign the common attributes of the widget to a domNode
|
||||||
options include:
|
options include:
|
||||||
excludeEventAttributes: ignores attributes whose name begins with "on"
|
sourcePrefix: prefix of attributes that are to be directly assigned (defaults to the empty string meaning all attributes)
|
||||||
|
destPrefix: prefix to be applied to attribute names that are to be directly assigned (defaults to the emtpy string which means no prefix is added)
|
||||||
|
changedAttributes: hashmap by attribute name of attributes to process (if missing, process all attributes)
|
||||||
|
excludeEventAttributes: ignores attributes whose name would begin with "on"
|
||||||
*/
|
*/
|
||||||
Widget.prototype.assignAttributes = function(domNode,options) {
|
Widget.prototype.assignAttributes = function(domNode,options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
var self = this;
|
var self = this,
|
||||||
|
changedAttributes = options.changedAttributes || this.attributes,
|
||||||
|
sourcePrefix = options.sourcePrefix || "",
|
||||||
|
destPrefix = options.destPrefix || "",
|
||||||
|
EVENT_ATTRIBUTE_PREFIX = "on";
|
||||||
var assignAttribute = function(name,value) {
|
var assignAttribute = function(name,value) {
|
||||||
|
// Process any style attributes before considering sourcePrefix and destPrefix
|
||||||
|
if(name.substr(0,6) === "style." && name.length > 6) {
|
||||||
|
domNode.style[$tw.utils.unHyphenateCss(name.substr(6))] = value;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Check if the sourcePrefix is a match
|
||||||
|
if(name.substr(0,sourcePrefix.length) === sourcePrefix) {
|
||||||
|
name = destPrefix + name.substr(sourcePrefix.length);
|
||||||
|
} else {
|
||||||
|
value = undefined;
|
||||||
|
}
|
||||||
// Check for excluded attribute names
|
// Check for excluded attribute names
|
||||||
if(options.excludeEventAttributes && name.substr(0,2) === "on") {
|
if(options.excludeEventAttributes && name.substr(0,2).toLowerCase() === EVENT_ATTRIBUTE_PREFIX) {
|
||||||
value = undefined;
|
value = undefined;
|
||||||
}
|
}
|
||||||
if(value !== undefined) {
|
if(value !== undefined) {
|
||||||
@@ -431,26 +450,24 @@ Widget.prototype.assignAttributes = function(domNode,options) {
|
|||||||
namespace = "http://www.w3.org/1999/xlink";
|
namespace = "http://www.w3.org/1999/xlink";
|
||||||
name = name.substr(6);
|
name = name.substr(6);
|
||||||
}
|
}
|
||||||
// Handle styles
|
// Setting certain attributes can cause a DOM error (eg xmlns on the svg element)
|
||||||
if(name.substr(0,6) === "style." && name.length > 6) {
|
try {
|
||||||
domNode.style[$tw.utils.unHyphenateCss(name.substr(6))] = value;
|
domNode.setAttributeNS(namespace,name,value);
|
||||||
} else {
|
} catch(e) {
|
||||||
// Setting certain attributes can cause a DOM error (eg xmlns on the svg element)
|
|
||||||
try {
|
|
||||||
domNode.setAttributeNS(namespace,name,value);
|
|
||||||
} catch(e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
// Not all parse tree nodes have the orderedAttributes property
|
// If the parse tree node has the orderedAttributes property then use that order
|
||||||
if(this.parseTreeNode.orderedAttributes) {
|
if(this.parseTreeNode.orderedAttributes) {
|
||||||
$tw.utils.each(this.parseTreeNode.orderedAttributes,function(attribute,index) {
|
$tw.utils.each(this.parseTreeNode.orderedAttributes,function(attribute,index) {
|
||||||
assignAttribute(attribute.name,self.attributes[attribute.name]);
|
if(attribute.name in changedAttributes) {
|
||||||
});
|
assignAttribute(attribute.name,self.getAttribute(attribute.name));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Otherwise update each changed attribute irrespective of order
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(Object.keys(self.attributes).sort(),function(name) {
|
$tw.utils.each(changedAttributes,function(value,name) {
|
||||||
assignAttribute(name,self.attributes[name]);
|
assignAttribute(name,self.getAttribute(name));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -718,44 +735,23 @@ Widget.prototype.findFirstDomNode = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Entry into destroy procedure
|
Remove any DOM nodes created by this widget or its children
|
||||||
*/
|
|
||||||
Widget.prototype.destroyChildren = function() {
|
|
||||||
$tw.utils.each(this.children,function(childWidget) {
|
|
||||||
childWidget.destroy();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/*
|
|
||||||
Legacy entry into destroy procedure
|
|
||||||
*/
|
*/
|
||||||
Widget.prototype.removeChildDomNodes = function() {
|
Widget.prototype.removeChildDomNodes = function() {
|
||||||
this.destroy();
|
// 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
|
||||||
};
|
|
||||||
/*
|
|
||||||
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.domNodes.length > 0) {
|
if(this.domNodes.length > 0) {
|
||||||
$tw.utils.each(this.domNodes,function(domNode) {
|
$tw.utils.each(this.domNodes,function(domNode) {
|
||||||
domNode.parentNode.removeChild(domNode);
|
domNode.parentNode.removeChild(domNode);
|
||||||
});
|
});
|
||||||
this.domNodes = [];
|
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.
|
Invoke the action widgets that are descendents of the current widget.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1063,6 +1063,34 @@ exports.getTextReferenceParserInfo = function(title,field,index,options) {
|
|||||||
return parserInfo;
|
return parserInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Parse a block of text of a specified MIME type
|
||||||
|
text: text on which to perform substitutions
|
||||||
|
widget
|
||||||
|
options: see below
|
||||||
|
Options include:
|
||||||
|
substitutions: an optional array of substitutions
|
||||||
|
*/
|
||||||
|
exports.getSubstitutedText = function(text,widget,options) {
|
||||||
|
options = options || {};
|
||||||
|
text = text || "";
|
||||||
|
var self = this,
|
||||||
|
substitutions = options.substitutions || [],
|
||||||
|
output;
|
||||||
|
// Evaluate embedded filters and substitute with first result
|
||||||
|
output = text.replace(/\$\{([\S\s]+?)\}\$/g, function(match,filter) {
|
||||||
|
return self.filterTiddlers(filter,widget)[0] || "";
|
||||||
|
});
|
||||||
|
// Process any substitutions provided in options
|
||||||
|
$tw.utils.each(substitutions,function(substitute) {
|
||||||
|
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(/\$\(([^\)\$]+)\)\$/g, function(match,varname) {
|
||||||
|
return widget.getVariable(varname,{defaultValue: ""})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Make a widget tree for a parse tree
|
Make a widget tree for a parse tree
|
||||||
parser: parser object
|
parser: parser object
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ tc-page-container tc-page-view-$(storyviewTitle)$ tc-language-$(languageTitle)$
|
|||||||
tv-config-toolbar-class={{$:/config/Toolbar/ButtonClass}}
|
tv-config-toolbar-class={{$:/config/Toolbar/ButtonClass}}
|
||||||
tv-show-missing-links={{$:/config/MissingLinks}}
|
tv-show-missing-links={{$:/config/MissingLinks}}
|
||||||
storyviewTitle={{$:/view}}
|
storyviewTitle={{$:/view}}
|
||||||
languageTitle={{{ [{$:/language}get[name]] }}}
|
languageTitle={{{ [{$:/language}get[name]] }}}>
|
||||||
tv-text-direction={{$:/config/DefaultTextDirection}}>
|
|
||||||
|
|
||||||
<div class=<<containerClasses>>>
|
<div class=<<containerClasses>>>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
code-body: yes
|
||||||
title: $:/core/ui/AlertTemplate
|
title: $:/core/ui/AlertTemplate
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
code-body: yes
|
||||||
title: $:/core/ui/EditTemplate
|
title: $:/core/ui/EditTemplate
|
||||||
|
|
||||||
\define delete-edittemplate-state-tiddlers()
|
\define delete-edittemplate-state-tiddlers()
|
||||||
@@ -29,7 +30,6 @@ title: $:/core/ui/EditTemplate
|
|||||||
data-tiddler-title=<<currentTiddler>>
|
data-tiddler-title=<<currentTiddler>>
|
||||||
data-tags={{!!tags}}
|
data-tags={{!!tags}}
|
||||||
class={{{ [all[shadows+tiddlers]tag[$:/tags/ClassFilters/TiddlerTemplate]!is[draft]] :map:flat[subfilter{!!text}] tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}
|
class={{{ [all[shadows+tiddlers]tag[$:/tags/ClassFilters/TiddlerTemplate]!is[draft]] :map:flat[subfilter{!!text}] tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}
|
||||||
dir=<<tv-text-direction>>
|
|
||||||
role="region"
|
role="region"
|
||||||
aria-label={{$:/language/EditTemplate/Caption}}>
|
aria-label={{$:/language/EditTemplate/Caption}}>
|
||||||
<$fieldmangler>
|
<$fieldmangler>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ title: $:/core/ui/EditTemplate/body/editor
|
|||||||
placeholder={{$:/language/EditTemplate/Body/Placeholder}}
|
placeholder={{$:/language/EditTemplate/Body/Placeholder}}
|
||||||
tabindex={{$:/config/EditTabIndex}}
|
tabindex={{$:/config/EditTabIndex}}
|
||||||
focus={{{ [{$:/config/AutoFocus}match[text]then[true]] ~[[false]] }}}
|
focus={{{ [{$:/config/AutoFocus}match[text]then[true]] ~[[false]] }}}
|
||||||
dir=<<tv-text-direction>>
|
|
||||||
cancelPopups="yes"
|
cancelPopups="yes"
|
||||||
fileDrop={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}}
|
fileDrop={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
|||||||
importState=<<qualify $:/state/ImportImage>> >
|
importState=<<qualify $:/state/ImportImage>> >
|
||||||
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> >
|
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> >
|
||||||
<$reveal stateTitle=<<edit-preview-state>> type="match" text="yes" tag="div">
|
<$reveal stateTitle=<<edit-preview-state>> type="match" text="yes" tag="div">
|
||||||
<div class="tc-tiddler-preview" dir=<<tv-text-direction>>>
|
<div class="tc-tiddler-preview">
|
||||||
|
|
||||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
|||||||
</div>
|
</div>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
|
|
||||||
<$reveal stateTitle=<<edit-preview-state>> type="nomatch" text="yes" tag="div" dir=<<tv-text-direction>>>
|
<$reveal stateTitle=<<edit-preview-state>> type="nomatch" text="yes" tag="div">
|
||||||
|
|
||||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ tags: $:/tags/EditTemplate
|
|||||||
$:/config/EditToolbarButtons/Visibility/$(listItem)$
|
$:/config/EditToolbarButtons/Visibility/$(listItem)$
|
||||||
\end
|
\end
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<div class="tc-tiddler-title tc-tiddler-edit-title" dir=<<tv-text-direction>>>
|
<div class="tc-tiddler-title tc-tiddler-edit-title">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
<span class="tc-tiddler-controls tc-titlebar"><$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]]}}}><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$let></$list></span>
|
<span class="tc-tiddler-controls tc-titlebar"><$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]]}}}><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$let></$list></span>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
|
|||||||
\whitespace trim
|
\whitespace trim
|
||||||
|
|
||||||
<$set name="newFieldValueTiddlerPrefix" value=<<newFieldValueTiddlerPrefix>> emptyValue=<<qualify "$:/temp/NewFieldValue">> >
|
<$set name="newFieldValueTiddlerPrefix" value=<<newFieldValueTiddlerPrefix>> emptyValue=<<qualify "$:/temp/NewFieldValue">> >
|
||||||
<div class="tc-edit-fields" dir=<<tv-text-direction>>>
|
<div class="tc-edit-fields">
|
||||||
<table class={{{ [all[current]fields[]] :filter[lookup[$:/config/EditTemplateFields/Visibility/]!match[hide]] +[count[]!match[0]] +[then[tc-edit-fields]] ~[[tc-edit-fields tc-edit-fields-small]] }}}>
|
<table class={{{ [all[current]fields[]] :filter[lookup[$:/config/EditTemplateFields/Visibility/]!match[hide]] +[count[]!match[0]] +[then[tc-edit-fields]] ~[[tc-edit-fields tc-edit-fields-small]] }}}>
|
||||||
<tbody>
|
<tbody>
|
||||||
<$list filter="[all[current]fields[]] +[sort[title]]" variable="currentField" storyview="pop">
|
<$list filter="[all[current]fields[]] +[sort[title]]" variable="currentField" storyview="pop">
|
||||||
@@ -101,7 +101,7 @@ $value={{{ [subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<$fieldmangler>
|
<$fieldmangler>
|
||||||
<div class="tc-edit-field-add" dir=<<tv-text-direction>>>
|
<div class="tc-edit-field-add">
|
||||||
<em class="tc-edit tc-small-gap-right">
|
<em class="tc-edit tc-small-gap-right">
|
||||||
<<lingo Fields/Add/Prompt>>
|
<<lingo Fields/Add/Prompt>>
|
||||||
</em>
|
</em>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ tags: $:/tags/EditTemplate
|
|||||||
<$list filter="[all[current]shadowsource[]]" variable="pluginTitle">
|
<$list filter="[all[current]shadowsource[]]" variable="pluginTitle">
|
||||||
|
|
||||||
<$set name="pluginLink" value=<<pluginLinkBody>>>
|
<$set name="pluginLink" value=<<pluginLinkBody>>>
|
||||||
<div class="tc-message-box" dir=<<tv-text-direction>>>
|
<div class="tc-message-box">
|
||||||
|
|
||||||
<<lingo Warning>>
|
<<lingo Warning>>
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ tags: $:/tags/EditTemplate
|
|||||||
<$list filter="[all[current]shadowsource[]]" variable="pluginTitle">
|
<$list filter="[all[current]shadowsource[]]" variable="pluginTitle">
|
||||||
|
|
||||||
<$set name="pluginLink" value=<<pluginLinkBody>>>
|
<$set name="pluginLink" value=<<pluginLinkBody>>>
|
||||||
<div class="tc-message-box" dir=<<tv-text-direction>>>
|
<div class="tc-message-box">
|
||||||
|
|
||||||
<<lingo OverriddenWarning>>
|
<<lingo OverriddenWarning>>
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ color:$(foregroundColor)$;
|
|||||||
|
|
||||||
\define edit-tags-template(tagField:"tags")
|
\define edit-tags-template(tagField:"tags")
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<div class="tc-edit-tags" dir=<<tv-text-direction>>>
|
<div class="tc-edit-tags">
|
||||||
<$list filter="[list[!!$tagField$]sort[title]]" storyview="pop">
|
<$list filter="[list[!!$tagField$]sort[title]]" storyview="pop">
|
||||||
<$macrocall $name="tag-body" colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} tagField=<<__tagField__>>/>
|
<$macrocall $name="tag-body" colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} tagField=<<__tagField__>>/>
|
||||||
</$list>
|
</$list>
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ title: $:/core/ui/EditTemplate/title
|
|||||||
tags: $:/tags/EditTemplate
|
tags: $:/tags/EditTemplate
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$edit-text field="draft.title" class="tc-titlebar tc-edit-texteditor" focus={{{ [{$:/config/AutoFocus}match[title]then[true]] ~[[false]] }}} tabindex={{$:/config/EditTabIndex}} cancelPopups="yes" dir=<<tv-text-direction>>/>
|
<$edit-text field="draft.title" class="tc-titlebar tc-edit-texteditor" focus={{{ [{$:/config/AutoFocus}match[title]then[true]] ~[[false]] }}} tabindex={{$:/config/EditTabIndex}} cancelPopups="yes"/>
|
||||||
|
|
||||||
<$vars pattern="""[\|\[\]{}]""" bad-chars="""`| [ ] { }`""">
|
<$vars pattern="""[\|\[\]{}]""" bad-chars="""`| [ ] { }`""">
|
||||||
|
|
||||||
<$list filter="[all[current]regexp:draft.title<pattern>]" variable="listItem">
|
<$list filter="[all[current]regexp:draft.title<pattern>]" variable="listItem">
|
||||||
|
|
||||||
<div class="tc-message-box" dir=<<tv-text-direction>>>
|
<div class="tc-message-box">
|
||||||
|
|
||||||
{{$:/core/images/warning}} {{$:/language/EditTemplate/Title/BadCharacterWarning}}
|
{{$:/core/images/warning}} {{$:/language/EditTemplate/Title/BadCharacterWarning}}
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ tags: $:/tags/EditTemplate
|
|||||||
|
|
||||||
</$vars>
|
</$vars>
|
||||||
|
|
||||||
<$reveal state="!!draft.title" type="nomatch" text={{!!draft.of}} tag="div" dir=<<tv-text-direction>>>
|
<$reveal state="!!draft.title" type="nomatch" text={{!!draft.of}} tag="div">
|
||||||
|
|
||||||
<$list filter="[{!!draft.title}!is[missing]]" variable="listItem">
|
<$list filter="[{!!draft.title}!is[missing]]" variable="listItem">
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ first-search-filter: [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]sort[d
|
|||||||
<div class="tc-edit-type-selector-wrapper">
|
<div class="tc-edit-type-selector-wrapper">
|
||||||
<em class="tc-edit tc-small-gap-right"><<lingo Type/Prompt>></em>
|
<em class="tc-edit tc-small-gap-right"><<lingo Type/Prompt>></em>
|
||||||
<div class="tc-type-selector-dropdown-wrapper">
|
<div class="tc-type-selector-dropdown-wrapper">
|
||||||
<div class="tc-type-selector" dir=<<tv-text-direction>>}><$fieldmangler>
|
<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>
|
</$fieldmangler></div>
|
||||||
|
|
||||||
<div class="tc-block-dropdown-wrapper">
|
<div class="tc-block-dropdown-wrapper">
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
title: $:/core/ui/ImportPreviews/Text
|
title: $:/core/ui/ImportPreviews/Text
|
||||||
tags: $:/tags/ImportPreview
|
tags: $:/tags/ImportPreview
|
||||||
caption: {{$:/language/Import/Listing/Preview/Text}}
|
caption: {{$:/language/Import/Listing/Preview/Text}}
|
||||||
|
code-body: yes
|
||||||
|
|
||||||
<$transclude tiddler=<<currentTiddler>> subtiddler=<<payloadTiddler>> mode="block"/>
|
<$transclude tiddler=<<currentTiddler>> subtiddler=<<payloadTiddler>> mode="block"/>
|
||||||
|
|||||||
@@ -3,15 +3,14 @@ tags: $:/tags/MoreSideBar
|
|||||||
caption: {{$:/language/SideBar/Tags/Caption}}
|
caption: {{$:/language/SideBar/Tags/Caption}}
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
|
|
||||||
<$let tv-config-toolbar-icons="yes" tv-config-toolbar-text="yes" tv-config-toolbar-class="">
|
<$let tv-config-toolbar-icons="yes" tv-config-toolbar-text="yes" tv-config-toolbar-class="">
|
||||||
<div class="tc-tiny-v-gap-bottom">
|
<div class="tc-tiny-v-gap-bottom">
|
||||||
{{$:/core/ui/Buttons/tag-manager}}
|
{{$:/core/ui/Buttons/tag-manager}}
|
||||||
</div>
|
</div>
|
||||||
</$let>
|
</$let>
|
||||||
<$list filter={{$:/core/Filters/AllTags!!filter}}>
|
<$list filter={{$:/core/Filters/AllTags!!filter}}>
|
||||||
<div class="tc-tiny-v-gap-bottom">
|
<div class="tc-tiny-v-gap-bottom">
|
||||||
<$transclude tiddler="$:/core/ui/TagTemplate"/>
|
<$transclude tiddler="$:/core/ui/TagTemplate"/>
|
||||||
</div>
|
</div>
|
||||||
</$list>
|
</$list>
|
||||||
<hr class="tc-untagged-separator">
|
<hr class="tc-untagged-separator">
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
title: $:/core/ui/PageStylesheet
|
title: $:/core/ui/PageStylesheet
|
||||||
|
code-body: yes
|
||||||
|
|
||||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ title: $:/core/ui/PageTemplate
|
|||||||
name: {{$:/language/PageTemplate/Name}}
|
name: {{$:/language/PageTemplate/Name}}
|
||||||
description: {{$:/language/PageTemplate/Description}}
|
description: {{$:/language/PageTemplate/Description}}
|
||||||
icon: $:/core/images/layout-button
|
icon: $:/core/images/layout-button
|
||||||
|
code-body: yes
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||||
@@ -13,14 +14,13 @@ icon: $:/core/images/layout-button
|
|||||||
tv-enable-drag-and-drop={{$:/config/DragAndDrop/Enable}}
|
tv-enable-drag-and-drop={{$:/config/DragAndDrop/Enable}}
|
||||||
tv-show-missing-links={{$:/config/MissingLinks}}
|
tv-show-missing-links={{$:/config/MissingLinks}}
|
||||||
storyviewTitle={{$:/view}}
|
storyviewTitle={{$:/view}}
|
||||||
languageTitle={{{ [{$:/language}get[name]] }}}
|
languageTitle={{{ [{$:/language}get[name]] }}}>
|
||||||
tv-text-direction={{$:/config/DefaultTextDirection}}>
|
|
||||||
|
|
||||||
<div class={{{ [all[shadows+tiddlers]tag[$:/tags/ClassFilters/PageTemplate]!is[draft]] :map:flat[subfilter{!!text}] tc-page-container [[tc-page-view-]addsuffix<storyviewTitle>] [[tc-language-]addsuffix<languageTitle>] :and[unique[]join[ ]] }}} >
|
<div class={{{ [all[shadows+tiddlers]tag[$:/tags/ClassFilters/PageTemplate]!is[draft]] :map:flat[subfilter{!!text}] tc-page-container [[tc-page-view-]addsuffix<storyviewTitle>] [[tc-language-]addsuffix<languageTitle>] :and[unique[]join[ ]] }}} >
|
||||||
|
|
||||||
<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
|
<$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">
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageTemplate]!has[draft.of]]" variable="listItem">
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
title: $:/core/ui/RootTemplate
|
title: $:/core/ui/RootTemplate
|
||||||
|
code-body: yes
|
||||||
|
|
||||||
<$transclude tiddler={{{ [{$:/layout}has[text]] ~[[$:/core/ui/PageTemplate]] }}} mode="inline"/>
|
<$transclude tiddler={{{ [{$:/layout}has[text]] ~[[$:/core/ui/PageTemplate]] }}} mode="inline"/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
title: $:/core/ui/StoryTiddlerTemplate
|
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]] }}} />
|
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/StoryTiddlerTemplateFilter]!is[draft]get[text]] :and[has[title]else[$:/core/ui/ViewTemplate]] }}} />
|
||||||
|
|||||||
@@ -2,22 +2,29 @@ title: $:/core/ui/TagPickerTagTemplate
|
|||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$button class=<<button-classes>> tag="a" tooltip={{$:/language/EditTemplate/Tags/Add/Button/Hint}}>
|
<$button class=<<button-classes>> tag="a" tooltip={{$:/language/EditTemplate/Tags/Add/Button/Hint}}>
|
||||||
<$list filter="[<saveTiddler>minlength[1]]">
|
<$list filter="[<saveTiddler>minlength[1]]">
|
||||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter="[<tag>]"/>
|
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter="[<tag>]"/>
|
||||||
</$list>
|
</$list>
|
||||||
<$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}>
|
<$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}>
|
||||||
<$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>> preventScroll="true"/>
|
<$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>> preventScroll="true"/>
|
||||||
</$set>
|
</$set>
|
||||||
<<delete-tag-state-tiddlers>>
|
<<delete-tag-state-tiddlers>>
|
||||||
<$list filter="[<refreshTitle>minlength[1]]">
|
<$list filter="[<refreshTitle>minlength[1]]">
|
||||||
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
||||||
</$list>
|
</$list>
|
||||||
<<actions>>
|
<<actions>>
|
||||||
<$set name="backgroundColor" value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
|
<$set name="backgroundColor"
|
||||||
<$wikify name="foregroundColor" text="""<$macrocall $name="contrastcolour" target=<<backgroundColor>> fallbackTarget=<<fallbackTarget>> colourA=<<colourA>> colourB=<<colourB>>/>""">
|
value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}
|
||||||
<span class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>> data-tag-title=<<currentTiddler>> >
|
>
|
||||||
{{||$:/core/ui/TiddlerIcon}}<$view field="title" format="text"/>
|
<$wikify name="foregroundColor"
|
||||||
</span>
|
text="""<$macrocall $name="contrastcolour" target=<<backgroundColor>> fallbackTarget=<<fallbackTarget>> colourA=<<colourA>> colourB=<<colourB>>/>"""
|
||||||
</$wikify>
|
>
|
||||||
</$set>
|
<span class="tc-tag-label tc-btn-invisible"
|
||||||
|
style=<<tag-pill-styles>>
|
||||||
|
data-tag-title=<<currentTiddler>>
|
||||||
|
>
|
||||||
|
{{||$:/core/ui/TiddlerIcon}}<$view field="title" format="text"/>
|
||||||
|
</span>
|
||||||
|
</$wikify>
|
||||||
|
</$set>
|
||||||
</$button>
|
</$button>
|
||||||
|
|||||||
@@ -3,16 +3,23 @@ title: $:/core/ui/TagTemplate
|
|||||||
\whitespace trim
|
\whitespace trim
|
||||||
<span class="tc-tag-list-item" data-tag-title=<<currentTiddler>>>
|
<span class="tc-tag-list-item" data-tag-title=<<currentTiddler>>>
|
||||||
<$set name="transclusion" value=<<currentTiddler>>>
|
<$set name="transclusion" value=<<currentTiddler>>>
|
||||||
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter='[all[current]tagging[]]' tag='span'"""/>
|
<$macrocall $name="tag-pill-body"
|
||||||
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes" class="tc-drop-down">
|
tag=<<currentTiddler>>
|
||||||
<$set name="tv-show-missing-links" value="yes">
|
icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}
|
||||||
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}
|
||||||
</$set>
|
palette={{$:/palette}}
|
||||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem">
|
element-tag="$button"
|
||||||
<$transclude tiddler=<<listItem>>/>
|
element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter="[all[current]tagging[]]" tag='span'"""
|
||||||
</$list>
|
/>
|
||||||
<hr>
|
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes" class="tc-drop-down">
|
||||||
<$macrocall $name="list-tagged-draggable" tag=<<currentTiddler>>/>
|
<$set name="tv-show-missing-links" value="yes">
|
||||||
</$reveal>
|
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
||||||
|
</$set>
|
||||||
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem">
|
||||||
|
<$transclude tiddler=<<listItem>>/>
|
||||||
|
</$list>
|
||||||
|
<hr>
|
||||||
|
<$macrocall $name="list-tagged-draggable" tag=<<currentTiddler>>/>
|
||||||
|
</$reveal>
|
||||||
</$set>
|
</$set>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
title: $:/core/ui/ViewTemplate
|
title: $:/core/ui/ViewTemplate
|
||||||
|
code-body: yes
|
||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
\define folded-state()
|
\define folded-state()
|
||||||
@@ -7,7 +8,7 @@ $:/state/folded/$(currentTiddler)$
|
|||||||
\define cancel-delete-tiddler-actions(message) <$action-sendmessage $message="tm-$message$-tiddler"/>
|
\define cancel-delete-tiddler-actions(message) <$action-sendmessage $message="tm-$message$-tiddler"/>
|
||||||
\import [all[shadows+tiddlers]tag[$:/tags/Macro/View]!is[draft]] [all[shadows+tiddlers]tag[$:/tags/Global/View]!is[draft]]
|
\import [all[shadows+tiddlers]tag[$:/tags/Macro/View]!is[draft]] [all[shadows+tiddlers]tag[$:/tags/Global/View]!is[draft]]
|
||||||
<$vars storyTiddler=<<currentTiddler>> tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">>>
|
<$vars storyTiddler=<<currentTiddler>> tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">>>
|
||||||
<div dir=<<tv-text-direction>> data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class={{{ [all[shadows+tiddlers]tag[$:/tags/ClassFilters/TiddlerTemplate]!is[draft]] :map:flat[subfilter{!!text}] tc-tiddler-frame tc-tiddler-view-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[shadow]is[tiddler]then[tc-tiddler-overridden-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}} role="article">
|
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class={{{ [all[shadows+tiddlers]tag[$:/tags/ClassFilters/TiddlerTemplate]!is[draft]] :map:flat[subfilter{!!text}] tc-tiddler-frame tc-tiddler-view-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[shadow]is[tiddler]then[tc-tiddler-overridden-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}} role="article">
|
||||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!is[draft]]" variable="listItem">
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!is[draft]]" variable="listItem">
|
||||||
<$transclude tiddler=<<listItem>>/>
|
<$transclude tiddler=<<listItem>>/>
|
||||||
</$list>
|
</$list>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ tags: $:/tags/ViewTemplate
|
|||||||
|
|
||||||
\import [all[shadows+tiddlers]tag[$:/tags/Macro/View/Body]!is[draft]] [all[shadows+tiddlers]tag[$:/tags/Global/View/Body]!is[draft]]
|
\import [all[shadows+tiddlers]tag[$:/tags/Macro/View/Body]!is[draft]] [all[shadows+tiddlers]tag[$:/tags/Global/View/Body]!is[draft]]
|
||||||
|
|
||||||
<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes" dir=<<tv-text-direction>>>
|
<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes">
|
||||||
|
|
||||||
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateBodyFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/body/default]] }}} />
|
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateBodyFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/body/default]] }}} />
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
title: $:/core/ui/ViewTemplate/body/default
|
title: $:/core/ui/ViewTemplate/body/default
|
||||||
|
code-body: yes
|
||||||
|
|
||||||
<$transclude>
|
<$transclude>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ tags: $:/tags/ViewTemplate
|
|||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
|
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
|
||||||
<div class="tc-subtitle" dir=<<tv-text-direction>>>
|
<div class="tc-subtitle">
|
||||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]]" variable="subtitleTiddler" counter="indexSubtitleTiddler">
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]]" variable="subtitleTiddler" counter="indexSubtitleTiddler">
|
||||||
<$list filter="[<indexSubtitleTiddler-first>match[no]]" variable="ignore">
|
<$list filter="[<indexSubtitleTiddler-first>match[no]]" variable="ignore">
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ tags: $:/tags/ViewTemplate
|
|||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
|
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
|
||||||
<div class="tc-tags-wrapper" dir=<<tv-text-direction>>><$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>
|
<div class="tc-tags-wrapper"><$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ tags: $:/tags/ViewTemplate
|
|||||||
fill:$(foregroundColor)$;
|
fill:$(foregroundColor)$;
|
||||||
\end
|
\end
|
||||||
<div class="tc-tiddler-title">
|
<div class="tc-tiddler-title">
|
||||||
<div class="tc-titlebar" dir=<<tv-text-direction>>>
|
<div class="tc-titlebar">
|
||||||
<span class="tc-tiddler-controls">
|
<span class="tc-tiddler-controls">
|
||||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]" storyview="pop" variable="listItem"><$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"><$transclude tiddler=<<listItem>>/></$set></$list>
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]" storyview="pop" variable="listItem"><$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"><$transclude tiddler=<<listItem>>/></$set></$list>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
title: $:/config/DefaultTextDirection
|
|
||||||
text: auto
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
title: $:/config/OfficialPluginLibrary
|
title: $:/config/OfficialPluginLibrary
|
||||||
tags: $:/tags/PluginLibrary
|
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}}
|
caption: {{$:/language/OfficialPluginLibrary}}
|
||||||
|
|
||||||
{{$:/language/OfficialPluginLibrary/Hint}}
|
{{$:/language/OfficialPluginLibrary/Hint}}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ title: $:/config/ViewTemplateBodyFilters/
|
|||||||
tags: $:/tags/ViewTemplateBodyFilter
|
tags: $:/tags/ViewTemplateBodyFilter
|
||||||
|
|
||||||
stylesheet: [tag[$:/tags/Stylesheet]then[$:/core/ui/ViewTemplate/body/rendered-plain-text]]
|
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]]
|
code-body: [field:code-body[yes]then[$:/core/ui/ViewTemplate/body/code]]
|
||||||
import: [field:plugin-type[import]then[$:/core/ui/ViewTemplate/body/import]]
|
import: [field:plugin-type[import]then[$:/core/ui/ViewTemplate/body/import]]
|
||||||
plugin: [has[plugin-type]then[$:/core/ui/ViewTemplate/body/plugin]]
|
plugin: [has[plugin-type]then[$:/core/ui/ViewTemplate/body/plugin]]
|
||||||
|
|||||||
@@ -4,7 +4,15 @@ code-body: yes
|
|||||||
|
|
||||||
\define tabs-button()
|
\define tabs-button()
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$button set=<<tabsState>> setTo=<<currentTab>> default=<<__default__>> selectedClass="tc-tab-selected" tooltip={{!!tooltip}} role="switch">
|
<$button
|
||||||
|
set=<<tabsState>>
|
||||||
|
setTo=<<currentTab>>
|
||||||
|
default=<<__default__>>
|
||||||
|
selectedClass="tc-tab-selected"
|
||||||
|
tooltip={{!!tooltip}}
|
||||||
|
role="switch"
|
||||||
|
data-tab-title=<<currentTab>>
|
||||||
|
>
|
||||||
<$tiddler tiddler=<<save-currentTiddler>>>
|
<$tiddler tiddler=<<save-currentTiddler>>>
|
||||||
<$set name="tv-wikilinks" value="no">
|
<$set name="tv-wikilinks" value="no">
|
||||||
<$transclude tiddler=<<__buttonTemplate__>> mode="inline">
|
<$transclude tiddler=<<__buttonTemplate__>> mode="inline">
|
||||||
|
|||||||
@@ -9,26 +9,51 @@ color:$(foregroundColor)$;
|
|||||||
|
|
||||||
<!-- This has no whitespace trim to avoid modifying $actions$. Closing tags omitted for brevity. -->
|
<!-- 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)
|
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
|
||||||
<$vars
|
\whitespace trim
|
||||||
|
<$let
|
||||||
foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">>
|
foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">>
|
||||||
backgroundColor="""$colour$"""
|
backgroundColor=<<__colour__>>
|
||||||
><$element-tag$
|
>
|
||||||
|
<$element-tag$
|
||||||
$element-attributes$
|
$element-attributes$
|
||||||
class="tc-tag-label tc-btn-invisible"
|
class="tc-tag-label tc-btn-invisible"
|
||||||
style=<<tag-pill-styles>>
|
style=<<tag-pill-styles>>
|
||||||
>$actions$<$transclude tiddler="""$icon$"""/><$view tiddler=<<__tag__>> field="title" format="text" /></$element-tag$>
|
>
|
||||||
|
<<__actions__>>
|
||||||
|
<$transclude tiddler=<<__icon__>>/>
|
||||||
|
<$view tiddler=<<__tag__>> field="title" format="text" />
|
||||||
|
</$element-tag$>
|
||||||
|
</$let>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
|
\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
|
||||||
<$macrocall $name="tag-pill-inner" tag=<<__tag__>> icon="""$icon$""" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
|
\whitespace trim
|
||||||
|
<$macrocall $name="tag-pill-inner"
|
||||||
|
tag=<<__tag__>>
|
||||||
|
icon=<<__icon__>>
|
||||||
|
colour=<<__colour__>>
|
||||||
|
fallbackTarget={{$palette$##tag-background}}
|
||||||
|
colourA={{$palette$##foreground}}
|
||||||
|
colourB={{$palette$##background}}
|
||||||
|
element-tag=<<__element-tag__>>
|
||||||
|
element-attributes=<<__element-attributes__>>
|
||||||
|
actions=<<__actions__>>
|
||||||
|
/>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"")
|
\define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"")
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<span class="tc-tag-list-item" data-tag-title=<<__tag__>>>
|
<span class="tc-tag-list-item" data-tag-title=<<__tag__>>>
|
||||||
<$let currentTiddler=<<__tag__>>>
|
<$let currentTiddler=<<__tag__>>>
|
||||||
<$macrocall $name="tag-pill-body" tag=<<__tag__>> icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
|
<$macrocall $name="tag-pill-body"
|
||||||
</$let>
|
tag=<<__tag__>>
|
||||||
|
icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}
|
||||||
|
colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}
|
||||||
|
palette={{$:/palette}}
|
||||||
|
element-tag=<<__element-tag__>>
|
||||||
|
element-attributes=<<__element-attributes__>>
|
||||||
|
actions=<<__actions__>>/>
|
||||||
|
</$let>
|
||||||
</span>
|
</span>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ tags: $:/tags/Macro
|
|||||||
|
|
||||||
\define toc-caption()
|
\define toc-caption()
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<span class="tc-toc-caption">
|
<span class="tc-toc-caption tc-tiny-gap-left">
|
||||||
<$set name="tv-wikilinks" value="no">
|
<$set name="tv-wikilinks" value="no">
|
||||||
<$transclude field="caption">
|
<$transclude field="caption">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
@@ -145,7 +145,7 @@ tags: $:/tags/Macro
|
|||||||
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
|
<$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">
|
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item-selected" value="toc-item">
|
||||||
<li class=<<toc-item-class>>>
|
<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">
|
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
|
||||||
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
|
||||||
<$transclude tiddler=<<toc-closed-icon>> />
|
<$transclude tiddler=<<toc-closed-icon>> />
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
title: $:/tags/ViewTemplateBodyFilter
|
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",
|
"file": "../../../tw5.com/tiddlers/images/New Release Banner.png",
|
||||||
"fields": {
|
"fields": {
|
||||||
"type": "image/jpg",
|
"type": "image/jpeg",
|
||||||
"title": "New Release Banner",
|
"title": "New Release Banner",
|
||||||
"tags": "picture"
|
"tags": "picture"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
created: 20141122200310516
|
created: 20141122200310516
|
||||||
modified: 20201213161842776
|
modified: 20230923031318421
|
||||||
|
tags: Mechanisms
|
||||||
title: HookMechanism
|
title: HookMechanism
|
||||||
type: text/vnd.tiddlywiki
|
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
|
```js
|
||||||
/*
|
/*
|
||||||
@@ -13,6 +18,8 @@ handler: function to be called when hook is invoked
|
|||||||
$tw.hooks.addHook(name,handler);
|
$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...)`
|
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
|
* ''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''.
|
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.
|
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.
|
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
|
!! Example
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,9 @@
|
|||||||
"empty": [
|
"empty": [
|
||||||
"--render","$:/core/save/all","empty.html","text/plain",
|
"--render","$:/core/save/all","empty.html","text/plain",
|
||||||
"--render","$:/core/save/all","empty.hta","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": [
|
"externalimages": [
|
||||||
"--savetiddlers","[is[image]]","images",
|
"--savetiddlers","[is[image]]","images",
|
||||||
"--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
|
"--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
|
||||||
@@ -20,7 +23,7 @@
|
|||||||
"static": [
|
"static": [
|
||||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.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"]
|
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"static": [
|
"static": [
|
||||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.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"]
|
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"static": [
|
"static": [
|
||||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.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"]
|
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
],
|
],
|
||||||
"library": [
|
"library": [
|
||||||
"--makelibrary","$:/UpgradeLibrary",
|
"--makelibrary","$:/UpgradeLibrary",
|
||||||
"--savelibrarytiddlers","$:/UpgradeLibrary","[prefix[$:/]] -[[$:/plugins/tiddlywiki/upgrade]] -[[$:/plugins/tiddlywiki/translators]] -[[$:/plugins/tiddlywiki/pluginlibrary]] -[[$:/plugins/tiddlywiki/jasmine]]","recipes/library/tiddlers/","$:/UpgradeLibrary/List",
|
"--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",
|
"--savetiddler","$:/UpgradeLibrary/List","recipes/library/tiddlers.json",
|
||||||
"--rendertiddler","$:/plugins/tiddlywiki/pluginlibrary/library.template.html","index.html","text/plain"]
|
"--rendertiddler","$:/plugins/tiddlywiki/pluginlibrary/library.template.html","index.html","text/plain"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
60
editions/prerelease/tiddlers/Release 5.3.2.tid
Normal file
60
editions/prerelease/tiddlers/Release 5.3.2.tid
Normal file
@@ -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
|
title: $:/config/LocalPluginLibrary
|
||||||
tags: $:/tags/PluginLibrary
|
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)
|
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//
|
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
|
title: $:/config/OfficialPluginLibrary
|
||||||
tags: $:/tags/PluginLibrary
|
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)
|
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.
|
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
|
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.
|
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": [
|
"favicon": [
|
||||||
"--savetiddler","$:/favicon.ico","favicon.ico"]
|
"--savetiddler","$:/favicon.ico","favicon.ico"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"static": [
|
"static": [
|
||||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.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"],
|
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"],
|
||||||
"tiddlywikicore": [
|
"tiddlywikicore": [
|
||||||
"--render","$:/core/templates/tiddlywiki5.js","[[tiddlywikicore-]addsuffix<version>addsuffix[.js]]","text/plain"]
|
"--render","$:/core/templates/tiddlywiki5.js","[[tiddlywikicore-]addsuffix<version>addsuffix[.js]]","text/plain"]
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"static": [
|
"static": [
|
||||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.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"]
|
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
40
editions/test/tiddlers/tests/data/filters/substitute.tid
Normal file
40
editions/test/tiddlers/tests/data/filters/substitute.tid
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
title: Filters/substitute
|
||||||
|
description: Test substitute operator
|
||||||
|
type: text/vnd.tiddlywiki-multiple
|
||||||
|
tags: [[$:/tags/wiki-test-spec]]
|
||||||
|
|
||||||
|
title: substitute filter data 1
|
||||||
|
tags: Hello There [[Welcome to TiddlyWiki]] GettingStarted
|
||||||
|
|
||||||
|
TiddlyWiki
|
||||||
|
+
|
||||||
|
title: substitute filter data 2
|
||||||
|
|
||||||
|
The output of the filter `[[substitute filter data 1]tags[]]` is ${[[substitute filter data 1]tags[]]}$.
|
||||||
|
+
|
||||||
|
title: substitute filter data 3
|
||||||
|
|
||||||
|
Welcome to $(projectname)$ $1$ $2$ $3$. Tiddlers starting with `substitute`: ${[prefix[substitute]format:titlelist[]join[ ]]}$.
|
||||||
|
+
|
||||||
|
title: Output
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
|
<$let projectname="TiddlyWiki">
|
||||||
|
(<$text text={{{ [[]substitute[]] }}}/>)
|
||||||
|
(<$text text={{{ [[Hello There, welcome to $TiddlyWiki$]substitute[]] }}}/>)
|
||||||
|
(<$text text={{{ [[Welcome to $(projectname)$]substitute[]] }}}/>)
|
||||||
|
(<$text text={{{ [[Welcome to $(projectname)$ $1$]substitute[today]] }}}/>)
|
||||||
|
(<$text text={{{ [[This is not a valid embedded filter ${ hello )$]substitute[]] }}}/>)
|
||||||
|
(<$text text={{{ [{substitute filter data 2}substitute[]] }}}/>)
|
||||||
|
(<$text text={{{ [{substitute filter data 3}substitute[every],[day]] }}}/>)
|
||||||
|
</$let>
|
||||||
|
+
|
||||||
|
title: ExpectedResult
|
||||||
|
|
||||||
|
<p>()
|
||||||
|
(Hello There, welcome to $TiddlyWiki$)
|
||||||
|
(Welcome to TiddlyWiki)
|
||||||
|
(Welcome to TiddlyWiki today)
|
||||||
|
(This is not a valid embedded filter ${ hello )$)
|
||||||
|
(The output of the filter `[[substitute filter data 1]tags[]]` is Hello.)
|
||||||
|
(Welcome to TiddlyWiki every day $3$. Tiddlers starting with `substitute`: [[substitute filter data 1]] [[substitute filter data 2]] [[substitute filter data 3]].)</p>
|
||||||
@@ -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
|
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>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
title: Widgets/DataAttributes/ButtonWidget
|
||||||
|
description: Data Attributes for ButtonWidget
|
||||||
|
type: text/vnd.tiddlywiki-multiple
|
||||||
|
tags: [[$:/tags/wiki-test-spec]]
|
||||||
|
|
||||||
|
title: Output
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
|
<$button tag="div" class="myclass" data-title="mytiddler" style.color="red" onclick="clicked">
|
||||||
|
my tiddler
|
||||||
|
</$button>
|
||||||
|
<$button tag="div" class="myclass" data-title={{Temp}} style.color={{{ [[Temp]get[color]] }}}>
|
||||||
|
hello
|
||||||
|
</$button>
|
||||||
|
+
|
||||||
|
title: Actions
|
||||||
|
|
||||||
|
<$action-setfield $tiddler="Temp" $field="text" $value="Title2" color="red"/>
|
||||||
|
+
|
||||||
|
title: Temp
|
||||||
|
color: black
|
||||||
|
|
||||||
|
Title1
|
||||||
|
+
|
||||||
|
title: ExpectedResult
|
||||||
|
|
||||||
|
<p><div class="myclass" data-title="mytiddler" style="color:red;">my tiddler</div><div class="myclass" data-title="Title2" style="color:red;">hello</div></p>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
title: Widgets/DataAttributes/CheckboxWidget
|
||||||
|
description: Data Attributes for CheckboxWidget
|
||||||
|
type: text/vnd.tiddlywiki-multiple
|
||||||
|
tags: [[$:/tags/wiki-test-spec]]
|
||||||
|
|
||||||
|
title: Output
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
|
<$checkbox tag="done" data-title={{Temp}} style.color={{{ [[Temp]get[color]] }}} onclick="clicked"> Is it done?</$checkbox>
|
||||||
|
+
|
||||||
|
title: Actions
|
||||||
|
|
||||||
|
<$action-setfield $tiddler="Temp" $field="text" $value="Title2" color="red"/>
|
||||||
|
+
|
||||||
|
title: Temp
|
||||||
|
color: black
|
||||||
|
|
||||||
|
Title1
|
||||||
|
+
|
||||||
|
title: ExpectedResult
|
||||||
|
|
||||||
|
<p><label class="tc-checkbox "><input data-title="Title2" type="checkbox" style="color:red;"><span>Is it done?</span></label></p>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user