Compare commits
98 Commits
b6dfa83f01
...
dc4dcd92ec
Author | SHA1 | Date |
---|---|---|
EHJ-52n | dc4dcd92ec | |
Matt Lauber | a081e58273 | |
Joshua Fontany | 5f74f4c2fa | |
Joshua Fontany | 9167b190d2 | |
Cameron Fischer | df8731f760 | |
Rob Hoelz | e9aa3c6c93 | |
Jeremy Ruston | 105e8195d5 | |
Simon Huber | eeb4e7a7f7 | |
Simon Huber | 7ce85a2ddb | |
Crystal Person | 804f227815 | |
Rob Hoelz | 9939759690 | |
Mario Pietsch | b595651fe1 | |
Mario Pietsch | 9cd6affcae | |
Mario Pietsch | e43cd2d989 | |
Mario Pietsch | f1e707bff4 | |
Mario Pietsch | 2d92a6fd78 | |
Mario Pietsch | 2e0e541ebf | |
Mario Pietsch | b4d7e34a5a | |
Mario Pietsch | b6eab1afd6 | |
Télumire | 32cbd53423 | |
Jeremy Ruston | 90a6f31db2 | |
Jeremy Ruston | d37d6595b5 | |
Jeremy Ruston | e02cafb938 | |
Jeremy Ruston | 801ed0ea11 | |
Mario Pietsch | 31ec1bdd50 | |
Jeremy Ruston | 62a5fc075b | |
Mario Pietsch | 0b6db6e860 | |
poc2go | 09f04cb5a6 | |
Mario Pietsch | 511d480a60 | |
Mario Pietsch | 3342cfc886 | |
Mario Pietsch | ec0b264426 | |
Mario Pietsch | 8f741e8e67 | |
Mario Pietsch | 32bf9fd7a1 | |
Jeremy Ruston | 3657e59a08 | |
Mateusz Wilczek | 21a5841aab | |
Mateusz Wilczek | edfd27fa45 | |
Jeremy Ruston | 0e7d566df7 | |
Mario Pietsch | 8481b7d137 | |
Mario Pietsch | 0fbfdce4b6 | |
Jeremy Ruston | 9079186b18 | |
Jeremy Ruston | e67eaca030 | |
Jeremy Ruston | 1222bed0de | |
Mario Pietsch | 78a09fcf56 | |
Mario Pietsch | 0f395ce81d | |
Mario Pietsch | b28f420430 | |
Mario Pietsch | 0b7914785c | |
Jeremy Ruston | 967e2b7fef | |
Mario Pietsch | 8d36ecd6bc | |
Mario Pietsch | c2b436371b | |
Mario Pietsch | 24e474bd72 | |
Mario Pietsch | a75d4ca003 | |
Mario Pietsch | 0fb10da8b3 | |
Mario Pietsch | 0202d7b463 | |
Mario Pietsch | b22570a91f | |
oeyoews | 00bd6f8ee8 | |
Jeremy Ruston | 43a2399698 | |
Télumire | 35d1609a2b | |
Jeremy Ruston | a90b1dbb49 | |
Jeremy Ruston | 72c4b92a4c | |
Simon Huber | bf9eafbad9 | |
Mario Pietsch | 28791287b2 | |
Mario Pietsch | 9082f36008 | |
Jeremy Ruston | e64aa6c8f9 | |
lin onetwo | 6f9cabd352 | |
Jeremy Ruston | 69e828fc30 | |
Jeremy Ruston | 7d25b13970 | |
lin onetwo | bede60d362 | |
TonyM | f02fafe365 | |
Mario Pietsch | 4fba206606 | |
Jeremy Ruston | 070327cb57 | |
Jeremy Ruston | 755a09be10 | |
Bram Chen | 9d874befa4 | |
Jeremy Ruston | f1effdd2cd | |
Jeremy Ruston | 5b2d35e8d1 | |
Jeremy Ruston | a75fd2a64a | |
catter-fly | 4ae6f1ffd4 | |
Mario Pietsch | ace6dbc514 | |
etardiff | 4cca77b72d | |
Jeremy Ruston | 3543fe53ff | |
Mario Pietsch | 70178dce78 | |
Mario Pietsch | 9e6e50eccf | |
Jeremy Ruston | 898cac7f71 | |
lin onetwo | 32de6eca22 | |
Jeremy Ruston | 09e6117fe2 | |
Robin Munn | 984863065e | |
Jeremy Ruston | c947ba4310 | |
Jeremy Ruston | b33cfeab06 | |
Jeremy Ruston | 540b3ff81e | |
Jeremy Ruston | c9675092ed | |
Mateusz Wilczek | d29df793a4 | |
Mateusz Wilczek | e57123936f | |
Jeremy Ruston | 6d721c728f | |
Jeremy Ruston | ae9250622f | |
Jeremy Ruston | 4dd9db3b46 | |
lin onetwo | 36fc8170a4 | |
Bram Chen | 96e11fa8b0 | |
Bimba Laszlo | 6236e7777c | |
EHJ-52n | eb1396c5fa |
|
@ -8,3 +8,4 @@ node_modules/
|
|||
/test-results/
|
||||
/playwright-report/
|
||||
/playwright/.cache/
|
||||
$__StoryList.tid
|
||||
|
|
31
boot/boot.js
31
boot/boot.js
|
@ -177,6 +177,7 @@ document: defaults to current document
|
|||
eventListeners: array of event listeners (this option won't work until $tw.utils.addEventListeners() has been loaded)
|
||||
*/
|
||||
$tw.utils.domMaker = function(tag,options) {
|
||||
var options = options || {};
|
||||
var doc = options.document || document;
|
||||
var element = doc.createElementNS(options.namespace || "http://www.w3.org/1999/xhtml",tag);
|
||||
if(options["class"]) {
|
||||
|
@ -218,9 +219,34 @@ $tw.utils.error = function(err) {
|
|||
heading = dm("h1",{text: errHeading}),
|
||||
prompt = dm("div",{text: promptMsg, "class": "tc-error-prompt"}),
|
||||
message = dm("div",{text: err, "class":"tc-error-message"}),
|
||||
button = dm("div",{children: [dm("button",{text: ( $tw.language == undefined ? "close" : $tw.language.getString("Buttons/Close/Caption") )})], "class": "tc-error-prompt"}),
|
||||
form = dm("form",{children: [heading,prompt,message,button], "class": "tc-error-form"});
|
||||
closeButton = dm("div",{children: [dm("button",{text: ( $tw.language == undefined ? "close" : $tw.language.getString("Buttons/Close/Caption") )})], "class": "tc-error-prompt"}),
|
||||
downloadButton = dm("div",{children: [dm("button",{text: ( $tw.language == undefined ? "download tiddlers" : $tw.language.getString("Buttons/EmergencyDownload/Caption") )})], "class": "tc-error-prompt"}),
|
||||
form = dm("form",{children: [heading,prompt,downloadButton,message,closeButton], "class": "tc-error-form"});
|
||||
document.body.insertBefore(form,document.body.firstChild);
|
||||
downloadButton.addEventListener("click",function(event) {
|
||||
if($tw && $tw.wiki) {
|
||||
var tiddlers = [];
|
||||
$tw.wiki.each(function(tiddler,title) {
|
||||
tiddlers.push(tiddler.fields);
|
||||
});
|
||||
var link = dm("a"),
|
||||
text = JSON.stringify(tiddlers);
|
||||
if(Blob !== undefined) {
|
||||
var blob = new Blob([text], {type: "text/html"});
|
||||
link.setAttribute("href", URL.createObjectURL(blob));
|
||||
} else {
|
||||
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
|
||||
}
|
||||
link.setAttribute("download","emergency-tiddlers-" + (new Date()) + ".json");
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
} else {
|
||||
alert("Emergency tiddler download is not available");
|
||||
}
|
||||
event.preventDefault();
|
||||
return false;
|
||||
},true);
|
||||
form.addEventListener("submit",function(event) {
|
||||
document.body.removeChild(form);
|
||||
event.preventDefault();
|
||||
|
@ -786,6 +812,7 @@ $tw.utils.Crypto = function() {
|
|||
}
|
||||
return outputText;
|
||||
};
|
||||
$tw.sjcl = sjcl;
|
||||
this.setPassword = function(newPassword) {
|
||||
currentPassword = newPassword;
|
||||
this.updateCryptoStateTiddler();
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
title: $:/core/images/default-layout
|
||||
tags: $:/tags/Image
|
||||
|
||||
\parameters (size:"22pt")
|
||||
<svg width=<<size>> height=<<size>> class="tc-image-default-layout tc-image-button" viewBox="0 0 128 128">
|
||||
<path d="M71.93 72A8.07 8.07 0 0 1 80 80.07v7.86A8.071 8.071 0 0 1 71.93 96H8.07A8.067 8.067 0 0 1 0 87.93v-7.86A8.072 8.072 0 0 1 8.07 72h63.86Zm0 32a8.07 8.07 0 0 1 8.07 8.07v7.86a8.071 8.071 0 0 1-8.07 8.07H8.07A8.067 8.067 0 0 1 0 119.93v-7.86A8.072 8.072 0 0 1 8.07 104h63.86Zm0-104A8.068 8.068 0 0 1 80 8.07v47.86A8.073 8.073 0 0 1 71.93 64H8.07A8.07 8.07 0 0 1 0 55.93V8.07A8.072 8.072 0 0 1 8.07 0h63.86Zm48 0c2.14 0 4.193.85 5.706 2.364A8.067 8.067 0 0 1 128 8.07v111.86c0 2.14-.85 4.193-2.364 5.706A8.067 8.067 0 0 1 119.93 128H96.07c-2.14 0-4.193-.85-5.706-2.364A8.067 8.067 0 0 1 88 119.93V8.07c0-2.14.85-4.193 2.364-5.706A8.067 8.067 0 0 1 96.07 0h23.86ZM116 24h-16a3.995 3.995 0 0 0-2.828 1.172 3.995 3.995 0 0 0 0 5.656A3.995 3.995 0 0 0 100 32h16a3.995 3.995 0 0 0 2.828-1.172 3.995 3.995 0 0 0 0-5.656A3.995 3.995 0 0 0 116 24Z"/>
|
||||
</svg>
|
|
@ -28,6 +28,7 @@ Encryption/ClearPassword/Caption: clear password
|
|||
Encryption/ClearPassword/Hint: Clear the password and save this wiki without encryption
|
||||
Encryption/SetPassword/Caption: set password
|
||||
Encryption/SetPassword/Hint: Set a password for saving this wiki with encryption
|
||||
EmergencyDownload/Caption: download tiddlers as json
|
||||
ExportPage/Caption: export all
|
||||
ExportPage/Hint: Export all tiddlers
|
||||
ExportTiddler/Caption: export tiddler
|
||||
|
|
|
@ -18,7 +18,7 @@ exports.info = {
|
|||
name: "listen",
|
||||
synchronous: true,
|
||||
namedParameterMode: true,
|
||||
mandatoryParameters: [],
|
||||
mandatoryParameters: []
|
||||
};
|
||||
|
||||
var Command = function(params,commander,callback) {
|
||||
|
|
|
@ -43,7 +43,9 @@ Saves individual tiddlers in their raw text or binary format to the specified fi
|
|||
directory: path.resolve(self.commander.outputPath),
|
||||
pathFilters: [filenameFilter],
|
||||
wiki: wiki,
|
||||
fileInfo: {}
|
||||
fileInfo: {
|
||||
overwrite: true
|
||||
}
|
||||
});
|
||||
if(self.commander.verbose) {
|
||||
console.log("Saving \"" + title + "\" to \"" + fileInfo.filepath + "\"");
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
/*\
|
||||
title: $:/core/modules/filters/backtranscludes.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator for returning all the backtranscludes from a tiddler
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.backtranscludes = function(source,operator,options) {
|
||||
var results = [];
|
||||
source(function(tiddler,title) {
|
||||
$tw.utils.pushTop(results,options.wiki.getTiddlerBacktranscludes(title));
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
|
@ -14,12 +14,9 @@ Filter operators for cryptography, using the Stanford JavaScript library
|
|||
|
||||
exports.sha256 = function(source,operator,options) {
|
||||
var results = [],
|
||||
length = parseInt(operator.operand,10) || 20,
|
||||
sha256 = function(text) {
|
||||
return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(text)).substr(0,length);
|
||||
};
|
||||
length = parseInt(operator.operand,10) || 20;
|
||||
source(function(tiddler,title) {
|
||||
results.push(sha256(title));
|
||||
results.push($tw.utils.sha256(title,{length: length}));
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
/*\
|
||||
title: $:/core/modules/filters/transcludes.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator for returning all the transcludes from a tiddler
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.transcludes = function(source,operator,options) {
|
||||
var results = new $tw.utils.LinkedList();
|
||||
source(function(tiddler,title) {
|
||||
results.pushTop(options.wiki.getTiddlerTranscludes(title));
|
||||
});
|
||||
return results.toArray();
|
||||
};
|
||||
|
||||
})();
|
|
@ -202,7 +202,7 @@ Extended filter operators to manipulate the current list.
|
|||
}
|
||||
if(resultsIndex !== -1) {
|
||||
i = i + step;
|
||||
nextOperandIndex = (i < opLength ? i : i - opLength);
|
||||
nextOperandIndex = (i < opLength ? i : i % opLength);
|
||||
if(operands.length > 1) {
|
||||
results.splice(resultsIndex,1,operands[nextOperandIndex]);
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,119 @@
|
|||
/*\
|
||||
title: $:/core/modules/indexers/back-indexer.js
|
||||
type: application/javascript
|
||||
module-type: indexer
|
||||
|
||||
By parsing the tiddler text, indexes the tiddlers' back links, back transclusions, block level back links.
|
||||
|
||||
\*/
|
||||
function BackIndexer(wiki) {
|
||||
this.wiki = wiki;
|
||||
}
|
||||
|
||||
BackIndexer.prototype.init = function() {
|
||||
this.subIndexers = {
|
||||
link: new BackSubIndexer(this,"extractLinks"),
|
||||
transclude: new BackSubIndexer(this,"extractTranscludes"),
|
||||
};
|
||||
};
|
||||
|
||||
BackIndexer.prototype.rebuild = function() {
|
||||
$tw.utils.each(this.subIndexers,function(subIndexer) {
|
||||
subIndexer.rebuild();
|
||||
});
|
||||
};
|
||||
|
||||
BackIndexer.prototype.update = function(updateDescriptor) {
|
||||
$tw.utils.each(this.subIndexers,function(subIndexer) {
|
||||
subIndexer.update(updateDescriptor);
|
||||
});
|
||||
};
|
||||
function BackSubIndexer(indexer,extractor) {
|
||||
this.wiki = indexer.wiki;
|
||||
this.indexer = indexer;
|
||||
this.extractor = extractor;
|
||||
/**
|
||||
* {
|
||||
* [target title, e.g. tiddler title being linked to]:
|
||||
* {
|
||||
* [source title, e.g. tiddler title that has link syntax in its text]: true
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
this.index = null;
|
||||
}
|
||||
|
||||
BackSubIndexer.prototype.init = function() {
|
||||
// lazy init until first lookup
|
||||
this.index = null;
|
||||
}
|
||||
|
||||
BackSubIndexer.prototype._init = function() {
|
||||
this.index = Object.create(null);
|
||||
var self = this;
|
||||
this.wiki.forEachTiddler(function(sourceTitle,tiddler) {
|
||||
var newTargets = self._getTarget(tiddler);
|
||||
$tw.utils.each(newTargets, function(target) {
|
||||
if(!self.index[target]) {
|
||||
self.index[target] = Object.create(null);
|
||||
}
|
||||
self.index[target][sourceTitle] = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
BackSubIndexer.prototype.rebuild = function() {
|
||||
this.index = null;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get things that is being referenced in the text, e.g. tiddler names in the link syntax.
|
||||
*/
|
||||
BackSubIndexer.prototype._getTarget = function(tiddler) {
|
||||
var parser = this.wiki.parseText(tiddler.fields.type, tiddler.fields.text, {});
|
||||
if(parser) {
|
||||
return this.wiki[this.extractor](parser.tree);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
BackSubIndexer.prototype.update = function(updateDescriptor) {
|
||||
// lazy init/update until first lookup
|
||||
if(!this.index) {
|
||||
return;
|
||||
}
|
||||
var newTargets = [],
|
||||
oldTargets = [],
|
||||
self = this;
|
||||
if(updateDescriptor.old.exists) {
|
||||
oldTargets = this._getTarget(updateDescriptor.old.tiddler);
|
||||
}
|
||||
if(updateDescriptor.new.exists) {
|
||||
newTargets = this._getTarget(updateDescriptor.new.tiddler);
|
||||
}
|
||||
|
||||
$tw.utils.each(oldTargets,function(target) {
|
||||
if(self.index[target]) {
|
||||
delete self.index[target][updateDescriptor.old.tiddler.fields.title];
|
||||
}
|
||||
});
|
||||
$tw.utils.each(newTargets,function(target) {
|
||||
if(!self.index[target]) {
|
||||
self.index[target] = Object.create(null);
|
||||
}
|
||||
self.index[target][updateDescriptor.new.tiddler.fields.title] = true;
|
||||
});
|
||||
}
|
||||
|
||||
BackSubIndexer.prototype.lookup = function(title) {
|
||||
if(!this.index) {
|
||||
this._init();
|
||||
}
|
||||
if(this.index[title]) {
|
||||
return Object.keys(this.index[title]);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
exports.BackIndexer = BackIndexer;
|
|
@ -1,86 +0,0 @@
|
|||
/*\
|
||||
title: $:/core/modules/indexers/backlinks-indexer.js
|
||||
type: application/javascript
|
||||
module-type: indexer
|
||||
|
||||
Indexes the tiddlers' backlinks
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global modules: false */
|
||||
"use strict";
|
||||
|
||||
|
||||
function BacklinksIndexer(wiki) {
|
||||
this.wiki = wiki;
|
||||
}
|
||||
|
||||
BacklinksIndexer.prototype.init = function() {
|
||||
this.index = null;
|
||||
}
|
||||
|
||||
BacklinksIndexer.prototype.rebuild = function() {
|
||||
this.index = null;
|
||||
}
|
||||
|
||||
BacklinksIndexer.prototype._getLinks = function(tiddler) {
|
||||
var parser = this.wiki.parseText(tiddler.fields.type, tiddler.fields.text, {});
|
||||
if(parser) {
|
||||
return this.wiki.extractLinks(parser.tree);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
BacklinksIndexer.prototype.update = function(updateDescriptor) {
|
||||
if(!this.index) {
|
||||
return;
|
||||
}
|
||||
var newLinks = [],
|
||||
oldLinks = [],
|
||||
self = this;
|
||||
if(updateDescriptor.old.exists) {
|
||||
oldLinks = this._getLinks(updateDescriptor.old.tiddler);
|
||||
}
|
||||
if(updateDescriptor.new.exists) {
|
||||
newLinks = this._getLinks(updateDescriptor.new.tiddler);
|
||||
}
|
||||
|
||||
$tw.utils.each(oldLinks,function(link) {
|
||||
if(self.index[link]) {
|
||||
delete self.index[link][updateDescriptor.old.tiddler.fields.title];
|
||||
}
|
||||
});
|
||||
$tw.utils.each(newLinks,function(link) {
|
||||
if(!self.index[link]) {
|
||||
self.index[link] = Object.create(null);
|
||||
}
|
||||
self.index[link][updateDescriptor.new.tiddler.fields.title] = true;
|
||||
});
|
||||
}
|
||||
|
||||
BacklinksIndexer.prototype.lookup = function(title) {
|
||||
if(!this.index) {
|
||||
this.index = Object.create(null);
|
||||
var self = this;
|
||||
this.wiki.forEachTiddler(function(title,tiddler) {
|
||||
var links = self._getLinks(tiddler);
|
||||
$tw.utils.each(links, function(link) {
|
||||
if(!self.index[link]) {
|
||||
self.index[link] = Object.create(null);
|
||||
}
|
||||
self.index[link][title] = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
if(this.index[title]) {
|
||||
return Object.keys(this.index[title]);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
exports.BacklinksIndexer = BacklinksIndexer;
|
||||
|
||||
})();
|
|
@ -35,9 +35,11 @@ exports.run = function(filter,format) {
|
|||
// Collect all the fields
|
||||
for(t=0;t<tiddlers.length; t++) {
|
||||
tiddler = this.wiki.getTiddler(tiddlers[t]);
|
||||
for(f in tiddler.fields) {
|
||||
if(fields.indexOf(f) === -1) {
|
||||
fields.push(f);
|
||||
if(tiddler) {
|
||||
for(f in tiddler.fields) {
|
||||
if(fields.indexOf(f) === -1) {
|
||||
fields.push(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,8 +62,10 @@ exports.run = function(filter,format) {
|
|||
for(var t=0;t<tiddlers.length; t++) {
|
||||
row = [];
|
||||
tiddler = this.wiki.getTiddler(tiddlers[t]);
|
||||
for(f=0; f<fields.length; f++) {
|
||||
row.push(quoteAndEscape(tiddler ? tiddler.getFieldString(fields[f]) || "" : ""));
|
||||
if(tiddler) {
|
||||
for(f=0; f<fields.length; f++) {
|
||||
row.push(quoteAndEscape(tiddler ? tiddler.getFieldString(fields[f]) || "" : ""));
|
||||
}
|
||||
}
|
||||
output.push(row.join(","));
|
||||
}
|
||||
|
|
|
@ -140,6 +140,11 @@ function sendResponse(request,response,statusCode,headers,data,encoding) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// RFC 7231, 6.1. Overview of Status Codes:
|
||||
// Browser clients may cache 200, 203, 204, 206, 300, 301,
|
||||
// 404, 405, 410, 414, and 501 unless given explicit cache controls
|
||||
headers["Cache-Control"] = headers["Cache-Control"] || "no-store";
|
||||
}
|
||||
/*
|
||||
If the gzip=yes is set, check if the user agent permits compression. If so,
|
||||
|
|
|
@ -81,6 +81,8 @@ exports.startup = function() {
|
|||
deferredChanges = Object.create(null);
|
||||
$tw.hooks.invokeHook("th-page-refreshed");
|
||||
}
|
||||
var throttledRefresh = $tw.perf.report("throttledRefresh",refresh);
|
||||
|
||||
// Add the change event handler
|
||||
$tw.wiki.addEventListener("change",$tw.perf.report("mainRefresh",function(changes) {
|
||||
// Check if only tiddlers that are throttled have changed
|
||||
|
@ -101,7 +103,7 @@ exports.startup = function() {
|
|||
if(isNaN(timeout)) {
|
||||
timeout = THROTTLE_REFRESH_TIMEOUT;
|
||||
}
|
||||
timerId = setTimeout(refresh,timeout);
|
||||
timerId = setTimeout(throttledRefresh,timeout);
|
||||
$tw.utils.extend(deferredChanges,changes);
|
||||
} else {
|
||||
$tw.utils.extend(deferredChanges,changes);
|
||||
|
|
|
@ -56,7 +56,7 @@ exports.startup = function() {
|
|||
return;
|
||||
}
|
||||
// Initialise the document
|
||||
srcDocument.write("<html><head></head><body class='tc-body tc-single-tiddler-window'></body></html>");
|
||||
srcDocument.write("<!DOCTYPE html><head></head><body class='tc-body tc-single-tiddler-window'></body></html>");
|
||||
srcDocument.close();
|
||||
srcDocument.title = windowTitle;
|
||||
srcWindow.addEventListener("beforeunload",function(event) {
|
||||
|
|
|
@ -283,7 +283,7 @@ exports.httpRequest = function(options) {
|
|||
// Set up the state change handler
|
||||
request.onreadystatechange = function() {
|
||||
if(this.readyState === 4) {
|
||||
if(this.status === 200 || this.status === 201 || this.status === 204) {
|
||||
if(this.status >= 200 && this.status < 300) {
|
||||
// Success!
|
||||
options.callback(null,this[returnProp],this);
|
||||
return;
|
||||
|
|
|
@ -316,11 +316,13 @@ Options include:
|
|||
pathFilters: optional array of filters to be used to generate the base path
|
||||
wiki: optional wiki for evaluating the pathFilters
|
||||
fileInfo: an existing fileInfo object to check against
|
||||
fileInfo.overwrite: if true, turns off filename clash numbers (defaults to false)
|
||||
*/
|
||||
exports.generateTiddlerFilepath = function(title,options) {
|
||||
var directory = options.directory || "",
|
||||
extension = options.extension || "",
|
||||
originalpath = (options.fileInfo && options.fileInfo.originalpath) ? options.fileInfo.originalpath : "",
|
||||
overwrite = options.fileInfo && options.fileInfo.overwrite || false,
|
||||
filepath;
|
||||
// Check if any of the pathFilters applies
|
||||
if(options.pathFilters && options.wiki) {
|
||||
|
@ -381,19 +383,20 @@ exports.generateTiddlerFilepath = function(title,options) {
|
|||
filepath += char.charCodeAt(0).toString();
|
||||
});
|
||||
}
|
||||
// Add a uniquifier if the file already exists
|
||||
var fullPath, oldPath = (options.fileInfo) ? options.fileInfo.filepath : undefined,
|
||||
// Add a uniquifier if the file already exists (default)
|
||||
var fullPath = path.resolve(directory, filepath + extension);
|
||||
if (!overwrite) {
|
||||
var oldPath = (options.fileInfo) ? options.fileInfo.filepath : undefined,
|
||||
count = 0;
|
||||
do {
|
||||
fullPath = path.resolve(directory,filepath + (count ? "_" + count : "") + extension);
|
||||
if(oldPath && oldPath == fullPath) {
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
} while(fs.existsSync(fullPath));
|
||||
do {
|
||||
fullPath = path.resolve(directory,filepath + (count ? "_" + count : "") + extension);
|
||||
if(oldPath && oldPath == fullPath) break;
|
||||
count++;
|
||||
} while(fs.existsSync(fullPath));
|
||||
}
|
||||
// If the last write failed with an error, or if path does not start with:
|
||||
// the resolved options.directory, the resolved wikiPath directory, the wikiTiddlersPath directory,
|
||||
// or the 'originalpath' directory, then $tw.utils.encodeURIComponentExtended() and resolve to tiddler directory.
|
||||
// or the 'originalpath' directory, then $tw.utils.encodeURIComponentExtended() and resolve to options.directory.
|
||||
var writePath = $tw.hooks.invokeHook("th-make-tiddler-path",fullPath,fullPath),
|
||||
encode = (options.fileInfo || {writeError: false}).writeError == true;
|
||||
if(!encode) {
|
||||
|
|
|
@ -819,6 +819,15 @@ exports.hashString = function(str) {
|
|||
},0);
|
||||
};
|
||||
|
||||
/*
|
||||
Cryptographic hash function as used by sha256 filter operator
|
||||
options.length .. number of characters returned defaults to 64
|
||||
*/
|
||||
exports.sha256 = function(str, options) {
|
||||
options = options || {}
|
||||
return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(str)).substr(0,options.length || 64);
|
||||
}
|
||||
|
||||
/*
|
||||
Base64 utility functions that work in either browser or Node.js
|
||||
*/
|
||||
|
@ -922,7 +931,7 @@ IE does not have sign function
|
|||
*/
|
||||
exports.sign = Math.sign || function(x) {
|
||||
x = +x; // convert to a number
|
||||
if (x === 0 || isNaN(x)) {
|
||||
if(x === 0 || isNaN(x)) {
|
||||
return x;
|
||||
}
|
||||
return x > 0 ? 1 : -1;
|
||||
|
@ -935,7 +944,7 @@ exports.strEndsWith = function(str,ending,position) {
|
|||
if(str.endsWith) {
|
||||
return str.endsWith(ending,position);
|
||||
} else {
|
||||
if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > str.length) {
|
||||
if(typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > str.length) {
|
||||
position = str.length;
|
||||
}
|
||||
position -= ending.length;
|
||||
|
|
|
@ -37,6 +37,7 @@ Compute the internal state of the widget
|
|||
DeleteFieldWidget.prototype.execute = function() {
|
||||
this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
|
||||
this.actionField = this.getAttribute("$field",null);
|
||||
this.actionTimestamp = this.getAttribute("$timestamp","yes") === "yes";
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -69,11 +70,15 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
|||
$tw.utils.each(this.attributes,function(attribute,name) {
|
||||
if(name.charAt(0) !== "$" && name !== "title") {
|
||||
removeFields[name] = undefined;
|
||||
hasChanged = true;
|
||||
if(name in tiddler.fields) {
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(hasChanged) {
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,removeFields,this.wiki.getModificationFields()));
|
||||
var creationFields = this.actionTimestamp ? this.wiki.getCreationFields() : {};
|
||||
var modificationFields = this.actionTimestamp ? this.wiki.getModificationFields() : {};
|
||||
this.wiki.addTiddler(new $tw.Tiddler(creationFields,tiddler,removeFields,modificationFields));
|
||||
}
|
||||
}
|
||||
return true; // Action was invoked
|
||||
|
|
|
@ -119,7 +119,7 @@ DraggableWidget.prototype.refresh = function(changedTiddlers) {
|
|||
return true;
|
||||
} else {
|
||||
if(changedAttributes["class"]) {
|
||||
this.assignDomNodeClasses();
|
||||
this.updateDomNodeClasses();
|
||||
}
|
||||
this.assignAttributes(this.domNodes[0],{
|
||||
changedAttributes: changedAttributes,
|
||||
|
@ -132,4 +132,4 @@ DraggableWidget.prototype.refresh = function(changedTiddlers) {
|
|||
|
||||
exports.draggable = DraggableWidget;
|
||||
|
||||
})();
|
||||
})();
|
||||
|
|
|
@ -49,7 +49,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
|
|||
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
|
||||
// Accumulate the <$set> widgets from each tiddler
|
||||
$tw.utils.each(this.tiddlerList,function(title) {
|
||||
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:true});
|
||||
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:false});
|
||||
if(parser) {
|
||||
var parseTreeNode = parser.tree[0];
|
||||
while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) {
|
||||
|
|
|
@ -534,8 +534,8 @@ Return an array of tiddler titles that link to the specified tiddler
|
|||
*/
|
||||
exports.getTiddlerBacklinks = function(targetTitle) {
|
||||
var self = this,
|
||||
backlinksIndexer = this.getIndexer("BacklinksIndexer"),
|
||||
backlinks = backlinksIndexer && backlinksIndexer.lookup(targetTitle);
|
||||
backIndexer = this.getIndexer("BackIndexer"),
|
||||
backlinks = backIndexer && backIndexer.subIndexers.link.lookup(targetTitle);
|
||||
|
||||
if(!backlinks) {
|
||||
backlinks = [];
|
||||
|
@ -549,6 +549,68 @@ exports.getTiddlerBacklinks = function(targetTitle) {
|
|||
return backlinks;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Return an array of tiddler titles that are directly transcluded within the given parse tree
|
||||
*/
|
||||
exports.extractTranscludes = function(parseTreeRoot) {
|
||||
// Count up the transcludes
|
||||
var transcludes = [],
|
||||
checkParseTree = function(parseTree, parentNode) {
|
||||
for(var t=0; t<parseTree.length; t++) {
|
||||
var parseTreeNode = parseTree[t];
|
||||
if(parseTreeNode.type === "transclude" && parseTreeNode.attributes.$tiddler && parseTreeNode.attributes.$tiddler.type === "string") {
|
||||
var value;
|
||||
// if it is Transclusion with Templates like `{{Index||$:/core/ui/TagTemplate}}`, the `$tiddler` will point to the template. We need to find the actual target tiddler from parent node
|
||||
if(parentNode && parentNode.type === "tiddler" && parentNode.attributes.tiddler && parentNode.attributes.tiddler.type === "string") {
|
||||
value = parentNode.attributes.tiddler.value;
|
||||
} else {
|
||||
value = parseTreeNode.attributes.$tiddler.value;
|
||||
}
|
||||
if(transcludes.indexOf(value) === -1) {
|
||||
transcludes.push(value);
|
||||
}
|
||||
}
|
||||
if(parseTreeNode.children) {
|
||||
checkParseTree(parseTreeNode.children, parseTreeNode);
|
||||
}
|
||||
}
|
||||
};
|
||||
checkParseTree(parseTreeRoot);
|
||||
return transcludes;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Return an array of tiddler titles that are transcluded from the specified tiddler
|
||||
*/
|
||||
exports.getTiddlerTranscludes = function(title) {
|
||||
var self = this;
|
||||
// We'll cache the transcludes so they only get computed if the tiddler changes
|
||||
return this.getCacheForTiddler(title,"transcludes",function() {
|
||||
// Parse the tiddler
|
||||
var parser = self.parseTiddler(title);
|
||||
if(parser) {
|
||||
return self.extractTranscludes(parser.tree);
|
||||
}
|
||||
return [];
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
Return an array of tiddler titles that transclude to the specified tiddler
|
||||
*/
|
||||
exports.getTiddlerBacktranscludes = function(targetTitle) {
|
||||
var self = this,
|
||||
backIndexer = this.getIndexer("BackIndexer"),
|
||||
backtranscludes = backIndexer && backIndexer.subIndexers.transclude.lookup(targetTitle);
|
||||
|
||||
if(!backtranscludes) {
|
||||
backtranscludes = [];
|
||||
}
|
||||
return backtranscludes;
|
||||
};
|
||||
|
||||
/*
|
||||
Return a hashmap of tiddler titles that are referenced but not defined. Each value is the number of times the missing tiddler is referenced
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@ title: $:/core/save/all-external-js
|
|||
\whitespace trim
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
\define saveTiddlerFilter()
|
||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
||||
\end
|
||||
|
||||
<!-- Important: core library is provided by serving URI encoded $:/core/templates/tiddlywiki5.js -->
|
||||
|
|
|
@ -3,7 +3,7 @@ title: $:/core/save/offline-external-js
|
|||
\whitespace trim
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
\define saveTiddlerFilter()
|
||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/plugins/tiddlywiki/filesystem]] -[[$:/plugins/tiddlywiki/tiddlyweb]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
||||
\end
|
||||
\define defaultCoreURL() tiddlywikicore-$(version)$.js
|
||||
<$let coreURL={{{ [[coreURL]is[variable]then<coreURL>else<defaultCoreURL>] }}}>
|
||||
|
|
|
@ -2,6 +2,6 @@ title: $:/core/save/all
|
|||
|
||||
\import [subfilter{$:/core/config/GlobalImportFilter}]
|
||||
\define saveTiddlerFilter()
|
||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
|
||||
\end
|
||||
{{$:/core/templates/tiddlywiki5.html}}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
title: $:/core/save/empty
|
||||
|
||||
\define saveTiddlerFilter()
|
||||
[is[system]] -[prefix[$:/state/popup/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
|
||||
[is[system]] -[prefix[$:/state/popup/]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
|
||||
\end
|
||||
{{$:/core/templates/tiddlywiki5.html}}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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]] [is[tiddler]type[application/javascript]] +[sort[title]]
|
||||
[is[system]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] [is[tiddler]type[application/javascript]] +[sort[title]]
|
||||
\end
|
||||
\define skinnySaveTiddlerFilter()
|
||||
[!is[system]] -[type[application/javascript]]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
title: $:/core/save/lazy-images
|
||||
|
||||
\define saveTiddlerFilter()
|
||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[!is[system]is[image]] +[sort[title]]
|
||||
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[is[system]type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[!is[system]is[image]] +[sort[title]]
|
||||
\end
|
||||
\define skinnySaveTiddlerFilter()
|
||||
[!is[system]is[image]]
|
||||
|
|
|
@ -40,10 +40,8 @@ caption: {{$:/language/Search/Filter/Caption}}
|
|||
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
|
||||
</$list></$list>
|
||||
\end
|
||||
|
||||
\whitespace trim
|
||||
<<lingo Filter/Hint>>
|
||||
|
||||
<div class="tc-search tc-advanced-search">
|
||||
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
|
||||
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
|
||||
|
@ -65,11 +63,10 @@ caption: {{$:/language/Search/Filter/Caption}}
|
|||
 
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"><$transclude/></$list>
|
||||
</div>
|
||||
|
||||
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
|
||||
<$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>">
|
||||
<div class="tc-search-results">
|
||||
<<lingo Filter/Matches>>
|
||||
<p><<lingo Filter/Matches>></p>
|
||||
<$list filter={{$:/temp/advancedsearch}}>
|
||||
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}>
|
||||
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
||||
|
|
|
@ -56,15 +56,16 @@ caption: {{$:/language/Search/Standard/Caption}}
|
|||
userInput={{{ [[$:/temp/advancedsearch]get[text]] }}}
|
||||
configTiddler={{{ [[$:/state/advancedsearch/standard/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}}
|
||||
searchListState="$:/temp/advancedsearch/selected-item">
|
||||
<$list
|
||||
filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]"
|
||||
emptyMessage="<$list filter='[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]'><$transclude/></$list>">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]">
|
||||
<$macrocall $name="tabs"
|
||||
tabsList="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"
|
||||
default={{$:/config/SearchResults/Default}}
|
||||
actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<currentTab>>/>"
|
||||
explicitState="$:/state/tab/search-results/advancedsearch" />
|
||||
</$list>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]] :else[[]]">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"><$transclude mode="block"/></$list>
|
||||
</$list>
|
||||
</$vars>
|
||||
</$list>
|
||||
</$reveal>
|
||||
|
|
|
@ -2,10 +2,19 @@ title: $:/core/ui/ControlPanel/Saving/DownloadSaver
|
|||
tags: $:/tags/ControlPanel/Saving
|
||||
caption: {{$:/language/ControlPanel/Saving/DownloadSaver/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Saving/DownloadSaver/
|
||||
|
||||
<div class="tc-control-panel-saving" data-setting-title=<<currentTab>>>
|
||||
|
||||
<<lingo Hint>>
|
||||
|
||||
!! <$link to="$:/config/DownloadSaver/AutoSave"><<lingo AutoSave/Hint>></$link>
|
||||
!!.tc-control-panel-accent <$link to="$:/config/DownloadSaver/AutoSave"><<lingo AutoSave/Hint>></$link>
|
||||
|
||||
<$checkbox tiddler="$:/config/DownloadSaver/AutoSave" field="text" checked="yes" unchecked="no" default="no"> <<lingo AutoSave/Description>> </$checkbox>
|
||||
<$checkbox tiddler="$:/config/DownloadSaver/AutoSave"
|
||||
field="text" checked="yes" unchecked="no" default="no"
|
||||
class="tc-control-panel-item"
|
||||
>
|
||||
<span class="tc-tiny-gap-left"><<lingo AutoSave/Description>></span>
|
||||
</$checkbox>
|
||||
</div>
|
|
@ -3,14 +3,22 @@ tags: $:/tags/ControlPanel/Saving
|
|||
caption: {{$:/language/ControlPanel/Saving/General/Caption}}
|
||||
list-before:
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/
|
||||
|
||||
<div class="tc-control-panel-saving" data-setting-title=<<currentTab>>>
|
||||
|
||||
{{$:/language/ControlPanel/Saving/General/Hint}}
|
||||
|
||||
!! <$link to="$:/config/AutoSave"><<lingo AutoSave/Caption>></$link>
|
||||
!!.tc-control-panel-accent <$link to="$:/config/AutoSave"><<lingo AutoSave/Caption>></$link>
|
||||
|
||||
<<lingo AutoSave/Hint>>
|
||||
|
||||
<$radio tiddler="$:/config/AutoSave" value="yes"> <<lingo AutoSave/Enabled/Description>> </$radio>
|
||||
<$radio tiddler="$:/config/AutoSave" value="yes">
|
||||
<span class="tc-tiny-gap-left"><<lingo AutoSave/Enabled/Description>></span>
|
||||
</$radio>
|
||||
|
||||
<$radio tiddler="$:/config/AutoSave" value="no"> <<lingo AutoSave/Disabled/Description>> </$radio>
|
||||
<$radio tiddler="$:/config/AutoSave" value="no">
|
||||
<span class="tc-tiny-gap-left"><<lingo AutoSave/Disabled/Description>></span>
|
||||
</$radio>
|
||||
</div>
|
|
@ -2,7 +2,16 @@ title: $:/core/ui/ControlPanel/Settings/CamelCase
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/CamelCase/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/CamelCase/
|
||||
|
||||
<<lingo Hint>>
|
||||
|
||||
<$checkbox tiddler="$:/config/WikiParserRules/Inline/wikilink" field="text" checked="enable" unchecked="disable" default="enable"> <$link to="$:/config/WikiParserRules/Inline/wikilink"><<lingo Description>></$link> </$checkbox>
|
||||
<$checkbox tiddler="$:/config/WikiParserRules/Inline/wikilink"
|
||||
field="text" checked="enable" unchecked="disable" default="enable"
|
||||
class="tc-control-panel-item"
|
||||
>
|
||||
<$link to="$:/config/WikiParserRules/Inline/wikilink" class="tc-tiny-gap-left">
|
||||
<<lingo Description>>
|
||||
</$link>
|
||||
</$checkbox>
|
||||
|
|
|
@ -2,13 +2,18 @@ caption: {{$:/language/ControlPanel/Settings/DefaultMoreSidebarTab/Caption}}
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
title: $:/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/DefaultMoreSidebarTab/
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/DefaultMoreSidebarTab/
|
||||
|
||||
<$link to="$:/config/DefaultMoreSidebarTab"><<lingo Hint>></$link>
|
||||
<$link to="$:/config/DefaultMoreSidebarTab" class="tc-control-panel-item">
|
||||
<<lingo Hint>>
|
||||
</$link>
|
||||
|
||||
<$select tiddler="$:/config/DefaultMoreSidebarTab">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/MoreSideBar]!has[draft.of]]">
|
||||
<option value=<<currentTiddler>>><$transclude field="caption"><$text text=<<currentTiddler>>/></$transclude></option>
|
||||
</$list>
|
||||
<$select tiddler="$:/config/DefaultMoreSidebarTab" class="tc-select">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/MoreSideBar]!has[draft.of]]">
|
||||
<option value=<<currentTiddler>>><$transclude field="caption">
|
||||
<$text text=<<currentTiddler>>/>
|
||||
</$transclude>
|
||||
</option>
|
||||
</$list>
|
||||
</$select>
|
||||
|
|
|
@ -5,10 +5,16 @@ title: $:/core/ui/ControlPanel/Settings/DefaultSidebarTab
|
|||
\define lingo-base() $:/language/ControlPanel/Settings/DefaultSidebarTab/
|
||||
\whitespace trim
|
||||
|
||||
<$link to="$:/config/DefaultSidebarTab"><<lingo Hint>></$link>
|
||||
<$link to="$:/config/DefaultSidebarTab" class="tc-control-panel-item">
|
||||
<<lingo Hint>>
|
||||
</$link>
|
||||
|
||||
<$select tiddler="$:/config/DefaultSidebarTab">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]">
|
||||
<option value=<<currentTiddler>>><$transclude field="caption"><$text text=<<currentTiddler>>/></$transclude></option>
|
||||
</$list>
|
||||
<$select tiddler="$:/config/DefaultSidebarTab" class="tc-select">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]">
|
||||
<option value=<<currentTiddler>>>
|
||||
<$transclude field="caption">
|
||||
<$text text=<<currentTiddler>>/>
|
||||
</$transclude>
|
||||
</option>
|
||||
</$list>
|
||||
</$select>
|
||||
|
|
|
@ -2,8 +2,15 @@ title: $:/core/ui/ControlPanel/Settings/EditorToolbar
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/EditorToolbar/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/EditorToolbar/
|
||||
<<lingo Hint>>
|
||||
|
||||
<$checkbox tiddler="$:/config/TextEditor/EnableToolbar" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/TextEditor/EnableToolbar"><<lingo Description>></$link> </$checkbox>
|
||||
|
||||
<$checkbox tiddler="$:/config/TextEditor/EnableToolbar"
|
||||
field="text" checked="yes" unchecked="no" default="yes"
|
||||
class="tc-control-panel-item"
|
||||
>
|
||||
<$link to="$:/config/TextEditor/EnableToolbar" class="tc-tiny-gap-left">
|
||||
<<lingo Description>>
|
||||
</$link>
|
||||
</$checkbox>
|
||||
|
|
|
@ -2,9 +2,17 @@ title: $:/core/ui/ControlPanel/Settings/InfoPanelMode
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/InfoPanelMode/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/InfoPanelMode/
|
||||
<$link to="$:/config/TiddlerInfo/Mode"><<lingo Hint>></$link>
|
||||
|
||||
<$radio tiddler="$:/config/TiddlerInfo/Mode" value="popup"> <<lingo Popup/Description>> </$radio>
|
||||
<$link to="$:/config/TiddlerInfo/Mode" class="tc-control-panel-item">
|
||||
<<lingo Hint>>
|
||||
</$link>
|
||||
|
||||
<$radio tiddler="$:/config/TiddlerInfo/Mode" value="sticky"> <<lingo Sticky/Description>> </$radio>
|
||||
<$radio tiddler="$:/config/TiddlerInfo/Mode" value="popup">
|
||||
<span class="tc-tiny-gap-left"><<lingo Popup/Description>></span>
|
||||
</$radio>
|
||||
|
||||
<$radio tiddler="$:/config/TiddlerInfo/Mode" value="sticky">
|
||||
<span class="tc-tiny-gap-left"><<lingo Sticky/Description>></span>
|
||||
</$radio>
|
||||
|
|
|
@ -2,21 +2,25 @@ title: $:/core/ui/ControlPanel/Settings/LinkToBehaviour
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/LinkToBehaviour/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/
|
||||
|
||||
<$link to="$:/config/Navigation/openLinkFromInsideRiver"><<lingo "InsideRiver/Hint">></$link>
|
||||
<$link to="$:/config/Navigation/openLinkFromInsideRiver" class="tc-control-panel-item">
|
||||
<<lingo "InsideRiver/Hint">>
|
||||
</$link>
|
||||
|
||||
<$select tiddler="$:/config/Navigation/openLinkFromInsideRiver">
|
||||
<option value="above"><<lingo "OpenAbove">></option>
|
||||
<option value="below"><<lingo "OpenBelow">></option>
|
||||
<option value="top"><<lingo "OpenAtTop">></option>
|
||||
<option value="bottom"><<lingo "OpenAtBottom">></option>
|
||||
<$select tiddler="$:/config/Navigation/openLinkFromInsideRiver" class="tc-select">
|
||||
<option value="above"><<lingo "OpenAbove">></option>
|
||||
<option value="below"><<lingo "OpenBelow">></option>
|
||||
<option value="top"><<lingo "OpenAtTop">></option>
|
||||
<option value="bottom"><<lingo "OpenAtBottom">></option>
|
||||
</$select>
|
||||
|
||||
<$link to="$:/config/Navigation/openLinkFromOutsideRiver"><<lingo "OutsideRiver/Hint">></$link>
|
||||
<$link to="$:/config/Navigation/openLinkFromOutsideRiver" class="tc-control-panel-item">
|
||||
<<lingo "OutsideRiver/Hint">>
|
||||
</$link>
|
||||
|
||||
<$select tiddler="$:/config/Navigation/openLinkFromOutsideRiver">
|
||||
<option value="top"><<lingo "OpenAtTop">></option>
|
||||
<option value="bottom"><<lingo "OpenAtBottom">></option>
|
||||
<$select tiddler="$:/config/Navigation/openLinkFromOutsideRiver" class="tc-select">
|
||||
<option value="top"><<lingo "OpenAtTop">></option>
|
||||
<option value="bottom"><<lingo "OpenAtBottom">></option>
|
||||
</$select>
|
||||
|
|
|
@ -2,8 +2,12 @@ title: $:/core/ui/ControlPanel/Settings/MissingLinks
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/MissingLinks/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/MissingLinks/
|
||||
<<lingo Hint>>
|
||||
|
||||
<$checkbox tiddler="$:/config/MissingLinks" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/MissingLinks"><<lingo Description>></$link> </$checkbox>
|
||||
|
||||
<$checkbox tiddler="$:/config/MissingLinks" field="text" checked="yes" unchecked="no" default="yes">
|
||||
<$link to="$:/config/MissingLinks" class="tc-control-panel-item">
|
||||
<span class="tc-tiny-gap-left"><<lingo Description>></span>
|
||||
</$link>
|
||||
</$checkbox>
|
||||
|
|
|
@ -2,12 +2,21 @@ title: $:/core/ui/ControlPanel/Settings/NavigationAddressBar
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/NavigationAddressBar/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/NavigationAddressBar/
|
||||
|
||||
<$link to="$:/config/Navigation/UpdateAddressBar"><<lingo Hint>></$link>
|
||||
<$link to="$:/config/Navigation/UpdateAddressBar" class="tc-control-panel-item">
|
||||
<<lingo Hint>>
|
||||
</$link>
|
||||
|
||||
<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="permaview"> <<lingo Permaview/Description>> </$radio>
|
||||
<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="permaview">
|
||||
<span class="tc-tiny-gap-left"><<lingo Permaview/Description>></span>
|
||||
</$radio>
|
||||
|
||||
<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="permalink"> <<lingo Permalink/Description>> </$radio>
|
||||
<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="permalink">
|
||||
<span class="tc-tiny-gap-left"><<lingo Permalink/Description>></span>
|
||||
</$radio>
|
||||
|
||||
<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="no"> <<lingo No/Description>> </$radio>
|
||||
<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="no">
|
||||
<span class="tc-tiny-gap-left"><<lingo No/Description>></span>
|
||||
</$radio>
|
||||
|
|
|
@ -2,9 +2,17 @@ title: $:/core/ui/ControlPanel/Settings/NavigationHistory
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/NavigationHistory/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/NavigationHistory/
|
||||
<$link to="$:/config/Navigation/UpdateHistory"><<lingo Hint>></$link>
|
||||
|
||||
<$radio tiddler="$:/config/Navigation/UpdateHistory" value="yes"> <<lingo Yes/Description>> </$radio>
|
||||
<$link to="$:/config/Navigation/UpdateHistory" class="tc-control-panel-item">
|
||||
<<lingo Hint>>
|
||||
</$link>
|
||||
|
||||
<$radio tiddler="$:/config/Navigation/UpdateHistory" value="no"> <<lingo No/Description>> </$radio>
|
||||
<$radio tiddler="$:/config/Navigation/UpdateHistory" value="yes">
|
||||
<span class="tc-tiny-gap-left"><<lingo Yes/Description>></span>
|
||||
</$radio>
|
||||
|
||||
<$radio tiddler="$:/config/Navigation/UpdateHistory" value="no">
|
||||
<span class="tc-tiny-gap-left"><<lingo No/Description>></span>
|
||||
</$radio>
|
||||
|
|
|
@ -2,9 +2,24 @@ title: $:/core/ui/ControlPanel/Settings/NavigationPermalinkviewMode
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/NavigationPermalinkviewMode/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/NavigationPermalinkviewMode/
|
||||
<<lingo Hint>>
|
||||
|
||||
<$checkbox tiddler="$:/config/Navigation/Permalinkview/CopyToClipboard" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/Navigation/Permalinkview/CopyToClipboard"><<lingo CopyToClipboard/Description>></$link> </$checkbox>
|
||||
<$checkbox tiddler="$:/config/Navigation/Permalinkview/CopyToClipboard"
|
||||
field="text" checked="yes" unchecked="no" default="yes"
|
||||
class="tc-control-panel-item"
|
||||
>
|
||||
<$link to="$:/config/Navigation/Permalinkview/CopyToClipboard" class="tc-tiny-gap-left">
|
||||
<<lingo CopyToClipboard/Description>>
|
||||
</$link>
|
||||
</$checkbox>
|
||||
|
||||
<$checkbox tiddler="$:/config/Navigation/Permalinkview/UpdateAddressBar" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/Navigation/Permalinkview/UpdateAddressBar"><<lingo UpdateAddressBar/Description>></$link> </$checkbox>
|
||||
<$checkbox tiddler="$:/config/Navigation/Permalinkview/UpdateAddressBar"
|
||||
field="text" checked="yes" unchecked="no" default="yes"
|
||||
class="tc-control-panel-item"
|
||||
>
|
||||
<$link to="$:/config/Navigation/Permalinkview/UpdateAddressBar" class="tc-tiny-gap-left">
|
||||
<<lingo UpdateAddressBar/Description>>
|
||||
</$link>
|
||||
</$checkbox>
|
||||
|
|
|
@ -2,7 +2,15 @@ title: $:/core/ui/ControlPanel/Settings/PerformanceInstrumentation
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/PerformanceInstrumentation/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/PerformanceInstrumentation/
|
||||
<<lingo Hint>>
|
||||
|
||||
<$checkbox tiddler="$:/config/Performance/Instrumentation" field="text" checked="yes" unchecked="no" default="no"> <$link to="$:/config/Performance/Instrumentation"><<lingo Description>></$link> </$checkbox>
|
||||
<$checkbox tiddler="$:/config/Performance/Instrumentation"
|
||||
field="text" checked="yes" unchecked="no" default="no"
|
||||
class="tc-control-panel-item"
|
||||
>
|
||||
<$link to="$:/config/Performance/Instrumentation" class="tc-tiny-gap-left">
|
||||
<<lingo Description>>
|
||||
</$link>
|
||||
</$checkbox>
|
||||
|
|
|
@ -2,9 +2,17 @@ title: $:/core/ui/ControlPanel/Settings/TitleLinks
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/TitleLinks/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/TitleLinks/
|
||||
<$link to="$:/config/Tiddlers/TitleLinks"><<lingo Hint>></$link>
|
||||
|
||||
<$radio tiddler="$:/config/Tiddlers/TitleLinks" value="yes"> <<lingo Yes/Description>> </$radio>
|
||||
<$link to="$:/config/Tiddlers/TitleLinks" class="tc-control-panel-item">
|
||||
<<lingo Hint>>
|
||||
</$link>
|
||||
|
||||
<$radio tiddler="$:/config/Tiddlers/TitleLinks" value="no"> <<lingo No/Description>> </$radio>
|
||||
<$radio tiddler="$:/config/Tiddlers/TitleLinks" value="yes">
|
||||
<span class="tc-tiny-gap-left"><<lingo Yes/Description>></span>
|
||||
</$radio>
|
||||
|
||||
<$radio tiddler="$:/config/Tiddlers/TitleLinks" value="no">
|
||||
<span class="tc-tiny-gap-left"><<lingo No/Description>></span>
|
||||
</$radio>
|
||||
|
|
|
@ -2,12 +2,15 @@ title: $:/core/ui/ControlPanel/Settings/ToolbarButtonStyle
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption}}
|
||||
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/
|
||||
\whitespace trim
|
||||
<$link to="$:/config/Toolbar/ButtonClass"><<lingo "Hint">></$link>
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/
|
||||
|
||||
<$select tiddler="$:/config/Toolbar/ButtonClass">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ToolbarButtonStyle]]">
|
||||
<option value={{!!text}}>{{!!caption}}</option>
|
||||
</$list>
|
||||
<$link to="$:/config/Toolbar/ButtonClass" class="tc-control-panel-item">
|
||||
<<lingo "Hint">>
|
||||
</$link>
|
||||
|
||||
<$select tiddler="$:/config/Toolbar/ButtonClass" class="tc-select">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ToolbarButtonStyle]]">
|
||||
<option value={{!!text}}>{{!!caption}}</option>
|
||||
</$list>
|
||||
</$select>
|
||||
|
|
|
@ -2,9 +2,24 @@ title: $:/core/ui/ControlPanel/Settings/ToolbarButtons
|
|||
tags: $:/tags/ControlPanel/Settings
|
||||
caption: {{$:/language/ControlPanel/Settings/ToolbarButtons/Caption}}
|
||||
|
||||
\whitespace trim
|
||||
\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtons/
|
||||
<<lingo Hint>>
|
||||
|
||||
<$checkbox tiddler="$:/config/Toolbar/Icons" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/Toolbar/Icons"><<lingo Icons/Description>></$link> </$checkbox>
|
||||
<$checkbox tiddler="$:/config/Toolbar/Icons"
|
||||
field="text" checked="yes" unchecked="no" default="yes"
|
||||
class="tc-control-panel-item"
|
||||
>
|
||||
<$link to="$:/config/Toolbar/Icons" class="tc-tiny-gap-left">
|
||||
<<lingo Icons/Description>>
|
||||
</$link>
|
||||
</$checkbox>
|
||||
|
||||
<$checkbox tiddler="$:/config/Toolbar/Text" field="text" checked="yes" unchecked="no" default="no"> <$link to="$:/config/Toolbar/Text"><<lingo Text/Description>></$link> </$checkbox>
|
||||
<$checkbox tiddler="$:/config/Toolbar/Text"
|
||||
field="text" checked="yes" unchecked="no" default="no"
|
||||
class="tc-control-panel-item"
|
||||
>
|
||||
<$link to="$:/config/Toolbar/Text" class="tc-tiny-gap-left">
|
||||
<<lingo Text/Description>>
|
||||
</$link>
|
||||
</$checkbox>
|
||||
|
|
|
@ -9,9 +9,9 @@ list-before:
|
|||
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings]]">
|
||||
|
||||
<div style="border-top:1px solid #eee;">
|
||||
<div class="tc-control-panel-setting" data-setting-title=<<currentTiddler>> style="border-top:1px solid #eee;">
|
||||
|
||||
!! <$link><$transclude field="caption"/></$link>
|
||||
!!.tc-control-panel-accent <$link><$transclude field="caption"/></$link>
|
||||
|
||||
<$transclude/>
|
||||
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
title: $:/core/ui/EditTemplate/controls
|
||||
tags: $:/tags/EditTemplate
|
||||
|
||||
\define config-title()
|
||||
$:/config/EditToolbarButtons/Visibility/$(listItem)$
|
||||
\end
|
||||
\define config-title() $:/config/EditToolbarButtons/Visibility/$(listItem)$
|
||||
\whitespace trim
|
||||
<div class="tc-tiddler-title tc-tiddler-edit-title">
|
||||
<$view field="title"/>
|
||||
<span class="tc-tiddler-controls tc-titlebar"><$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]]}}}><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$let></$list></span>
|
||||
<div style="clear: both;"></div>
|
||||
<$view field="title"/>
|
||||
<span class="tc-tiddler-controls tc-titlebar">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem">
|
||||
<$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]] }}}>
|
||||
<$reveal type="nomatch" state=<<config-title>> text="hide">
|
||||
<$transclude $tiddler=<<listItem>>/>
|
||||
</$reveal>
|
||||
</$let>
|
||||
</$list>
|
||||
</span>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
title: $:/core/ui/KeyboardShortcuts/refresh
|
||||
tags: $:/tags/KeyboardShortcut
|
||||
key: ((refresh))
|
||||
|
||||
<$action-sendmessage $message="tm-browser-refresh"/>
|
|
@ -1,17 +1,14 @@
|
|||
title: $:/core/ui/PageTemplate/pagecontrols
|
||||
|
||||
\whitespace trim
|
||||
\define config-title()
|
||||
$:/config/PageControlButtons/Visibility/$(listItem)$
|
||||
\end
|
||||
\function config-title() [[$:/config/PageControlButtons/Visibility/$(listItem)$]substitute[]]
|
||||
|
||||
<div class="tc-page-controls">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem">
|
||||
<$set name="hidden" value=<<config-title>>>
|
||||
<$list filter="[<hidden>!text[hide]]" storyview="pop" variable="ignore">
|
||||
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
|
||||
<$transclude tiddler=<<listItem>> mode="inline"/>
|
||||
</$set>
|
||||
</$list>
|
||||
</$set>
|
||||
</$list>
|
||||
</div>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem">
|
||||
<$list filter="[<config-title>!text[hide]]" storyview="pop" variable="ignore">
|
||||
<$let tv-config-toolbar-class={{{ [enlist<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]] +[join[ ]] }}}>
|
||||
<$transclude $tiddler=<<listItem>> $mode="inline"/>
|
||||
</$let>
|
||||
</$list>
|
||||
</$list>
|
||||
</div>
|
|
@ -4,48 +4,41 @@ caption: {{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}
|
|||
description: {{$:/language/Buttons/More/Hint}}
|
||||
|
||||
\whitespace trim
|
||||
\define config-title()
|
||||
$:/config/PageControlButtons/Visibility/$(listItem)$
|
||||
\end
|
||||
<$button popup=<<qualify "$:/state/popup/more">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
|
||||
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
||||
<span class="tc-btn-text">
|
||||
<$text text={{$:/language/Buttons/More/Caption}}/>
|
||||
</span>
|
||||
</$list>
|
||||
</$button><$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes">
|
||||
|
||||
<div class="tc-drop-down">
|
||||
|
||||
<$set name="tv-config-toolbar-icons" value="yes">
|
||||
|
||||
<$set name="tv-config-toolbar-text" value="yes">
|
||||
|
||||
<$set name="tv-config-toolbar-class" value="tc-btn-invisible">
|
||||
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]" variable="listItem">
|
||||
|
||||
<$reveal type="match" state=<<config-title>> text="hide">
|
||||
|
||||
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
|
||||
|
||||
<$transclude tiddler=<<listItem>> mode="inline"/>
|
||||
|
||||
</$set>
|
||||
|
||||
</$reveal>
|
||||
|
||||
</$list>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</div>
|
||||
\define config-title() $:/config/PageControlButtons/Visibility/$(listItem)$
|
||||
|
||||
<$button popup=<<qualify "$:/state/popup/more">>
|
||||
tooltip={{$:/language/Buttons/More/Hint}}
|
||||
aria-label={{$:/language/Buttons/More/Caption}}
|
||||
class=<<tv-config-toolbar-class>>
|
||||
selectedClass="tc-selected"
|
||||
>
|
||||
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
||||
<span class="tc-btn-text">
|
||||
<$text text={{$:/language/Buttons/More/Caption}}/>
|
||||
</span>
|
||||
</$list>
|
||||
</$button>
|
||||
<$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes">
|
||||
<div class="tc-drop-down">
|
||||
<$set name="tv-config-toolbar-icons" value="yes">
|
||||
<$set name="tv-config-toolbar-text" value="yes">
|
||||
<$set name="tv-config-toolbar-class" value="tc-btn-invisible">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]"
|
||||
variable="listItem"
|
||||
>
|
||||
<$reveal type="match" state=<<config-title>> text="hide">
|
||||
<$set name="tv-config-toolbar-class"
|
||||
filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"
|
||||
>
|
||||
<$transclude tiddler=<<listItem>> mode="inline"/>
|
||||
</$set>
|
||||
</$reveal>
|
||||
</$list>
|
||||
</$set>
|
||||
</$set>
|
||||
</$set>
|
||||
</div>
|
||||
</$reveal>
|
|
@ -1,7 +1,7 @@
|
|||
title: $:/core/ui/PageTemplate
|
||||
name: {{$:/language/PageTemplate/Name}}
|
||||
description: {{$:/language/PageTemplate/Description}}
|
||||
icon: $:/core/images/layout-button
|
||||
icon: $:/core/images/default-layout
|
||||
code-body: yes
|
||||
|
||||
\whitespace trim
|
||||
|
|
|
@ -2,31 +2,38 @@ title: $:/core/ui/ViewTemplate/title
|
|||
tags: $:/tags/ViewTemplate
|
||||
|
||||
\whitespace trim
|
||||
\define title-styles()
|
||||
fill:$(foregroundColor)$;
|
||||
\end
|
||||
\define title-styles() fill:$(foregroundColor)$;
|
||||
|
||||
<div class="tc-tiddler-title">
|
||||
<div class="tc-titlebar">
|
||||
<span class="tc-tiddler-controls">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]" storyview="pop" variable="listItem"><$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"><$transclude tiddler=<<listItem>>/></$set></$list>
|
||||
</span>
|
||||
<$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}>
|
||||
<$link>
|
||||
<$list filter="[<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] +[!is[blank]]" variable="ignore">
|
||||
<$let foregroundColor={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
|
||||
<span class="tc-tiddler-title-icon" style=<<title-styles>>>
|
||||
{{||$:/core/ui/TiddlerIcon}}
|
||||
</span>
|
||||
</$let>
|
||||
</$list>
|
||||
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/title/default]] }}} />
|
||||
</$link>
|
||||
</$set>
|
||||
</div>
|
||||
|
||||
<$reveal type="nomatch" text="" default="" state=<<tiddlerInfoState>> class="tc-tiddler-info tc-popup-handle" animate="yes" retain="yes">
|
||||
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfoSegment]!has[draft.of]] [[$:/core/ui/TiddlerInfo]]" variable="listItem"><$transclude tiddler=<<listItem>> mode="block"/></$list>
|
||||
|
||||
</$reveal>
|
||||
<div class="tc-titlebar">
|
||||
<span class="tc-tiddler-controls">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]"
|
||||
storyview="pop"
|
||||
variable="listItem"
|
||||
>
|
||||
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
|
||||
<$transclude tiddler=<<listItem>>/>
|
||||
</$set>
|
||||
</$list>
|
||||
</span>
|
||||
<$set name="tv-wikilinks" value={{$:/config/Tiddlers/TitleLinks}}>
|
||||
<$link>
|
||||
<$list filter="[<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] +[!is[blank]]"
|
||||
variable="ignore"
|
||||
>
|
||||
<$let foregroundColor={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
|
||||
<span class="tc-tiddler-title-icon" style=<<title-styles>>>
|
||||
{{||$:/core/ui/TiddlerIcon}}
|
||||
</span>
|
||||
</$let>
|
||||
</$list>
|
||||
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/title/default]] }}} />
|
||||
</$link>
|
||||
</$set>
|
||||
</div>
|
||||
<$reveal tag="div" type="nomatch" text="" default="" state=<<tiddlerInfoState>> class="tc-tiddler-info tc-popup-handle" animate="yes" retain="yes">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfoSegment]!has[draft.of]] [[$:/core/ui/TiddlerInfo]]" variable="listItem">
|
||||
<$transclude tiddler=<<listItem>> mode="block"/>
|
||||
</$list>
|
||||
</$reveal>
|
||||
</div>
|
||||
|
|
|
@ -4,49 +4,41 @@ caption: {{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}
|
|||
description: {{$:/language/Buttons/More/Hint}}
|
||||
|
||||
\whitespace trim
|
||||
\define config-title()
|
||||
$:/config/ViewToolbarButtons/Visibility/$(listItem)$
|
||||
\end
|
||||
<$button popup=<<qualify "$:/state/popup/more">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
|
||||
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
||||
<span class="tc-btn-text">
|
||||
<$text text={{$:/language/Buttons/More/Caption}}/>
|
||||
</span>
|
||||
</$list>
|
||||
\define config-title() $:/config/ViewToolbarButtons/Visibility/$(listItem)$
|
||||
|
||||
<$button popup=<<qualify "$:/state/popup/more">>
|
||||
tooltip={{$:/language/Buttons/More/Hint}}
|
||||
aria-label={{$:/language/Buttons/More/Caption}}
|
||||
class=<<tv-config-toolbar-class>>
|
||||
selectedClass="tc-selected"
|
||||
>
|
||||
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
||||
<span class="tc-btn-text">
|
||||
<$text text={{$:/language/Buttons/More/Caption}}/>
|
||||
</span>
|
||||
</$list>
|
||||
</$button>
|
||||
<$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="belowleft" animate="yes">
|
||||
|
||||
<div class="tc-drop-down">
|
||||
|
||||
<$set name="tv-config-toolbar-icons" value="yes">
|
||||
|
||||
<$set name="tv-config-toolbar-text" value="yes">
|
||||
|
||||
<$set name="tv-config-toolbar-class" value="tc-btn-invisible">
|
||||
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]" variable="listItem">
|
||||
|
||||
<$reveal type="match" state=<<config-title>> text="hide">
|
||||
|
||||
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
|
||||
|
||||
<$transclude tiddler=<<listItem>> mode="inline"/>
|
||||
|
||||
</$set>
|
||||
|
||||
</$reveal>
|
||||
|
||||
</$list>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tc-drop-down">
|
||||
<$set name="tv-config-toolbar-icons" value="yes">
|
||||
<$set name="tv-config-toolbar-text" value="yes">
|
||||
<$set name="tv-config-toolbar-class" value="tc-btn-invisible">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]"
|
||||
variable="listItem"
|
||||
>
|
||||
<$reveal type="match" state=<<config-title>> text="hide">
|
||||
<$set name="tv-config-toolbar-class"
|
||||
filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]"
|
||||
>
|
||||
<$transclude tiddler=<<listItem>> mode="inline"/>
|
||||
</$set>
|
||||
</$reveal>
|
||||
</$list>
|
||||
</$set>
|
||||
</$set>
|
||||
</$set>
|
||||
</div>
|
||||
</$reveal>
|
|
@ -35,6 +35,7 @@ new-tiddler: {{$:/language/Buttons/NewTiddler/Hint}}
|
|||
picture: {{$:/language/Buttons/Picture/Hint}}
|
||||
preview: {{$:/language/Buttons/Preview/Hint}}
|
||||
quote: {{$:/language/Buttons/Quote/Hint}}
|
||||
refresh: {{$:/language/Buttons/Refresh/Hint}}
|
||||
save-tiddler: {{$:/language/Buttons/Save/Hint}}
|
||||
save-wiki: {{$:/language/Buttons/SaveWiki/Hint}}
|
||||
sidebar-search: {{$:/language/Buttons/SidebarSearch/Hint}}
|
||||
|
|
|
@ -6,4 +6,5 @@ underline: meta-U
|
|||
new-image: ctrl-I
|
||||
new-journal: ctrl-J
|
||||
new-tiddler: ctrl-N
|
||||
refresh: meta-R
|
||||
save-wiki: meta-S
|
||||
|
|
|
@ -6,3 +6,4 @@ underline: ctrl-U
|
|||
new-image: alt-I
|
||||
new-journal: alt-J
|
||||
new-tiddler: alt-N
|
||||
refresh: ctrl-R
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
title: $:/core/macros/CSS
|
||||
tags: $:/tags/Global
|
||||
tags: $:/tags/Macro $:/tags/Global
|
||||
|
||||
\procedure colour(name)
|
||||
\whitespace trim
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
title: $:/core/macros/copy-to-clipboard
|
||||
tags: $:/tags/Global
|
||||
tags: $:/tags/Macro $:/tags/Global
|
||||
|
||||
\whitespace trim
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
title: $:/core/macros/diff
|
||||
tags: $:/tags/Global
|
||||
tags: $:/tags/Macro $:/tags/Global
|
||||
|
||||
\whitespace trim
|
||||
|
||||
|
|
|
@ -1,177 +1,182 @@
|
|||
title: $:/core/macros/tag-picker
|
||||
tags: $:/tags/Macro
|
||||
first-search-filter: [tags[]!is[system]search:title<userInput>sort[]]
|
||||
second-search-filter: [tags[]is[system]search:title<userInput>sort[]]
|
||||
tags: tags: $:/tags/Macro $:/tags/Global
|
||||
first-search-filter: [subfilter<tagListFilter>!is[system]search:title<userInput>sort[]]
|
||||
second-search-filter: [subfilter<tagListFilter>is[system]search:title<userInput>sort[]]
|
||||
|
||||
\define get-tagpicker-focus-selector() [data-tiddler-title="$(currentTiddlerCSSEscaped)$"] .tc-add-tag-name input
|
||||
<!-- first-search-filter and second-search-filter fields are not used here in the code, but they are defined as parameters for keyboard-driven-input macro -->
|
||||
|
||||
\define delete-tag-state-tiddlers() <$action-deletetiddler $filter="[<newTagNameTiddler>] [<storeTitle>] [<tagSelectionState>]"/>
|
||||
|
||||
\define add-tag-actions(actions,tagField:"tags")
|
||||
\whitespace trim
|
||||
<$set name="tag" value={{{ [<__tiddler__>get[text]] }}}>
|
||||
<$list
|
||||
filter="[<saveTiddler>!contains:$tagField$<tag>!match[]]"
|
||||
variable="ignore"
|
||||
emptyMessage="<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter='-[<tag>]'/>"
|
||||
>
|
||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/>
|
||||
<$transclude $variable="__actions__"/>
|
||||
</$list>
|
||||
</$set>
|
||||
<<delete-tag-state-tiddlers>>
|
||||
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
||||
|
||||
<!-- tf.tagpicker-dropdown-id is needed if several tap-pickers are shown in one tiddler -->
|
||||
\function tf.tagpicker-dropdown-id()
|
||||
[<qualify $:/state/popup/tags-auto-complete>]
|
||||
[[$(saveTiddler)$-[$(tagField)$-$(tagListFilter)$]substitute[]sha256[]] +[join[/]]
|
||||
\end
|
||||
|
||||
\define clear-tags-actions-inner()
|
||||
\whitespace trim
|
||||
<$list
|
||||
filter="[<storeTitle>has[text]] [<newTagNameTiddler>has[text]]"
|
||||
variable="ignore"
|
||||
emptyMessage="<<cancel-delete-tiddler-actions 'cancel'>>"
|
||||
>
|
||||
\function tf.tagpicker-dropdown-class() [<tf.tagpicker-dropdown-id>sha256[]addprefix[tc-]]
|
||||
\function tf.get-tagpicker-focus-selector() [<tf.tagpicker-dropdown-class>addprefix[.]] .tc-popup-handle +[join[ ]]
|
||||
|
||||
<!-- clean up temporary tiddlers, so the next "pick" starts with a clean input -->
|
||||
<!-- This could probably be optimized / removed if we would use different temp-tiddlers
|
||||
(future improvement because keeping track is comlex for humans)
|
||||
-->
|
||||
\procedure delete-tag-state-tiddlers()
|
||||
<$action-deletetiddler $filter="[<newTagNameTiddler>] [<storeTitle>] [<tagSelectionState>]"/>
|
||||
\end
|
||||
|
||||
<!-- trigger __toggle tag__ by keyboard -->
|
||||
\procedure add-tag-actions()
|
||||
<$let tag=<<_tf.getTag>> >
|
||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter='+[toggle<tag>trim[]]'/>
|
||||
<% if [<tag>] :intersection[<saveTiddler>get<tagField>enlist-input[]] %>
|
||||
<!-- tag has been removed - do nothing -->
|
||||
<% else %>
|
||||
<<actions>>
|
||||
<% endif %>
|
||||
<<delete-tag-state-tiddlers>>
|
||||
</$list>
|
||||
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
||||
</$let>
|
||||
\end
|
||||
<!-- <$action-log /> -->
|
||||
|
||||
<!-- ESC key removes the text from the input
|
||||
The second ESC tries to close the "draft tiddler"
|
||||
-->
|
||||
\procedure clear-tags-actions-inner()
|
||||
<% if [<storeTitle>has[text]] ~[<newTagNameTiddler>has[text]] %>
|
||||
<<delete-tag-state-tiddlers>>
|
||||
<% else %>
|
||||
<<cancel-delete-tiddler-actions "cancel">>
|
||||
<% endif %>
|
||||
\end
|
||||
|
||||
\define clear-tags-actions()
|
||||
\whitespace trim
|
||||
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}>
|
||||
<$list filter="[<newTagNameTiddler>get[text]!match<userInput>]" emptyMessage="<<clear-tags-actions-inner>>">
|
||||
<$action-setfield $tiddler=<<newTagNameTiddler>> text=<<userInput>>/><$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
||||
<!-- triggered by keyboard only -->
|
||||
\procedure clear-tags-actions()
|
||||
<$let userInput=<<_tf.getUserInput>> >
|
||||
<!-- this list __cannot__ be transformed to conditional IF. The list variable is used! -->
|
||||
<$list filter="[<newTagNameTiddler>get[text]!match<userInput>]" >
|
||||
<$list-empty>
|
||||
<<clear-tags-actions-inner>>
|
||||
</$list-empty>
|
||||
<$action-setfield $tiddler=<<newTagNameTiddler>> text=<<userInput>>/>
|
||||
<$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
|
||||
</$list>
|
||||
</$set>
|
||||
</$let>
|
||||
\end
|
||||
|
||||
\define tag-picker-inner(actions,tagField:"tags")
|
||||
\whitespace trim
|
||||
<$vars
|
||||
newTagNameInputTiddlerQualified=<<qualify "$:/temp/NewTagName/input">>
|
||||
newTagNameSelectionTiddlerQualified=<<qualify "$:/temp/NewTagName/selected-item">>
|
||||
fallbackTarget={{$(palette)$##tag-background}}
|
||||
colourA={{$(palette)$##foreground}}
|
||||
colourB={{$(palette)$##background}}
|
||||
>
|
||||
<$vars
|
||||
storeTitle={{{ [<newTagNameInputTiddler>!match[]] ~[<newTagNameInputTiddlerQualified>] }}}
|
||||
tagSelectionState={{{ [<newTagNameSelectionTiddler>!match[]] ~[<newTagNameSelectionTiddlerQualified>] }}}
|
||||
<!-- similar to add-tag-actions __but__ add-only -->
|
||||
\procedure add-button-actions()
|
||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<tagField>> $subfilter="[<tag>trim[]]"/>
|
||||
<<actions>>
|
||||
<<delete-tag-state-tiddlers>>
|
||||
<$action-sendmessage $message="tm-focus-selector" $param=<<tf.get-tagpicker-focus-selector>>/>
|
||||
\end
|
||||
<!-- <$action-log /> -->
|
||||
|
||||
<!-- create dropdown list -->
|
||||
\procedure tag-picker-listTags(filter, suffix)
|
||||
<$let userInput=<<_tf.getUserInput>> >
|
||||
<$list filter="[<userInput>minlength{$:/config/Tags/MinLength}limit[1]]"
|
||||
emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem"
|
||||
>
|
||||
<$vars
|
||||
refreshTitle=<<qualify "$:/temp/NewTagName/refresh">>
|
||||
nonSystemTagsFilter="[tags[]!is[system]search:title<userInput>sort[]]"
|
||||
systemTagsFilter="[tags[]is[system]search:title<userInput>sort[]]"
|
||||
<$list filter=<<filter>> variable="tag">
|
||||
<!-- The buttonClasses filter is used to define tc-tag-button-selected state -->
|
||||
<!-- tf.get-tagpicker-focus-selector has to be resolved for $:/core/ui/TagPickerTagTemplate,
|
||||
othwerwise qualify in tf.tagpicker-dropdown-id causes problems -->
|
||||
<$let currentTiddler=<<tag>>
|
||||
button-classes=`tc-btn-invisible ${[<tag>addsuffix<suffix>] -[<tagSelectionState>get[text]] :then[[]] ~tc-tag-button-selected }$`
|
||||
get-tagpicker-focus-selector=`${[<tf.get-tagpicker-focus-selector>]}$`
|
||||
>
|
||||
{{||$:/core/ui/TagPickerTagTemplate}}
|
||||
</$let>
|
||||
</$list>
|
||||
</$list>
|
||||
</$let>
|
||||
\end
|
||||
|
||||
<!-- tag-picker-inner is the main function -->
|
||||
\procedure tag-picker-inner()
|
||||
<div class={{{ [[tc-edit-add-tag]] [<tf.tagpicker-dropdown-class>] +[join[ ]] }}}>
|
||||
<div class="tc-edit-add-tag-ui">
|
||||
<span class="tc-add-tag-name tc-small-gap-right">
|
||||
<$macrocall $name="keyboard-driven-input"
|
||||
tiddler=<<newTagNameTiddler>>
|
||||
storeTitle=<<storeTitle>>
|
||||
refreshTitle=<<refreshTitle>>
|
||||
selectionStateTitle=<<tagSelectionState>>
|
||||
inputAcceptActions=<<add-tag-actions>>
|
||||
inputCancelActions=<<clear-tags-actions>>
|
||||
tag="input"
|
||||
placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}}
|
||||
focusPopup=<<tf.tagpicker-dropdown-id>>
|
||||
class="tc-edit-texteditor tc-popup-handle"
|
||||
tabindex=<<tabIndex>>
|
||||
focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] ~[[false]] }}}
|
||||
filterMinLength={{$:/config/Tags/MinLength}}
|
||||
cancelPopups=<<cancelPopups>>
|
||||
configTiddlerFilter="[[$:/core/macros/tag-picker]]"
|
||||
/>
|
||||
</span>
|
||||
<$button popup=<<tf.tagpicker-dropdown-id>> class="tc-btn-invisible tc-btn-dropdown"
|
||||
tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}
|
||||
>
|
||||
<div class="tc-edit-add-tag">
|
||||
<div>
|
||||
<span class="tc-add-tag-name tc-small-gap-right">
|
||||
<$macrocall
|
||||
$name="keyboard-driven-input"
|
||||
tiddler=<<newTagNameTiddler>>
|
||||
storeTitle=<<storeTitle>>
|
||||
refreshTitle=<<refreshTitle>>
|
||||
selectionStateTitle=<<tagSelectionState>>
|
||||
inputAcceptActions="<$macrocall $name='add-tag-actions' actions=<<__actions__>> tagField=<<__tagField__>>/>"
|
||||
inputCancelActions=<<clear-tags-actions>>
|
||||
tag="input"
|
||||
placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}}
|
||||
focusPopup=<<qualify "$:/state/popup/tags-auto-complete">>
|
||||
class="tc-edit-texteditor tc-popup-handle"
|
||||
tabindex=<<tabIndex>>
|
||||
focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] ~[[false]] }}}
|
||||
filterMinLength={{$:/config/Tags/MinLength}}
|
||||
cancelPopups=<<cancelPopups>>
|
||||
configTiddlerFilter="[[$:/core/macros/tag-picker]]"
|
||||
/>
|
||||
</span>
|
||||
<$button popup=<<qualify "$:/state/popup/tags-auto-complete">>
|
||||
class="tc-btn-invisible tc-btn-dropdown"
|
||||
tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}}
|
||||
aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}
|
||||
>
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
<$reveal state=<<storeTitle>> type="nomatch" text="">
|
||||
<$button class="tc-btn-invisible tc-small-gap tc-btn-dropdown"
|
||||
tooltip={{$:/language/EditTemplate/Tags/ClearInput/Hint}}
|
||||
aria-label={{$:/language/EditTemplate/Tags/ClearInput/Caption}}
|
||||
>
|
||||
{{$:/core/images/close-button}}<<delete-tag-state-tiddlers>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
<span class="tc-add-tag-button tc-small-gap-left">
|
||||
<$set name="tag" value={{{ [<newTagNameTiddler>get[text]] }}}>
|
||||
<$button set=<<newTagNameTiddler>> setTo="" class="">
|
||||
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/>
|
||||
<$transclude $variable="__actions__"/>
|
||||
<$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}>
|
||||
<<delete-tag-state-tiddlers>><$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>>/>
|
||||
</$set>
|
||||
{{$:/language/EditTemplate/Tags/Add/Button}}
|
||||
</$button>
|
||||
</$set>
|
||||
</span>
|
||||
</div>
|
||||
<div class="tc-block-dropdown-wrapper">
|
||||
<$reveal state=<<qualify "$:/state/popup/tags-auto-complete">> type="nomatch" text="" default="">
|
||||
<div class="tc-block-dropdown tc-block-tags-dropdown">
|
||||
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}>
|
||||
<$list
|
||||
filter="[<userInput>minlength{$:/config/Tags/MinLength}limit[1]]"
|
||||
emptyMessage="<div class='tc-search-results'
|
||||
>
|
||||
{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
|
||||
<$list filter=<<nonSystemTagsFilter>> variable="tag">
|
||||
<$list
|
||||
filter="[<tag>addsuffix[-primaryList]] -[<tagSelectionState>get[text]]"
|
||||
emptyMessage="<$vars button-classes='tc-btn-invisible tc-tag-button-selected' actions=<<__actions__>> tagField=<<__tagField__>> currentTiddler=<<tag>>>{{||$:/core/ui/TagPickerTagTemplate}}</$vars>"
|
||||
>
|
||||
<$vars button-classes="tc-btn-invisible"
|
||||
actions=<<__actions__>>
|
||||
tagField=<<__tagField__>>
|
||||
currentTiddler=<<tag>>
|
||||
>
|
||||
{{||$:/core/ui/TagPickerTagTemplate}}
|
||||
</$vars>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
<hr>
|
||||
<$list filter="[<userInput>minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>
|
||||
{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
|
||||
<$list filter=<<systemTagsFilter>> variable="tag">
|
||||
<$list filter="[<tag>addsuffix[-secondaryList]] -[<tagSelectionState>get[text]]"
|
||||
emptyMessage="<$vars button-classes='tc-btn-invisible tc-tag-button-selected' actions=<<__actions__>> tagField=<<__tagField__>> currentTiddler=<<tag>>>{{||$:/core/ui/TagPickerTagTemplate}}</$vars>"
|
||||
>
|
||||
<$vars button-classes="tc-btn-invisible"
|
||||
actions=<<__actions__>>
|
||||
tagField=<<__tagField__>>
|
||||
currentTiddler=<<tag>>
|
||||
>
|
||||
{{||$:/core/ui/TagPickerTagTemplate}}
|
||||
</$vars>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$set>
|
||||
</div>
|
||||
</$reveal>
|
||||
</div>
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
<% if [<storeTitle>has[text]] %>
|
||||
<$button actions=<<delete-tag-state-tiddlers>> class="tc-btn-invisible tc-small-gap tc-btn-dropdown"
|
||||
tooltip={{$:/language/EditTemplate/Tags/ClearInput/Hint}} aria-label={{$:/language/EditTemplate/Tags/ClearInput/Caption}}
|
||||
>
|
||||
{{$:/core/images/close-button}}
|
||||
</$button>
|
||||
<% endif %>
|
||||
<span class="tc-add-tag-button tc-small-gap-left">
|
||||
<$let tag=<<_tf.getTag>>>
|
||||
<$button set=<<newTagNameTiddler>> actions=<<add-button-actions>> >
|
||||
{{$:/language/EditTemplate/Tags/Add/Button}}
|
||||
</$button>
|
||||
</$let>
|
||||
</span>
|
||||
</div>
|
||||
<div class="tc-block-dropdown-wrapper">
|
||||
<% if [<tf.tagpicker-dropdown-id>has[text]] %>
|
||||
<div class="tc-block-dropdown tc-block-tags-dropdown">
|
||||
<$macrocall $name="tag-picker-listTags" filter=<<nonSystemTagsFilter>> suffix="-primaryList" />
|
||||
<hr>
|
||||
<$macrocall $name="tag-picker-listTags" filter=<<systemTagsFilter>> suffix="-secondaryList" />
|
||||
</div>
|
||||
</$vars>
|
||||
</$vars>
|
||||
</$vars>
|
||||
<% endif %>
|
||||
</div>
|
||||
</div>
|
||||
\end
|
||||
|
||||
\define tag-picker(actions,tagField:"tags")
|
||||
\whitespace trim
|
||||
<$vars saveTiddler=<<currentTiddler>> palette={{$:/palette}}>
|
||||
<$list
|
||||
filter="[<newTagNameTiddler>match[]]"
|
||||
emptyMessage="<$macrocall $name='tag-picker-inner' actions=<<__actions__>> tagField=<<__tagField__>>/>"
|
||||
>
|
||||
<$set name="newTagNameTiddler" value=<<qualify "$:/temp/NewTagName">>>
|
||||
<$macrocall $name="tag-picker-inner" actions=<<__actions__>> tagField=<<__tagField__>>/>
|
||||
</$set>
|
||||
</$list>
|
||||
</$vars>
|
||||
\end
|
||||
<!-- prepare all variables for tag-picker keyboard handling -->
|
||||
\procedure tag-picker(actions, tagField:"tags", tiddler, tagListFilter:"[tags[]]")
|
||||
|
||||
\function _tf.getUserInput() [<storeTitle>get[text]]
|
||||
\function _tf.getTag() [<newTagNameTiddler>get[text]]
|
||||
|
||||
<!-- keep those variables because they may "blead" into macros using old syntax -->
|
||||
<$let
|
||||
palette={{$:/palette}}
|
||||
colourA={{{ [<palette>getindex[foreground]] }}}
|
||||
colourB={{{ [<palette>getindex[background]] }}}
|
||||
fallbackTarget={{{ [<palette>getindex[tag-background]] }}}
|
||||
|
||||
saveTiddler={{{ [<tiddler>is[blank]then<currentTiddler>else<tiddler>] }}}
|
||||
|
||||
newTagNameTiddler={{{ [[$:/temp/NewTagName]] [<tagField>!match[tags]] +[join[/]] [<qualify>] +[join[]] }}}
|
||||
storeTitle={{{ [[$:/temp/NewTagName/input]] [<tagField>!match[tags]] +[join[/]] [<qualify>] +[join[]] }}}
|
||||
|
||||
newTagNameSelectionTiddlerQualified=<<qualify "$:/temp/NewTagName/selected-item">>
|
||||
tagSelectionState={{{ [<newTagNameSelectionTiddler>!match[]] ~[<newTagNameSelectionTiddlerQualified>] }}}
|
||||
|
||||
refreshTitle=<<qualify "$:/temp/NewTagName/refresh">>
|
||||
|
||||
nonSystemTagsFilter="[subfilter<tagListFilter>!is[system]search:title<userInput>sort[]]"
|
||||
systemTagsFilter="[subfilter<tagListFilter>is[system]search:title<userInput>sort[]]"
|
||||
|
||||
cancelPopups="yes"
|
||||
>
|
||||
<$macrocall $name="tag-picker-inner"/>
|
||||
</$let>
|
||||
\end
|
|
@ -21,7 +21,9 @@ color:$(foregroundColor)$;
|
|||
>
|
||||
<<__actions__>>
|
||||
<$transclude tiddler=<<__icon__>>/>
|
||||
<$view tiddler=<<__tag__>> field="title" format="text" />
|
||||
<span class={{{ [<__tag__>is[missing]then[tc-tag-missing]else[tc-tag-exists]] }}}>
|
||||
<$view tiddler=<<__tag__>> field="title" format="text" />
|
||||
</span>
|
||||
</$element-tag$>
|
||||
</$let>
|
||||
\end
|
||||
|
|
|
@ -16,6 +16,7 @@ Welcome to the developer documentation for TiddlyWiki (https://tiddlywiki.com/).
|
|||
** [[Adding Babel Polyfill to TiddlyWiki]]
|
||||
** [[TiddlyWiki Drag and Drop Interoperability]]
|
||||
** [[Javascript Widget Tutorial]]
|
||||
** [[Using TiddlyWiki as a library in another Node.js application]]
|
||||
* The original developer documentation from https://tiddlywiki.com:
|
||||
** [[TiddlyWiki for Developers]]
|
||||
** [[TiddlyWiki Coding Style Guidelines]]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
created: 20190202035524804
|
||||
modified: 20221029161501848
|
||||
modified: 20240302110658300
|
||||
tags:
|
||||
title: Javascript Widget Tutorial
|
||||
type: text/vnd.tiddlywiki
|
||||
|
@ -9,21 +9,23 @@ This tutorial provides step-by-step, interactive examples of how to write code f
|
|||
|
||||
Intended audience:
|
||||
|
||||
# Those who know tiddlywiki well and know programming and javascript and want to write their own widget. I don't make any effort to explain javascript here. For that you will need other resources.
|
||||
# Those who know tiddlywiki well and know programming and javascript and want to write their own widget.
|
||||
# Those who know tiddlywiki well and don't know javascript, but want to understand more about how tiddlywiki works. You should be able to skim through and interact with the demos and learn something.
|
||||
|
||||
!The tutorial
|
||||
*[[Undefined widget tutorial]]
|
||||
*[[Do nothing widget tutorial]]
|
||||
*[[Hello World widget tutorial]]
|
||||
*[[Widget refresh tutorial part I]]
|
||||
*[[Widget refresh tutorial part II]]
|
||||
*[[Widget refresh tutorial part III]]
|
||||
*[[Widget attributes tutorial part I]]
|
||||
*[[Widget attributes tutorial part II]]
|
||||
*[[Child widgets tutorial]]
|
||||
We don't make any effort to explain javascript here. For that you will need other resources, like [[MDN|https://developer.mozilla.org/en-US/docs/Web/JavaScript]].
|
||||
|
||||
! Notes
|
||||
!! The tutorial
|
||||
* [[Undefined widget tutorial]]
|
||||
* [[Do nothing widget tutorial]]
|
||||
* [[Hello World widget tutorial]]
|
||||
* [[Widget refresh tutorial part I]]
|
||||
* [[Widget refresh tutorial part II]]
|
||||
* [[Widget refresh tutorial part III]]
|
||||
* [[Widget attributes tutorial part I]]
|
||||
* [[Widget attributes tutorial part II]]
|
||||
* [[Child widgets tutorial]]
|
||||
|
||||
!! Notes
|
||||
|
||||
tiddlywiki doesn't support dynamically reloading javascript. If you change a javascript tiddler, then you need to save and reload the wiki before the changes will take affect.
|
||||
|
||||
|
@ -31,7 +33,11 @@ To avoid the need for such reloads, the excellent [[innerwiki plugin|https://tid
|
|||
|
||||
Without the need for reloads, a tiddlywiki instance with the [[innerwiki plugin|https://tiddlywiki.com/prerelease/plugins/tiddlywiki/innerwiki/]] installed works great as a playground for interacting with tiddlywiki javascript.
|
||||
|
||||
! Other documentation on writing TW widgets
|
||||
!! Other documentation on writing TW widgets
|
||||
|
||||
*WidgetModules
|
||||
*[[Widgets]]
|
||||
* WidgetModules
|
||||
* [[Widgets]]
|
||||
|
||||
!! Full API doc
|
||||
|
||||
[[Github Pages of TW5-Typed|https://tiddly-gittly.github.io/TW5-Typed/api/classes/modules_widgets.widget]]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
modified: 20160305222940000
|
||||
created: 20160111034749658
|
||||
modified: 20240302110735646
|
||||
title: Using ES2016 for Writing Plugins
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
|
@ -7,7 +7,15 @@ With the advent of ES2015 (also known as ES6) and the availability of [[Babel.js
|
|||
|
||||
Please understand how the PluginMechanism works since this is all about writing a plugin using Babel to compile the output that will be included in the final TiddlyWiki (for example [[TiddlyWiki on Node.js]]).
|
||||
|
||||
!! Installing and Configuring Babel
|
||||
!! Use a framework
|
||||
|
||||
It is recommended to use develop toolkit managed by community. For example,
|
||||
|
||||
# [[Modern.TiddlyDev|https://tiddly-gittly.github.io/Modern.TiddlyDev/]]
|
||||
|
||||
They are known as "~JavaScript Meta-Framework". With them, you can start developing in a few minutes, without hours of configuration and debugging the build steps.
|
||||
|
||||
!! Installing and Configuring Babel by yourself
|
||||
|
||||
You can install Babel using
|
||||
|
||||
|
@ -33,7 +41,9 @@ Inside your plugin project edit the file `.babelrc` and enter the following:
|
|||
|
||||
<<.tip "I found it easier to manage my plugins as if they were ''npm'' modules complete with a `package.json` that compiles the output via `npm run build`. See [[npm-scripts documentation|https://docs.npmjs.com/misc/scripts]] for details.">>
|
||||
|
||||
!! Compiling the Output
|
||||
Another benefit of using such a "Meta-Framework" is that you can easily maintain your configuration, you will find it difficult to upgrade those config files after several months.
|
||||
|
||||
!!! Compiling the Output
|
||||
|
||||
Pick a folder to store the ES2015 JavaScript and a folder to output the TiddlyWiki ready JavaScript. In this example I will use `src` and `lib` respectively. With Babel installed and working I can compile all the JavaScript in the `src` folder to the `lib` folder by running this command:
|
||||
|
||||
|
@ -43,7 +53,7 @@ $ babel src -d lib
|
|||
|
||||
<<.warning "Babel will //not// copy over non-JavaScript files. It is up to the developer to include all the supporting files themselves. Babel only converts the ~JavaScript files (ending in `.js`) from the `src` folder to the `lib` folder.">>
|
||||
|
||||
!! Imports and Exports
|
||||
!!! Imports and Exports
|
||||
|
||||
In a plugin written pre-ES2015 one would `require` a module through TiddlyWiki like so:
|
||||
|
||||
|
@ -71,7 +81,7 @@ export { MyWidget as mywidget };
|
|||
|
||||
It is important to understand that in ES2016 the ''default'' export is not supported in TiddlyWiki. This is mostly because the core code expects specific properties to be attached to the `exports` variable. Bable's `export` conversion plays well with this //except// with the default export.
|
||||
|
||||
!! Classes
|
||||
!!! Classes
|
||||
|
||||
In the example of a widget ES2016 plays well with class inheritance. To contrast the typical Widget definition would look something like this:
|
||||
|
||||
|
@ -104,7 +114,7 @@ class NameWidget extends Widget {
|
|||
}
|
||||
```
|
||||
|
||||
!!! Non Class Modules
|
||||
!!!! Non Class Modules
|
||||
|
||||
For non class modules you can use the `export` keyword. Here is a simple [[Startup Module|ModuleType]]:
|
||||
|
||||
|
@ -122,11 +132,11 @@ export const params = {};
|
|||
export function run() {…}
|
||||
```
|
||||
|
||||
!! Polyfills
|
||||
!!! Polyfills
|
||||
|
||||
ES2015 comes with some features that are part of the JavaScript core objects. These are not supported by all browsers. To use these features in [[most browsers|BrowserCompatibility]] you will need a <<.def "polyfill">>. Babel has a polyfill package that you can include. See [[Adding Babel Polyfill to TiddlyWiki]] for how to accomplish this.
|
||||
|
||||
!! Example
|
||||
!!! Example
|
||||
|
||||
Here is an example ES2015 plugin/widget that will show the time and update it:
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
title: Using TiddlyWiki as a library in another Node.js application
|
||||
|
||||
Node.js applications can include TiddlyWiki as a library so that they can use wikitext rendering.
|
||||
|
||||
See the demo at https://github.com/Jermolene/TiddlyWiki5DemoApp
|
|
@ -0,0 +1,6 @@
|
|||
created: 20240311150859344
|
||||
modified: 20240311150859344
|
||||
title: $:/themes/tiddlywiki/vanilla/options/sidebarlayout
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
fluid-fixed
|
|
@ -1,6 +0,0 @@
|
|||
created: 20160511060801385
|
||||
list: Reference JSONTiddlers
|
||||
modified: 20160511060801385
|
||||
title: $:/StoryList
|
||||
type: text/vnd.tiddlywiki
|
||||
|
|
@ -47,6 +47,7 @@
|
|||
"it-IT",
|
||||
"ja-JP",
|
||||
"ko-KR",
|
||||
"mk-MK",
|
||||
"nl-NL",
|
||||
"pa-IN",
|
||||
"pt-PT",
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
title: $:/config/Performance/Instrumentation
|
||||
text: yes
|
|
@ -12,6 +12,7 @@ title: Output
|
|||
+
|
||||
title: Definitions
|
||||
|
||||
\whitespace trim
|
||||
<$set name="one" value="elephant">
|
||||
<$set name="two" value="giraffe">
|
||||
</$set>
|
||||
|
|
|
@ -14,6 +14,7 @@ title: Output
|
|||
+
|
||||
title: Definitions
|
||||
|
||||
\whitespace trim
|
||||
\define name() Bugs Bunny
|
||||
\procedure address()
|
||||
Bunny Hill
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
title: Macros/unusedtitle/basic-draft-exists
|
||||
description: test <<unusedtitle>> with basic macro parameters but they are empty
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Draft of 'test'
|
||||
draft.of: test
|
||||
draft.title: test
|
||||
|
||||
+
|
||||
title: Draft of 'asdf 0'
|
||||
draft.of: asdf 0
|
||||
draft.title: asdf 0
|
||||
|
||||
+
|
||||
title: Output
|
||||
|
||||
<!-- hanled in wiki.js -->
|
||||
<<unusedtitle baseName:"test">>
|
||||
|
||||
<!-- handled in unusedtitle.js -->
|
||||
<<unusedtitle baseName:"asdf" separator:" " template:"$basename$$separator$$count:1$">>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>test 1</p><p>asdf 1</p>
|
|
@ -0,0 +1,23 @@
|
|||
title: Macros/unusedtitle/basic-params-empty-tiddler-exists
|
||||
description: test <<unusedtitle>> with basic macro parameters but they are empty
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: New Tiddler
|
||||
|
||||
+
|
||||
title: Output
|
||||
|
||||
<!-- hanled in wiki.js -->
|
||||
<<unusedtitle separator:"">>
|
||||
|
||||
<!-- handled in unusedtitle.js -->
|
||||
<<unusedtitle baseName:"">>
|
||||
|
||||
<!-- handled in wiki.js -->
|
||||
<<unusedtitle template:"">>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>New Tiddler 1</p><p>New Tiddler 1</p><p>New Tiddler 1</p>
|
|
@ -0,0 +1,20 @@
|
|||
title: Macros/unusedtitle/basic-params-empty
|
||||
description: test <<unusedtitle>> with basic macro parameters but they are empty
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
<!-- hanled in wiki.js -->
|
||||
<<unusedtitle separator:"">>
|
||||
|
||||
<!-- handled in unusedtitle.js -->
|
||||
<<unusedtitle baseName:"">>
|
||||
|
||||
<!-- handled in wiki.js -->
|
||||
<<unusedtitle template:"">>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>New Tiddler</p><p>New Tiddler</p><p>New Tiddler</p>
|
|
@ -0,0 +1,28 @@
|
|||
title: Macros/unusedtitle/basic-params-tiddlers-exist
|
||||
description: test <<unusedtitle>> with basic macro parameters, where new-name tiddlers already exist
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: New Tiddler
|
||||
|
||||
+
|
||||
title: anotherBase
|
||||
|
||||
+
|
||||
title: About
|
||||
|
||||
+
|
||||
title: Output
|
||||
|
||||
<<unusedtitle>>
|
||||
|
||||
<<unusedtitle separator:"-">>
|
||||
|
||||
<<unusedtitle baseName:"anotherBase">>
|
||||
|
||||
<<unusedtitle baseName:"About" separator:"-">>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>New Tiddler 1</p><p>New Tiddler-1</p><p>anotherBase 1</p><p>About-1</p>
|
|
@ -0,0 +1,20 @@
|
|||
title: Macros/unusedtitle/basic-params
|
||||
description: test <<unusedtitle>> with basic macro parameters
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
<<unusedtitle>>
|
||||
|
||||
<!-- EDGECASE: separator is ignored if tiddler title does not exist -->
|
||||
<<unusedtitle separator:"-">>
|
||||
|
||||
<<unusedtitle baseName:"anotherBase">>
|
||||
|
||||
<<unusedtitle baseName:"About" separator:"-">>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>New Tiddler</p><p>New Tiddler</p><p>anotherBase</p><p>About</p>
|
|
@ -0,0 +1,50 @@
|
|||
title: Macros/unusedtitle/template-empty-params-tiddler-exist
|
||||
description: test <<unusedtitle>> with templates where parameters are empty
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: New Tiddler
|
||||
|
||||
+
|
||||
title: xxx
|
||||
|
||||
+
|
||||
title: 00-New Tiddler
|
||||
|
||||
+
|
||||
title: 0000 asdf
|
||||
|
||||
+
|
||||
title: 0001 asdf
|
||||
|
||||
+
|
||||
title: 0000 abc
|
||||
|
||||
+
|
||||
title: Output
|
||||
|
||||
<!-- empty template - no template handling at all -->
|
||||
<<unusedtitle template:"">>
|
||||
|
||||
<!--
|
||||
uses basename AND separator if tiddler exists
|
||||
because it uses default naming build rules - no template handling
|
||||
-->
|
||||
<<unusedtitle template:"" separator:"-y-" baseName:"xxx">>
|
||||
|
||||
<<unusedtitle baseName:"" template:"$count:2$-$basename$">>
|
||||
|
||||
<!--
|
||||
EDGECASE: if separator is empty it will be initialized with a single space " "
|
||||
to have the same rules for templates and default title creation
|
||||
-->
|
||||
<<unusedtitle baseName:"asdf" separator:"" template:"$count:4$$separator$$basename$">>
|
||||
|
||||
<!-- separator = " " -->
|
||||
<<unusedtitle baseName:"abc" separator:" " template:"$count:4$$separator$$basename$">>
|
||||
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>New Tiddler 1</p><p>xxx-y-1</p><p>01-New Tiddler</p><p>0002 asdf</p><p>0001 abc</p>
|
|
@ -0,0 +1,24 @@
|
|||
title: Macros/unusedtitle/template-empty-params
|
||||
description: test <<unusedtitle>> with templates where parameters are empty
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
<!-- empty template -->
|
||||
<<unusedtitle template:"">>
|
||||
|
||||
<!--
|
||||
uses basename but ignores separator,
|
||||
because it uses default naming build rules -- no template handling is active
|
||||
-->
|
||||
<<unusedtitle template:"" separator:"-x-" baseName:"xxx">>
|
||||
|
||||
<<unusedtitle baseName:"" template:"$count:2$-$basename$">>
|
||||
|
||||
<<unusedtitle baseName:"asdf" separator:"" template:"$count:4$$separator$$basename$">>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>New Tiddler</p><p>xxx</p><p>00-New Tiddler</p><p>0000 asdf</p>
|
|
@ -0,0 +1,28 @@
|
|||
title: Macros/unusedtitle/template
|
||||
description: test <<unusedtitle>> with templates
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
<!-- empty template - standard rules are used -->
|
||||
<<unusedtitle template:"">>
|
||||
|
||||
<<unusedtitle template:"count-missing">>
|
||||
|
||||
<<unusedtitle template:"$count:2$-new">>
|
||||
|
||||
<!-- template is handled using $tw.utils.formatTitleString -->
|
||||
<<unusedtitle baseName:"base" template:"$count:2$-$basename$">>
|
||||
|
||||
<<unusedtitle baseName:"" template:"$count:2$-$basename$">>
|
||||
|
||||
<!-- UPPERCASES are intentional in template strings. They should be case-insensistive -->
|
||||
<<unusedtitle baseName:"asdf" separator:"-" template:"$coUNT:2$$sepaRATor$$baseName$">>
|
||||
|
||||
<<unusedtitle baseName:"asdf" separator:"" template:"$count:2$$separator$$basename$">>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>New Tiddler</p><p>count-missing</p><p>00-new</p><p>00-base</p><p>00-New Tiddler</p><p>00-asdf</p><p>00 asdf</p>
|
|
@ -0,0 +1,25 @@
|
|||
title: Transclude/Procedures/Whitespace2
|
||||
description: Procedures should inherit whitespace settings from definition site
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\procedure testproc()
|
||||
This is a sentence
|
||||
\end
|
||||
|
||||
\define testmacro()
|
||||
This is a sentence
|
||||
\end
|
||||
This is a sentence
|
||||
[<<testproc>>]
|
||||
[<<testmacro>>]
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>This is a sentence
|
||||
[This is a sentence ]
|
||||
[This is a sentence ]
|
||||
</p>
|
|
@ -0,0 +1,30 @@
|
|||
title: Transclude/Procedures/Whitespace3
|
||||
description: Procedures should inherit whitespace settings from definition site
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\import Definitions
|
||||
|
||||
This is a sentence
|
||||
[<<testproc>>]
|
||||
[<<testmacro>>]
|
||||
|
||||
+
|
||||
title: Definitions
|
||||
|
||||
\procedure testproc()
|
||||
This is a sentence
|
||||
\end
|
||||
|
||||
\define testmacro()
|
||||
This is a sentence
|
||||
\end
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>This is a sentence
|
||||
[This is a sentence ]
|
||||
[This is a sentence ]
|
||||
</p>
|
|
@ -0,0 +1,176 @@
|
|||
/*\
|
||||
title: test-action-deletefield.js
|
||||
type: application/javascript
|
||||
tags: [[$:/tags/test-spec]]
|
||||
|
||||
Tests <$action-deletefield />.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/* jslint node: true, browser: true */
|
||||
/* eslint-env node, browser, jasmine */
|
||||
/* eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/
|
||||
/* global $tw, require */
|
||||
"use strict";
|
||||
|
||||
describe("<$action-deletefield /> tests", function() {
|
||||
|
||||
const TEST_TIDDLER_TITLE = "TargetTiddler";
|
||||
const TEST_TIDDLER_MODIFIED = "20240313114828368";
|
||||
|
||||
function setupWiki(condition, targetField, wikiOptions) {
|
||||
// Create a wiki
|
||||
var wiki = new $tw.Wiki({});
|
||||
var tiddlers = [{
|
||||
title: "Root",
|
||||
text: "Some dummy content"
|
||||
}];
|
||||
var tiddler;
|
||||
if(condition.targetTiddlerExists) {
|
||||
var fields = {
|
||||
title: TEST_TIDDLER_TITLE,
|
||||
};
|
||||
if(condition.modifiedFieldExists) {
|
||||
fields.modified = TEST_TIDDLER_MODIFIED;
|
||||
}
|
||||
if(condition.targetFieldExists) {
|
||||
fields[targetField] = "some text";
|
||||
}
|
||||
var tiddler = new $tw.Tiddler(fields);
|
||||
tiddlers.push(tiddler);
|
||||
}
|
||||
wiki.addTiddlers(tiddlers);
|
||||
wiki.addIndexersToWiki();
|
||||
var widgetNode = wiki.makeTranscludeWidget("Root",{document: $tw.fakeDocument, parseAsInline: true});
|
||||
var container = $tw.fakeDocument.createElement("div");
|
||||
widgetNode.render(container,null);
|
||||
return {
|
||||
wiki: wiki,
|
||||
widgetNode: widgetNode,
|
||||
contaienr: container,
|
||||
tiddler: tiddler,
|
||||
};
|
||||
}
|
||||
|
||||
function generateTestConditions() {
|
||||
var conditions = [];
|
||||
|
||||
$tw.utils.each([true, false], function(tiddlerArgumentIsPresent) {
|
||||
$tw.utils.each([true, false], function(targetTiddlerExists) {
|
||||
$tw.utils.each([true, false], function(targetFieldExists) {
|
||||
$tw.utils.each([true, false], function(fieldArgumentIsUsed) {
|
||||
$tw.utils.each([true, false], function(modifiedFieldExists) {
|
||||
$tw.utils.each(["", "yes", "no"], function(timestampArgument) {
|
||||
conditions.push({
|
||||
tiddlerArgumentIsPresent: tiddlerArgumentIsPresent,
|
||||
targetTiddlerExists: targetTiddlerExists,
|
||||
targetFieldExists: targetFieldExists,
|
||||
fieldArgumentIsUsed: fieldArgumentIsUsed,
|
||||
modifiedFieldExists: modifiedFieldExists,
|
||||
timestampArgument: timestampArgument,
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return conditions;
|
||||
}
|
||||
|
||||
function generateActionWikitext(condition, targetField) {
|
||||
var actionPieces = [
|
||||
"<$action-deletefield",
|
||||
(condition.tiddlerArgumentIsPresent ? "$tiddler='" + TEST_TIDDLER_TITLE + "'" : ""),
|
||||
(condition.fieldArgumentIsUsed ? "$field='" + targetField + "'" : targetField),
|
||||
(condition.timestampArgument !== "" ? "$timestamp='" + condition.timestampArgument + "'" : ""),
|
||||
"/>",
|
||||
];
|
||||
|
||||
return actionPieces.join(" ");
|
||||
}
|
||||
|
||||
function generateTestContext(action, tiddler) {
|
||||
var expectationContext = "action: " + action + "\ntiddler:\n\n";
|
||||
if(tiddler) {
|
||||
expectationContext += tiddler.getFieldStringBlock({exclude: ["text"]});
|
||||
if(tiddler.text) {
|
||||
expectationContext += "\n\n" + tiddler.text;
|
||||
}
|
||||
expectationContext += "\n\n";
|
||||
} else {
|
||||
expectationContext += "null";
|
||||
}
|
||||
|
||||
return expectationContext;
|
||||
}
|
||||
|
||||
it("should correctly delete fields", function() {
|
||||
var fields = ['caption', 'description', 'text'];
|
||||
|
||||
var conditions = generateTestConditions();
|
||||
|
||||
$tw.utils.each(conditions, function(condition) {
|
||||
$tw.utils.each(fields, function(field) {
|
||||
var info = setupWiki(condition, field);
|
||||
var originalTiddler = info.tiddler;
|
||||
|
||||
var invokeActions = function(actions) {
|
||||
info.widgetNode.invokeActionString(actions,info.widgetNode,null,{
|
||||
currentTiddler: TEST_TIDDLER_TITLE,
|
||||
});
|
||||
};
|
||||
|
||||
var action = generateActionWikitext(condition,field);
|
||||
|
||||
invokeActions(action);
|
||||
|
||||
var testContext = generateTestContext(action,originalTiddler);
|
||||
|
||||
var tiddler = info.wiki.getTiddler(TEST_TIDDLER_TITLE);
|
||||
if(originalTiddler) {
|
||||
// assert that the tiddler doesn't have the target field anymore
|
||||
expect(tiddler.hasField(field)).withContext(testContext).toBeFalsy();
|
||||
|
||||
var targetFieldWasPresent = originalTiddler.hasField(field);
|
||||
var updateTimestamps = condition.timestampArgument !== "no";
|
||||
|
||||
// "created" should exist if it did beforehand, or if the tiddler changed and we asked the widget to update timestamps
|
||||
var createdFieldShouldExist = originalTiddler.hasField("created") || (targetFieldWasPresent && updateTimestamps);
|
||||
|
||||
// "created" should change only if it didn't exist beforehand and the tiddler changed and we asked the widget to update timestamps
|
||||
var createdFieldShouldChange = !originalTiddler.hasField("created") && (targetFieldWasPresent && updateTimestamps);
|
||||
|
||||
// "modified" should exist if it did beforehand, or if the tiddler changed and we asked the widget to update timestamps
|
||||
var modifiedFieldShouldExist = originalTiddler.hasField("modified") || (targetFieldWasPresent && updateTimestamps);
|
||||
|
||||
// "modified" should change if the tiddler changed and we asked the widget to update timestamps
|
||||
var modifiedFieldShouldChange = targetFieldWasPresent && updateTimestamps;
|
||||
|
||||
expect(tiddler.hasField("created")).withContext(testContext).toBe(createdFieldShouldExist);
|
||||
expect(tiddler.hasField("modified")).withContext(testContext).toBe(modifiedFieldShouldExist);
|
||||
|
||||
if(createdFieldShouldChange) {
|
||||
expect(tiddler.fields.created).withContext(testContext).not.toEqual(originalTiddler.fields.created);
|
||||
} else {
|
||||
expect(tiddler.fields.created).withContext(testContext).toEqual(originalTiddler.fields.created);
|
||||
}
|
||||
|
||||
if(modifiedFieldShouldChange) {
|
||||
expect(tiddler.fields.modified).withContext(testContext).not.toEqual(originalTiddler.fields.modified);
|
||||
} else {
|
||||
expect(tiddler.fields.modified).withContext(testContext).toEqual(originalTiddler.fields.modified);
|
||||
}
|
||||
} else {
|
||||
// assert that the tiddler didn't get created if it didn't exist already
|
||||
expect(tiddler).withContext(testContext).toBeUndefined();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
|
@ -0,0 +1,148 @@
|
|||
/*\
|
||||
title: test-backtranscludes.js
|
||||
type: application/javascript
|
||||
tags: $:/tags/test-spec
|
||||
|
||||
Tests the backtranscludes mechanism.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
describe('Backtranscludes tests', function() {
|
||||
describe('a tiddler with no transcludes to it', function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: ''});
|
||||
|
||||
it('should have no backtranscludes', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('A tiddler added to the wiki with a transclude to it', function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: 'something'});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A transclude to {{TestIncoming}}'});
|
||||
|
||||
it('should have a backtransclude', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
|
||||
});
|
||||
});
|
||||
|
||||
describe('A tiddler transclude with template will still use the tiddler as result.', function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: 'something'});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A transclude to {{TestIncoming||$:/core/ui/TagTemplate}}'});
|
||||
|
||||
it('should have a backtransclude', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
|
||||
});
|
||||
});
|
||||
|
||||
describe('A tiddler that has a transclude added to it later', function() {
|
||||
it('should have an additional backtransclude', function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: ''});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A transclude to {{TestIncoming}}'});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing2',
|
||||
text: 'Nothing yet!'});
|
||||
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing2',
|
||||
text: 'Updated with transclude to {{TestIncoming}}'});
|
||||
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing,TestOutgoing2');
|
||||
});
|
||||
});
|
||||
|
||||
describe('A tiddler that has a transclude remove from it later', function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: ''});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A transclude to {{TestIncoming}}'});
|
||||
|
||||
it('should have one fewer backtransclude', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'No transclude to ~TestIncoming'});
|
||||
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('A tiddler transcludeing to another that gets renamed', function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: ''});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A transclude to {{TestIncoming}}'});
|
||||
|
||||
it('should have its name changed in the backtranscludes', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
|
||||
|
||||
wiki.renameTiddler('TestOutgoing', 'TestExtroverted');
|
||||
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestExtroverted');
|
||||
});
|
||||
});
|
||||
|
||||
describe('A tiddler transcludeing to another that gets deleted', function() {
|
||||
var wiki = new $tw.Wiki();
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestIncoming',
|
||||
text: ''});
|
||||
|
||||
wiki.addTiddler({
|
||||
title: 'TestOutgoing',
|
||||
text: 'A transclude to {{TestIncoming}}'});
|
||||
|
||||
it('should be removed from backtranscludes', function() {
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('TestOutgoing');
|
||||
|
||||
wiki.deleteTiddler('TestOutgoing');
|
||||
|
||||
expect(wiki.filterTiddlers('TestIncoming +[backtranscludes[]]').join(',')).toBe('');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
|
@ -22,6 +22,7 @@
|
|||
"it-IT",
|
||||
"ja-JP",
|
||||
"ko-KR",
|
||||
"mk-MK",
|
||||
"nl-NL",
|
||||
"pa-IN",
|
||||
"pl-PL",
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
list: HelloThere
|
||||
title: $:/StoryList
|
||||
type: text/vnd.tiddlywiki
|
|
@ -0,0 +1,12 @@
|
|||
created: 20240313100515958
|
||||
modified: 20240313103959789
|
||||
tags: Editions
|
||||
title: TiddlyWiki Docs PR Maker
|
||||
|
||||
''~TiddlyWiki Docs PR Maker'' is a special edition of tiddlywiki.com designed to help you contribute to and improve the documentation made by [[@saqimtiaz|https://github.com/saqimtiaz/]].
|
||||
|
||||
https://saqimtiaz.github.io/tw5-docs-pr-maker/
|
||||
|
||||
All changes made to the documentation can be very easily submitted to GitHub -- the pull request will be automatically made, hence the "PR Maker" name of the edition.
|
||||
|
||||
You will need to create a free ~GitHub account and sign the [[Contributor License Agreement]] before using the Docs PR Maker. You can find more details about contributing to the documentation [[here|Improving TiddlyWiki Documentation]].
|
|
@ -1,5 +1,5 @@
|
|||
created: 20140820151051019
|
||||
modified: 20190115165616599
|
||||
modified: 20240313114828368
|
||||
tags: Community
|
||||
title: Improving TiddlyWiki Documentation
|
||||
type: text/vnd.tiddlywiki
|
||||
|
@ -8,9 +8,29 @@ Anyone can submit improvements to the TiddlyWiki documentation that appears on h
|
|||
|
||||
<<.warning """If you already know GitHub, note that documentation updates must be directed to the `tiddlywiki-com` branch""">>
|
||||
|
||||
! Before you start editing
|
||||
|
||||
# Read and observe the [[Documentation Style Guide]]
|
||||
# Create an account on https://github.com if you don't already have one
|
||||
# If you haven't done so already, sign the [[Contributor License Agreement]] as described in [[Signing the Contributor License Agreement]]
|
||||
|
||||
! Editing and submitting your edits
|
||||
|
||||
You can choose to edit the documentation using the [[TiddlyWiki Docs PR Maker]] or directly in ~GitHub. The first method is especially recommended for users not familiar with ~GitHub.
|
||||
|
||||
!! Using [[Docs PR Maker|TiddlyWiki Docs PR Maker]] edition
|
||||
|
||||
# Go to https://saqimtiaz.github.io/tw5-docs-pr-maker/ or click the link displayed in the ribbon underneath the title when editing a tiddler on tiddlywiki.com
|
||||
# Go through the quick introduction where you will need to provide your ~GitHub username and a ~GitHub access token (you will be guided in creating one)
|
||||
# Edit or create tiddlers to update the documentation, the wiki will keep track of all changes
|
||||
# Click the "Submit updates" button and check if all the tiddlers that you edited are included in the submission; if not, drag them into the box
|
||||
# Provide a concise title and description of your changes (see the rules about titling pull requests in [[contribution guidelines|Contributing]])
|
||||
# Submit your changes:
|
||||
** "Save as draft" will create a //draft// pull request, this is useful if you don't want the changes to be merged //yet//, because you want to work on it later or discuss it first
|
||||
** "Submit documentation update" will create a pull request, which will be immediately available for review and merging
|
||||
|
||||
!! Using ~GitHub
|
||||
|
||||
# On https://tiddlywiki.com, click "edit" on the tiddler you want to improve
|
||||
# You should see a pink banner with the text: //Can you help us improve this documentation? Find out how to edit this tiddler on ~GitHub//
|
||||
# Click on the external link ...''this tiddler on ~GitHub''
|
||||
|
|
|
@ -3,7 +3,7 @@ modified: 20210106151027439
|
|||
tags: [[Community Plugins]]
|
||||
title: Disqus comments plugin by bimlas
|
||||
type: text/vnd.tiddlywiki
|
||||
url: https://bimlas.gitlab.io/tw5-disqus/
|
||||
url: https://bimlas.github.io/tw5-disqus/
|
||||
|
||||
Use this plugin to give your visitors the opportunity to comment on your tiddlers without changing the wiki itself.
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ modified: 20210106151027488
|
|||
tags: [[Community Plugins]]
|
||||
title: Kin filter operator by bimlas
|
||||
type: text/vnd.tiddlywiki
|
||||
url: https://bimlas.gitlab.io/tw5-kin-filter/
|
||||
url: https://bimlas.github.io/tw5-kin-filter/
|
||||
|
||||
The purpose of the kin operator with examples:
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ modified: 20210106151027508
|
|||
tags: [[Community Plugins]]
|
||||
title: Locator plugin by bimlas
|
||||
type: text/vnd.tiddlywiki
|
||||
url: https://bimlas.gitlab.io/tw5-locator/
|
||||
url: https://bimlas.github.io/tw5-locator/
|
||||
|
||||
For those who use many tags or store many different topics in a common wiki the Locator plugin is a table of contents widget and an enhanced search engine that gives you the opportunity to filter results by related tags. Unlike table of contents, standard search and list of tags, this plugin offers these features in an organic, collaborative way.
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
created: 20240309135835396
|
||||
modified: 20240309142156125
|
||||
tags: Concepts
|
||||
title: Bags and Recipes
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The bags and recipes model is a reference architecture for how tiddlers can be shared between multiple wikis. It was first introduced by TiddlyWeb in 2008.
|
||||
|
||||
The principles of bags and recipes can be simply stated:
|
||||
|
||||
# Tiddlers are stored in named "bags"
|
||||
# Bags have access controls that determines which users can read or write to them
|
||||
# Recipes are named lists of bags, ordered from lowest priority to highest
|
||||
# The tiddlers within a recipe are accumulated in turn from each bag in the recipe in order of increasing priority. Thus, if there are multiple tiddlers with the same title in different bags then the one from the highest priority bag will be used as the recipe tiddler
|
||||
# Wikis are composed by splicing the tiddlers from the corresponding recipe into the standard TW5 HTML template
|
||||
|
||||
A very simple example of the recipe/bag model might be for a single user who maintains the following bags:
|
||||
|
||||
* ''recipes'' - tiddlers related to cooking recipes
|
||||
* ''work'' - tiddlers related to work
|
||||
* ''app'' - common tiddlers for customising TiddlyWiki
|
||||
|
||||
Those bags would be used with the following recipes:
|
||||
|
||||
* ''recipes'' --> recipes, app - wiki for working with recipes, with common custom components
|
||||
* ''work'' --> work, app - wiki for working with work, with common custom components
|
||||
* ''app'' --> app - wiki for maintaining custom components
|
||||
|
||||
All of this will work dynamically, so changes to the app bag will instantly ripple into the affected hosted wikis.
|
||||
|
||||
A more complex example might be for a teacher working with a group of students:
|
||||
|
||||
* ''student-{name}'' bag for each students work
|
||||
* ''teacher-course'' bag for the coursework, editable by the teacher
|
||||
* ''teacher-tools'' bag for custom tools used by the teacher
|
||||
|
||||
Those bags would be exposed through the following hosted wikis:
|
||||
|
||||
* ''student-{name}'' hosted wiki for each students work, including the coursework material
|
||||
* ''teacher-course'' hosted wiki for the coursework, editable by the teacher
|
||||
* ''teacher'' hosted wiki for the teacher, bringing together all the bags, giving them an overview of all the students work
|
||||
|
|
@ -2,8 +2,9 @@ created: 201308300841
|
|||
modified: 20170127221451610
|
||||
tags: Definitions
|
||||
title: TiddlyWeb
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
TiddlyWeb is a reference implementation for an interface to put [[Tiddlers]] on the web.
|
||||
TiddlyWeb is a reference implementation for an interface to put [[Tiddlers]] on the web using the [[Bags and Recipes]] model.
|
||||
|
||||
It was created by a team led by Chris Dent at [[Osmosoft]] under [[BT]] from 2008 to 2012.
|
||||
|
||||
|
@ -16,5 +17,3 @@ Other implementations of the API include:
|
|||
* [[TiddlyWiki App Engine Server|https://github.com/rsc/tiddly]], a 300-line Go implementation from Russ Cox
|
||||
* [[TiddlyWiki 5 server module|https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/commands/server.js]], the bare-bones subset of the API implemented in TiddlyWiki version 5 for Node.js
|
||||
* [[tiddly-wiki-server|https://github.com/nathanielknight/tiddly-wiki-server]], an implementation based on Rust and SQLite
|
||||
|
||||
As of early 2017, none is currently as complete as TiddlyWeb itself.
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
created: 20240309100338678
|
||||
modified: 20240309135821423
|
||||
tags: Definitions
|
||||
title: TiddlyWebAdaptor
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
TiddlyWebAdaptor is a component of [[TiddlyWiki on Node.js]]. It provides the means to synchronise changes to tiddlers from the browser to a server, and from the server to the browser. It can be found in the plugin [[$:/plugins/tiddlywiki/tiddlyweb]].
|
||||
|
||||
TiddlyWebAdaptor was designed to be compatible both with TiddlyWeb and with TiddlyWiki's own built-in server mechanism. The [[Bags and Recipes]] model is fully supported by [[TiddlyWeb]], but TiddlyWiki's built-in server only supports a simplified model with a single bag and a single recipe.
|
|
@ -0,0 +1,13 @@
|
|||
created: 20211002204500000
|
||||
tags: [[Filter Operators]]
|
||||
title: backtranscludes Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: backtranscludes
|
||||
op-purpose: find the titles that transcludes to each input title
|
||||
op-input: a [[selection of titles|Title Selection]]
|
||||
op-parameter: none
|
||||
op-output: any non-[[system|SystemTiddlers]] titles that contain [[transclusion|Transclusion]] to the input titles
|
||||
|
||||
Each input title is processed in turn. The corresponding tiddler's list of backtranscludes is generated, sorted alphabetically by title, and then [[dominantly appended|Dominant Append]] to the operator's overall output.
|
||||
|
||||
<<.operator-examples "backtranscludes">>
|
|
@ -0,0 +1,7 @@
|
|||
tags: [[backtranscludes Operator]] [[Operator Examples]]
|
||||
title: backtranscludes Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-example 1 "[[Motovun Jack.jpg]backtranscludes[]]">>
|
||||
|
||||
<<.operator-example 2 "[[Transclusion]backtranscludes[]]">>
|
|
@ -0,0 +1,9 @@
|
|||
created: 20240308122813807
|
||||
modified: 20240308122916812
|
||||
tags: [[Operator Examples]] [[sha256 Operator]]
|
||||
title: sha256 Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-example 1 "[[test]sha256[]]">>
|
||||
|
||||
<<.operator-example 2 "[[test]sha256[64]]">>
|
|
@ -0,0 +1,5 @@
|
|||
tags: [[transcludes Operator]] [[Operator Examples]]
|
||||
title: transcludes Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-example 1 "[[Images in WikiText]transcludes[]]">>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue