mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-28 11:00:27 +00:00
Merge remote-tracking branch 'refs/remotes/Jermolene/master'
This commit is contained in:
commit
09d4d0e3e3
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
.c9/
|
||||
tmp/
|
||||
output/
|
||||
node_modules/
|
||||
|
@ -5,3 +5,4 @@ plugins/tiddlywiki/highlight/files/
|
||||
plugins/tiddlywiki/jasmine/files/
|
||||
plugins/tiddlywiki/markdown/files/
|
||||
plugins/tiddlywiki/markdown/files/
|
||||
node_modules/
|
||||
|
@ -2,3 +2,4 @@
|
||||
.c9/
|
||||
tmp/
|
||||
output/
|
||||
node_modules/
|
||||
|
5
bin/clean.sh
Executable file
5
bin/clean.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Remove any output files
|
||||
|
||||
find . -regex "^./editions/[a-z0-9\.-]*/output/.*" -delete
|
14
boot/boot.js
14
boot/boot.js
@ -590,7 +590,7 @@ Crypto helper object for encrypted content. It maintains the password text in a
|
||||
the password, and to encrypt/decrypt a block of text
|
||||
*/
|
||||
$tw.utils.Crypto = function() {
|
||||
var sjcl = $tw.node ? require("./sjcl.js") : window.sjcl,
|
||||
var sjcl = $tw.node ? (global.sjcl || require("./sjcl.js")) : window.sjcl,
|
||||
currentPassword = null,
|
||||
callSjcl = function(method,inputText,password) {
|
||||
password = password || currentPassword;
|
||||
@ -812,6 +812,7 @@ $tw.Tiddler = function(/* [fields,] fields */) {
|
||||
}
|
||||
// Freeze the tiddler against modification
|
||||
Object.freeze(this.fields);
|
||||
Object.freeze(this);
|
||||
};
|
||||
|
||||
$tw.Tiddler.prototype.hasField = function(field) {
|
||||
@ -1399,10 +1400,6 @@ $tw.loadTiddlersBrowser = function() {
|
||||
for(var t=0; t<containerIds.length; t++) {
|
||||
$tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementById(containerIds[t])));
|
||||
}
|
||||
// Load any preloaded tiddlers
|
||||
if($tw.preloadTiddlers) {
|
||||
$tw.wiki.addTiddlers($tw.preloadTiddlers);
|
||||
}
|
||||
};
|
||||
|
||||
} else {
|
||||
@ -1808,7 +1805,7 @@ $tw.boot.startup = function(options) {
|
||||
$tw.boot.wikiPath = process.cwd();
|
||||
}
|
||||
// Read package info
|
||||
$tw.packageInfo = require("../package.json");
|
||||
$tw.packageInfo = $tw.packageInfo || require("../package.json");
|
||||
// Check node version number
|
||||
if(!$tw.utils.checkVersions(process.version.substr(1),$tw.packageInfo.engines.node.substr(2))) {
|
||||
$tw.utils.error("TiddlyWiki5 requires node.js version " + $tw.packageInfo.engines.node);
|
||||
@ -1839,6 +1836,7 @@ $tw.boot.startup = function(options) {
|
||||
$tw.utils.registerFileType("audio/mp3","base64",".mp3");
|
||||
$tw.utils.registerFileType("audio/mp4","base64",[".mp4",".m4a"]);
|
||||
$tw.utils.registerFileType("text/x-markdown","utf8",[".md",".markdown"]);
|
||||
$tw.utils.registerFileType("application/enex+xml","utf8",".enex");
|
||||
// Create the wiki store for the app
|
||||
$tw.wiki = new $tw.Wiki();
|
||||
// Install built in tiddler fields modules
|
||||
@ -1866,6 +1864,10 @@ $tw.boot.startup = function(options) {
|
||||
} else {
|
||||
$tw.loadTiddlersNode();
|
||||
}
|
||||
// Load any preloaded tiddlers
|
||||
if($tw.preloadTiddlers) {
|
||||
$tw.wiki.addTiddlers($tw.preloadTiddlers);
|
||||
}
|
||||
// Unpack plugin tiddlers
|
||||
$tw.wiki.readPluginInfo();
|
||||
$tw.wiki.registerPluginTiddlers("plugin",$tw.safeMode ? ["$:/core"] : undefined);
|
||||
|
@ -99,7 +99,14 @@ $tw.preloadTiddler = function(fields) {
|
||||
$tw.preloadTiddlers.push(fields);
|
||||
};
|
||||
|
||||
return $tw
|
||||
/*
|
||||
Convenience function for pushing an array of tiddlers onto the preloading array
|
||||
*/
|
||||
$tw.preloadTiddlerArray = function(fieldsArray) {
|
||||
$tw.preloadTiddlers.push.apply($tw.preloadTiddlers,fieldsArray);
|
||||
};
|
||||
|
||||
return $tw;
|
||||
|
||||
});
|
||||
|
||||
|
@ -4,7 +4,7 @@ type: text/plain
|
||||
TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)
|
||||
|
||||
Copyright © Jeremy Ruston 2004-2007
|
||||
Copyright © UnaMesa Association 2007-2015
|
||||
Copyright © UnaMesa Association 2007-2016
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
14
core/images/file.tid
Normal file
14
core/images/file.tid
Normal file
@ -0,0 +1,14 @@
|
||||
title: $:/core/images/file
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-file tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="nonzero">
|
||||
<path d="M111.96811,30.5 L112,30.5 L112,119.999079 C112,124.417866 108.419113,128 104.000754,128 L23.9992458,128 C19.5813843,128 16,124.417687 16,119.999079 L16,8.00092105 C16,3.58213437 19.5808867,0 23.9992458,0 L81,0 L81,0.0201838424 C83.1589869,-0.071534047 85.3482153,0.707077645 86.9982489,2.35711116 L109.625176,24.9840387 C111.151676,26.510538 111.932942,28.4998414 111.96811,30.5 L111.96811,30.5 Z M81,8 L24,8 L24,120 L104,120 L104,30.5 L89.0003461,30.5 C84.5818769,30.5 81,26.9216269 81,22.4996539 L81,8 Z"></path>
|
||||
<rect x="32" y="36" width="64" height="8" rx="8"></rect>
|
||||
<rect x="32" y="52" width="64" height="8" rx="8"></rect>
|
||||
<rect x="32" y="68" width="64" height="8" rx="8"></rect>
|
||||
<rect x="32" y="84" width="64" height="8" rx="8"></rect>
|
||||
<rect x="32" y="100" width="64" height="8" rx="8"></rect>
|
||||
<rect x="32" y="20" width="40" height="8" rx="8"></rect>
|
||||
</g>
|
||||
</svg>
|
9
core/images/folder.tid
Normal file
9
core/images/folder.tid
Normal file
@ -0,0 +1,9 @@
|
||||
title: $:/core/images/folder
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-folder tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="evenodd">
|
||||
<path d="M55.6943257,128.000004 L7.99859666,128.000004 C3.5810937,128.000004 0,124.413822 0,119.996384 L0,48.0036243 C0,43.5833471 3.58387508,40.0000044 7.99859666,40.0000044 L16,40.0000044 L16,31.9999914 C16,27.5817181 19.5783731,24 24.0003461,24 L55.9996539,24 C60.4181231,24 64,27.5800761 64,31.9999914 L64,40.0000044 L104.001403,40.0000044 C108.418906,40.0000044 112,43.5861868 112,48.0036243 L112,59.8298353 L104,59.7475921 L104,51.9994189 C104,49.7887607 102.207895,48.0000044 99.9972215,48.0000044 L56,48.0000044 L56,36.0000255 C56,33.7898932 54.2072328,32 51.9957423,32 L28.0042577,32 C25.7890275,32 24,33.7908724 24,36.0000255 L24,48.0000044 L12.0027785,48.0000044 C9.78987688,48.0000044 8,49.7906032 8,51.9994189 L8,116.00059 C8,118.211248 9.79210499,120.000004 12.0027785,120.000004 L58.7630167,120.000004 L55.6943257,128.000004 L55.6943257,128.000004 Z"></path>
|
||||
<path d="M23.8728955,55.5 L119.875702,55.5 C124.293205,55.5 126.87957,59.5532655 125.650111,64.5630007 L112.305967,118.936999 C111.077582,123.942356 106.497904,128 102.083183,128 L6.08037597,128 C1.66287302,128 -0.923492342,123.946735 0.305967145,118.936999 L13.650111,64.5630007 C14.878496,59.5576436 19.4581739,55.5 23.8728955,55.5 L23.8728955,55.5 L23.8728955,55.5 Z M25.6530124,64 L113.647455,64 C115.858129,64 117.151473,66.0930612 116.538306,68.6662267 L105.417772,115.333773 C104.803671,117.910859 102.515967,120 100.303066,120 L12.3086228,120 C10.0979492,120 8.8046054,117.906939 9.41777189,115.333773 L20.5383062,68.6662267 C21.1524069,66.0891409 23.4401107,64 25.6530124,64 L25.6530124,64 L25.6530124,64 Z"></path>
|
||||
</g>
|
||||
</svg>
|
8
core/images/spiral.tid
Normal file
8
core/images/spiral.tid
Normal file
@ -0,0 +1,8 @@
|
||||
title: $:/core/images/spiral
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-spiral tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="nonzero">
|
||||
<path d="M64.534 68.348c3.39 0 6.097-2.62 6.476-5.968l-4.755-.538 4.75.583c.377-3.07-1.194-6.054-3.89-7.78-2.757-1.773-6.34-2.01-9.566-.7-3.46 1.403-6.14 4.392-7.35 8.148l-.01.026c-1.3 4.08-.72 8.64 1.58 12.52 2.5 4.2 6.77 7.2 11.76 8.27 5.37 1.15 11.11-.05 15.83-3.31 5.04-3.51 8.46-9.02 9.45-15.3 1.05-6.7-.72-13.63-4.92-19.19l.02.02c-4.42-5.93-11.2-9.82-18.78-10.78-7.96-1.01-16.13 1.31-22.59 6.43-6.81 5.39-11.18 13.41-12.11 22.26-.98 9.27 1.87 18.65 7.93 26.02 6.32 7.69 15.6 12.56 25.74 13.48 10.54.96 21.15-2.42 29.45-9.4l.01-.01c8.58-7.25 13.94-17.78 14.86-29.21.94-11.84-2.96-23.69-10.86-32.9-8.19-9.5-19.95-15.36-32.69-16.27-13.16-.94-26.24 3.49-36.34 12.34l.01-.01c-10.41 9.08-16.78 22.1-17.68 36.15-.93 14.44 4.03 28.77 13.79 39.78 10.03 11.32 24.28 18.2 39.6 19.09 15.73.92 31.31-4.56 43.24-15.234 12.23-10.954 19.61-26.44 20.5-43.074.14-2.64-1.89-4.89-4.52-5.03-2.64-.14-4.89 1.88-5.03 4.52-.75 14.1-7 27.2-17.33 36.45-10.03 8.98-23.11 13.58-36.3 12.81-12.79-.75-24.67-6.48-33-15.89-8.07-9.11-12.17-20.94-11.41-32.827.74-11.52 5.942-22.15 14.43-29.54l.01-.01c8.18-7.17 18.74-10.75 29.35-9.998 10.21.726 19.6 5.41 26.11 12.96 6.24 7.273 9.32 16.61 8.573 25.894-.718 8.9-4.88 17.064-11.504 22.66l.01-.007c-6.36 5.342-14.44 7.92-22.425 7.19-7.604-.68-14.52-4.314-19.21-10.027-4.44-5.4-6.517-12.23-5.806-18.94.67-6.3 3.76-11.977 8.54-15.766 4.46-3.54 10.05-5.128 15.44-4.44 5.03.63 9.46 3.18 12.32 7.01l.02.024c2.65 3.5 3.75 7.814 3.1 11.92-.59 3.71-2.58 6.925-5.45 8.924-2.56 1.767-5.61 2.403-8.38 1.81-2.42-.516-4.42-1.92-5.53-3.79-.93-1.56-1.15-3.3-.69-4.75l-4.56-1.446L59.325 65c.36-1.12 1.068-1.905 1.84-2.22.25-.103.48-.14.668-.13.06.006.11.015.14.025.01 0 .01 0-.01-.01-.02-.015-.054-.045-.094-.088-.06-.064-.12-.145-.17-.244-.15-.29-.23-.678-.18-1.11l-.005.04c.15-1.332 1.38-2.523 3.035-2.523-2.65 0-4.79 2.144-4.79 4.787s2.14 4.785 4.78 4.785z"></path>
|
||||
</g>
|
||||
</svg>
|
@ -32,6 +32,8 @@ ExportTiddlers/Caption: export tiddlers
|
||||
ExportTiddlers/Hint: Export tiddlers
|
||||
Fold/Caption: fold tiddler
|
||||
Fold/Hint: Fold the body of this tiddler
|
||||
Fold/FoldBar/Caption: fold-bar
|
||||
Fold/FoldBar/Hint: Optional bars to fold and unfold tiddlers
|
||||
Unfold/Caption: unfold tiddler
|
||||
Unfold/Hint: Unfold the body of this tiddler
|
||||
FoldOthers/Caption: fold other tiddlers
|
||||
|
@ -39,7 +39,7 @@ Palette/HideEditor/Caption: hide editor
|
||||
Palette/Prompt: Current palette:
|
||||
Palette/ShowEditor/Caption: show editor
|
||||
Parsing/Caption: Parsing
|
||||
Parsing/Hint: Here you can globally disable individual wiki parser rules. Take care as disabling some paser rules can prevent ~TiddlyWiki functioning correctly (you can restore normal operation with [[safe mode|http://tiddlywiki.com/#SafeMode]] )
|
||||
Parsing/Hint: Here you can globally disable individual wiki parser rules. Take care as disabling some parser rules can prevent ~TiddlyWiki functioning correctly (you can restore normal operation with [[safe mode|http://tiddlywiki.com/#SafeMode]] )
|
||||
Parsing/Block/Caption: Block Parse Rules
|
||||
Parsing/Inline/Caption: Inline Parse Rules
|
||||
Parsing/Pragma/Caption: Pragma Parse Rules
|
||||
|
@ -13,8 +13,8 @@ Fields/Add/Prompt: Add a new field:
|
||||
Fields/Add/Value/Placeholder: field value
|
||||
Fields/Add/Dropdown/System: System fields
|
||||
Fields/Add/Dropdown/User: User fields
|
||||
Shadow/Warning: This is a shadow tiddler. Any changes will override the default version
|
||||
Shadow/OverriddenWarning: This is a modified shadow tiddler. You can revert to the default version by deleting this tiddler
|
||||
Shadow/Warning: This is a shadow tiddler. Any changes you make will override the default version from the plugin <<pluginLink>>
|
||||
Shadow/OverriddenWarning: This is a modified shadow tiddler. You can revert to the default version in the plugin <<pluginLink>> by deleting this tiddler
|
||||
Tags/Add/Button: add
|
||||
Tags/Add/Placeholder: tag name
|
||||
Tags/Dropdown/Caption: tag list
|
||||
|
@ -34,5 +34,5 @@ TagManager/Count/Heading: Count
|
||||
TagManager/Icon/Heading: Icon
|
||||
TagManager/Info/Heading: Info
|
||||
TagManager/Tag/Heading: Tag
|
||||
Tiddler/DateFormat: DDth MMM YYYY at hh12:mmam
|
||||
Tiddler/DateFormat: DDth MMM YYYY at hh12:0mmam
|
||||
UnsavedChangesWarning: You have unsaved changes in TiddlyWiki
|
||||
|
@ -12,7 +12,7 @@ Serve tiddlers over http
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
if(!$tw.browser) {
|
||||
if($tw.node) {
|
||||
var util = require("util"),
|
||||
fs = require("fs"),
|
||||
url = require("url"),
|
||||
|
49
core/modules/filters/days.js
Normal file
49
core/modules/filters/days.js
Normal file
@ -0,0 +1,49 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/days.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator that selects tiddlers with a specified date field within a specified date interval.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.days = function(source,operator,options) {
|
||||
var results = [],
|
||||
fieldName = operator.suffix || "modified",
|
||||
dayInterval = (parseInt(operator.operand,10)||0),
|
||||
dayIntervalSign = $tw.utils.sign(dayInterval),
|
||||
targetTimeStamp = (new Date()).setHours(0,0,0,0) + 1000*60*60*24*dayInterval,
|
||||
isWithinDays = function(dateField) {
|
||||
var sign = $tw.utils.sign(targetTimeStamp - (new Date(dateField)).setHours(0,0,0,0));
|
||||
return sign === 0 || sign === dayIntervalSign;
|
||||
};
|
||||
|
||||
if(operator.prefix === "!") {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler && tiddler.fields[fieldName]) {
|
||||
if(!isWithinDays($tw.utils.parseDate(tiddler.fields[fieldName]))) {
|
||||
results.push(title);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler && tiddler.fields[fieldName]) {
|
||||
if(isWithinDays($tw.utils.parseDate(tiddler.fields[fieldName]))) {
|
||||
results.push(title);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
@ -3,7 +3,8 @@ title: $:/core/modules/filters/each.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator that selects one tiddler for each unique value of the specified field
|
||||
Filter operator that selects one tiddler for each unique value of the specified field.
|
||||
With suffix "list", selects all tiddlers that are values in a specified list field.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
@ -16,22 +17,34 @@ Filter operator that selects one tiddler for each unique value of the specified
|
||||
Export our filter function
|
||||
*/
|
||||
exports.each = function(source,operator,options) {
|
||||
var results = [],
|
||||
values = {};
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler) {
|
||||
var value;
|
||||
if((operator.operand === "") || (operator.operand === "title")) {
|
||||
value = title;
|
||||
} else {
|
||||
value = tiddler.getFieldString(operator.operand);
|
||||
var results =[] ,
|
||||
value,values = {},
|
||||
field = operator.operand || "title";
|
||||
if(operator.suffix !== "list-item") {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler) {
|
||||
value = (field === "title") ? title : tiddler.getFieldString(field);
|
||||
if(!$tw.utils.hop(values,value)) {
|
||||
values[value] = true;
|
||||
results.push(title);
|
||||
}
|
||||
}
|
||||
if(!$tw.utils.hop(values,value)) {
|
||||
values[value] = true;
|
||||
results.push(title);
|
||||
});
|
||||
} else {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler) {
|
||||
$tw.utils.each(
|
||||
options.wiki.getTiddlerList(title,field),
|
||||
function(value) {
|
||||
if(!$tw.utils.hop(values,value)) {
|
||||
values[value] = true;
|
||||
results.push(value);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
|
@ -1,35 +0,0 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/recent.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator that selects tiddlers with a specified date field within the last N days.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.recent = function(source,operator,options) {
|
||||
var results = [],
|
||||
fieldName = operator.suffix || "modified",
|
||||
targetTimeStamp = (new Date()).setHours(0,0,0,0) - 1000*60*60*24*(parseInt(operator.operand,10) || 0),
|
||||
isRecent = function(dateField) {
|
||||
return targetTimeStamp <= (new Date(dateField)).setHours(0,0,0,0);
|
||||
};
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler && tiddler.fields[fieldName]) {
|
||||
if(isRecent($tw.utils.parseDate(tiddler.fields[fieldName]))) {
|
||||
results.push(title);
|
||||
}
|
||||
}
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
189
core/modules/filters/x-listops.js
Normal file
189
core/modules/filters/x-listops.js
Normal file
@ -0,0 +1,189 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/x-listops.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Extended filter operators to manipulate the current list.
|
||||
|
||||
\*/
|
||||
(function () {
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Fetch titles from the current list
|
||||
*/
|
||||
var prepare_results = function (source) {
|
||||
var results = [];
|
||||
source(function (tiddler, title) {
|
||||
results.push(title);
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
Moves a number of items from the tail of the current list before the item named in the operand
|
||||
*/
|
||||
exports.putbefore = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand),
|
||||
count = parseInt(operator.suffix) || 1;
|
||||
return (index === -1) ?
|
||||
results.slice(0, -1) :
|
||||
results.slice(0, index).concat(results.slice(-count)).concat(results.slice(index, -count));
|
||||
};
|
||||
|
||||
/*
|
||||
Moves a number of items from the tail of the current list after the item named in the operand
|
||||
*/
|
||||
exports.putafter = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand),
|
||||
count = parseInt(operator.suffix) || 1;
|
||||
return (index === -1) ?
|
||||
results.slice(0, -1) :
|
||||
results.slice(0, index + 1).concat(results.slice(-count)).concat(results.slice(index + 1, -count));
|
||||
};
|
||||
|
||||
/*
|
||||
Replaces the item named in the operand with a number of items from the tail of the current list
|
||||
*/
|
||||
exports.replace = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand),
|
||||
count = parseInt(operator.suffix) || 1;
|
||||
return (index === -1) ?
|
||||
results.slice(0, -count) :
|
||||
results.slice(0, index).concat(results.slice(-count)).concat(results.slice(index + 1, -count));
|
||||
};
|
||||
|
||||
/*
|
||||
Moves a number of items from the tail of the current list to the head of the list
|
||||
*/
|
||||
exports.putfirst = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
count = parseInt(operator.suffix) || 1;
|
||||
return results.slice(-count).concat(results.slice(0, -count));
|
||||
};
|
||||
|
||||
/*
|
||||
Moves a number of items from the head of the current list to the tail of the list
|
||||
*/
|
||||
exports.putlast = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
count = parseInt(operator.suffix) || 1;
|
||||
return results.slice(count).concat(results.slice(0, count));
|
||||
};
|
||||
|
||||
/*
|
||||
Moves the item named in the operand a number of places forward or backward in the list
|
||||
*/
|
||||
exports.move = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand),
|
||||
count = parseInt(operator.suffix) || 1,
|
||||
marker = results.splice(index, 1);
|
||||
return results.slice(0, index + count).concat(marker).concat(results.slice(index + count));
|
||||
};
|
||||
|
||||
/*
|
||||
Returns the items from the current list that are after the item named in the operand
|
||||
*/
|
||||
exports.allafter = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand);
|
||||
return (index === -1 || index > (results.length - 2)) ? [] :
|
||||
(operator.suffix) ? results.slice(index) :
|
||||
results.slice(index + 1);
|
||||
};
|
||||
|
||||
/*
|
||||
Returns the items from the current list that are before the item named in the operand
|
||||
*/
|
||||
exports.allbefore = function (source, operator) {
|
||||
var results = prepare_results(source),
|
||||
index = results.indexOf(operator.operand);
|
||||
return (index <= 0) ? [] :
|
||||
(operator.suffix) ? results.slice(0, index + 1) :
|
||||
results.slice(0, index);
|
||||
};
|
||||
|
||||
/*
|
||||
Appends the items listed in the operand array to the tail of the current list
|
||||
*/
|
||||
exports.append = function (source, operator) {
|
||||
var append = $tw.utils.parseStringArray(operator.operand, "true"),
|
||||
results = prepare_results(source),
|
||||
count = parseInt(operator.suffix) || append.length;
|
||||
return (append.length === 0) ? results :
|
||||
(operator.prefix) ? results.concat(append.slice(-count)) :
|
||||
results.concat(append.slice(0, count));
|
||||
};
|
||||
|
||||
/*
|
||||
Prepends the items listed in the operand array to the head of the current list
|
||||
*/
|
||||
exports.prepend = function (source, operator) {
|
||||
var prepend = $tw.utils.parseStringArray(operator.operand, "true"),
|
||||
results = prepare_results(source),
|
||||
count = parseInt(operator.suffix) || prepend.length;
|
||||
return (prepend.length === 0) ? results :
|
||||
(operator.prefix) ? prepend.slice(-count).concat(results) :
|
||||
prepend.slice(0, count).concat(results);
|
||||
};
|
||||
|
||||
/*
|
||||
Returns all items from the current list except the items listed in the operand array
|
||||
*/
|
||||
exports.remove = function (source, operator) {
|
||||
var array = $tw.utils.parseStringArray(operator.operand, "true"),
|
||||
results = prepare_results(source),
|
||||
count = parseInt(operator.suffix) || array.length,
|
||||
p,
|
||||
len,
|
||||
index;
|
||||
len = array.length - 1;
|
||||
for (p = 0; p < count; ++p) {
|
||||
if (operator.prefix) {
|
||||
index = results.indexOf(array[len - p]);
|
||||
} else {
|
||||
index = results.indexOf(array[p]);
|
||||
}
|
||||
if (index !== -1) {
|
||||
results.splice(index, 1);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
Returns all items from the current list sorted in the order of the items in the operand array
|
||||
*/
|
||||
exports.sortby = function (source, operator) {
|
||||
var results = prepare_results(source);
|
||||
if (!results || results.length < 2) {
|
||||
return results;
|
||||
}
|
||||
var lookup = $tw.utils.parseStringArray(operator.operand, "true");
|
||||
results.sort(function (a, b) {
|
||||
return lookup.indexOf(a) - lookup.indexOf(b);
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
Removes all duplicate items from the current list
|
||||
*/
|
||||
exports.unique = function (source, operator) {
|
||||
var results = prepare_results(source);
|
||||
var set = results.reduce(function (a, b) {
|
||||
if (a.indexOf(b) < 0) {
|
||||
a.push(b);
|
||||
}
|
||||
return a;
|
||||
}, []);
|
||||
return set;
|
||||
};
|
||||
})();
|
@ -31,12 +31,7 @@ Trigger a popup open or closed. Parameters are in a hashmap:
|
||||
*/
|
||||
Popup.prototype.triggerPopup = function(options) {
|
||||
// Check if this popup is already active
|
||||
var index = -1;
|
||||
for(var t=0; t<this.popups.length; t++) {
|
||||
if(this.popups[t].title === options.title) {
|
||||
index = t;
|
||||
}
|
||||
}
|
||||
var index = this.findPopup(options.title);
|
||||
// Compute the new state
|
||||
var state = index === -1;
|
||||
if(options.force !== undefined) {
|
||||
@ -50,6 +45,16 @@ Popup.prototype.triggerPopup = function(options) {
|
||||
}
|
||||
};
|
||||
|
||||
Popup.prototype.findPopup = function(title) {
|
||||
var index = -1;
|
||||
for(var t=0; t<this.popups.length; t++) {
|
||||
if(this.popups[t].title === title) {
|
||||
index = t;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
};
|
||||
|
||||
Popup.prototype.handleEvent = function(event) {
|
||||
if(event.type === "click") {
|
||||
// Find out what was clicked on
|
||||
@ -107,12 +112,14 @@ Popup.prototype.show = function(options) {
|
||||
var info = this.popupInfo(options.domNode);
|
||||
// Cancel any higher level popups
|
||||
this.cancel(info.popupLevel);
|
||||
// Store the popup details
|
||||
this.popups.push({
|
||||
title: options.title,
|
||||
wiki: options.wiki,
|
||||
domNode: options.domNode
|
||||
});
|
||||
// Store the popup details if not already there
|
||||
if(this.findPopup(options.title) === -1) {
|
||||
this.popups.push({
|
||||
title: options.title,
|
||||
wiki: options.wiki,
|
||||
domNode: options.domNode
|
||||
});
|
||||
}
|
||||
// Set the state tiddler
|
||||
options.wiki.setTextReference(options.title,
|
||||
"(" + options.domNode.offsetLeft + "," + options.domNode.offsetTop + "," +
|
||||
|
@ -35,9 +35,7 @@ exports.trim = function(str) {
|
||||
Return the number of keys in an object
|
||||
*/
|
||||
exports.count = function(object) {
|
||||
var s = 0;
|
||||
$tw.utils.each(object,function() {s++;});
|
||||
return s;
|
||||
return Object.keys(object || {}).length;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -645,4 +643,15 @@ exports.tagToCssSelector = function(tagName) {
|
||||
};
|
||||
|
||||
|
||||
})();
|
||||
/*
|
||||
IE does not have sign function
|
||||
*/
|
||||
exports.sign = Math.sign || function(x) {
|
||||
x = +x; // convert to a number
|
||||
if (x === 0 || isNaN(x)) {
|
||||
return x;
|
||||
}
|
||||
return x > 0 ? 1 : -1;
|
||||
};
|
||||
|
||||
})();
|
||||
|
92
core/modules/widgets/action-listops.js
Normal file
92
core/modules/widgets/action-listops.js
Normal file
@ -0,0 +1,92 @@
|
||||
/*\
|
||||
title: $:/core/modules/widgets/action-listops.js
|
||||
type: application/javascript
|
||||
module-type: widget
|
||||
|
||||
Action widget to apply list operations to any tiddler field (defaults to the 'list' field of the current tiddler)
|
||||
|
||||
\*/
|
||||
(function() {
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||
var ActionListopsWidget = function(parseTreeNode, options) {
|
||||
this.initialise(parseTreeNode, options);
|
||||
};
|
||||
/**
|
||||
* Inherit from the base widget class
|
||||
*/
|
||||
ActionListopsWidget.prototype = new Widget();
|
||||
/**
|
||||
* Render this widget into the DOM
|
||||
*/
|
||||
ActionListopsWidget.prototype.render = function(parent, nextSibling) {
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
};
|
||||
/**
|
||||
* Compute the internal state of the widget
|
||||
*/
|
||||
ActionListopsWidget.prototype.execute = function() {
|
||||
// Get our parameters
|
||||
this.target = this.getAttribute("$tiddler", this.getVariable(
|
||||
"currentTiddler"));
|
||||
this.filter = this.getAttribute("$filter");
|
||||
this.subfilter = this.getAttribute("$subfilter");
|
||||
this.listField = this.getAttribute("$field", "list");
|
||||
this.listIndex = this.getAttribute("$index");
|
||||
this.filtertags = this.getAttribute("$tags");
|
||||
};
|
||||
/**
|
||||
* Refresh the widget by ensuring our attributes are up to date
|
||||
*/
|
||||
ActionListopsWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.$tiddler || changedAttributes.$filter ||
|
||||
changedAttributes.$subfilter || changedAttributes.$field ||
|
||||
changedAttributes.$index || changedAttributes.$tags) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
}
|
||||
return this.refreshChildren(changedTiddlers);
|
||||
};
|
||||
/**
|
||||
* Invoke the action associated with this widget
|
||||
*/
|
||||
ActionListopsWidget.prototype.invokeAction = function(triggeringWidget,
|
||||
event) {
|
||||
//Apply the specified filters to the lists
|
||||
var field = this.listField,
|
||||
index,
|
||||
type = "!!",
|
||||
list = this.listField;
|
||||
if(this.listIndex) {
|
||||
field = undefined;
|
||||
index = this.listIndex;
|
||||
type = "##";
|
||||
list = this.listIndex;
|
||||
}
|
||||
if(this.filter) {
|
||||
this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(
|
||||
this.wiki
|
||||
.filterTiddlers(this.filter, this)));
|
||||
}
|
||||
if(this.subfilter) {
|
||||
var subfilter = "[list[" + this.target + type + list + "]] " + this.subfilter;
|
||||
this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(
|
||||
this.wiki
|
||||
.filterTiddlers(subfilter, this)));
|
||||
}
|
||||
if(this.filtertags) {
|
||||
var tagfilter = "[list[" + this.target + "!!tags]] " + this.filtertags;
|
||||
this.wiki.setText(this.target, "tags", undefined, $tw.utils.stringifyList(
|
||||
this.wiki.filterTiddlers(tagfilter, this)));
|
||||
}
|
||||
return true; // Action was invoked
|
||||
};
|
||||
|
||||
exports["action-listops"] = ActionListopsWidget;
|
||||
|
||||
})();
|
@ -61,7 +61,9 @@ SetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
||||
var self = this,
|
||||
options = {};
|
||||
options.suppressTimestamp = !this.actionTimestamp;
|
||||
this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options);
|
||||
if((typeof this.actionField == "string") || (typeof this.actionIndex == "string") || (typeof this.actionValue == "string")) {
|
||||
this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options);
|
||||
}
|
||||
$tw.utils.each(this.attributes,function(attribute,name) {
|
||||
if(name.charAt(0) !== "$") {
|
||||
self.wiki.setText(self.actionTiddler,name,undefined,attribute,options);
|
||||
|
@ -42,9 +42,14 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
|
||||
if(this.tooltip) {
|
||||
domNode.setAttribute("title",this.tooltip);
|
||||
}
|
||||
// Nw.js supports "nwsaveas" to force a "save as" dialogue that allows a new or existing file to be selected
|
||||
if(this.nwsaveas) {
|
||||
domNode.setAttribute("nwsaveas",this.nwsaveas);
|
||||
}
|
||||
// Nw.js supports "webkitdirectory" to allow a directory to be selected
|
||||
if(this.webkitdirectory) {
|
||||
domNode.setAttribute("webkitdirectory",this.webkitdirectory);
|
||||
}
|
||||
// Add a click event handler
|
||||
domNode.addEventListener("change",function (event) {
|
||||
if(self.message) {
|
||||
@ -71,6 +76,7 @@ BrowseWidget.prototype.execute = function() {
|
||||
this.param = this.getAttribute("param");
|
||||
this.tooltip = this.getAttribute("tooltip");
|
||||
this.nwsaveas = this.getAttribute("nwsaveas");
|
||||
this.webkitdirectory = this.getAttribute("webkitdirectory");
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -52,6 +52,9 @@ EditTextWidget.prototype.render = function(parent,nextSibling) {
|
||||
if(this.editSize) {
|
||||
domNode.setAttribute("size",this.editSize);
|
||||
}
|
||||
if(this.editRows) {
|
||||
domNode.setAttribute("rows",this.editRows);
|
||||
}
|
||||
// Assign classes
|
||||
if(this.editClass) {
|
||||
domNode.className = this.editClass;
|
||||
@ -79,7 +82,7 @@ EditTextWidget.prototype.render = function(parent,nextSibling) {
|
||||
if(this.editFocus === "true") {
|
||||
if(domNode.focus && domNode.select) {
|
||||
domNode.focus();
|
||||
domNode.select();
|
||||
domNode.select();
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -148,6 +151,7 @@ EditTextWidget.prototype.execute = function() {
|
||||
this.editClass = this.getAttribute("class");
|
||||
this.editPlaceholder = this.getAttribute("placeholder");
|
||||
this.editSize = this.getAttribute("size");
|
||||
this.editRows = this.getAttribute("rows");
|
||||
this.editAutoHeight = this.getAttribute("autoHeight","yes") === "yes";
|
||||
this.editMinHeight = this.getAttribute("minHeight",DEFAULT_MIN_TEXT_AREA_HEIGHT);
|
||||
this.editFocusPopup = this.getAttribute("focusPopup");
|
||||
@ -178,7 +182,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
||||
EditTextWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
// 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) {
|
||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.placeholder || changedAttributes.size || changedAttributes.autoHeight || changedAttributes.minHeight || changedAttributes.focusPopup || changedAttributes.rows) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else if(changedTiddlers[this.editTitle]) {
|
||||
@ -213,18 +217,31 @@ EditTextWidget.prototype.updateEditorDomNode = function(text) {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Get the first parent element that has scrollbars or use the body as fallback.
|
||||
*/
|
||||
EditTextWidget.prototype.getScrollContainer = function(el) {
|
||||
while(el.parentNode) {
|
||||
el = el.parentNode;
|
||||
if(el.scrollTop) {
|
||||
return el;
|
||||
}
|
||||
}
|
||||
return this.document.body;
|
||||
};
|
||||
|
||||
/*
|
||||
Fix the height of textareas to fit their content
|
||||
*/
|
||||
EditTextWidget.prototype.fixHeight = function() {
|
||||
var self = this,
|
||||
domNode = this.domNodes[0];
|
||||
var domNode = this.domNodes[0];
|
||||
if(this.editAutoHeight && domNode && !domNode.isTiddlyWikiFakeDom && this.editTag === "textarea") {
|
||||
// Resize the textarea to fit its content, preserving scroll position
|
||||
var scrollPosition = $tw.utils.getScrollPosition(),
|
||||
scrollTop = scrollPosition.y;
|
||||
// Measure the specified minimum height
|
||||
domNode.style.height = self.editMinHeight;
|
||||
// Get the scroll container and register the current scroll position
|
||||
var container = this.getScrollContainer(domNode),
|
||||
scrollTop = container.scrollTop;
|
||||
// Measure the specified minimum height
|
||||
domNode.style.height = this.editMinHeight;
|
||||
var minHeight = domNode.offsetHeight;
|
||||
// Set its height to auto so that it snaps to the correct height
|
||||
domNode.style.height = "auto";
|
||||
@ -232,12 +249,11 @@ EditTextWidget.prototype.fixHeight = function() {
|
||||
var newHeight = Math.max(domNode.scrollHeight + domNode.offsetHeight - domNode.clientHeight,minHeight);
|
||||
// Only try to change the height if it has changed
|
||||
if(newHeight !== domNode.offsetHeight) {
|
||||
domNode.style.height = newHeight + "px";
|
||||
domNode.style.height = newHeight + "px";
|
||||
// Make sure that the dimensions of the textarea are recalculated
|
||||
$tw.utils.forceLayout(domNode);
|
||||
// Check that the scroll position is still visible before trying to scroll back to it
|
||||
scrollTop = Math.min(scrollTop,self.document.body.scrollHeight - window.innerHeight);
|
||||
window.scrollTo(scrollPosition.x,scrollTop);
|
||||
// Set the container to the position we registered at the beginning
|
||||
container.scrollTop = scrollTop;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -135,6 +135,10 @@ FieldManglerWidget.prototype.handleAddTagEvent = function(event) {
|
||||
$tw.utils.pushTop(modification.tags,tag);
|
||||
this.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));
|
||||
}
|
||||
} else if(typeof event.param === "string" && event.param.trim() !== "" && this.mangleTitle.trim() !== "") {
|
||||
var tag = [];
|
||||
tag.push(event.param.trim());
|
||||
this.wiki.addTiddler({title: this.mangleTitle, tags: tag});
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
@ -42,6 +42,7 @@ KeyboardWidget.prototype.render = function(parent,nextSibling) {
|
||||
// Add a keyboard event handler
|
||||
domNode.addEventListener("keydown",function (event) {
|
||||
if($tw.utils.checkKeyDescriptor(event,self.keyInfo)) {
|
||||
self.invokeActions(this,event);
|
||||
self.dispatchMessage(event);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
@ -51,7 +51,12 @@ SelectWidget.prototype.render = function(parent,nextSibling) {
|
||||
Handle a change event
|
||||
*/
|
||||
SelectWidget.prototype.handleChangeEvent = function(event) {
|
||||
var value = this.getSelectDomNode().value;
|
||||
if(this.selectMultiple == false) {
|
||||
var value = this.getSelectDomNode().value;
|
||||
} else {
|
||||
var value = this.getSelectValues()
|
||||
value = $tw.utils.stringifyList(value);
|
||||
}
|
||||
this.wiki.setText(this.selectTitle,this.selectField,this.selectIndex,value);
|
||||
};
|
||||
|
||||
@ -81,9 +86,21 @@ SelectWidget.prototype.setSelectValue = function() {
|
||||
}
|
||||
}
|
||||
// Assign it to the select element if it's different than the current value
|
||||
var domNode = this.getSelectDomNode();
|
||||
if(domNode.value !== value) {
|
||||
domNode.value = value;
|
||||
if (this.selectMultiple) {
|
||||
value = value === undefined ? "" : value;
|
||||
var select = this.getSelectDomNode();
|
||||
var values = Array.isArray(value) ? value : $tw.utils.parseStringArray(value);
|
||||
for(var i=0; i < select.children.length; i++){
|
||||
if(values.indexOf(select.children[i].value) != -1) {
|
||||
select.children[i].selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
var domNode = this.getSelectDomNode();
|
||||
if(domNode.value !== value) {
|
||||
domNode.value = value;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -94,6 +111,22 @@ SelectWidget.prototype.getSelectDomNode = function() {
|
||||
return this.children[0].domNodes[0];
|
||||
};
|
||||
|
||||
// Return an array of the selected opion values
|
||||
// select is an HTML select element
|
||||
SelectWidget.prototype.getSelectValues = function() {
|
||||
var select, result, options, opt;
|
||||
select = this.getSelectDomNode();
|
||||
result = [];
|
||||
options = select && select.options;
|
||||
for (var i=0; i<options.length; i++) {
|
||||
opt = options[i];
|
||||
if (opt.selected) {
|
||||
result.push(opt.value || opt.text);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
Compute the internal state of the widget
|
||||
*/
|
||||
@ -104,6 +137,8 @@ SelectWidget.prototype.execute = function() {
|
||||
this.selectIndex = this.getAttribute("index");
|
||||
this.selectClass = this.getAttribute("class");
|
||||
this.selectDefault = this.getAttribute("default");
|
||||
this.selectMultiple = this.getAttribute("multiple", false);
|
||||
this.selectSize = this.getAttribute("size");
|
||||
// Make the child widgets
|
||||
var selectNode = {
|
||||
type: "element",
|
||||
@ -113,6 +148,12 @@ SelectWidget.prototype.execute = function() {
|
||||
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);
|
||||
}
|
||||
this.makeChildWidgets([selectNode]);
|
||||
};
|
||||
|
||||
|
@ -61,6 +61,8 @@ SetWidget.prototype.getValue = function() {
|
||||
if(results.length === 0 && this.setEmptyValue !== undefined) {
|
||||
value = this.setEmptyValue;
|
||||
}
|
||||
} else if(!value && this.setEmptyValue) {
|
||||
value = this.setEmptyValue;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
@ -193,11 +193,11 @@ exports.generateNewTitle = function(baseTitle,options) {
|
||||
};
|
||||
|
||||
exports.isSystemTiddler = function(title) {
|
||||
return title.indexOf("$:/") === 0;
|
||||
return title && title.indexOf("$:/") === 0;
|
||||
};
|
||||
|
||||
exports.isTemporaryTiddler = function(title) {
|
||||
return title.indexOf("$:/temp/") === 0;
|
||||
return title && title.indexOf("$:/temp/") === 0;
|
||||
};
|
||||
|
||||
exports.isImageTiddler = function(title) {
|
||||
|
6
core/templates/save-lazy-all.tid
Normal file
6
core/templates/save-lazy-all.tid
Normal file
@ -0,0 +1,6 @@
|
||||
title: $:/core/save/lazy-all
|
||||
|
||||
\define saveTiddlerFilter()
|
||||
[is[system]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
|
||||
\end
|
||||
{{$:/core/templates/tiddlywiki5.html}}
|
@ -3,35 +3,13 @@ tags: $:/tags/AdvancedSearch
|
||||
caption: {{$:/language/Search/Filter/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/Search/
|
||||
<$linkcatcher to="$:/temp/advancedsearch">
|
||||
|
||||
<<lingo Filter/Hint>>
|
||||
|
||||
<div class="tc-search tc-advanced-search">
|
||||
<$edit-text tiddler="$:/temp/advancedsearch" type="search" tag="input"/>
|
||||
<$button popup=<<qualify "$:/state/filterDropdown">> class="tc-btn-invisible">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
|
||||
<$button class="tc-btn-invisible">
|
||||
<$action-setfield $tiddler="$:/temp/advancedsearch" $field="text" $value=""/>
|
||||
{{$:/core/images/close-button}}
|
||||
</$button>
|
||||
<$macrocall $name="exportButton" exportFilter={{$:/temp/advancedsearch}} lingoBase="$:/language/Buttons/ExportTiddlers/"/>
|
||||
</$reveal>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"><$transclude/></$list>
|
||||
</div>
|
||||
|
||||
<div class="tc-block-dropdown-wrapper">
|
||||
<$reveal state=<<qualify "$:/state/filterDropdown">> type="nomatch" text="" default="">
|
||||
<div class="tc-block-dropdown tc-edit-type-dropdown">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]"><$link to={{!!filter}}><$transclude field="description"/></$link>
|
||||
</$list>
|
||||
</div>
|
||||
</$reveal>
|
||||
</div>
|
||||
|
||||
</$linkcatcher>
|
||||
|
||||
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
|
||||
<$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>""">
|
||||
<div class="tc-search-results">
|
||||
|
9
core/ui/AdvancedSearch/FilterButtons/clear.tid
Normal file
9
core/ui/AdvancedSearch/FilterButtons/clear.tid
Normal file
@ -0,0 +1,9 @@
|
||||
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/clear
|
||||
tags: $:/tags/AdvancedSearch/FilterButton
|
||||
|
||||
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
|
||||
<$button class="tc-btn-invisible">
|
||||
<$action-setfield $tiddler="$:/temp/advancedsearch" $field="text" $value=""/>
|
||||
{{$:/core/images/close-button}}
|
||||
</$button>
|
||||
</$reveal>
|
26
core/ui/AdvancedSearch/FilterButtons/delete.tid
Normal file
26
core/ui/AdvancedSearch/FilterButtons/delete.tid
Normal file
@ -0,0 +1,26 @@
|
||||
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/delete
|
||||
tags: $:/tags/AdvancedSearch/FilterButton
|
||||
|
||||
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
|
||||
<$button popup=<<qualify "$:/state/filterDeleteDropdown">> class="tc-btn-invisible">
|
||||
{{$:/core/images/delete-button}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
|
||||
<$reveal state=<<qualify "$:/state/filterDeleteDropdown">> type="popup" position="belowleft" animate="yes">
|
||||
<div class="tc-block-dropdown-wrapper">
|
||||
<div class="tc-block-dropdown tc-edit-type-dropdown">
|
||||
<div class="tc-dropdown-item-plain">
|
||||
<$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>""">
|
||||
Are you sure you wish to delete <<resultCount>> tiddler(s)?
|
||||
</$set>
|
||||
</div>
|
||||
<div class="tc-dropdown-item-plain">
|
||||
<$button class="tc-btn">
|
||||
<$action-deletetiddler $filter={{$:/temp/advancedsearch}}/>
|
||||
Delete these tiddlers
|
||||
</$button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</$reveal>
|
19
core/ui/AdvancedSearch/FilterButtons/dropdown.tid
Normal file
19
core/ui/AdvancedSearch/FilterButtons/dropdown.tid
Normal file
@ -0,0 +1,19 @@
|
||||
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/dropdown
|
||||
tags: $:/tags/AdvancedSearch/FilterButton
|
||||
|
||||
<span class="tc-popup-keep">
|
||||
<$button popup=<<qualify "$:/state/filterDropdown">> class="tc-btn-invisible">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
</span>
|
||||
|
||||
<$reveal state=<<qualify "$:/state/filterDropdown">> type="popup" position="belowleft" animate="yes">
|
||||
<$linkcatcher to="$:/temp/advancedsearch">
|
||||
<div class="tc-block-dropdown-wrapper">
|
||||
<div class="tc-block-dropdown tc-edit-type-dropdown">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]"><$link to={{!!filter}}><$transclude field="description"/></$link>
|
||||
</$list>
|
||||
</div>
|
||||
</div>
|
||||
</$linkcatcher>
|
||||
</$reveal>
|
6
core/ui/AdvancedSearch/FilterButtons/export.tid
Normal file
6
core/ui/AdvancedSearch/FilterButtons/export.tid
Normal file
@ -0,0 +1,6 @@
|
||||
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/export
|
||||
tags: $:/tags/AdvancedSearch/FilterButton
|
||||
|
||||
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
|
||||
<$macrocall $name="exportButton" exportFilter={{$:/temp/advancedsearch}} lingoBase="$:/language/Buttons/ExportTiddlers/"/>
|
||||
</$reveal>
|
@ -2,8 +2,7 @@ title: $:/core/ui/AlertTemplate
|
||||
|
||||
<div class="tc-alert">
|
||||
<div class="tc-alert-toolbar">
|
||||
<$button message="tm-delete-tiddler" class="tc-btn-invisible">
|
||||
{{$:/core/images/delete-button}}</$button>
|
||||
<$button class="tc-btn-invisible"><$action-deletetiddler $tiddler=<<currentTiddler>>/>{{$:/core/images/delete-button}}</$button>
|
||||
</div>
|
||||
<div class="tc-alert-subtitle">
|
||||
<$view field="component"/> - <$view field="modified" format="date" template="0hh:0mm:0ss DD MM YYYY"/> <$reveal type="nomatch" state="!!count" text=""><span class="tc-alert-highlight">(count: <$view field="count"/>)</span></$reveal>
|
||||
|
@ -96,9 +96,7 @@ No information provided
|
||||
</$set>
|
||||
\end
|
||||
|
||||
<$button message="tm-modal" param="$:/core/ui/ControlPanel/Modals/AddPlugins" tooltip={{$:/language/ControlPanel/Plugins/Add/Hint}} class="tc-btn-big-green" style="background:blue;">
|
||||
{{$:/core/images/download-button}} <<lingo Add/Caption>>
|
||||
</$button>
|
||||
{{$:/core/ui/ControlPanel/Plugins/AddPlugins}}
|
||||
|
||||
<<lingo Installed/Hint>>
|
||||
|
||||
|
7
core/ui/ControlPanel/Plugins/AddPlugins.tid
Normal file
7
core/ui/ControlPanel/Plugins/AddPlugins.tid
Normal file
@ -0,0 +1,7 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/AddPlugins
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/Plugins/
|
||||
|
||||
<$button message="tm-modal" param="$:/core/ui/ControlPanel/Modals/AddPlugins" tooltip={{$:/language/ControlPanel/Plugins/Add/Hint}} class="tc-btn-big-green" style="background:blue;">
|
||||
{{$:/core/images/download-button}} <<lingo Add/Caption>>
|
||||
</$button>
|
@ -2,18 +2,37 @@ title: $:/core/ui/EditTemplate/shadow
|
||||
tags: $:/tags/EditTemplate
|
||||
|
||||
\define lingo-base() $:/language/EditTemplate/Shadow/
|
||||
\define pluginLinkBody()
|
||||
<$link to="""$(pluginTitle)$""">
|
||||
<$text text="""$(pluginTitle)$"""/>
|
||||
</$link>
|
||||
\end
|
||||
<$list filter="[all[current]get[draft.of]is[shadow]!is[tiddler]]">
|
||||
|
||||
<$list filter="[all[current]shadowsource[]]" variable="pluginTitle">
|
||||
|
||||
<$set name="pluginLink" value=<<pluginLinkBody>>>
|
||||
<div class="tc-message-box">
|
||||
|
||||
<<lingo Warning>>
|
||||
|
||||
</div>
|
||||
</$set>
|
||||
</$list>
|
||||
|
||||
</$list>
|
||||
|
||||
<$list filter="[all[current]get[draft.of]is[shadow]is[tiddler]]">
|
||||
|
||||
<$list filter="[all[current]shadowsource[]]" variable="pluginTitle">
|
||||
|
||||
<$set name="pluginLink" value=<<pluginLinkBody>>>
|
||||
<div class="tc-message-box">
|
||||
|
||||
<<lingo OverriddenWarning>>
|
||||
|
||||
</div>
|
||||
</$set>
|
||||
</$list>
|
||||
|
||||
</$list>
|
@ -29,16 +29,12 @@ title: $:/core/ui/SideBarLists
|
||||
</$reveal>
|
||||
</div>
|
||||
|
||||
<$reveal state="$:/temp/search" type="nomatch" text="">
|
||||
<$reveal tag="div" class="tc-block-dropdown-wrapper" state="$:/temp/search" type="nomatch" text="">
|
||||
|
||||
<$reveal state=<<qualify "$:/state/popup/search-dropdown">> type="nomatch" text="" default="">
|
||||
|
||||
<div class="tc-drop-down tc-search-drop-down tc-popup-handle">
|
||||
<$reveal tag="div" class="tc-block-dropdown tc-search-drop-down tc-popup-handle" state=<<qualify "$:/state/popup/search-dropdown">> type="nomatch" text="" default="">
|
||||
|
||||
{{$:/core/ui/SearchResults}}
|
||||
|
||||
</div>
|
||||
|
||||
</$reveal>
|
||||
|
||||
</$reveal>
|
||||
|
@ -27,4 +27,4 @@ color:$(foregroundColor)$;
|
||||
</span>
|
||||
\end
|
||||
|
||||
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}}/>
|
||||
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}}/>
|
@ -1,6 +1,6 @@
|
||||
title: $:/core/ui/Buttons/fold-bar
|
||||
tags: $:/tags/ViewToolbar
|
||||
caption: fold-bar
|
||||
description: Optional bars to fold and unfold tiddlers
|
||||
caption: {{$:/language/Buttons/Fold/FoldBar/Caption}}
|
||||
description: {{$:/language/Buttons/Fold/FoldBar/Hint}}
|
||||
|
||||
<!-- This dummy toolbar button is here to allow visibility of the fold-bar to be controlled as if it were a toolbar button -->
|
@ -3,8 +3,7 @@ tags: $:/tags/ViewToolbar
|
||||
caption: {{$:/core/images/fold-button}} {{$:/language/Buttons/Fold/Caption}}
|
||||
description: {{$:/language/Buttons/Fold/Hint}}
|
||||
|
||||
<$reveal type="nomatch" state=<<folded-state>> text="hide" default="show">
|
||||
<$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$reveal type="nomatch" state=<<folded-state>> text="hide" default="show"><$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
|
||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
|
||||
{{$:/core/images/fold-button}}
|
||||
@ -14,11 +13,7 @@ description: {{$:/language/Buttons/Fold/Hint}}
|
||||
<$text text={{$:/language/Buttons/Fold/Caption}}/>
|
||||
</span>
|
||||
</$list>
|
||||
</$button>
|
||||
</$reveal>
|
||||
|
||||
<$reveal type="match" state=<<folded-state>> text="hide" default="show">
|
||||
<$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
</$button></$reveal><$reveal type="match" state=<<folded-state>> text="hide" default="show"><$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
|
||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
|
||||
{{$:/core/images/unfold-button}}
|
||||
@ -28,5 +23,4 @@ description: {{$:/language/Buttons/Fold/Hint}}
|
||||
<$text text={{$:/language/Buttons/Unfold/Caption}}/>
|
||||
</span>
|
||||
</$list>
|
||||
</$button>
|
||||
</$reveal>
|
||||
</$button></$reveal>
|
@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: http://tiddlywiki.com/library/v5.1.9/index.html
|
||||
url: http://tiddlywiki.com/library/v5.1.12/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}}
|
||||
|
||||
{{$:/language/OfficialPluginLibrary/Hint}}
|
||||
|
@ -4,16 +4,16 @@ tags: $:/tags/Macro
|
||||
\define tabs(tabsList,default,state:"$:/state/tab",class,template)
|
||||
<div class="tc-tab-set $class$">
|
||||
<div class="tc-tab-buttons $class$">
|
||||
<$list filter="$tabsList$" variable="currentTab">
|
||||
<$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tc-tab-selected">
|
||||
<$list filter="$tabsList$" variable="currentTab"><$set name="save-currentTiddler" value=<<currentTiddler>>><$tiddler tiddler=<<currentTab>>><$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tc-tab-selected" tooltip={{!!tooltip}}>
|
||||
<$tiddler tiddler=<<save-currentTiddler>>>
|
||||
<$set name="tv-wikilinks" value="no">
|
||||
<$transclude tiddler=<<currentTab>> field="caption">
|
||||
<$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/>
|
||||
</$transclude>
|
||||
</$set>
|
||||
</$button>
|
||||
</$list>
|
||||
</div><div class="tc-tab-divider $class$"/><div class="tc-tab-content $class$">
|
||||
</$set></$tiddler></$button></$tiddler></$set></$list>
|
||||
</div>
|
||||
<div class="tc-tab-divider $class$"/>
|
||||
<div class="tc-tab-content $class$">
|
||||
<$list filter="$tabsList$" variable="currentTab">
|
||||
|
||||
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
|
||||
|
2
core/wiki/tags/AdvancedSearchFilterButton.tid
Normal file
2
core/wiki/tags/AdvancedSearchFilterButton.tid
Normal file
@ -0,0 +1,2 @@
|
||||
title: $:/tags/AdvancedSearch/FilterButton
|
||||
list: $:/core/ui/AdvancedSearch/Filter/FilterButtons/dropdown $:/core/ui/AdvancedSearch/Filter/FilterButtons/clear $:/core/ui/AdvancedSearch/Filter/FilterButtons/export $:/core/ui/AdvancedSearch/Filter/FilterButtons/delete
|
@ -2,7 +2,7 @@ title: Releasing a new version of TiddlyWiki
|
||||
|
||||
# Move the latest release note from the prerelease edition into the tw5.com edition
|
||||
# Adjust the release date and the ''released'' field of the latest release tiddler (eg, [[Release 5.1.3]])
|
||||
# Ensure [[Releases]] has the new version as the default tab
|
||||
# Ensure [[TiddlyWiki Releases]] has the new version as the default tab
|
||||
# Adjust the modified time of HelloThere
|
||||
# Make sure ''Jermolene/TiddlyWiki5'' is fully committed
|
||||
# Edit `package.json` to the new version number
|
||||
|
@ -12,7 +12,7 @@ The parse-tree consists of nested nodes like
|
||||
```js
|
||||
{type: "element", tag: <string>, attributes: {}, children: []} - an HTML element
|
||||
{type: "text", text: <string>} - a text node
|
||||
{type: "entity", value: <string>} - an HTML entity like © for a copyright symbol
|
||||
{type: "entity", entity: <string>} - an HTML entity like © for a copyright symbol
|
||||
{type: "raw", html: <string>} - raw HTML
|
||||
```
|
||||
|
||||
@ -37,4 +37,4 @@ Attributes in the parse-tree are not stored as simple strings but they are nodes
|
||||
```js
|
||||
{type: "string", value: <string>} - literal string
|
||||
{type: "indirect", textReference: <textReference>} - indirect through a text reference
|
||||
```
|
||||
```
|
||||
|
@ -16,6 +16,7 @@
|
||||
"tiddlywiki/railroad",
|
||||
"tiddlywiki/stacked-view",
|
||||
"tiddlywiki/text-slicer",
|
||||
"tiddlywiki/xmldom",
|
||||
"tiddlywiki/powered-by-tiddlywiki"
|
||||
],
|
||||
"languages": [
|
||||
|
@ -4,9 +4,9 @@ title: Translations
|
||||
$(languagePluginTitle)$/icon
|
||||
\end
|
||||
|
||||
The following plugin translations are currently available:
|
||||
TiddlyWiki is currently available in <$count filter="[[$:/languages/en-GB]] [plugin-type[language]sort[title]] -[[$:/languages/de-AT]]"/> languages:
|
||||
|
||||
<div class="tc-drop-down-language-chooser" style="font-size: 16px; line-height: 20px;">
|
||||
<div class="tc-drop-down-language-chooser" style="font-size: 10px; line-height: 12px; -moz-columns:2; -webkit-columns:2; columns:2;">
|
||||
<$list filter="[[$:/languages/en-GB]] [plugin-type[language]sort[title]] -[[$:/languages/de-AT]]">
|
||||
<div class="tc-language-list">
|
||||
<span class="tc-language-list-greeting">
|
||||
|
@ -17,20 +17,29 @@
|
||||
"tiddlywiki/readonly"
|
||||
],
|
||||
"languages": [
|
||||
"ca-ES",
|
||||
"cs-CZ",
|
||||
"da-DK",
|
||||
"el-GR",
|
||||
"en-US",
|
||||
"en-GB",
|
||||
"de-AT",
|
||||
"de-DE",
|
||||
"el-GR",
|
||||
"en-GB",
|
||||
"en-US",
|
||||
"es-ES",
|
||||
"fr-FR",
|
||||
"zh-Hans",
|
||||
"zh-Hant",
|
||||
"hi-IN",
|
||||
"ia-IA",
|
||||
"it-IT",
|
||||
"ja-JP",
|
||||
"cs-CZ",
|
||||
"ru-RU"
|
||||
"ko-KR",
|
||||
"nl-NL",
|
||||
"pa-IN",
|
||||
"pt-PT",
|
||||
"ru-RU",
|
||||
"sk-SK",
|
||||
"sv-SE",
|
||||
"zh-Hans",
|
||||
"zh-Hant"
|
||||
],
|
||||
"build": {
|
||||
"index": [
|
||||
|
@ -22,59 +22,60 @@ These examples are taken from http://khan.github.io/KaTeX/
|
||||
|
||||
!! Example 1
|
||||
|
||||
If the text between `$$` contains newlines it will rendered in display mode:
|
||||
|
||||
```
|
||||
$$\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi$$
|
||||
$$
|
||||
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||
$$
|
||||
```
|
||||
|
||||
$$\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi$$
|
||||
$$
|
||||
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||
$$
|
||||
|
||||
!! Example 2
|
||||
|
||||
```
|
||||
$$\displaystyle \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }$$
|
||||
$$
|
||||
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
|
||||
$$
|
||||
```
|
||||
|
||||
$$\displaystyle \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }$$
|
||||
$$
|
||||
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
|
||||
$$
|
||||
|
||||
|
||||
!! Example 3
|
||||
|
||||
Use a wrapper element with the class `katex-display` to render math in display mode, centred on a single line in display style.
|
||||
|
||||
```
|
||||
<div class="katex-display">
|
||||
$$\displaystyle \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
|
||||
</div>
|
||||
$$
|
||||
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.
|
||||
$$
|
||||
```
|
||||
|
||||
<div class="katex-display">
|
||||
$$\displaystyle \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
|
||||
</div>
|
||||
|
||||
!! Example 4
|
||||
|
||||
```
|
||||
$$\displaystyle 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.$$
|
||||
```
|
||||
|
||||
$$\displaystyle 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.$$
|
||||
$$
|
||||
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.
|
||||
$$
|
||||
|
||||
!! Widget Example
|
||||
|
||||
For more flexibility the KaTeX widget can also be used via the full widget syntax:
|
||||
|
||||
```
|
||||
<$latex text="\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi"></$latex>
|
||||
<$latex text="f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi" displayMode="true"></$latex>
|
||||
```
|
||||
|
||||
<$latex text="\displaystyle f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi"></$latex>
|
||||
<$latex text="f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi" displayMode="true"></$latex>
|
||||
|
||||
! Error Handling
|
||||
|
||||
Any LaTeX syntax errors are flagged with the problematic syntax highlighted. For example:
|
||||
|
||||
```
|
||||
$$\displaystyle f(x) = \int_{-\infty}^\infinity\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi$$
|
||||
$$ f(x) = \int_{-\infty}^\infinity\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi $$
|
||||
```
|
||||
|
||||
$$\displaystyle f(x) = \int_{-\infty}^\infinity\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi$$
|
||||
$$ f(x) = \int_{-\infty}^\infinity\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi $$
|
||||
|
||||
|
40
editions/prerelease/tiddlers/Release 5.1.12.tid
Normal file
40
editions/prerelease/tiddlers/Release 5.1.12.tid
Normal file
@ -0,0 +1,40 @@
|
||||
caption: 5.1.12
|
||||
created: 20160205184203773
|
||||
modified: 20160205184203773
|
||||
tags: ReleaseNotes
|
||||
title: Release 5.1.12
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.1.11...v5.1.12]]//
|
||||
|
||||
! Major Improvements
|
||||
|
||||
!! TBD
|
||||
|
||||
! Other Improvements
|
||||
|
||||
!! Translation Improvements
|
||||
|
||||
* TBD
|
||||
|
||||
!! Usability Improvements
|
||||
|
||||
* TBD
|
||||
|
||||
!! Hackability Improvements
|
||||
|
||||
* TBD
|
||||
|
||||
!! Bug Fixes
|
||||
|
||||
* TBD
|
||||
|
||||
!! Node.js Improvements
|
||||
|
||||
* TBD
|
||||
|
||||
!! Contributors
|
||||
|
||||
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
|
||||
|
||||
* [[@telmiger|https://github.com/telmiger]]
|
@ -1,15 +0,0 @@
|
||||
tags: [[Filter Operators]] [[Date Operators]]
|
||||
title: recent Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: recent
|
||||
op-purpose: filter the input by age
|
||||
op-input: a [[selection of titles|Title Selection]]
|
||||
op-suffix: the name of a [[date field|Date Fields]], defaulting to <<.field modified>>
|
||||
op-suffix-name: F
|
||||
op-parameter: a number of days, defaulting to 0
|
||||
op-parameter-name: D
|
||||
op-output: those input tiddlers in which field <<.place F>> is at most <<.place D>> days old, ignoring time
|
||||
|
||||
Select tiddlers where a specified date field (default "modified") is within the last N days (default 0, meaning today).
|
||||
|
||||
<<.operator-examples "recent">>
|
@ -1,6 +1,6 @@
|
||||
title: $:/config/LocalPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: http://127.0.0.1:8080/prerelease/library/v5.1.10/index.html
|
||||
url: http://127.0.0.1:8080/prerelease/library/v5.1.12/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease Local)
|
||||
|
||||
A locally installed version of the official ~TiddlyWiki plugin library at tiddlywiki.com for testing and debugging. //Requires a local web server to share the library//
|
||||
|
@ -1,6 +1,6 @@
|
||||
title: $:/config/OfficialPluginLibrary
|
||||
tags: $:/tags/PluginLibrary
|
||||
url: http://tiddlywiki.com/prerelease/library/v5.1.10/index.html
|
||||
url: http://tiddlywiki.com/prerelease/library/v5.1.11/index.html
|
||||
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease)
|
||||
|
||||
The prerelease version of the official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
|
||||
|
@ -5,9 +5,7 @@ modified: 20150428204930183
|
||||
<$edit-text tiddler="""$tiddler$""" index="""$colour$""" type="color" tag="input"/>
|
||||
\end
|
||||
|
||||
This is a pre-release build of TiddlyWiki.
|
||||
|
||||
It is provided for testing purposes. Please don't try to use it for anything important -- you should use the latest official release from http://tiddlywiki.com.
|
||||
This is a pre-release build of TiddlyWiki. It is provided for testing purposes. ''Please don't try to use it for anything important'' -- you should use the latest official release from http://tiddlywiki.com.
|
||||
|
||||
<$list filter="[tag[ReleaseNotes]!has[released]!sort[created]]">
|
||||
<h1><$text text=<<currentTiddler>>/></h1>
|
||||
|
@ -51,12 +51,14 @@ describe("Filter tests", function() {
|
||||
title: "TiddlerOne",
|
||||
text: "The quick brown fox in $:/TiddlerTwo",
|
||||
tags: ["one"],
|
||||
authors: "Joe Bloggs",
|
||||
modifier: "JoeBloggs",
|
||||
modified: "201304152222"});
|
||||
wiki.addTiddler({
|
||||
title: "$:/TiddlerTwo",
|
||||
text: "The rain in Spain\nfalls mainly on the plain and [[a fourth tiddler]]",
|
||||
tags: ["two"],
|
||||
authors: "[[John Doe]]",
|
||||
modifier: "JohnDoe",
|
||||
modified: "201304152211"});
|
||||
wiki.addTiddler({
|
||||
@ -217,6 +219,8 @@ describe("Filter tests", function() {
|
||||
|
||||
it("should handle the each operator", function() {
|
||||
expect(wiki.filterTiddlers("[each[modifier]sort[title]]").join(",")).toBe("$:/TiddlerTwo,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[each:list-item[tags]sort[title]]").join(",")).toBe("one,two");
|
||||
expect(wiki.filterTiddlers("[each:list-item[authors]sort[title]]").join(",")).toBe("Bloggs,Joe,John Doe");
|
||||
});
|
||||
|
||||
it("should handle the eachday operator", function() {
|
||||
|
@ -104,6 +104,13 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i
|
||||
Dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
</p>
|
||||
|
||||
<dl>
|
||||
<dt>Term being defined</dt>
|
||||
<dd>Definition of that term</dd>
|
||||
<dt>Another term</dt>
|
||||
<dd>Another definition</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Story</h3>
|
||||
|
||||
<ul class="intro">
|
||||
|
@ -1,7 +1,8 @@
|
||||
{
|
||||
"description": "Tools for slicing up long texts into individual tiddlers",
|
||||
"plugins": [
|
||||
"tiddlywiki/text-slicer"
|
||||
"tiddlywiki/text-slicer",
|
||||
"tiddlywiki/xmldom"
|
||||
],
|
||||
"languages": [
|
||||
],
|
||||
|
@ -1,5 +1,8 @@
|
||||
title: SampleAlert
|
||||
component: demo
|
||||
created: 20160107230134172
|
||||
modified: 20160107230134172
|
||||
title: SampleAlert
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
This is a demonstration alert.
|
||||
|
@ -0,0 +1,16 @@
|
||||
created: 20160204225047445
|
||||
modified: 20160204225307847
|
||||
tags: Articles
|
||||
title: "A free, open source wiki revisited" by Mark Gibbs, NetworkWorld
|
||||
type: text/vnd.tiddlywiki
|
||||
url: http://www.networkworld.com/article/3028098/open-source-tools/tiddlywiki-a-free-open-source-wiki-revisited.html
|
||||
|
||||
Interesting article giving the perspective of someone who has been away from TiddlyWiki for a few years:
|
||||
|
||||
{{!!url}}
|
||||
|
||||
<<<
|
||||
Way back in the mists of time (actually, January 2009) I wrote about a really cool tool called TiddlyWiki, a “non-linear personal web notebook”. Fast forward to today and I just had an out of body experience: Completely by accident I found a TiddlyWiki that I started when I wrote that piece and it still works!
|
||||
|
||||
Finding code that works flawlessly after just two or three years is magical enough but after seven years?! And given that TiddlyWiki is written as a single page Web application and considering how different browsers are now than they were in 2009, the fact that the old version of TiddlyWiki still works is not short of miraculous.
|
||||
<<<
|
@ -0,0 +1,22 @@
|
||||
created: 20150913184230499
|
||||
modified: 20150913184230499
|
||||
tags: Resources
|
||||
title: TWCommunitySearch
|
||||
type: text/vnd.tiddlywiki
|
||||
url: http://erwanm.github.io/tw-community-search
|
||||
|
||||
The [[CommunitySearch wiki|http://erwanm.github.io/tw-community-search]] aggregates many public wikis from the community. It is updated automatically every day. At the time of writing, more than 5000 tiddlers are indexed, thus giving access to the largest known collection of TW content.
|
||||
|
||||
It lets you search for some specific content among a preselected list of wikis. The indexed content is mostly focused on TW usage, so you would typically use this search system to find information about a particular aspect of TiddlyWiki. Say for example that you want to learn how to make a table of content, type "table of content" in the [[CommunitySearch box|http://erwanm.github.io/tw-community-search/#CommunitySearch]] (also accessible in the default tiddler [[GettingStarted|http://erwanm.github.io/tw-community-search/#GettingStarted]]). The search results are links to various wikis, and point directly to the specific tiddlers containing your request.
|
||||
|
||||
|
||||
The ~CommunitySearch wiki also lets you:
|
||||
|
||||
* Browse the [[list of wikis|http://erwanm.github.io/tw-community-search/#CommunityWikis]]
|
||||
* Browse the [[list of author|http://erwanm.github.io/tw-community-search/#CommunityAuthors]]
|
||||
* Browse the [[list of plugins|http://erwanm.github.io/tw-community-search/#CommunityPlugins]]
|
||||
* Access content by [[tag|http://erwanm.github.io/tw-community-search/#CommunityTags]] (see also [[BookmarkingTags|http://erwanm.github.io/tw-community-search/#BookmarkingTags]])
|
||||
* Follow the [[latest news|http://erwanm.github.io/tw-community-search/#CommunityNews]] from the community (and [[publish your own news|http://erwanm.github.io/tw-community-search/#PublishingInCommunityNews]] if you are a wiki author)
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
created: 20151015072304780
|
||||
modified: 20151015073121685
|
||||
tags: Resources
|
||||
title: datepicker plugin based on Pikaday, by kixam
|
||||
type: text/vnd.tiddlywiki
|
||||
url: http://kixam.github.io/TW5-datePicker/
|
||||
|
||||
An interactive date picker plugin based on [[Pikaday|https://github.com/dbushell/Pikaday]]. A demo can be found here: {{!!url}}.
|
||||
|
||||
<<<
|
||||
datepicker is a TiddlyWiki plugin that allows you to use a widget much like EditTextWidget to pick a date (not a time). It shows a nice interactive mini-calendar when clicked, allows you to set a date format for display, and is compatible with core date fields such as `modified` and `created`.
|
||||
<<<
|
@ -3,7 +3,7 @@ modified: 20141130195444237
|
||||
tags: Concepts
|
||||
title: Transclusion
|
||||
|
||||
<a href="http://en.wikipedia.org/wiki/Transclusion">Transclusion</a> is the process of referencing one tiddler "A" from another tiddler "B" such that the content of "A" appears to be a part of "B".
|
||||
[[Transclusion|http://en.wikipedia.org/wiki/Transclusion]] is the process of referencing one tiddler "A" from another tiddler "B" such that the content of "A" appears to be a part of "B".
|
||||
|
||||
Copying and pasting content creates multiple copies of the same content in several different places. With transclusion, there can be a single copy and a special instruction in "B" which indicates the point at which content should be inserted from tiddler "A".
|
||||
|
||||
@ -16,6 +16,7 @@ To learn more:
|
||||
* [[Transclusion in WikiText]]
|
||||
* [[Transclusion Basic Usage]]
|
||||
* [[Transclusion with Templates]]
|
||||
* [[Transclusion and Substitution]]
|
||||
* TextReference
|
||||
* TemplateTiddlers
|
||||
* TranscludeWidget
|
||||
|
@ -1,6 +1,6 @@
|
||||
created: 20140126125259638
|
||||
modified: 20150427121710347
|
||||
tags: Definitions Features Saving Platforms
|
||||
modified: 20160107230954643
|
||||
tags: Definitions Saving Platforms
|
||||
title: TiddlyDesktop
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
|
@ -3,6 +3,7 @@ modified: 20150221211613000
|
||||
title: SampleTabFour
|
||||
tags: sampletab
|
||||
caption: Four
|
||||
tooltip: This tab specifies both a caption and a tooltip
|
||||
order: 4
|
||||
|
||||
This is the fourth of our sample tabs.
|
||||
|
@ -2,5 +2,6 @@ created: 20150221211557000
|
||||
title: SampleTabThree
|
||||
tags: sampletab
|
||||
order: 3
|
||||
tooltip: This tab specifies a tooltip only
|
||||
|
||||
This is the third of our sample tabs.
|
||||
|
@ -1,12 +1,16 @@
|
||||
created: 20140908125500000
|
||||
list: [[Empty Edition]]
|
||||
modified: 20150412185442868
|
||||
modified: 20160107222125923
|
||||
tags: TableOfContents
|
||||
title: Editions
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
TiddlyWiki is distributed in several different editions that are tuned for specific purposes. Each one consists of the same TiddlyWiki core components along with the required plugins, documentation and sample content.
|
||||
TiddlyWiki is distributed in several distinct editions that are tuned for specific purposes.
|
||||
|
||||
You can mix and match the components of these editions, to make a unique solution to your particular application.
|
||||
An edition consists of the TiddlyWiki core components along with plugins, documentation and sample content to get you up and running as quickly as possible.
|
||||
|
||||
You can mix and match the components of these editions, to make a unique solution for your particular application.
|
||||
|
||||
<<list-links "[tag[Editions]]">>
|
||||
|
||||
<$macrocall $name=".tip" _="""Note that editions should not be confused with the [[platforms|Platforms]] on which TiddlyWiki runs (eg as a [[single HTML file|Saving]] vs. [[under Node.js|TiddlyWiki on Node.js]])"""/>
|
||||
|
@ -1,23 +1,11 @@
|
||||
created: 20130822172800000
|
||||
modified: 20140920143945484
|
||||
modified: 20160107225826644
|
||||
tags: TableOfContents
|
||||
title: Features
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define alert-demo()
|
||||
<$fieldmangler tiddler="SampleAlert"><$set name="currentTiddler" value="SampleAlert"><$button message="tm-add-tag" param="$:/tags/Alert">alerts</$button></$set></$fieldmangler>
|
||||
\end
|
||||
|
||||
Further information about specific TiddlyWiki features:
|
||||
|
||||
<<list-links "[tag[Features]]">>
|
||||
|
||||
----
|
||||
|
||||
* Familiar user interface elements like <<alert-demo>>, <$button message="tm-modal" param="SampleWizard">wizards</$button> and <$button message="tm-notify" param="SampleNotification">notifications</$button>
|
||||
* Try out the <$button message="tm-full-screen">full screen support</$button>
|
||||
* Explore the [[D3.js visualisation plugin|http://tiddlywiki.com/plugins/tiddlywiki/d3/index.html]]
|
||||
* [[CodeMirror support via a plugin|http://tiddlywiki.com/plugins/tiddlywiki/codemirror/index.html]]
|
||||
* [[Markdown support via a plugin|http://tiddlywiki.com/plugins/tiddlywiki/markdown/index.html]]
|
||||
* [[Classic TiddlyWiki markup support via a plugin|http://tiddlywiki.com/plugins/tiddlywiki/tw2parser/index.html]]
|
||||
* Last but not least, TiddlyWiki is a rare example of a practical [[quine|Quine]]
|
||||
Last but not least, TiddlyWiki is a rare example of a practical [[quine|Quine]]
|
||||
|
@ -1,5 +1,5 @@
|
||||
created: 20140206214608586
|
||||
modified: 20140912141710950
|
||||
modified: 20151105122712982
|
||||
tags: Features
|
||||
title: LazyLoading
|
||||
type: text/vnd.tiddlywiki
|
||||
@ -8,19 +8,27 @@ Ordinarily with TiddlyWiki, the full content of all tiddlers is embedded into th
|
||||
|
||||
Lazy loading can be used in two configurations:
|
||||
|
||||
* When running [[TiddlyWiki on Node.js]], image tiddlers can be subject to lazy loading
|
||||
* When running [[TiddlyWiki on Node.js]], just image tiddlers or all non-system tiddlers can be subject to lazy loading
|
||||
* When running [[TiddlyWiki in the Sky for TiddlyWeb]], all tiddlers are subject to lazy loading
|
||||
|
||||
See the LazyLoadingMechanism for details of how lazy loading is implemented.
|
||||
|
||||
! Lazy loading under Node.js
|
||||
|
||||
To run TiddlyWiki with lazy loading for images, use this alternative ServerCommand to start the server:
|
||||
To start TiddlyWiki with lazy loading for image tiddlers use this command:
|
||||
|
||||
|
||||
```
|
||||
tiddlywiki --server 8080 $:/core/save/lazy-images
|
||||
```
|
||||
|
||||
To apply lazy loading to all non-system tiddlers use this command:
|
||||
|
||||
|
||||
```
|
||||
tiddlywiki --server 8080 $:/core/save/lazy-all
|
||||
```
|
||||
|
||||
! Lazy loading under TiddlyWeb
|
||||
|
||||
With the current configuration, lazy loading is enabled by default.
|
||||
|
11
editions/tw5.com/tiddlers/features/Modals.tid
Normal file
11
editions/tw5.com/tiddlers/features/Modals.tid
Normal file
@ -0,0 +1,11 @@
|
||||
created: 20160107225427489
|
||||
modified: 20160107225651558
|
||||
tags: Features
|
||||
title: Modals
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Modals (or "wizards") fade the main TiddlyWiki window to display an isolated tiddler that must be explicitly dismissed by the user.
|
||||
|
||||
Modals are displayed with the [[WidgetMessage: tm-modal]].
|
||||
|
||||
<$button message="tm-modal" param="SampleWizard">Open demo modal</$button>
|
9
editions/tw5.com/tiddlers/features/Notifications.tid
Normal file
9
editions/tw5.com/tiddlers/features/Notifications.tid
Normal file
@ -0,0 +1,9 @@
|
||||
created: 20160107225753340
|
||||
modified: 20160107225855353
|
||||
tags: Features
|
||||
title: Notifications
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Notifications are small informational messages that appear at the top right of the TiddlyWiki window, and automatically disappear after a preset time.
|
||||
|
||||
<$button message="tm-notify" param="SampleNotification">Display sample notification</$button>
|
@ -28,7 +28,9 @@ The following table lists all the core operators. The commonest ones are checkma
|
||||
</tr>
|
||||
<<.operator-rows "[tag[Filter Operators]!tag[Order Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">>
|
||||
<<.group-heading "Order Operators">>
|
||||
<<.operator-rows "[tag[Filter Operators]tag[Order Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">>
|
||||
<<.operator-rows "[tag[Filter Operators]tag[Order Operators]!tag[Listops Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">>
|
||||
<<.group-heading "Listops Operators">>
|
||||
<<.operator-rows "[tag[Filter Operators]tag[Listops Operators]tag[Order Operators]!tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">>
|
||||
<<.group-heading "String Operators">>
|
||||
<<.operator-rows "[tag[Filter Operators]!tag[Order Operators]tag[String Operators]!tag[Tag Operators]!tag[Special Operators]sort[]]">>
|
||||
<<.group-heading "Tag Operators">>
|
||||
|
14
editions/tw5.com/tiddlers/filters/allafter.tid
Normal file
14
editions/tw5.com/tiddlers/filters/allafter.tid
Normal file
@ -0,0 +1,14 @@
|
||||
caption: allafter
|
||||
created: 20151017145021839
|
||||
modified: 20151108051523860
|
||||
op-input: a list of items
|
||||
op-output: all items after the marker
|
||||
op-parameter: the list item to be used as a marker
|
||||
op-parameter-name: marker
|
||||
op-purpose: discard all items except those after the marker
|
||||
op-suffix: specifying a suffix ('include') will include the marker in the output
|
||||
tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]]
|
||||
title: allafter Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-examples "allafter">>
|
14
editions/tw5.com/tiddlers/filters/allbefore.tid
Normal file
14
editions/tw5.com/tiddlers/filters/allbefore.tid
Normal file
@ -0,0 +1,14 @@
|
||||
caption: allbefore
|
||||
created: 20151017145131857
|
||||
modified: 20151108051507578
|
||||
op-input: a list of items
|
||||
op-output: all items before the marker
|
||||
op-parameter: the list item to be used as a marker
|
||||
op-parameter-name: marker
|
||||
op-purpose: discard all items except those before the marker
|
||||
op-suffix: specifying a suffix ('include') will include the marker in the output
|
||||
tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]]
|
||||
title: allbefore Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-examples "allbefore">>
|
15
editions/tw5.com/tiddlers/filters/append.tid
Normal file
15
editions/tw5.com/tiddlers/filters/append.tid
Normal file
@ -0,0 +1,15 @@
|
||||
caption: append
|
||||
created: 20151017145358368
|
||||
modified: 20151108051540981
|
||||
op-input: a list of items
|
||||
op-neg-output: a list with items appended from the tail of the operand array
|
||||
op-output: a list with items appended from the head of the operand array
|
||||
op-parameter: the array of items to be appended to the tail of the list
|
||||
op-parameter-name: list
|
||||
op-purpose: append a range of items from an array to the list
|
||||
op-suffix: an integer N, defaulting to all
|
||||
tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]]
|
||||
title: append Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-examples "append">>
|
16
editions/tw5.com/tiddlers/filters/days.tid
Normal file
16
editions/tw5.com/tiddlers/filters/days.tid
Normal file
@ -0,0 +1,16 @@
|
||||
tags: [[Filter Operators]] [[Date Operators]] [[Negatable Operators]]
|
||||
title: days Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: days
|
||||
op-input: a [[selection of titles|Title Selection]]
|
||||
op-neg-output: those input tiddlers in which field <<.place F>> is more than <<.place D>> days in the { future | past }, where <<.place D>> is { positive | negative }
|
||||
op-output: those input tiddlers in which field <<.place F>> is <<.place D>> days in the { future | past } or any time { before | after } that, including { past | future }, where <<.place D>> is { positive | negative }
|
||||
op-parameter: a number of days, defaulting to 0
|
||||
op-parameter-name: D
|
||||
op-purpose: filter the input by date
|
||||
op-suffix: the name of a [[date field|Date Fields]], defaulting to <<.field modified>>
|
||||
op-suffix-name: F
|
||||
|
||||
Select tiddlers where a specified date field (default "modified") is withing a specified date range. Time portion is ignored.
|
||||
|
||||
<<.operator-examples "days">>
|
@ -6,7 +6,7 @@ type: text/vnd.tiddlywiki
|
||||
caption: each
|
||||
op-purpose: select one of each group of input titles by field
|
||||
op-input: a [[selection of titles|Title Selection]]
|
||||
op-suffix: optionally, `list`
|
||||
op-suffix: optionally, `list-item`
|
||||
op-parameter: the name of a [[field|TiddlerFields]], defaulting to <<.field title>>
|
||||
op-parameter-name: F
|
||||
op-output: a selection containing the first input title encountered for each distinct value of field <<.place F>>
|
||||
@ -15,7 +15,7 @@ Each input title is processed in turn. The value of field <<.place F>> in the co
|
||||
|
||||
;each
|
||||
:As long as the field's value has not been encountered before, the title is appended to the output.
|
||||
;each:list
|
||||
;each:list-item
|
||||
:The value is treated as a [[title list|Title List]]. Each title in the list considered in turn. If it has not been encountered before, it is appended to the output.
|
||||
|
||||
If a tiddler doesn't contain field <<.place F>>, it is treated as if the field's value was empty.
|
||||
|
10
editions/tw5.com/tiddlers/filters/examples/allafter.tid
Normal file
10
editions/tw5.com/tiddlers/filters/examples/allafter.tid
Normal file
@ -0,0 +1,10 @@
|
||||
created: 20151022123929297
|
||||
modified: 20151108080543606
|
||||
tags: [[Operator Examples]] [[allafter Operator]]
|
||||
title: allafter Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]] +[allafter[Wednesday]]">>
|
||||
<<.operator-example 2 "[list[Days of the Week]] +[allafter:include[Wednesday]]">>
|
10
editions/tw5.com/tiddlers/filters/examples/allbefore.tid
Normal file
10
editions/tw5.com/tiddlers/filters/examples/allbefore.tid
Normal file
@ -0,0 +1,10 @@
|
||||
created: 20151017150902487
|
||||
modified: 20151108051438263
|
||||
tags: [[Operator Examples]] [[allbefore Operator]]
|
||||
title: allbefore Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]allbefore[Wednesday]]">>
|
||||
<<.operator-example 2 "[list[Days of the Week]allbefore:include[Wednesday]]">>
|
14
editions/tw5.com/tiddlers/filters/examples/append.tid
Normal file
14
editions/tw5.com/tiddlers/filters/examples/append.tid
Normal file
@ -0,0 +1,14 @@
|
||||
created: 20151017150942725
|
||||
modified: 20151108051557748
|
||||
tags: [[Operator Examples]] [[append Operator]]
|
||||
title: append Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]append[Tomorrow]]">>
|
||||
<<.operator-example 2 "[list[Days of the Week]append[Yesterday Today Tomorrow]]">>
|
||||
|
||||
;Append the first 4 short days of the week to our list
|
||||
|
||||
<<.operator-example 3 "[list[Days of the Week]append:4{Days of the Week!!short}]">>
|
@ -1,9 +1,9 @@
|
||||
tags: [[recent Operator]] [[Operator Examples]]
|
||||
title: recent Operator (Examples)
|
||||
tags: [[Operator Examples]] [[days Operator]]
|
||||
title: days Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-example 1 "[recent[1]]" "tiddlers modified yesterday and today">>
|
||||
<<.operator-example 2 "[recent:created[14]]" "tiddlers created within the last 14 days">>
|
||||
<<.operator-example 1 "[days[-14]]" "tiddlers modified within the last 14 days">>
|
||||
<<.operator-example 2 "[!days:created[-800]]" "tiddlers created more than 800 days ago">>
|
||||
The filter can be used to highlight new items in a list. For example:
|
||||
<$macrocall
|
||||
$name="wikitext-example-without-html" src=
|
||||
@ -11,7 +11,7 @@ The filter can be used to highlight new items in a list. For example:
|
||||
<ul>
|
||||
<$list filter="[tag[ReleaseNotes]!<currentTiddler>!sort[modified]]">
|
||||
<li>
|
||||
<$link><$view field="title"/></$link><$list filter="[<currentTiddler>recent[90]]"> @@color:red;^^new^^@@</$list>
|
||||
<$link><$view field="title"/></$link><$list filter="[<currentTiddler>days[-120]]"> @@color:red;^^new^^@@</$list>
|
||||
</li>
|
||||
</$list>
|
||||
</ul>
|
@ -6,5 +6,6 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-example 1 "[each[color]]">>
|
||||
<<.operator-example 2 "[sort[title]each[type]]" "the alphabetically first tiddler of each type">>
|
||||
<<.operator-example 3 "[each:list-item[list]]" "all tiddlers listed anywhere in the core list field">>
|
||||
|
||||
For an example of using the <<.op each>> operator to generate a two-tier list of groups and members, see [[GroupedLists]].
|
||||
|
10
editions/tw5.com/tiddlers/filters/examples/move.tid
Normal file
10
editions/tw5.com/tiddlers/filters/examples/move.tid
Normal file
@ -0,0 +1,10 @@
|
||||
created: 20151022123633433
|
||||
modified: 20151108051643871
|
||||
tags: [[Operator Examples]] [[move Operator]]
|
||||
title: move Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]] +[move[Wednesday]]">>
|
||||
<<.operator-example 2 "[list[Days of the Week]] +[move:-2[Wednesday]]">>
|
15
editions/tw5.com/tiddlers/filters/examples/prepend.tid
Normal file
15
editions/tw5.com/tiddlers/filters/examples/prepend.tid
Normal file
@ -0,0 +1,15 @@
|
||||
created: 20151017151508135
|
||||
modified: 20151108051743531
|
||||
tags: [[Operator Examples]] [[prepend Operator]]
|
||||
title: prepend Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
The operator may be used to prepend a number of items to the list.
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]prepend[Yesterday Today Tomorrow]]">>
|
||||
|
||||
The operand may list only items without spaces -- to include items with spaces, use a reference to an array e.g. prepend the last three short days of the week to the list
|
||||
|
||||
<<.operator-example 2 "[list[Days of the Week]!prepend:3{Days of the Week!!short}]">>
|
11
editions/tw5.com/tiddlers/filters/examples/putafter.tid
Normal file
11
editions/tw5.com/tiddlers/filters/examples/putafter.tid
Normal file
@ -0,0 +1,11 @@
|
||||
created: 20151017151905558
|
||||
modified: 20151108051825288
|
||||
tags: [[Operator Examples]] [[putafter Operator]]
|
||||
title: putafter Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]] +[putafter[Wednesday]]">>
|
||||
<<.operator-example 2 "[list[Days of the Week]] +[putafter:2[Tuesday]]">>
|
||||
<<.operator-example 3 "[list[Days of the Week]] [[Yesterday]] [[Today]] [[Tomorrow]] +[putafter:3[Tuesday]]">>
|
11
editions/tw5.com/tiddlers/filters/examples/putbefore.tid
Normal file
11
editions/tw5.com/tiddlers/filters/examples/putbefore.tid
Normal file
@ -0,0 +1,11 @@
|
||||
created: 20151022142602628
|
||||
modified: 20151108051906935
|
||||
tags: [[Operator Examples]] [[putbefore Operator]]
|
||||
title: putbefore Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]] +[putbefore[Wednesday]]">>
|
||||
<<.operator-example 2 "[list[Days of the Week]] +[putbefore:2[Tuesday]]">>
|
||||
<<.operator-example 3 "[list[Days of the Week]] [[Yesterday]] [[Today]] [[Tomorrow]] +[putbefore:3[Tuesday]]">>
|
11
editions/tw5.com/tiddlers/filters/examples/putfirst.tid
Normal file
11
editions/tw5.com/tiddlers/filters/examples/putfirst.tid
Normal file
@ -0,0 +1,11 @@
|
||||
created: 20151017152847899
|
||||
modified: 20151108051943204
|
||||
tags: [[Operator Examples]] [[putfirst Operator]]
|
||||
title: putfirst Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]] +[putfirst[]]">>
|
||||
<<.operator-example 2 "[list[Days of the Week]] +[putfirst:2[]]">>
|
||||
<<.operator-example 3 "[list[Days of the Week]] [[Yesterday]] [[Today]] [[Tomorrow]] +[putfirst:-2[]]">>
|
11
editions/tw5.com/tiddlers/filters/examples/putlast.tid
Normal file
11
editions/tw5.com/tiddlers/filters/examples/putlast.tid
Normal file
@ -0,0 +1,11 @@
|
||||
created: 20151017153037776
|
||||
modified: 20151108052020761
|
||||
tags: [[Operator Examples]] [[putlast Operator]]
|
||||
title: putlast Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]] +[putlast[]]">>
|
||||
<<.operator-example 2 "[list[Days of the Week]] +[putlast:2[]]">>
|
||||
<<.operator-example 3 "one two three [list[Days of the Week]] +[putlast:-3[]]">>
|
11
editions/tw5.com/tiddlers/filters/examples/remove.tid
Normal file
11
editions/tw5.com/tiddlers/filters/examples/remove.tid
Normal file
@ -0,0 +1,11 @@
|
||||
created: 20151018054129966
|
||||
modified: 20151108052052606
|
||||
tags: [[Operator Examples]] [[remove Operator]]
|
||||
title: remove Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]] +[remove[Tuesday Wednesday Thursday]]">>
|
||||
<<.operator-example 2 "[list[Days of the Week]] +[remove:3[Monday Wednesday Friday Saturday]]">>
|
||||
<<.operator-example 3 "[list[Days of the Week]] +[!remove:2{Days of the Week!!list}]">>
|
11
editions/tw5.com/tiddlers/filters/examples/replace.tid
Normal file
11
editions/tw5.com/tiddlers/filters/examples/replace.tid
Normal file
@ -0,0 +1,11 @@
|
||||
created: 20151017153634099
|
||||
modified: 20151108052127454
|
||||
tags: [[Operator Examples]] [[replace Operator]]
|
||||
title: replace Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "[list[Days of the Week]] Last +[replace[Wednesday]]">>
|
||||
<<.operator-example 2 "[list[Days of the Week]] Last +[replace:2[Tuesday]]">>
|
||||
<<.operator-example 3 "[list[Days of the Week]] [[Yesterday]] [[Today]] [[Tomorrow]] +[replace:3[Tuesday]]">>
|
11
editions/tw5.com/tiddlers/filters/examples/sortby.tid
Normal file
11
editions/tw5.com/tiddlers/filters/examples/sortby.tid
Normal file
@ -0,0 +1,11 @@
|
||||
created: 20151018123433917
|
||||
modified: 20151108052158811
|
||||
tags: [[Operator Examples]] [[sortby Operator]]
|
||||
title: sortby Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.using-days-of-week>>
|
||||
|
||||
<<.operator-example 1 "10 6 4 9 3 2 8 +[sortby[1 2 3 4 5 6 7 8 9 10]]">>
|
||||
<<.operator-example 2 "Friday Tuesday Monday Thursday Sunday +[sortby{Days of the Week!!list}]">>
|
||||
<<.operator-example 3 "1 Mon 5 Fri 4 Tue Sun 2 +[sortby{Days of the Week!!short}]">>
|
14
editions/tw5.com/tiddlers/filters/move.tid
Normal file
14
editions/tw5.com/tiddlers/filters/move.tid
Normal file
@ -0,0 +1,14 @@
|
||||
caption: move
|
||||
created: 20151022123413501
|
||||
modified: 20151108082424017
|
||||
op-input: a list of items
|
||||
op-output: re-ordered list of items
|
||||
op-parameter: the list item to be used as a marker
|
||||
op-parameter-name: marker
|
||||
op-purpose: move marker N places in the list
|
||||
op-suffix: an integer N, defaulting to 1
|
||||
tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]]
|
||||
title: move Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-examples "move">>
|
15
editions/tw5.com/tiddlers/filters/prepend.tid
Normal file
15
editions/tw5.com/tiddlers/filters/prepend.tid
Normal file
@ -0,0 +1,15 @@
|
||||
caption: prepend
|
||||
created: 20151017145439292
|
||||
modified: 20151108051701587
|
||||
op-input: a list of items
|
||||
op-neg-output: a list with items prepended from the tail of the operand array
|
||||
op-output: a list with items prepended from the head of the operand array
|
||||
op-parameter: the array of items to be prepended to the head of the list
|
||||
op-parameter-name: list
|
||||
op-purpose: prepend a range of items from an array to the list
|
||||
op-suffix: an integer N, defaulting to all
|
||||
tags: [[Filter Operators]] [[Order Operators]] [[Listops Operators]]
|
||||
title: prepend Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-examples "prepend">>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user