1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 07:13:15 +00:00

Merge branch 'master' into publishing-framework

This commit is contained in:
jeremy@jermolene.com 2021-06-01 13:17:47 +01:00
commit f1d76a1eee
257 changed files with 1783 additions and 480 deletions

View File

@ -130,7 +130,7 @@ Saving/TiddlySpot/Filename: Upload Filename
Saving/TiddlySpot/Heading: ~TiddlySpot
Saving/TiddlySpot/Hint: //The server URL defaults to `http://<wikiname>.tiddlyspot.com/store.cgi` and can be changed to use a custom server address, e.g. `http://example.com/store.php`.//
Saving/TiddlySpot/Password: Password
Saving/TiddlySpot/ReadOnly: Note that [[TiddlySpot|http://tiddlyspot.com]] no longer allows the creation of new sites. For new sites you can use [[TiddlyHost|https://tiddlyhost.com]], a new hosting service which replaces ~TiddlySpot.
Saving/TiddlySpot/ReadOnly: Note that [[TiddlySpot|http://tiddlyspot.com]] no longer allows the creation of new sites. For new sites, you can use [[TiddlyHost|https://tiddlyhost.com]], a new hosting service that replaces ~TiddlySpot.
Saving/TiddlySpot/ServerURL: Server URL
Saving/TiddlySpot/UploadDir: Upload Directory
Saving/TiddlySpot/UserName: Wiki Name

View File

@ -3,6 +3,8 @@ title: $:/language/EditTemplate/
Body/External/Hint: This tiddler shows content stored outside of the main TiddlyWiki file. You can edit the tags and fields but cannot directly edit the content itself
Body/Placeholder: Type the text for this tiddler
Body/Preview/Type/Output: output
Body/Preview/Type/DiffShadow: differences from shadow (if any)
Body/Preview/Type/DiffCurrent: differences from current
Field/Remove/Caption: remove field
Field/Remove/Hint: Remove field
Field/Dropdown/Caption: field list

View File

@ -19,8 +19,8 @@ All parameters are optional with safe defaults, and can be specified in any orde
* ''username'' - optional username for basic authentication
* ''password'' - optional password for basic authentication
* ''authenticated-user-header'' - optional name of header to be used for trusted authentication
* ''readers'' - comma separated list of principals allowed to read from this wiki
* ''writers'' - comma separated list of principals allowed to write to this wiki
* ''readers'' - comma-separated list of principals allowed to read from this wiki
* ''writers'' - comma-separated list of principals allowed to write to this wiki
* ''csrf-disable'' - set to "yes" to disable CSRF checks (defaults to "no")
* ''sse-enabled'' - set to "yes" to enable Server-sent events (defaults to "no")
* ''sitemap'' - optional sitemap describing how the tiddlers will be served. See [[Publishing]] for more details
@ -31,7 +31,7 @@ All parameters are optional with safe defaults, and can be specified in any orde
* ''tls-key'' - pathname of TLS key file (relative to wiki folder)
* ''debug-level'' - optional debug level; set to "debug" to view request details (defaults to "none")
* ''gzip'' - set to "yes" to enable gzip compression for some http endpoints (defaults to "no")
* ''use-browser-cache'' - set to "yes" to allow the browser to cache responses to save bandwith (defaults to "no")
* ''use-browser-cache'' - set to "yes" to allow the browser to cache responses to save bandwidth (defaults to "no")
For information on opening up your instance to the entire local network, and possible security concerns, see the WebServer tiddler at TiddlyWiki.com.

View File

@ -24,7 +24,7 @@ Notes:
* The output directory is not cleared of any existing files
* Any missing directories in the path to the filename are automatically created.
* When referring to a tiddler with spaces in its title, take care to use both the quotes required by your shell and also TiddlyWiki's double square brackets : `--render "[[Motovun Jack.jpg]]"`
* When referring to a tiddler with spaces in its title, take care to use both the quotes required by your shell and also TiddlyWiki's double square brackets: `--render "[[Motovun Jack.jpg]]"`
* The filename filter is evaluated with the selected items being set to the title of the tiddler currently being rendered, allowing the title to be used as the basis for computing the filename. For example `[encodeuricomponent[]addprefix[static/]]` applies URI encoding to each title, and then adds the prefix `static/`
* Multiple ''name''/''value'' pairs can be used to pass more than one variable
* The `--render` command is a more flexible replacement for both the `--rendertiddler` and `--rendertiddlers` commands, which are deprecated

View File

@ -16,7 +16,7 @@ Notes:
* The output directory is not cleared of any existing files
* Any missing directories in the path to the filename are automatically created.
* When saving a tiddler with spaces in its title, take care to use both the quotes required by your shell and also TiddlyWiki's double square brackets : `--save "[[Motovun Jack.jpg]]"`
* When saving a tiddler with spaces in its title, take care to use both the quotes required by your shell and also TiddlyWiki's double square brackets: `--save "[[Motovun Jack.jpg]]"`
* The filename filter is evaluated with the selected items being set to the title of the tiddler currently being saved, allowing the title to be used as the basis for computing the filename. For example `[encodeuricomponent[]addprefix[static/]]` applies URI encoding to each title, and then adds the prefix `static/`
* The `--save` command is a more flexible replacement for both the `--savetiddler` and `--savetiddlers` commands, which are deprecated

View File

@ -1,6 +1,6 @@
title: $:/language/Import/
Editor/Import/Heading: Import images and insert into the editor.
Editor/Import/Heading: Import images and insert them into the editor.
Imported/Hint: The following tiddlers were imported:
Listing/Cancel/Caption: Cancel
Listing/Hint: These tiddlers are ready to import:
@ -23,7 +23,11 @@ Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugi
Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming <<incoming>> not being newer than existing <<existing>>).
Upgrader/Plugins/Upgraded: Upgraded plugin from <<incoming>> to <<upgraded>>.
Upgrader/State/Suppressed: Blocked temporary state tiddler.
Upgrader/System/Disabled: Disabled system tiddler.
Upgrader/System/Suppressed: Blocked system tiddler.
Upgrader/System/Warning: Core module tiddler.
Upgrader/System/Alert: You are about to import a tiddler that will overwrite a core module tiddler. This is not recommended as it may make the system unstable.
Upgrader/ThemeTweaks/Created: Migrated theme tweak from <$text text=<<from>>/>.
Upgrader/Tiddler/Disabled: Disabled tiddler.
Upgrader/Tiddler/Selected: User selected.
Upgrader/Tiddler/Unselected: Unselected tiddler.

View File

@ -34,7 +34,7 @@ exports.htmlEntities = {quot:34, amp:38, apos:39, lt:60, gt:62, nbsp:160, iexcl:
exports.htmlVoidElements = "area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr".split(",");
exports.htmlBlockElements = "address,article,aside,audio,blockquote,canvas,dd,div,dl,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,noscript,ol,output,p,pre,section,table,tfoot,ul,video".split(",");
exports.htmlBlockElements = "address,article,aside,audio,blockquote,canvas,dd,details,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,nav,ol,p,pre,section,summary,table,tfoot,ul,video".split(",");
exports.htmlUnsafeElements = "script".split(",");

View File

@ -87,7 +87,6 @@ function FramedEngine(options) {
{name: "input",handlerObject: this,handlerMethod: "handleInputEvent"},
{name: "keydown",handlerObject: this.widget,handlerMethod: "handleKeydownEvent"},
{name: "focus",handlerObject: this,handlerMethod: "handleFocusEvent"}
]);
// Add drag and drop event listeners if fileDrop is enabled
if(this.widget.isFileDropEnabled) {

View File

@ -381,7 +381,6 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
};
return EditTextWidget;
}
exports.editTextWidgetFactory = editTextWidgetFactory;

View File

@ -0,0 +1,23 @@
/*\
title: $:/core/modules/editor/operations/text/insert-text.js
type: application/javascript
module-type: texteditoroperation
Text editor operation insert text at the caret position. If there is a selection it is replaced.
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports["insert-text"] = function(event,operation) {
operation.replacement = event.paramObject.text;
operation.cutStart = operation.selStart;
operation.cutEnd = operation.selEnd;
operation.newSelStart = operation.selStart + operation.replacement.length;
operation.newSelEnd = operation.newSelStart;
};
})();

View File

@ -17,10 +17,21 @@ exports.filter = function(operationSubFunction,options) {
return function(results,source,widget) {
if(results.length > 0) {
var resultsToRemove = [];
results.each(function(result) {
var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([result]),widget);
results.each(function(title) {
var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
getVariable: function(name) {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return widget.getVariable("currentTiddler");
default:
return widget.getVariable(name);
}
}
});
if(filtered.length === 0) {
resultsToRemove.push(result);
resultsToRemove.push(title);
}
});
results.remove(resultsToRemove);

View File

@ -23,6 +23,8 @@ exports.reduce = function(operationSubFunction,options) {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return widget.getVariable("currentTiddler");
case "accumulator":
return "" + accumulator;
case "index":

View File

@ -30,6 +30,8 @@ exports.sort = function(operationSubFunction,options) {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return widget.getVariable("currentTiddler");
default:
return widget.getVariable(name);
}

View File

@ -323,6 +323,9 @@ exports.compileFilter = function(filterString) {
} else if(typeof source === "object") { // Array or hashmap
source = self.makeTiddlerIterator(source);
}
if(!widget) {
widget = $tw.rootWidget;
}
var results = new $tw.utils.LinkedList();
$tw.utils.each(operationFunctions,function(operationFunction) {
operationFunction(results,source,widget);

View File

@ -0,0 +1,27 @@
/*\
title: $:/core/modules/filters/deserializers.js
type: application/javascript
module-type: filteroperator
Filter operator for returning the names of the deserializers in this wiki
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.deserializers = function(source,operator,options) {
var results = [];
$tw.utils.each($tw.Wiki.tiddlerDeserializerModules,function(deserializer,type) {
results.push(type);
});
results.sort();
return results;
};
})();

View File

@ -20,7 +20,18 @@ exports.filter = function(source,operator,options) {
results = [],
target = operator.prefix !== "!";
source(function(tiddler,title) {
var list = filterFn.call(options.wiki,options.wiki.makeTiddlerIterator([title]),options.widget);
var list = filterFn.call(options.wiki,options.wiki.makeTiddlerIterator([title]),{
getVariable: function(name) {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return options.widget.getVariable("currentTiddler");
default:
return options.widget.getVariable(name);
}
}
});
if((list.length > 0) === target) {
results.push(title);
}

View File

@ -0,0 +1,25 @@
/*\
title: $:/core/modules/filters/format/titlelist.js
type: application/javascript
module-type: formatfilteroperator
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.titlelist = function(source,operand,options) {
var results = [];
source(function(tiddler,title) {
if(title && title.length) {
results.push($tw.utils.stringifyList([title]));
}
});
return results;
};
})();

View File

@ -31,6 +31,8 @@ exports.reduce = function(source,operator,options) {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return options.widget.getVariable("currentTiddler");
case "accumulator":
return "" + accumulator;
case "index":

View File

@ -27,9 +27,12 @@ exports.sortsub = function(source,operator,options) {
iterator(options.wiki.getTiddler(title),title);
},{
getVariable: function(name) {
if(name === "currentTiddler") {
return title;
} else {
switch(name) {
case "currentTiddler":
return "" + title;
case "..currentTiddler":
return options.widget.getVariable("currentTiddler");
default:
return options.widget.getVariable(name);
}
}

View File

@ -295,7 +295,7 @@ KeyboardManager.prototype.getEventModifierKeyDescriptor = function(event) {
event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey ? "meta" :
event.metaKey && event.ctrlKey && !event.shiftKey && !event.altKey ? "meta-ctrl" :
event.metaKey && event.ctrlKey && event.shiftKey && !event.altKey ? "meta-ctrl-shift" :
event.metaKey && event.ctrlKey & event.shiftKey && event.altKey ? "meta-ctrl-alt-shift" : "normal";
event.metaKey && event.ctrlKey && event.shiftKey && event.altKey ? "meta-ctrl-alt-shift" : "normal";
};
KeyboardManager.prototype.getShortcutTiddlerList = function() {

View File

@ -36,7 +36,7 @@ exports.parse = function() {
// Move past the pragma invocation
this.parser.pos = this.matchRegExp.lastIndex;
// Parse the filter terminated by a line break
var reMatch = /(.*)(\r?\n)|$/mg;
var reMatch = /(.*)(?:$|\r?\n)/mg;
reMatch.lastIndex = this.parser.pos;
var match = reMatch.exec(this.parser.source);
this.parser.pos = reMatch.lastIndex;

View File

@ -82,7 +82,7 @@ exports.startup = function() {
var onlyThrottledTiddlersHaveChanged = true;
for(var title in changes) {
var tiddler = $tw.wiki.getTiddler(title);
if(!tiddler || !(tiddler.hasField("draft.of") || tiddler.hasField("throttle.refresh"))) {
if(!$tw.wiki.isVolatileTiddler(title) && (!tiddler || !(tiddler.hasField("draft.of") || tiddler.hasField("throttle.refresh")))) {
onlyThrottledTiddlersHaveChanged = false;
}
}

View File

@ -601,7 +601,10 @@ SaveTiddlerTask.prototype.run = function(callback) {
tiddler = this.syncer.wiki.tiddlerExists(this.title) && this.syncer.wiki.getTiddler(this.title);
this.syncer.logger.log("Dispatching 'save' task:",this.title);
if(tiddler) {
this.syncer.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {
this.syncer.syncadaptor.saveTiddler(tiddler,{
changeCount: changeCount,
tiddlerInfo: self.syncer.tiddlerInfo[self.title]
},function(err,adaptorInfo,revision) {
// If there's an error, exit without changing any internal state
if(err) {
return callback(err);
@ -615,8 +618,6 @@ SaveTiddlerTask.prototype.run = function(callback) {
};
// Invoke the callback
callback(null);
},{
tiddlerInfo: self.syncer.tiddlerInfo[self.title]
});
} else {
this.syncer.logger.log(" Not Dispatching 'save' task:",this.title,"tiddler does not exist");
@ -633,7 +634,9 @@ function DeleteTiddlerTask(syncer,title) {
DeleteTiddlerTask.prototype.run = function(callback) {
var self = this;
this.syncer.logger.log("Dispatching 'delete' task:",this.title);
this.syncer.syncadaptor.deleteTiddler(this.title,function(err) {
this.syncer.syncadaptor.deleteTiddler(this.title,{
tiddlerInfo: self.syncer.tiddlerInfo[this.title]
},function(err,adaptorInfo) {
// If there's an error, exit without changing any internal state
if(err) {
return callback(err);
@ -642,8 +645,6 @@ DeleteTiddlerTask.prototype.run = function(callback) {
delete self.syncer.tiddlerInfo[self.title];
// Invoke the callback
callback(null);
},{
tiddlerInfo: self.syncer.tiddlerInfo[this.title]
});
};

View File

@ -12,8 +12,8 @@ Upgrader module that suppresses certain system tiddlers that shouldn't be import
/*global $tw: false */
"use strict";
var DONT_IMPORT_LIST = ["$:/StoryList","$:/HistoryList"],
DONT_IMPORT_PREFIX_LIST = ["$:/temp/","$:/state/","$:/Import"],
var DONT_IMPORT_LIST = ["$:/Import"],
UNSELECT_PREFIX_LIST = ["$:/temp/","$:/state/","$:/StoryList","$:/HistoryList"],
WARN_IMPORT_PREFIX_LIST = ["$:/core/modules/"];
exports.upgrade = function(wiki,titles,tiddlers) {
@ -26,11 +26,10 @@ exports.upgrade = function(wiki,titles,tiddlers) {
tiddlers[title] = Object.create(null);
messages[title] = $tw.language.getString("Import/Upgrader/System/Suppressed");
} else {
for(var t=0; t<DONT_IMPORT_PREFIX_LIST.length; t++) {
var prefix = DONT_IMPORT_PREFIX_LIST[t];
for(var t=0; t<UNSELECT_PREFIX_LIST.length; t++) {
var prefix = UNSELECT_PREFIX_LIST[t];
if(title.substr(0,prefix.length) === prefix) {
tiddlers[title] = Object.create(null);
messages[title] = $tw.language.getString("Import/Upgrader/State/Suppressed");
messages[title] = $tw.language.getString("Import/Upgrader/Tiddler/Unselected");
}
}
for(var t=0; t<WARN_IMPORT_PREFIX_LIST.length; t++) {

View File

@ -22,6 +22,10 @@ exports.domContains = function(a,b) {
!!(a.compareDocumentPosition(b) & 16);
};
exports.domMatchesSelector = function(node,selector) {
return node.matches ? node.matches(selector) : node.msMatchesSelector(selector);
};
exports.removeChildren = function(node) {
while(node.hasChildNodes()) {
node.removeChild(node.firstChild);

View File

@ -27,8 +27,11 @@ CreateTiddlerWidget.prototype = new Widget();
Render this widget into the DOM
*/
CreateTiddlerWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
// Render children
this.renderChildren(parent,nextSibling);
};
/*
@ -44,7 +47,8 @@ CreateTiddlerWidget.prototype.execute = function() {
this.actionTemplate = this.getAttribute("$template");
this.useTemplate = !!this.actionTemplate;
this.actionOverwrite = this.getAttribute("$overwrite","no");
// Construct the child widgets
this.makeChildWidgets();
};
/*
@ -86,18 +90,20 @@ CreateTiddlerWidget.prototype.invokeAction = function(triggeringWidget,event) {
if (!this.hasBase && this.useTemplate) {
title = this.wiki.generateNewTitle(this.actionTemplate);
} else if (!this.hasBase && !this.useTemplate) {
// If NO $basetitle AND NO $template use initial title
// DON'T overwrite any stuff
// If no $basetitle and no $template then use initial title
title = this.wiki.generateNewTitle(title);
}
var templateTiddler = this.wiki.getTiddler(this.actionTemplate) || {};
var tiddler = this.wiki.addTiddler(new $tw.Tiddler(templateTiddler.fields,creationFields,fields,modificationFields,{title: title}));
this.wiki.addTiddler(new $tw.Tiddler(templateTiddler.fields,creationFields,fields,modificationFields,{title: title}));
var draftTitle = this.wiki.generateDraftTitle(title);
if(this.actionSaveTitle) {
this.wiki.setTextReference(this.actionSaveTitle,title,this.getVariable("currentTiddler"));
}
if(this.actionSaveDraftTitle) {
this.wiki.setTextReference(this.actionSaveDraftTitle,this.wiki.generateDraftTitle(title),this.getVariable("currentTiddler"));
this.wiki.setTextReference(this.actionSaveDraftTitle,draftTitle,this.getVariable("currentTiddler"));
}
this.setVariable("createTiddler-title",title);
this.setVariable("createTiddler-draftTitle",draftTitle);
return true; // Action was invoked
};

View File

@ -47,17 +47,24 @@ EventWidget.prototype.render = function(parent,nextSibling) {
domNode.addEventListener(type,function(event) {
var selector = self.getAttribute("selector"),
actions = self.getAttribute("actions-"+type),
stopPropagation = self.getAttribute("stopPropagation","onaction"),
selectedNode = event.target,
selectedNodeRect,
catcherNodeRect,
variables = {};
// Firefox can fire dragover and dragenter events on text nodes instead of their parents
if(selectedNode.nodeType === 3) {
selectedNode = selectedNode.parentNode;
}
if(selector) {
// Search ancestors for a node that matches the selector
while(!selectedNode.matches(selector) && selectedNode !== domNode) {
while(!$tw.utils.domMatchesSelector(selectedNode,selector) && selectedNode !== domNode) {
selectedNode = selectedNode.parentNode;
}
// If we found one, copy the attributes as variables, otherwise exit
if(selectedNode.matches(selector)) {
if($tw.utils.domMatchesSelector(selectedNode,selector)) {
// Only set up variables if we have actions to invoke
if(actions) {
$tw.utils.each(selectedNode.attributes,function(attribute) {
variables["dom-" + attribute.name] = attribute.value.toString();
});
@ -79,6 +86,7 @@ EventWidget.prototype.render = function(parent,nextSibling) {
catcherNodeRect = self.domNode.getBoundingClientRect();
variables["event-fromcatcher-posx"] = (event.clientX - catcherNodeRect.left).toString();
variables["event-fromcatcher-posy"] = (event.clientY - catcherNodeRect.top).toString();
}
} else {
return false;
}
@ -106,6 +114,8 @@ EventWidget.prototype.render = function(parent,nextSibling) {
variables["event-detail"] = event.detail.toString();
}
self.invokeActionString(actions,self,event,variables);
}
if((actions && stopPropagation === "onaction") || stopPropagation === "always") {
event.preventDefault();
event.stopPropagation();
return true;

View File

@ -44,26 +44,35 @@ KeyboardWidget.prototype.render = function(parent,nextSibling) {
classes.push("tc-keyboard");
domNode.className = classes.join(" ");
// Add a keyboard event handler
domNode.addEventListener("keydown",function (event) {
if($tw.keyboardManager.checkKeyDescriptors(event,self.keyInfoArray)) {
var handled = self.invokeActions(self,event);
if(self.actions) {
self.invokeActionString(self.actions,self,event);
$tw.utils.addEventListeners(domNode,[
{name: "keydown", handlerObject: this, handlerMethod: "handleChangeEvent"}
]);
// Insert element
parent.insertBefore(domNode,nextSibling);
this.renderChildren(domNode,null);
this.domNodes.push(domNode);
};
KeyboardWidget.prototype.handleChangeEvent = function(event) {
if($tw.keyboardManager.checkKeyDescriptors(event,this.keyInfoArray)) {
var handled = this.invokeActions(this,event);
if(this.actions) {
var variables = {
"event-key": event.key,
"event-code": event.code,
"modifier": $tw.keyboardManager.getEventModifierKeyDescriptor(event)
};
this.invokeActionString(this.actions,this,event,variables);
}
self.dispatchMessage(event);
if(handled || self.actions || self.message) {
this.dispatchMessage(event);
if(handled || this.actions || this.message) {
event.preventDefault();
event.stopPropagation();
}
return true;
}
return false;
},false);
// Insert element
parent.insertBefore(domNode,nextSibling);
this.renderChildren(domNode,null);
this.domNodes.push(domNode);
};
}
KeyboardWidget.prototype.dispatchMessage = function(event) {
this.dispatchEvent({type: this.message, param: this.param, tiddlerTitle: this.getVariable("currentTiddler")});

View File

@ -522,10 +522,15 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
});
// Give the active upgrader modules a chance to process the incoming tiddlers
var messages = this.wiki.invokeUpgraders(incomingTiddlers,importData.tiddlers);
// Deselect any disabled, but _not_ suppressed tiddlers
var systemMessage = $tw.language.getString("Import/Upgrader/Tiddler/Unselected");
$tw.utils.each(messages,function(message,title) {
newFields["message-" + title] = message;
if (message.indexOf(systemMessage) !== -1) {
newFields["selection-" + title] = "unchecked";
}
});
// Deselect any suppressed tiddlers
// Deselect suppressed tiddlers ... they have been removed and can't be selected anymore
$tw.utils.each(importData.tiddlers,function(tiddler,title) {
if($tw.utils.count(tiddler) === 0) {
newFields["selection-" + title] = "unchecked";
@ -557,10 +562,12 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
NavigatorWidget.prototype.handlePerformImportEvent = function(event) {
var self = this,
importTiddler = this.wiki.getTiddler(event.param),
importData = this.wiki.getTiddlerDataCached(event.param,{tiddlers: {}}),
importData,
importReport = [];
// Add the tiddlers to the store
importReport.push($tw.language.getString("Import/Imported/Hint") + "\n");
// If you need to modify the import tiddler payload then consider th-importing-tiddler instead
importTiddler = $tw.hooks.invokeHook("th-before-importing",importTiddler);
importData = this.wiki.getTiddlerDataCached(event.param,{tiddlers: {}}),
$tw.utils.each(importData.tiddlers,function(tiddlerFields) {
var title = tiddlerFields.title;
if(title && importTiddler && importTiddler.fields["selection-" + title] !== "unchecked") {
@ -569,7 +576,10 @@ NavigatorWidget.prototype.handlePerformImportEvent = function(event) {
} else {
var tiddler = new $tw.Tiddler(tiddlerFields);
}
// th-importing-tiddler doesn't allow user interaction by default
// If you want to use the default UI then use: $:/core/modules/upgraders/ instead
tiddler = $tw.hooks.invokeHook("th-importing-tiddler",tiddler);
// Add the tiddlers to the store
self.wiki.addTiddler(tiddler);
importReport.push("# [[" + tiddler.fields.title + "]]");
}

View File

@ -569,9 +569,10 @@ Widget.prototype.invokeActions = function(triggeringWidget,event) {
// For each child widget
for(var t=0; t<this.children.length; t++) {
var child = this.children[t];
// Rerender the child to ensure the attribute values are up to date
child.refreshSelf();
// Invoke the child if it is an action widget
if(child.invokeAction) {
child.refreshSelf();
if(child.invokeAction(triggeringWidget,event)) {
handled = true;
}

View File

@ -221,6 +221,10 @@ exports.isTemporaryTiddler = function(title) {
return title && title.indexOf("$:/temp/") === 0;
};
exports.isVolatileTiddler = function(title) {
return title && title.indexOf("$:/temp/volatile/") === 0;
};
exports.isImageTiddler = function(title) {
var tiddler = this.getTiddler(title);
if(tiddler) {
@ -1505,6 +1509,13 @@ exports.invokeUpgraders = function(titles,tiddlers) {
// Determine whether a plugin by title is dynamically loadable
exports.doesPluginRequireReload = function(title) {
var tiddler = this.getTiddler(title);
if(tiddler && tiddler.fields.type === "application/json" && tiddler.fields["plugin-type"]) {
if(tiddler.fields["plugin-type"] === "import") {
// The import plugin never requires reloading
return false;
}
}
return this.doesPluginInfoRequireReload(this.getPluginInfo(title) || this.getTiddlerDataCached(title));
};
@ -1568,4 +1579,3 @@ exports.unslugify = function(slug) {
};
})();

View File

@ -1,5 +1,6 @@
title: $:/palettes/Blanca
name: Blanca
color-scheme: light
description: A clean white palette to let you focus
tags: $:/tags/Palette
type: application/x-tiddler-dictionary

View File

@ -1,5 +1,6 @@
title: $:/palettes/Blue
name: Blue
color-scheme: light
description: A blue theme
tags: $:/tags/Palette
type: application/x-tiddler-dictionary

View File

@ -1,5 +1,6 @@
title: $:/palettes/Muted
name: Muted
color-scheme: light
description: Bright tiddlers on a muted background
tags: $:/tags/Palette
type: application/x-tiddler-dictionary

View File

@ -1,5 +1,6 @@
title: $:/palettes/ContrastLight
name: Contrast (Light)
color-scheme: light
description: High contrast and unambiguous (light version)
tags: $:/tags/Palette
type: application/x-tiddler-dictionary

View File

@ -1,5 +1,6 @@
title: $:/palettes/ContrastDark
name: Contrast (Dark)
color-scheme: dark
description: High contrast and unambiguous (dark version)
tags: $:/tags/Palette
type: application/x-tiddler-dictionary

View File

@ -1,5 +1,6 @@
title: $:/palettes/CupertinoDark
tags: $:/tags/Palette
color-scheme: dark
name: Cupertino Dark
description: A macOS inspired dark palette
type: application/x-tiddler-dictionary

View File

@ -5,6 +5,7 @@ name: DarkPhotos
tags: $:/tags/Palette
title: $:/palettes/DarkPhotos
type: application/x-tiddler-dictionary
color-scheme: light
alert-background: #ffe476
alert-border: #b99e2f

View File

@ -1,5 +1,6 @@
title: $:/palettes/DesertSand
tags: $:/tags/Palette
color-scheme: light
name: Desert Sand
description: A desert sand palette
type: application/x-tiddler-dictionary

View File

@ -1,5 +1,6 @@
title: $:/palettes/GruvboxDark
name: Gruvbox Dark
color-scheme: dark
description: Retro groove color scheme
tags: $:/tags/Palette
type: application/x-tiddler-dictionary

View File

@ -1,5 +1,6 @@
title: $:/palettes/Nord
name: Nord
color-scheme: dark
description: An arctic, north-bluish color palette.
tags: $:/tags/Palette
type: application/x-tiddler-dictionary

View File

@ -1,5 +1,6 @@
title: $:/palettes/Rocker
name: Rocker
color-scheme: dark
description: A dark theme
tags: $:/tags/Palette
type: application/x-tiddler-dictionary

View File

@ -1,5 +1,6 @@
title: $:/palettes/SolarFlare
name: Solar Flare
color-scheme: light
description: Warm, relaxing earth colours
tags: $:/tags/Palette
type: application/x-tiddler-dictionary

View File

@ -4,6 +4,7 @@ type: application/x-tiddler-dictionary
description: Precision dark colors for machines and people
license: MIT, Ethan Schoonover, https://github.com/altercation/solarized/blob/master/LICENSE
name: SolarizedDark
color-scheme: dark
alert-background: #073642
alert-border: #93a1a1

View File

@ -4,6 +4,7 @@ type: application/x-tiddler-dictionary
description: Precision colors for machines and people
license: MIT, Ethan Schoonover, https://github.com/altercation/solarized/blob/master/LICENSE
name: SolarizedLight
color-scheme: light
alert-background: #eee8d5
alert-border: #586e75

View File

@ -3,6 +3,7 @@ tags: $:/tags/Palette
type: application/x-tiddler-dictionary
description: Cold, spartan day colors
name: Spartan Day
color-scheme: light
alert-background: <<colour background>>
alert-border: <<colour very-muted-foreground>>

View File

@ -3,6 +3,7 @@ tags: $:/tags/Palette
type: application/x-tiddler-dictionary
description: Dark spartan colors
name: Spartan Night
color-scheme: dark
alert-background: <<colour background>>
alert-border: <<colour very-muted-foreground>>

View File

@ -4,6 +4,7 @@ author: Thomas Elmiger
type: application/x-tiddler-dictionary
name: Twilight
description: Delightful, soft darkness.
color-scheme: dark
alert-background: rgb(255, 255, 102)
alert-border: rgb(232, 232, 125)

View File

@ -3,6 +3,7 @@ name: Vanilla
description: Pale and unobtrusive
tags: $:/tags/Palette
type: application/x-tiddler-dictionary
color-scheme: light
alert-background: #ffe476
alert-border: #b99e2f

View File

@ -1,6 +1,6 @@
title: $:/core/ui/EditTemplate/body/preview/diffs-current
tags: $:/tags/EditPreview
caption: differences from current
caption: {{$:/language/EditTemplate/Body/Preview/Type/DiffCurrent}}
list-after: $:/core/ui/EditTemplate/body/preview/output
<$list filter="[<currentTiddler>!is[image]]" emptyMessage={{$:/core/ui/EditTemplate/body/preview/output}}>

View File

@ -1,6 +1,6 @@
title: $:/core/ui/EditTemplate/body/preview/diffs-shadow
tags: $:/tags/EditPreview
caption: differences from shadow (if any)
caption: {{$:/language/EditTemplate/Body/Preview/Type/DiffShadow}}
list-after: $:/core/ui/EditTemplate/body/preview/output
<$list filter="[<currentTiddler>!is[image]]" emptyMessage={{$:/core/ui/EditTemplate/body/preview/output}}>

View File

@ -14,7 +14,7 @@ color:$(foregroundColor)$;
\define tag-body-inner(colour,fallbackTarget,colourA,colourB,icon,tagField:"tags")
\whitespace trim
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<span style=<<tag-styles>> class="tc-tag-label tc-tag-list-item">
<span style=<<tag-styles>> class="tc-tag-label tc-tag-list-item tc-small-gap-right">
<$transclude tiddler="""$icon$"""/><$view field="title" format="text" />
<$button class="tc-btn-invisible tc-remove-tag-button" style=<<tag-styles>>><$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="-[{!!title}]"/>{{$:/core/images/close-button}}</$button>
</span>

View File

@ -16,7 +16,7 @@ condition: [<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]
<$list filter="[<importTitle>links[]] :reduce[get[type]prefix[image]then<replacement-text-image>else<replacement-text-file>search-replace[$title$],<currentTiddler>addprefix<accumulator>]" variable="imageTitle">
<$action-sendmessage
$message="tm-edit-text-operation"
$param="replace-selection"
$param="insert-text"
text=<<imageTitle>>
/>
</$list>

View File

@ -12,6 +12,24 @@ title: $:/core/ui/ImportListing
</$list>
\end
\define selectionInfo()
\whitespace trim
<$set name="escUnselected" value={{{[{$:/language/Import/Upgrader/Tiddler/Unselected}escaperegexp[]addprefix[(?g)]]}}}>
<$list filter="[all[current]get<messageField>regexp<escUnselected>]" variable="ignore">
<$text text={{{[all[current]get<selectionField>match[checked]then{$:/language/Import/Upgrader/Tiddler/Selected}else[]]}}}/>
</$list>
</$set>
\end
\define libraryInfo()
\whitespace trim
<$set name="escUnselected" value={{{[{$:/language/Import/Upgrader/Tiddler/Unselected}escaperegexp[]addprefix[(?g)]]}}}>
<$list filter="[all[current]get<messageField>!regexp<escUnselected>]" variable="ignore">
<$text text={{{[all[current]get<messageField>]}}}/>
</$list>
</$set>
\end
\define selectionField() selection-$(payloadTiddler)$
\define renameField() rename-$(payloadTiddler)$
@ -69,7 +87,8 @@ title: $:/core/ui/ImportListing
</$reveal>
</td>
<td>
<$view field=<<messageField>>/>
<<selectionInfo>>
<<libraryInfo>>
<<overWriteWarning>>
</td>
</tr>

View File

@ -5,6 +5,7 @@ description: {{$:/language/Buttons/AdvancedSearch/Hint}}
\whitespace trim
\define advanced-search-button(class)
\whitespace trim
<$button to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="""$(tv-config-toolbar-class)$ $class$""">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/advanced-search-button}}

View File

@ -3,11 +3,14 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/close-all-button}} {{$:/language/Buttons/CloseAll/Caption}}
description: {{$:/language/Buttons/CloseAll/Hint}}
\whitespace trim
<$button message="tm-close-all-tiddlers" tooltip={{$:/language/Buttons/CloseAll/Hint}} aria-label={{$:/language/Buttons/CloseAll/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/close-all-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/CloseAll/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/CloseAll/Caption}}/>
</span>
</$list>
</$button>

View File

@ -5,6 +5,7 @@ description: {{$:/language/Buttons/ControlPanel/Hint}}
\whitespace trim
\define control-panel-button(class)
\whitespace trim
<$button to="$:/ControlPanel" tooltip={{$:/language/Buttons/ControlPanel/Hint}} aria-label={{$:/language/Buttons/ControlPanel/Caption}} class="""$(tv-config-toolbar-class)$ $class$""">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/options-button}}

View File

@ -10,7 +10,9 @@ description: {{$:/language/Buttons/Encryption/Hint}}
{{$:/core/images/locked-padlock}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Encryption/ClearPassword/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Encryption/ClearPassword/Caption}}/>
</span>
</$list>
</$button>
</$reveal>
@ -20,7 +22,9 @@ description: {{$:/language/Buttons/Encryption/Hint}}
{{$:/core/images/unlocked-padlock}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Encryption/SetPassword/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Encryption/SetPassword/Caption}}/>
</span>
</$list>
</$button>
</$reveal>

View File

@ -3,12 +3,15 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/fold-all-button}} {{$:/language/Buttons/FoldAll/Caption}}
description: {{$:/language/Buttons/FoldAll/Hint}}
\whitespace trim
<$button tooltip={{$:/language/Buttons/FoldAll/Hint}} aria-label={{$:/language/Buttons/FoldAll/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-fold-all-tiddlers" $param=<<currentTiddler>> foldedStatePrefix="$:/state/folded/"/>
<$list filter="[<tv-config-toolbar-icons>match[yes]]" variable="listItem">
{{$:/core/images/fold-all-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/FoldAll/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/FoldAll/Caption}}/>
</span>
</$list>
</$button>

View File

@ -3,11 +3,14 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/full-screen-button}} {{$:/language/Buttons/FullScreen/Caption}}
description: {{$:/language/Buttons/FullScreen/Hint}}
\whitespace trim
<$button message="tm-full-screen" tooltip={{$:/language/Buttons/FullScreen/Hint}} aria-label={{$:/language/Buttons/FullScreen/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/full-screen-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/FullScreen/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/FullScreen/Caption}}/>
</span>
</$list>
</$button>

View File

@ -3,11 +3,14 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/home-button}} {{$:/language/Buttons/Home/Caption}}
description: {{$:/language/Buttons/Home/Hint}}
\whitespace trim
<$button message="tm-home" tooltip={{$:/language/Buttons/Home/Hint}} aria-label={{$:/language/Buttons/Home/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/home-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Home/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Home/Caption}}/>
</span>
</$list>
</$button>

View File

@ -3,13 +3,16 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/import-button}} {{$:/language/Buttons/Import/Caption}}
description: {{$:/language/Buttons/Import/Hint}}
\whitespace trim
<div class="tc-file-input-wrapper">
<$button tooltip={{$:/language/Buttons/Import/Hint}} aria-label={{$:/language/Buttons/Import/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/import-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Import/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Import/Caption}}/>
</span>
</$list>
</$button>
<$browse tooltip={{$:/language/Buttons/Import/Hint}}/>

View File

@ -16,7 +16,6 @@ $(languagePluginTitle)$/icon
</$set>
</span>
</$list>
<$text text=" "/>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Language/Caption}}/></span>
</$list>

View File

@ -5,12 +5,15 @@ description: {{$:/language/Buttons/Manager/Hint}}
\whitespace trim
\define manager-button(class)
\whitespace trim
<$button to="$:/Manager" tooltip={{$:/language/Buttons/Manager/Hint}} aria-label={{$:/language/Buttons/Manager/Caption}} class="""$(tv-config-toolbar-class)$ $class$""">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/list}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Manager/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Manager/Caption}}/>
</span>
</$list>
</$button>
\end

View File

@ -3,6 +3,7 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}
description: {{$:/language/Buttons/More/Hint}}
\whitespace trim
\define config-title()
$:/config/PageControlButtons/Visibility/$(listItem)$
\end
@ -11,7 +12,9 @@ $:/config/PageControlButtons/Visibility/$(listItem)$
{{$:/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>
<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">

View File

@ -9,6 +9,8 @@ description: {{$:/language/Buttons/NewImage/Hint}}
{{$:/core/images/new-image-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewImage/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/NewImage/Caption}}/>
</span>
</$list>
</$button>

View File

@ -5,12 +5,15 @@ description: {{$:/language/Buttons/NewJournal/Hint}}
\whitespace trim
\define journalButton()
\whitespace trim
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>> actions={{$:/core/ui/Actions/new-journal}}>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/new-journal-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewJournal/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/NewJournal/Caption}}/>
</span>
</$list>
</$button>
\end

View File

@ -9,6 +9,8 @@ description: {{$:/language/Buttons/NewTiddler/Hint}}
{{$:/core/images/new-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTiddler/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/NewTiddler/Caption}}/>
</span>
</$list>
</$button>

View File

@ -9,7 +9,6 @@ description: {{$:/language/Buttons/Palette/Hint}}
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/palette}}
</$list>
<$text text=" "/>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Palette/Caption}}/></span>
</$list>

View File

@ -3,11 +3,14 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/print-button}} {{$:/language/Buttons/Print/Caption}}
description: {{$:/language/Buttons/Print/Hint}}
\whitespace trim
<$button message="tm-print" tooltip={{$:/language/Buttons/Print/Hint}} aria-label={{$:/language/Buttons/Print/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/print-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Print/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Print/Caption}}/>
</span>
</$list>
</$button>

View File

@ -3,11 +3,14 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/refresh-button}} {{$:/language/Buttons/Refresh/Caption}}
description: {{$:/language/Buttons/Refresh/Hint}}
\whitespace trim
<$button message="tm-browser-refresh" tooltip={{$:/language/Buttons/Refresh/Hint}} aria-label={{$:/language/Buttons/Refresh/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/refresh-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Refresh/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Refresh/Caption}}/>
</span>
</$list>
</$button>

View File

@ -3,6 +3,7 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/save-button}} {{$:/language/Buttons/SaveWiki/Caption}}
description: {{$:/language/Buttons/SaveWiki/Hint}}
\whitespace trim
<$button tooltip={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class=<<tv-config-toolbar-class>>>
<$wikify name="site-title" text={{$:/config/SaveWikiButton/Filename}}>
<$action-sendmessage $message="tm-save-wiki" $param={{$:/config/SaveWikiButton/Template}} filename=<<site-title>>/>
@ -12,7 +13,9 @@ description: {{$:/language/Buttons/SaveWiki/Hint}}
{{$:/core/images/save-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/SaveWiki/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/SaveWiki/Caption}}/>
</span>
</$list>
</span>
</$button>

View File

@ -14,7 +14,6 @@ $:/core/images/storyview-$(storyview)$
<$transclude tiddler=<<icon>>/>
</$set>
</$list>
<$text text=" "/>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/StoryView/Caption}}/></span>
</$list>

View File

@ -5,12 +5,15 @@ description: {{$:/language/Buttons/TagManager/Hint}}
\whitespace trim
\define control-panel-button(class)
\whitespace trim
<$button to="$:/TagManager" tooltip={{$:/language/Buttons/TagManager/Hint}} aria-label={{$:/language/Buttons/TagManager/Caption}} class="""$(tv-config-toolbar-class)$ $class$""">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/tag-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/TagManager/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/TagManager/Caption}}/>
</span>
</$list>
</$button>
\end

View File

@ -9,7 +9,6 @@ description: {{$:/language/Buttons/Theme/Hint}}
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/theme-button}}
</$list>
<$text text=" "/>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Theme/Caption}}/></span>
</$list>

View File

@ -11,7 +11,9 @@ description: {{$:/language/Buttons/Timestamp/Hint}}
{{$:/core/images/timestamp-on}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Timestamp/On/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Timestamp/On/Caption}}/>
</span>
</$list>
</$button>
</$reveal>
@ -22,7 +24,9 @@ description: {{$:/language/Buttons/Timestamp/Hint}}
{{$:/core/images/timestamp-off}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Timestamp/Off/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/Timestamp/Off/Caption}}/>
</span>
</$list>
</$button>
</$reveal>

View File

@ -3,12 +3,15 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/unfold-all-button}} {{$:/language/Buttons/UnfoldAll/Caption}}
description: {{$:/language/Buttons/UnfoldAll/Hint}}
\whitespace trim
<$button tooltip={{$:/language/Buttons/UnfoldAll/Hint}} aria-label={{$:/language/Buttons/UnfoldAll/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-unfold-all-tiddlers" $param=<<currentTiddler>> foldedStatePrefix="$:/state/folded/"/>
<$list filter="[<tv-config-toolbar-icons>match[yes]]" variable="listItem">
{{$:/core/images/unfold-all-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/UnfoldAll/Caption}}/></span>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/UnfoldAll/Caption}}/>
</span>
</$list>
</$button>

View File

@ -10,7 +10,6 @@ description: {{$:/language/Buttons/Clone/Hint}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text=" "/>
<$text text={{$:/language/Buttons/Clone/Caption}}/>
</span>
</$list>

View File

@ -10,7 +10,6 @@ description: {{$:/language/Buttons/CloseOthers/Hint}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text=" "/>
<$text text={{$:/language/Buttons/CloseOthers/Caption}}/>
</span>
</$list>

View File

@ -10,7 +10,6 @@ description: {{$:/language/Buttons/Edit/Hint}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text=" "/>
<$text text={{$:/language/Buttons/Edit/Caption}}/>
</span>
</$list>

View File

@ -11,7 +11,6 @@ description: {{$:/language/Buttons/FoldOthers/Hint}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text=" "/>
<$text text={{$:/language/Buttons/FoldOthers/Caption}}/>
</span>
</$list>

View File

@ -12,7 +12,6 @@ description: {{$:/language/Buttons/Fold/Hint}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text=" "/>
<$text text={{$:/language/Buttons/Fold/Caption}}/>
</span>
</$list>
@ -26,7 +25,6 @@ description: {{$:/language/Buttons/Fold/Hint}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text=" "/>
<$text text={{$:/language/Buttons/Unfold/Caption}}/>
</span>
</$list>

View File

@ -5,6 +5,7 @@ description: {{$:/language/Buttons/Info/Hint}}
\whitespace trim
\define button-content()
\whitespace trim
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/info-button}}
</$list>

View File

@ -13,7 +13,6 @@ $:/config/ViewToolbarButtons/Visibility/$(listItem)$
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text=" "/>
<$text text={{$:/language/Buttons/More/Caption}}/>
</span>
</$list>

View File

@ -10,6 +10,7 @@ description: {{$:/language/Buttons/NewHere/Hint}}
</$set>
\end
\define newHereButton()
\whitespace trim
<$button actions=<<newHereActions>> tooltip={{$:/language/Buttons/NewHere/Hint}} aria-label={{$:/language/Buttons/NewHere/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/core/images/new-here-button}}

View File

@ -8,6 +8,7 @@ description: {{$:/language/Buttons/NewJournalHere/Hint}}
[[$(currentTiddlerTag)$]] $(journalTags)$
\end
\define journalButton()
\whitespace trim
<$button tooltip={{$:/language/Buttons/NewJournalHere/Hint}} aria-label={{$:/language/Buttons/NewJournalHere/Caption}} class=<<tv-config-toolbar-class>>>
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalButtonTags>>/>

View File

@ -10,7 +10,6 @@ description: {{$:/language/Buttons/OpenWindow/Hint}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text=" "/>
<$text text={{$:/language/Buttons/OpenWindow/Caption}}/>
</span>
</$list>

View File

@ -10,7 +10,6 @@ description: {{$:/language/Buttons/Permalink/Hint}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text=" "/>
<$text text={{$:/language/Buttons/Permalink/Caption}}/>
</span>
</$list>

View File

@ -10,7 +10,6 @@ description: {{$:/language/Buttons/Permaview/Hint}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text">
<$text text=" "/>
<$text text={{$:/language/Buttons/Permaview/Caption}}/>
</span>
</$list>

View File

@ -6,6 +6,7 @@ $baseFilename$$(extension)$
\end
\define exportButton(exportFilter:"[!is[system]sort[title]]",lingoBase,baseFilename:"tiddlers")
\whitespace trim
<$vars hint={{{ [<__lingoBase__>addsuffix[Hint]get[text]] }}} caption={{{ [<__lingoBase__>addsuffix[Caption]get[text]] }}}>
<span class="tc-popup-keep"><$button popup=<<qualify "$:/state/popup/export">> tooltip=<<hint>> aria-label=<<caption>> class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>match[yes]]">

View File

@ -69,7 +69,7 @@ Returns a revision ID.
Retrieves status information from the server. This method is optional.
|!Parameter |!Description |
|callback |Callback function invoked with parameters `err,isLoggedIn,username,isReadOnly` |
|callback |Callback function invoked with parameters `err,isLoggedIn,username,isReadOnly,isAnonymous,isPollingDisabled` |
!! `login(username,password,callback)`
@ -128,33 +128,40 @@ The syncer will use the `getUpdatedTiddlers()` method in preference to the `getS
|!Parameter |!Description |
|callback |Callback function invoked with parameter `err,tiddlers`, where `tiddlers` is an array of tiddler field objects |
!! `saveTiddler(tiddler,callback)`
!! `saveTiddler(tiddler,options,callback)`
Saves a tiddler to the server.
|!Parameter |!Description |
|tiddler |Tiddler to be saved |
|options |See below |
|callback |Callback function invoked with parameter `err,adaptorInfo,revision` |
|tiddlerInfo |The tiddlerInfo maintained by the syncer for this tiddler |
!! `loadTiddler(title,callback)`
!! `loadTiddler(title,options,callback)`
Loads a tiddler from the server.
|!Parameter |!Description |
|title |Title of tiddler to be retrieved |
|options |See below |
|callback |Callback function invoked with parameter `err,tiddlerFields` |
!! `deleteTiddler(title,callback,options)`
!! `deleteTiddler(title,options,callback)`
Delete a tiddler from the server.
|!Parameter |!Description |
|title |Title of tiddler to be deleted |
|callback |Callback function invoked with parameter `err` |
|options |See below |
|callback |Callback function invoked with parameter `err` |
The options parameter contains the following properties:
!!! Options
<<.from-version "5.2.0">> The signature of syncadaptor functions that accept callbacks has been changed so that the callback is always the last argument. A check for the old order of arguments means that this change is backwards compatible. The new order should be prefered when updating or writing new plugins.
The options parameter may contain the following properties, depending on the method called.
|!Property |!Description |
|changeCount |The //new// changeCount value for this tiddler |
|tiddlerInfo |The tiddlerInfo maintained by the syncer for this tiddler |

View File

@ -0,0 +1,68 @@
created: 20210203184649726
modified: 20210208152038746
tags: HookMechanism
title: Hook: th-before-importing
type: text/vnd.tiddlywiki
This hook allows plugins to inspect or modify the `importTiddler` object ''before'' any tiddlers are imported. It is invoked after the final "Import" button is clicked, but ''before'' the selected tiddlers are being imported into the store.
''Intended Usecases'':
* Manipulate the import "selection state"
* Eg: create a customized "log-tiddler" that contains a heading, that should only be written once
''Important'':
* This hook ''should not'' be used to manpulate the `importTiddler.fields.text` element!
* If you want to give the users a possibility to verify the imported data, use ùpgraders like: `$:/core/modules/upgraders/` instead
* If you need to manipulate the imported tiddler content, without default user interaction, consider: [[Hook: th-importing-tiddler]] instead
The hook is part of the `NavigatorWidget.prototype.handlePerformImportEvent` function.
Hook function parameters:
* ''importTiddler'': an object, that contains information about "selected / unselected" tiddlers and more
Return value:
* ''importTiddler'': object
The hook must return the `importTiddler` object. For many usecases the object will be returned unmodified.
''Example code how to implement a hook in your project''
```
/*\
title: $:/plugins/<author>/<plugin>/th-before-importing.js
type: application/javascript
module-type: startup
YOUR DISCRCRIPTION COMES HERE!
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false, exports: true */
"use strict";
// Export name and synchronous status
exports.name = "<yournamecomesherewithoutspaces>";
exports.platforms = ["browser"];
exports.after = ["startup"];
exports.synchronous = true;
// Define your variables here!
exports.startup = function() {
$tw.hooks.addHook("th-before-importing",function(importTiddler) {
// YOUR CODE !
return importTiddler;
});
};
})();
```

View File

@ -1,11 +1,13 @@
created: 20170209130829546
modified: 20171010115148355
modified: 20210203190724491
tags: HookMechanism
title: Hook: th-importing-tiddler
type: text/vnd.tiddlywiki
This hook allows plugins to inspect or modify tiddlers as they are imported via the import mechanism. It is invoked when the final "Import" button is clicked, and the selected tiddlers are being imported into the store.
The hook is part of the `NavigatorWidget.prototype.handlePerformImportEvent` function.
Use this hook if you want to process each imported tiddler after they have been extracted from the files. See [[Hook: th-importing-file]] if you want to control how tiddlers are extracted from files during an import.
Hook function parameters:

View File

@ -144,7 +144,7 @@ type: text/vnd.tiddlywiki
* <<contributor NicolasPetton>>
* <<contributor OdinJorna>>
* <<contributor pmario>>
* <<contributor saqimtias>>
* <<contributor saqimtiaz>>
* <<contributor simonbaird>>
* <<contributor slaymaker1907>>
* <<contributor twMat>>

View File

@ -809,6 +809,16 @@ function runTests(wiki) {
expect(wiki.filterTiddlers("'-' +[escapecss[]]").join(",")).toBe("\\-");
});
it("should handle the format operator", function() {
expect(wiki.filterTiddlers("[[Hello There]] [[GettingStarted]] +[format:titlelist[]]").join(" ")).toBe("[[Hello There]] GettingStarted");
expect(wiki.filterTiddlers("[title[Hello There]] +[format:titlelist[]]").join(" ")).toBe("[[Hello There]]");
expect(wiki.filterTiddlers("[title[HelloThere]] +[format:titlelist[]]").join(" ")).toBe("HelloThere");
});
it("should handle the deserializers operator", function() {
expect(wiki.filterTiddlers("[deserializers[]]").join(",")).toBe("application/javascript,application/json,application/x-tiddler,application/x-tiddler-html-div,application/x-tiddlers,text/css,text/html,text/plain");
});
}
});

View File

@ -702,6 +702,19 @@ describe("Widget module", function() {
expect(wrapper.innerHTML).toBe("<p>Don't forget me.</p>");
});
/** Special case. \import should parse correctly, even if it's
* the only line in the tiddler. Technically doesn't cause a
* visual difference, but may affect plugins if it doesn't.
*/
it("should work when import pragma is standalone", function() {
var wiki = new $tw.Wiki();
var text = "\\import [prefix[XXX]]";
var parseTreeNode = parseText(text,wiki);
// Test the resulting parse tree node, since there is no
// rendering which may expose a problem.
expect(parseTreeNode.children[0].attributes.filter.value).toBe('[prefix[XXX]]');
});
/** This test reproduces issue #4504.
*
* The importvariable widget was creating redundant copies into

View File

@ -0,0 +1,4 @@
created: 20210525102327864
modified: 20210525102327884
title: $:/key-test
type: text/vnd.tiddlywiki

View File

@ -0,0 +1,11 @@
created: 20210525102659716
modified: 20210525102701077
title: $:/key-test/action
type: text/vnd.tiddlywiki
<$vars tv-wikilinks="no">
* event-key:
* event-code:
* modifier:
</$vars>

View File

@ -0,0 +1,66 @@
created: 20210427092418146
modified: 20210525130708186
tags: KeyboardWidget
title: Key Codes (Example 1)
type: text/vnd.tiddlywiki
\define key-test() $:/key-test
\import [[Keyboard Codes (Macros)]]
\define keys()
backspace tab clear return enter pause escape space
page_up page_down end home printscreen insert delete
left up right down results in: ArrowLeft ArrowUp ArrowRight ArrowDown
0 1 2 3
shift+0 shift+1 shift+2 shift+3 results in: = ! " with modifierKey: shift
ctrl+0 ctrl+1 ctrl+2 ctrl+3
alt+0 alt+1 alt+2 alt+3
ctrl+alt+0 ctrl+alt+1 ctrl+alt+2 ctrl+alt+3
alt+shift+0 alt+shift+1 alt+shift+2 alt+shift+3
ctrl+shift+0 ctrl+shift+1 ctrl+shift+2 ctrl+shift+3 INFO: ctrl-shift-0 is eaten by windows!!
ctrl+alt+shift+0 ctrl+alt+shift+1 ctrl+alt+shift+2 ctrl+alt+shift+3
a s d
shift+a shift+s shift+d
ctrl+a ctrl+s ctrl+d
alt+a alt+s alt+d
ctrl+shift+a ctrl+shift+s ctrl+shift+d
alt+shift+a alt+shift+s alt+shift+d
ctrl+alt+a ctrl+alt+s ctrl+alt+d
ctrl+alt+shift+a ctrl+alt+shift+s ctrl+alt+shift+d
numpad0 numpad1 numpad2 numpad3
multiply add separator subtract decimal divide
f1 f2 f3
semicolon equals comma dash period slash backquote openbracket backslash closebracket quote
\end
! Key Codes
{{$:/key-test/action}}
! Input Area
Depending on your OS and browser keyboard settings, some combinations may be "eaten" by the OS, or the browser!
--> <$keyboard key={{{ [enlist<keys>join[ ]] }}} actions=<<actionKey>> >
<$edit-text tiddler=<<key-test>> placeholder="- Click here. Try keys from list below -" tag=input focus />
</$keyboard> <--
!! Keys to be used
<pre><code><$vars tv-wikilinks="no"><<keys>></$vars></code></pre>
All possible keys can be found at: [[Keyboard Codes]]
! Example Code
<<showCode>>

View File

@ -0,0 +1,43 @@
created: 20210427130002905
modified: 20210525130748774
tags: KeyboardWidget
title: Key Codes (Example)
type: text/vnd.tiddlywiki
\define key-test() $:/key-test
\import [[Keyboard Codes (Macros)]]
\define keys()
1 2 3
shift+1 shift+2 shift+3
a s d
f1 f2 f3
\end
! Key Codes
{{$:/key-test/action}}
! Input Area
Depending on your OS and browser keyboard settings, some combinations may be "eaten" by the OS, or the browser
--> <$keyboard key={{{ [enlist<keys>join[ ]] }}} actions=<<actionKey>> >
<$edit-text tiddler=<<key-test>> placeholder="- Click here to try keys -" tag=input />
</$keyboard> <--
!! Keys to be tested
<$list filter="[enlist<keys>]"><kbd><<currentTiddler>></kbd>, </$list>
-----
All usable keys can be found at: [[Keyboard Codes]]
A more advanced example can be found at: [[Key Codes (Example 1)]]
! Code
<<showCode>>

Some files were not shown because too many files have changed in this diff Show More