1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-03-02 13:59:50 +00:00

Compare commits

..

5 Commits

Author SHA1 Message Date
jeremy@jermolene.com
a79644bff3 Fix new selection tracker to return relative coordinates 2022-06-17 16:37:31 +01:00
jeremy@jermolene.com
9e8e93cbb7 Docs update 2022-04-08 12:29:59 +01:00
jeremy@jermolene.com
495c42c7cf Introduce new selection tracker 2022-03-29 17:12:48 +01:00
jeremy@jermolene.com
ffea61b345 Merge branch 'master' into dynannotate-improvements 2022-03-24 09:14:08 +00:00
jeremy@jermolene.com
5f4dc2a5fe Initial Commit 2022-03-11 10:25:16 +00:00
678 changed files with 21660 additions and 8088 deletions

43
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,43 @@
---
name: Bug report
about: Create a report to help us improve TiddlyWiki 5
title: "[BUG]"
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**TiddlyWiki Configuration (please complete the following information):**
- Version [e.g. v5.1.24]
- Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc]
- Plugins installed [e.g. Freelinks, TiddlyMap]
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@@ -1,67 +0,0 @@
name: Bug report
description: Create a report to help us improve TiddlyWiki 5
title: "[BUG] "
body:
- type: textarea
id: Describe
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: Expected
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: false
- type: textarea
id: Reproduce
attributes:
label: To Reproduce
description: "Steps to reproduce the behavior:"
value: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: false
- type: textarea
id: Screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
placeholder: Drag image here to upload screenshot!
validations:
required: false
- type: textarea
id: Configuration
attributes:
label: TiddlyWiki Configuration
description: please complete the following information
value: |
- Version [e.g. v5.1.24]
- Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc]
- Plugins installed [e.g. Freelinks, TiddlyMap]
### Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
### Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
validations:
required: true
- type: textarea
id: Context
attributes:
label: Additional context
description: Add any other context about the problem here.

View File

@@ -1,8 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Discuss feature request
url: https://github.com/Jermolene/TiddlyWiki5/discussions
about: Open new discussion about new feature
- name: Talk.Tiddlywiki Forum
url: https://talk.tiddlywiki.org
about: Join the Forum

View File

@@ -20,11 +20,3 @@ A clear and concise description of any alternative solutions or features you've
Add any other context or screenshots about the feature request here. Add any other context or screenshots about the feature request here.
If you link to discussions elsewhere then please copy and paste the important text, and don't expect readers to scan the entire discussion to find the relevant part. If you link to discussions elsewhere then please copy and paste the important text, and don't expect readers to scan the entire discussion to find the relevant part.
## Checklist before requesting a review
- [ ] Illustrate any visual changes (however minor) with before/after screenshots
- [ ] Self-review of code
- [ ] Documentation updates (for user-visible changes)
- [ ] Tests (for core code changes)
- [ ] Complies with coding style guidelines (for JavaScript code)

View File

@@ -5,7 +5,7 @@
# Default to the current version number for building the plugin library # Default to the current version number for building the plugin library
if [ -z "$TW5_BUILD_VERSION" ]; then if [ -z "$TW5_BUILD_VERSION" ]; then
TW5_BUILD_VERSION=v5.2.3 TW5_BUILD_VERSION=v5.2.2
fi fi
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]" echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"

View File

@@ -1230,16 +1230,13 @@ $tw.Wiki = function(options) {
this.getTiddler = function(title) { this.getTiddler = function(title) {
if(title) { if(title) {
var t = tiddlers[title]; var t = tiddlers[title];
if(t !== undefined) { if(t instanceof $tw.Tiddler) {
return t; return t;
} else { } else if(title !== undefined && shadowTiddlers[title]) {
var s = shadowTiddlers[title]; return shadowTiddlers[title].tiddler;
if(s !== undefined) {
return s.tiddler;
}
} }
return undefined;
} }
return undefined;
}; };
// Get an array of all tiddler titles // Get an array of all tiddler titles
@@ -2419,7 +2416,7 @@ $tw.boot.initStartup = function(options) {
$tw.utils.registerFileType("application/epub+zip","base64",".epub"); $tw.utils.registerFileType("application/epub+zip","base64",".epub");
$tw.utils.registerFileType("application/octet-stream","base64",".octet-stream"); $tw.utils.registerFileType("application/octet-stream","base64",".octet-stream");
// Create the wiki store for the app // Create the wiki store for the app
$tw.wiki = new $tw.Wiki($tw.safeMode && {enableIndexers: []}); $tw.wiki = new $tw.Wiki();
// Install built in tiddler fields modules // Install built in tiddler fields modules
$tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap("tiddlerfield"); $tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap("tiddlerfield");
// Install the tiddler deserializer modules // Install the tiddler deserializer modules
@@ -2599,7 +2596,7 @@ $tw.boot.isStartupTaskEligible = function(taskModule) {
for(t=0; t<remaining.length; t++) { for(t=0; t<remaining.length; t++) {
var task = remaining[t]; var task = remaining[t];
if(task.before && task.before.indexOf(name) !== -1) { if(task.before && task.before.indexOf(name) !== -1) {
if($tw.boot.doesTaskMatchPlatform(task) && (!task.name || $tw.boot.disabledStartupModules.indexOf(task.name) === -1)) { if($tw.boot.doesTaskMatchPlatform(task) || (task.name && $tw.boot.disabledStartupModules.indexOf(name) !== -1)) {
return false; return false;
} }
} }

File diff suppressed because one or more lines are too long

View File

@@ -18,8 +18,6 @@ CopyToClipboard/Caption: copy to clipboard
CopyToClipboard/Hint: Copy this text to the clipboard CopyToClipboard/Hint: Copy this text to the clipboard
Delete/Caption: delete Delete/Caption: delete
Delete/Hint: Delete this tiddler Delete/Hint: Delete this tiddler
DeleteTiddlers/Caption: delete tiddlers
DeleteTiddlers/Hint: Delete tiddlers
Edit/Caption: edit Edit/Caption: edit
Edit/Hint: Edit this tiddler Edit/Hint: Edit this tiddler
Encryption/Caption: encryption Encryption/Caption: encryption

View File

@@ -1,6 +1,5 @@
title: $:/language/EditTemplate/ title: $:/language/EditTemplate/
Caption: Editor
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/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/Placeholder: Type the text for this tiddler
Body/Preview/Type/Output: output Body/Preview/Type/Output: output

View File

@@ -9,10 +9,9 @@ Before you start storing important information in ~TiddlyWiki it is vital to mak
<div class="tc-control-panel"> <div class="tc-control-panel">
|tc-table-no-border tc-first-col-min-width tc-first-link-nowrap|k |<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
| <$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link>|<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> | |<$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
| <$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link>|<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> | |<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|^ <$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link><br><<lingo DefaultTiddlers/TopHint>>|<$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
</div> </div>
See the [[control panel|$:/ControlPanel]] for more options. See the [[control panel|$:/ControlPanel]] for more options.

View File

@@ -3,7 +3,6 @@ title: $:/language/Help/default
\define commandTitle() \define commandTitle()
$:/language/Help/$(command)$ $:/language/Help/$(command)$
\end \end
\whitespace trim
``` ```
usage: tiddlywiki [<wikifolder>] [--<command> [<args>...]...] usage: tiddlywiki [<wikifolder>] [--<command> [<args>...]...]
``` ```
@@ -12,9 +11,7 @@ Available commands:
<ul> <ul>
<$list filter="[commands[]sort[title]]" variable="command"> <$list filter="[commands[]sort[title]]" variable="command">
<li><$link to=<<commandTitle>>><$macrocall $name="command" $type="text/plain" $output="text/plain"/></$link>: <li><$link to=<<commandTitle>>><$macrocall $name="command" $type="text/plain" $output="text/plain"/></$link>: <$transclude tiddler=<<commandTitle>> field="description"/></li>
&#32;
<$transclude tiddler=<<commandTitle>> field="description"/></li>
</$list> </$list>
</ul> </ul>

View File

@@ -31,5 +31,5 @@ Notes:
Examples: Examples:
* `--render '[!is[system]]' '[encodeuricomponent[]addprefix[tiddlers/]addsuffix[.html]]'` -- renders all non-system tiddlers as files in the subdirectory "tiddlers" with URL-encoded titles and the extension HTML * `--render "[!is[system]]" "[encodeuricomponent[]addprefix[tiddlers/]addsuffix[.html]]"` -- renders all non-system tiddlers as files in the subdirectory "tiddlers" with URL-encoded titles and the extension HTML
* `--render '.' 'tiddlers.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[HelloThere]]'` -- renders the tiddlers tagged "HelloThere" to a JSON file named "tiddlers.json"

View File

@@ -8,7 +8,6 @@ CloseAll/Button: close all
ColourPicker/Recent: Recent: ColourPicker/Recent: Recent:
ConfirmCancelTiddler: Do you wish to discard changes to the tiddler "<$text text=<<title>>/>"? ConfirmCancelTiddler: Do you wish to discard changes to the tiddler "<$text text=<<title>>/>"?
ConfirmDeleteTiddler: Do you wish to delete the tiddler "<$text text=<<title>>/>"? ConfirmDeleteTiddler: Do you wish to delete the tiddler "<$text text=<<title>>/>"?
ConfirmDeleteTiddlers: Are you sure you wish to delete <<resultCount>> tiddler(s)?
ConfirmOverwriteTiddler: Do you wish to overwrite the tiddler "<$text text=<<title>>/>"? ConfirmOverwriteTiddler: Do you wish to overwrite the tiddler "<$text text=<<title>>/>"?
ConfirmEditShadowTiddler: You are about to edit a ShadowTiddler. Any changes will override the default system making future upgrades non-trivial. Are you sure you want to edit "<$text text=<<title>>/>"? ConfirmEditShadowTiddler: You are about to edit a ShadowTiddler. Any changes will override the default system making future upgrades non-trivial. Are you sure you want to edit "<$text text=<<title>>/>"?
ConfirmAction: Do you wish to proceed? ConfirmAction: Do you wish to proceed?

View File

@@ -1,6 +1,5 @@
title: $:/language/SideBar/ title: $:/language/SideBar/
Caption: Sidebar
All/Caption: All All/Caption: All
Contents/Caption: Contents Contents/Caption: Contents
Drafts/Caption: Drafts Drafts/Caption: Drafts

View File

@@ -50,7 +50,7 @@ Render individual tiddlers and save the results to the specified files
console.log("Rendering \"" + title + "\" to \"" + filepath + "\""); console.log("Rendering \"" + title + "\" to \"" + filepath + "\"");
} }
var parser = wiki.parseTiddler(template || title), var parser = wiki.parseTiddler(template || title),
widgetNode = wiki.makeWidget(parser,{variables: $tw.utils.extend({},variables,{currentTiddler: title,storyTiddler: title})}), widgetNode = wiki.makeWidget(parser,{variables: $tw.utils.extend({},variables,{currentTiddler: title})}),
container = $tw.fakeDocument.createElement("div"); container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null); widgetNode.render(container,null);
var text = type === "text/html" ? container.innerHTML : container.textContent; var text = type === "text/html" ? container.innerHTML : container.textContent;

View File

@@ -40,7 +40,6 @@ Command.prototype.execute = function() {
$tw.utils.createFileDirectories(filename); $tw.utils.createFileDirectories(filename);
if(template) { if(template) {
variables.currentTiddler = title; variables.currentTiddler = title;
variables.storyTiddler = title;
title = template; title = template;
} }
if(name && value) { if(name && value) {

View File

@@ -46,7 +46,7 @@ Command.prototype.execute = function() {
} }
$tw.utils.each(tiddlers,function(title) { $tw.utils.each(tiddlers,function(title) {
var parser = wiki.parseTiddler(template), var parser = wiki.parseTiddler(template),
widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title, storyTiddler: title}}), widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}}),
container = $tw.fakeDocument.createElement("div"); container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null); widgetNode.render(container,null);
var text = type === "text/html" ? container.innerHTML : container.textContent, var text = type === "text/html" ? container.innerHTML : container.textContent,

View File

@@ -8,60 +8,46 @@ Saves individual tiddlers in their raw text or binary format to the specified fi
\*/ \*/
(function(){ (function(){
/*jslint node: true, browser: true */ /*jslint node: true, browser: true */
/*global $tw: false */ /*global $tw: false */
"use strict"; "use strict";
exports.info = { exports.info = {
name: "save", name: "save",
synchronous: true synchronous: true
}; };
var Command = function(params,commander,callback) { var Command = function(params,commander,callback) {
this.params = params; this.params = params;
this.commander = commander; this.commander = commander;
this.callback = callback; this.callback = callback;
}; };
Command.prototype.execute = function() { Command.prototype.execute = function() {
if(this.params.length < 1) { if(this.params.length < 1) {
return "Missing filename filter"; return "Missing filename filter";
}
var self = this,
fs = require("fs"),
path = require("path"),
wiki = this.commander.wiki,
tiddlerFilter = this.params[0],
filenameFilter = this.params[1] || "[is[tiddler]]",
tiddlers = wiki.filterTiddlers(tiddlerFilter);
$tw.utils.each(tiddlers,function(title) {
var tiddler = self.commander.wiki.getTiddler(title),
type = tiddler.fields.type || "text/vnd.tiddlywiki",
contentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: "utf8"},
filepath = path.resolve(self.commander.outputPath,wiki.filterTiddlers(filenameFilter,$tw.rootWidget,wiki.makeTiddlerIterator([title]))[0]);
if(self.commander.verbose) {
console.log("Saving \"" + title + "\" to \"" + filepath + "\"");
} }
var self = this, $tw.utils.createFileDirectories(filepath);
fs = require("fs"), fs.writeFileSync(filepath,tiddler.fields.text,contentTypeInfo.encoding);
path = require("path"), });
result = null, return null;
wiki = this.commander.wiki, };
tiddlerFilter = this.params[0],
filenameFilter = this.params[1] || "[is[tiddler]]", exports.Command = Command;
tiddlers = wiki.filterTiddlers(tiddlerFilter);
$tw.utils.each(tiddlers,function(title) { })();
if(!result) {
var tiddler = self.commander.wiki.getTiddler(title);
if(tiddler) {
var fileInfo = $tw.utils.generateTiddlerFileInfo(tiddler,{
directory: path.resolve(self.commander.outputPath),
pathFilters: [filenameFilter],
wiki: wiki,
fileInfo: {}
});
if(self.commander.verbose) {
console.log("Saving \"" + title + "\" to \"" + fileInfo.filepath + "\"");
}
try {
$tw.utils.saveTiddlerToFileSync(tiddler,fileInfo);
} catch (err) {
result = "Error saving tiddler \"" + title + "\", to file: \"" + fileInfo.filepath + "\"";
}
} else {
result = "Tiddler '" + title + "' not found";
}
}
});
return result;
};
exports.Command = Command;
})();

View File

@@ -34,10 +34,8 @@ function FramedEngine(options) {
this.parentNode.insertBefore(this.iframeNode,this.nextSibling); this.parentNode.insertBefore(this.iframeNode,this.nextSibling);
this.iframeDoc = this.iframeNode.contentWindow.document; this.iframeDoc = this.iframeNode.contentWindow.document;
// (Firefox requires us to put some empty content in the iframe) // (Firefox requires us to put some empty content in the iframe)
var paletteTitle = this.widget.wiki.getTiddlerText("$:/palette");
var colorScheme = (this.widget.wiki.getTiddler(paletteTitle) || {fields: {}}).fields["color-scheme"] || "light";
this.iframeDoc.open(); this.iframeDoc.open();
this.iframeDoc.write("<meta name='color-scheme' content='" + colorScheme + "'>"); this.iframeDoc.write("");
this.iframeDoc.close(); this.iframeDoc.close();
// Style the iframe // Style the iframe
this.iframeNode.className = this.dummyTextArea.className; this.iframeNode.className = this.dummyTextArea.className;

View File

@@ -115,7 +115,7 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
// Otherwise, we need to construct a default value for the editor // Otherwise, we need to construct a default value for the editor
switch(this.editField) { switch(this.editField) {
case "text": case "text":
value = ""; value = "Type the text for the tiddler '" + this.editTitle + "'";
type = "text/vnd.tiddlywiki"; type = "text/vnd.tiddlywiki";
break; break;
case "title": case "title":

View File

@@ -25,8 +25,8 @@ exports["prefix-lines"] = function(event,operation) {
$tw.utils.each(lines,function(line,index) { $tw.utils.each(lines,function(line,index) {
// Remove and count any existing prefix characters // Remove and count any existing prefix characters
var count = 0; var count = 0;
while($tw.utils.startsWith(line,event.paramObject.character)) { while(line.charAt(0) === event.paramObject.character) {
line = line.substring(event.paramObject.character.length); line = line.substring(1);
count++; count++;
} }
// Remove any whitespace // Remove any whitespace

View File

@@ -15,33 +15,16 @@ Text editor operation to wrap the selected lines with a prefix and suffix
exports["wrap-lines"] = function(event,operation) { exports["wrap-lines"] = function(event,operation) {
var prefix = event.paramObject.prefix || "", var prefix = event.paramObject.prefix || "",
suffix = event.paramObject.suffix || ""; suffix = event.paramObject.suffix || "";
if($tw.utils.endsWith(operation.text.substring(0,operation.selStart), prefix + "\n") && // Cut just past the preceding line break, or the start of the text
$tw.utils.startsWith(operation.text.substring(operation.selEnd), "\n" + suffix)) { operation.cutStart = $tw.utils.findPrecedingLineBreak(operation.text,operation.selStart);
// Selected text is already surrounded by prefix and suffix: Remove them // Cut to just past the following line break, or to the end of the text
// Cut selected text plus prefix and suffix operation.cutEnd = $tw.utils.findFollowingLineBreak(operation.text,operation.selEnd);
operation.cutStart = operation.selStart - (prefix.length + 1); // Add the prefix and suffix
operation.cutEnd = operation.selEnd + suffix.length + 1; operation.replacement = prefix + "\n" +
// Also cut the following newline (if there is any) operation.text.substring(operation.cutStart,operation.cutEnd) + "\n" +
if (operation.text[operation.cutEnd] === "\n") { suffix + "\n";
operation.cutEnd++; operation.newSelStart = operation.cutStart + prefix.length + 1;
} operation.newSelEnd = operation.newSelStart + (operation.cutEnd - operation.cutStart);
// Replace with selection
operation.replacement = operation.text.substring(operation.selStart,operation.selEnd);
// Select text that was in between prefix and suffix
operation.newSelStart = operation.cutStart;
operation.newSelEnd = operation.selEnd - (prefix.length + 1);
} else {
// Cut just past the preceding line break, or the start of the text
operation.cutStart = $tw.utils.findPrecedingLineBreak(operation.text,operation.selStart);
// Cut to just past the following line break, or to the end of the text
operation.cutEnd = $tw.utils.findFollowingLineBreak(operation.text,operation.selEnd);
// Add the prefix and suffix
operation.replacement = prefix + "\n" +
operation.text.substring(operation.cutStart,operation.cutEnd) + "\n" +
suffix + "\n";
operation.newSelStart = operation.cutStart + prefix.length + 1;
operation.newSelEnd = operation.newSelStart + (operation.cutEnd - operation.cutStart);
}
}; };
})(); })();

View File

@@ -16,9 +16,7 @@ exports.map = function(operationSubFunction,options) {
return function(results,source,widget) { return function(results,source,widget) {
if(results.length > 0) { if(results.length > 0) {
var inputTitles = results.toArray(), var inputTitles = results.toArray(),
index = 0, index = 0;
suffixes = options.suffixes,
flatten = (suffixes[0] && suffixes[0][0] === "flat") ? true : false;
results.clear(); results.clear();
$tw.utils.each(inputTitles,function(title) { $tw.utils.each(inputTitles,function(title) {
var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{ var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
@@ -38,13 +36,7 @@ exports.map = function(operationSubFunction,options) {
} }
} }
}); });
if(filtered.length && flatten) { results.push(filtered[0] || "");
$tw.utils.each(filtered,function(value) {
results.push(value);
})
} else {
results.push(filtered[0]||"");
}
++index; ++index;
}); });
} }

View File

@@ -12,9 +12,6 @@ Adds tiddler filtering methods to the $tw.Wiki object.
/*global $tw: false */ /*global $tw: false */
"use strict"; "use strict";
/* Maximum permitted filter recursion depth */
var MAX_FILTER_DEPTH = 300;
/* /*
Parses an operation (i.e. a run) within a filter string Parses an operation (i.e. a run) within a filter string
operators: Array of array of operator nodes into which results should be inserted operators: Array of array of operator nodes into which results should be inserted
@@ -223,18 +220,10 @@ source: an iterator function for the source tiddlers, called source(iterator), w
widget: an optional widget node for retrieving the current tiddler etc. widget: an optional widget node for retrieving the current tiddler etc.
*/ */
exports.compileFilter = function(filterString) { exports.compileFilter = function(filterString) {
if(!this.filterCache) {
this.filterCache = Object.create(null);
this.filterCacheCount = 0;
}
if(this.filterCache[filterString] !== undefined) {
return this.filterCache[filterString];
}
var filterParseTree; var filterParseTree;
try { try {
filterParseTree = this.parseFilter(filterString); filterParseTree = this.parseFilter(filterString);
} catch(e) { } catch(e) {
// We do not cache this result, so it adjusts along with localization changes
return function(source,widget) { return function(source,widget) {
return [$tw.language.getString("Error/Filter") + ": " + e]; return [$tw.language.getString("Error/Filter") + ": " + e];
}; };
@@ -331,7 +320,7 @@ exports.compileFilter = function(filterString) {
})()); })());
}); });
// Return a function that applies the operations to a source iterator of tiddler titles // Return a function that applies the operations to a source iterator of tiddler titles
var fnMeasured = $tw.perf.measure("filter: " + filterString,function filterFunction(source,widget) { return $tw.perf.measure("filter: " + filterString,function filterFunction(source,widget) {
if(!source) { if(!source) {
source = self.each; source = self.each;
} else if(typeof source === "object") { // Array or hashmap } else if(typeof source === "object") { // Array or hashmap
@@ -341,27 +330,11 @@ exports.compileFilter = function(filterString) {
widget = $tw.rootWidget; widget = $tw.rootWidget;
} }
var results = new $tw.utils.LinkedList(); var results = new $tw.utils.LinkedList();
self.filterRecursionCount = (self.filterRecursionCount || 0) + 1; $tw.utils.each(operationFunctions,function(operationFunction) {
if(self.filterRecursionCount < MAX_FILTER_DEPTH) { operationFunction(results,source,widget);
$tw.utils.each(operationFunctions,function(operationFunction) { });
operationFunction(results,source,widget);
});
} else {
results.push("/**-- Excessive filter recursion --**/");
}
self.filterRecursionCount = self.filterRecursionCount - 1;
return results.toArray(); return results.toArray();
}); });
if(this.filterCacheCount >= 2000) {
// To prevent memory leak, we maintain an upper limit for cache size.
// Reset if exceeded. This should give us 95% of the benefit
// that no cache limit would give us.
this.filterCache = Object.create(null);
this.filterCacheCount = 0;
}
this.filterCache[filterString] = fnMeasured;
this.filterCacheCount++;
return fnMeasured;
}; };
})(); })();

View File

@@ -1,35 +0,0 @@
/*\
title: $:/core/modules/filters/format/json.js
type: application/javascript
module-type: formatfilteroperator
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.json = function(source,operand,options) {
var results = [],
spaces = null;
if(operand) {
spaces = /^\d+$/.test(operand) ? parseInt(operand,10) : operand;
}
source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title);
try {
data = JSON.parse(title);
} catch(e) {
data = undefined;
}
if(data !== undefined) {
results.push(JSON.stringify(data,null,spaces));
}
});
return results;
};
})();

View File

@@ -1,46 +0,0 @@
/*\
title: $:/core/modules/filters/insertafter.js
type: application/javascript
module-type: filteroperator
Insert an item after another item in a list
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Order a list
*/
exports.insertafter = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
results.push(title);
});
var target = operator.operands[1] || (options.widget && options.widget.getVariable(operator.suffix || "currentTiddler"));
if(target !== operator.operand) {
// Remove the entry from the list if it is present
var pos = results.indexOf(operator.operand);
if(pos !== -1) {
results.splice(pos,1);
}
// Insert the entry after the target marker
pos = results.indexOf(target);
if(pos !== -1) {
results.splice(pos+1,0,operator.operand);
} else {
var suffix = operator.operands.length > 1 ? operator.suffix : "";
if(suffix === "start") {
results.splice(0,0,operator.operand);
} else {
results.push(operator.operand);
}
}
}
return results;
};
})();

View File

@@ -32,12 +32,7 @@ exports.insertbefore = function(source,operator,options) {
if(pos !== -1) { if(pos !== -1) {
results.splice(pos,0,operator.operand); results.splice(pos,0,operator.operand);
} else { } else {
var suffix = operator.operands.length > 1 ? operator.suffix : ""; results.push(operator.operand);
if(suffix == "start") {
results.splice(0,0,operator.operand);
} else {
results.push(operator.operand);
}
} }
} }
return results; return results;

View File

@@ -12,24 +12,24 @@ Filter operators for JSON operations
/*global $tw: false */ /*global $tw: false */
"use strict"; "use strict";
exports["jsonget"] = function(source,operator,options) { exports["getjson"] = function(source,operator,options) {
var results = []; var results = [];
source(function(tiddler,title) { source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title,title); var data = options.wiki.getTiddlerDataCached(title);
if(data) { if(data) {
var item = getDataItemValueAsString(data,operator.operands); var item = getDataItemValueAsStrings(data,operator.operands);
if(item !== undefined) { if(item !== undefined) {
results.push(item); results.push.apply(results,item);
} }
} }
}); });
return results; return results;
}; };
exports["jsonindexes"] = function(source,operator,options) { exports["indexesjson"] = function(source,operator,options) {
var results = []; var results = [];
source(function(tiddler,title) { source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title,title); var data = options.wiki.getTiddlerDataCached(title);
if(data) { if(data) {
var item = getDataItemKeysAsStrings(data,operator.operands); var item = getDataItemKeysAsStrings(data,operator.operands);
if(item !== undefined) { if(item !== undefined) {
@@ -40,10 +40,10 @@ exports["jsonindexes"] = function(source,operator,options) {
return results; return results;
}; };
exports["jsontype"] = function(source,operator,options) { exports["typejson"] = function(source,operator,options) {
var results = []; var results = [];
source(function(tiddler,title) { source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title,title); var data = options.wiki.getTiddlerDataCached(title);
if(data) { if(data) {
var item = getDataItemType(data,operator.operands); var item = getDataItemType(data,operator.operands);
if(item !== undefined) { if(item !== undefined) {
@@ -57,11 +57,11 @@ exports["jsontype"] = function(source,operator,options) {
/* /*
Given a JSON data structure and an array of index strings, return an array of the string representation of the values at the end of the index chain, or "undefined" if any of the index strings are invalid Given a JSON data structure and an array of index strings, return an array of the string representation of the values at the end of the index chain, or "undefined" if any of the index strings are invalid
*/ */
function getDataItemValueAsString(data,indexes) { function getDataItemValueAsStrings(data,indexes) {
// Get the item // Get the item
var item = getDataItem(data,indexes); var item = getDataItem(data,indexes);
// Return the item as a string // Return the item as a string
return convertDataItemValueToString(item); return convertDataItemValueToStrings(item);
} }
/* /*
@@ -77,15 +77,29 @@ function getDataItemKeysAsStrings(data,indexes) {
/* /*
Return an array of the string representation of the values of a data item, or "undefined" if the item is undefined Return an array of the string representation of the values of a data item, or "undefined" if the item is undefined
*/ */
function convertDataItemValueToString(item) { function convertDataItemValueToStrings(item) {
// Return the item as a string // Return the item as a string
if(item === undefined) { if(item === undefined) {
return item; return item;
} }
if(typeof item === "object") { if(typeof item === "object") {
return JSON.stringify(item); if(item === null) {
return ["null"];
}
var results = [];
if($tw.utils.isArray(item)) {
$tw.utils.each(item,function(value) {
results.push.apply(results,convertDataItemValueToStrings(value));
});
return results;
} else {
$tw.utils.each(Object.keys(item).sort(),function(key) {
results.push.apply(results,convertDataItemValueToStrings(item[key]));
});
return results;
}
} }
return item.toString(); return [item.toString()];
} }
/* /*

View File

@@ -116,7 +116,7 @@ WikiParser.prototype.loadRemoteTiddler = function(url) {
*/ */
WikiParser.prototype.setupRules = function(proto,configPrefix) { WikiParser.prototype.setupRules = function(proto,configPrefix) {
var self = this; var self = this;
if(!$tw.safeMode) { if(!$tw.safemode) {
$tw.utils.each(proto,function(object,name) { $tw.utils.each(proto,function(object,name) {
if(self.wiki.getTiddlerText(configPrefix + name,"enable") !== "enable") { if(self.wiki.getTiddlerText(configPrefix + name,"enable") !== "enable") {
delete proto[name]; delete proto[name];

View File

@@ -80,7 +80,6 @@ PutSaver.prototype.save = function(text,method,callback) {
if(this.etag) { if(this.etag) {
headers["If-Match"] = this.etag; headers["If-Match"] = this.etag;
} }
$tw.notifier.display("$:/language/Notifications/Save/Starting");
$tw.utils.httpRequest({ $tw.utils.httpRequest({
url: this.uri(), url: this.uri(),
type: "PUT", type: "PUT",
@@ -88,20 +87,17 @@ PutSaver.prototype.save = function(text,method,callback) {
data: text, data: text,
callback: function(err,data,xhr) { callback: function(err,data,xhr) {
if(err) { if(err) {
var status = xhr.status, // response is textual: "XMLHttpRequest error code: 412"
errorMsg = err; var status = Number(err.substring(err.indexOf(':') + 2, err.length))
if(status === 412) { // file changed on server if(status === 412) { // file changed on server
errorMsg = $tw.language.getString("Error/PutEditConflict"); callback($tw.language.getString("Error/PutEditConflict"));
} else if(status === 401) { // authentication required } else if(status === 401) { // authentication required
errorMsg = $tw.language.getString("Error/PutUnauthorized"); callback($tw.language.getString("Error/PutUnauthorized"));
} else if(status === 403) { // permission denied } else if(status === 403) { // permission denied
errorMsg = $tw.language.getString("Error/PutForbidden"); callback($tw.language.getString("Error/PutForbidden"));
} else {
callback(err); // fail
} }
if (xhr.responseText) {
// treat any server response like a plain text error explanation
errorMsg = errorMsg + "\n\n" + xhr.responseText;
}
callback(errorMsg); // fail
} else { } else {
self.etag = xhr.getResponseHeader("ETag"); self.etag = xhr.getResponseHeader("ETag");
if(self.etag == null) { if(self.etag == null) {

View File

@@ -64,7 +64,6 @@ UploadSaver.prototype.save = function(text,method,callback) {
var tail = "\r\n--" + boundary + "--\r\n", var tail = "\r\n--" + boundary + "--\r\n",
data = head.join("\r\n") + text + tail; data = head.join("\r\n") + text + tail;
// Do the HTTP post // Do the HTTP post
$tw.notifier.display("$:/language/Notifications/Save/Starting");
var http = new XMLHttpRequest(); var http = new XMLHttpRequest();
http.open("POST",url,true,username,password); http.open("POST",url,true,username,password);
http.setRequestHeader("Content-Type","multipart/form-data; charset=UTF-8; boundary=" + boundary); http.setRequestHeader("Content-Type","multipart/form-data; charset=UTF-8; boundary=" + boundary);
@@ -82,6 +81,7 @@ UploadSaver.prototype.save = function(text,method,callback) {
} catch(ex) { } catch(ex) {
return callback($tw.language.getString("Error/Caption") + ":" + ex); return callback($tw.language.getString("Error/Caption") + ":" + ex);
} }
$tw.notifier.display("$:/language/Notifications/Save/Starting");
return true; return true;
}; };

View File

@@ -359,9 +359,8 @@ Server.prototype.listen = function(port,host,prefix) {
} }
// Display the port number after we've started listening (the port number might have been specified as zero, in which case we will get an assigned port) // Display the port number after we've started listening (the port number might have been specified as zero, in which case we will get an assigned port)
server.on("listening",function() { server.on("listening",function() {
var address = server.address(), var address = server.address();
url = self.protocol + "://" + (address.family === "IPv6" ? "[" + address.address + "]" : address.address) + ":" + address.port + prefix; $tw.utils.log("Serving on " + self.protocol + "://" + address.address + ":" + address.port + prefix,"brown/orange");
$tw.utils.log("Serving on " + url,"brown/orange");
$tw.utils.log("(press ctrl-C to exit)","red"); $tw.utils.log("(press ctrl-C to exit)","red");
}); });
// Listen // Listen

View File

@@ -62,14 +62,12 @@ function loadIFrame(url,callback) {
Unload library iframe for given url Unload library iframe for given url
*/ */
function unloadIFrame(url){ function unloadIFrame(url){
var iframes = document.getElementsByTagName('iframe'); $tw.utils.each(document.getElementsByTagName('iframe'), function(iframe) {
for(var t=iframes.length-1; t--; t>=0) {
var iframe = iframes[t];
if(iframe.getAttribute("library") === "true" && if(iframe.getAttribute("library") === "true" &&
iframe.getAttribute("src") === url) { iframe.getAttribute("src") === url) {
iframe.parentNode.removeChild(iframe); iframe.parentNode.removeChild(iframe);
} }
} });
} }
function saveIFrameInfoTiddler(iframeInfo) { function saveIFrameInfoTiddler(iframeInfo) {

View File

@@ -54,9 +54,7 @@ exports.startup = function() {
var hash = $tw.utils.getLocationHash(); var hash = $tw.utils.getLocationHash();
if(hash !== $tw.locationHash) { if(hash !== $tw.locationHash) {
$tw.locationHash = hash; $tw.locationHash = hash;
if(hash !== "#") { openStartupTiddlers({defaultToCurrentStory: true});
openStartupTiddlers({defaultToCurrentStory: true});
}
} }
},false); },false);
// Listen for the tm-browser-refresh message // Listen for the tm-browser-refresh message

View File

@@ -281,56 +281,5 @@ exports.getLocationPath = function() {
return window.location.toString().split("#")[0]; return window.location.toString().split("#")[0];
}; };
/*
Collect DOM variables
*/
exports.collectDOMVariables = function(selectedNode,domNode,event) {
var variables = {},
selectedNodeRect,
domNodeRect;
if(selectedNode) {
$tw.utils.each(selectedNode.attributes,function(attribute) {
variables["dom-" + attribute.name] = attribute.value.toString();
});
if(selectedNode.offsetLeft) {
// Add a variable with a popup coordinate string for the selected node
variables["tv-popup-coords"] = "(" + selectedNode.offsetLeft + "," + selectedNode.offsetTop +"," + selectedNode.offsetWidth + "," + selectedNode.offsetHeight + ")";
// Add variables for offset of selected node
variables["tv-selectednode-posx"] = selectedNode.offsetLeft.toString();
variables["tv-selectednode-posy"] = selectedNode.offsetTop.toString();
variables["tv-selectednode-width"] = selectedNode.offsetWidth.toString();
variables["tv-selectednode-height"] = selectedNode.offsetHeight.toString();
}
}
if(domNode && domNode.offsetWidth) {
variables["tv-widgetnode-width"] = domNode.offsetWidth.toString();
variables["tv-widgetnode-height"] = domNode.offsetHeight.toString();
}
if(event && event.clientX && event.clientY) {
if(selectedNode) {
// Add variables for event X and Y position relative to selected node
selectedNodeRect = selectedNode.getBoundingClientRect();
variables["event-fromselected-posx"] = (event.clientX - selectedNodeRect.left).toString();
variables["event-fromselected-posy"] = (event.clientY - selectedNodeRect.top).toString();
}
if(domNode) {
// Add variables for event X and Y position relative to event catcher node
domNodeRect = domNode.getBoundingClientRect();
variables["event-fromcatcher-posx"] = (event.clientX - domNodeRect.left).toString();
variables["event-fromcatcher-posy"] = (event.clientY - domNodeRect.top).toString();
}
// Add variables for event X and Y position relative to the viewport
variables["event-fromviewport-posx"] = event.clientX.toString();
variables["event-fromviewport-posy"] = event.clientY.toString();
}
return variables;
};
})(); })();

View File

@@ -25,13 +25,14 @@ widget: widget to use as the context for the filter
exports.makeDraggable = function(options) { exports.makeDraggable = function(options) {
var dragImageType = options.dragImageType || "dom", var dragImageType = options.dragImageType || "dom",
dragImage, dragImage,
domNode = options.domNode; domNode = options.domNode,
dragHandle = options.selector && domNode.querySelector(options.selector) || domNode;
// Make the dom node draggable (not necessary for anchor tags) // Make the dom node draggable (not necessary for anchor tags)
if(!options.selector && ((domNode.tagName || "").toLowerCase() !== "a")) { if((domNode.tagName || "").toLowerCase() !== "a") {
domNode.setAttribute("draggable","true"); dragHandle.setAttribute("draggable","true");
} }
// Add event handlers // Add event handlers
$tw.utils.addEventListeners(domNode,[ $tw.utils.addEventListeners(dragHandle,[
{name: "dragstart", handlerFunction: function(event) { {name: "dragstart", handlerFunction: function(event) {
if(event.dataTransfer === undefined) { if(event.dataTransfer === undefined) {
return false; return false;
@@ -40,26 +41,20 @@ exports.makeDraggable = function(options) {
var dragTiddler = options.dragTiddlerFn && options.dragTiddlerFn(), var dragTiddler = options.dragTiddlerFn && options.dragTiddlerFn(),
dragFilter = options.dragFilterFn && options.dragFilterFn(), dragFilter = options.dragFilterFn && options.dragFilterFn(),
titles = dragTiddler ? [dragTiddler] : [], titles = dragTiddler ? [dragTiddler] : [],
startActions = options.startActions, startActions = options.startActions;
variables,
domNodeRect;
if(dragFilter) { if(dragFilter) {
titles.push.apply(titles,options.widget.wiki.filterTiddlers(dragFilter,options.widget)); titles.push.apply(titles,options.widget.wiki.filterTiddlers(dragFilter,options.widget));
} }
var titleString = $tw.utils.stringifyList(titles); var titleString = $tw.utils.stringifyList(titles);
// Check that we've something to drag // Check that we've something to drag
if(titles.length > 0 && (options.selector && $tw.utils.domMatchesSelector(event.target,options.selector) || event.target === domNode)) { if(titles.length > 0 && event.target === dragHandle) {
// Mark the drag in progress // Mark the drag in progress
$tw.dragInProgress = domNode; $tw.dragInProgress = domNode;
// Set the dragging class on the element being dragged // Set the dragging class on the element being dragged
$tw.utils.addClass(domNode,"tc-dragging"); $tw.utils.addClass(event.target,"tc-dragging");
// Invoke drag-start actions if given // Invoke drag-start actions if given
if(startActions !== undefined) { if(startActions !== undefined) {
// Collect our variables options.widget.invokeActionString(startActions,options.widget,event,{actionTiddler: titleString});
variables = $tw.utils.collectDOMVariables(domNode,null,event);
variables.modifier = $tw.keyboardManager.getEventModifierKeyDescriptor(event);
variables["actionTiddler"] = titleString;
options.widget.invokeActionString(startActions,options.widget,event,variables);
} }
// Create the drag image elements // Create the drag image elements
dragImage = options.widget.document.createElement("div"); dragImage = options.widget.document.createElement("div");
@@ -106,22 +101,20 @@ exports.makeDraggable = function(options) {
dataTransfer.setData("text/vnd.tiddler",jsonData); dataTransfer.setData("text/vnd.tiddler",jsonData);
dataTransfer.setData("text/plain",titleString); dataTransfer.setData("text/plain",titleString);
dataTransfer.setData("text/x-moz-url","data:text/vnd.tiddler," + encodeURIComponent(jsonData)); dataTransfer.setData("text/x-moz-url","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
} else {
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
} }
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
dataTransfer.setData("Text",titleString); dataTransfer.setData("Text",titleString);
event.stopPropagation(); event.stopPropagation();
} }
return false; return false;
}}, }},
{name: "dragend", handlerFunction: function(event) { {name: "dragend", handlerFunction: function(event) {
if((options.selector && $tw.utils.domMatchesSelector(event.target,options.selector)) || event.target === domNode) { if(event.target === domNode) {
// Collect the tiddlers being dragged // Collect the tiddlers being dragged
var dragTiddler = options.dragTiddlerFn && options.dragTiddlerFn(), var dragTiddler = options.dragTiddlerFn && options.dragTiddlerFn(),
dragFilter = options.dragFilterFn && options.dragFilterFn(), dragFilter = options.dragFilterFn && options.dragFilterFn(),
titles = dragTiddler ? [dragTiddler] : [], titles = dragTiddler ? [dragTiddler] : [],
endActions = options.endActions, endActions = options.endActions;
variables;
if(dragFilter) { if(dragFilter) {
titles.push.apply(titles,options.widget.wiki.filterTiddlers(dragFilter,options.widget)); titles.push.apply(titles,options.widget.wiki.filterTiddlers(dragFilter,options.widget));
} }
@@ -129,13 +122,10 @@ exports.makeDraggable = function(options) {
$tw.dragInProgress = null; $tw.dragInProgress = null;
// Invoke drag-end actions if given // Invoke drag-end actions if given
if(endActions !== undefined) { if(endActions !== undefined) {
variables = $tw.utils.collectDOMVariables(domNode,null,event); options.widget.invokeActionString(endActions,options.widget,event,{actionTiddler: titleString});
variables.modifier = $tw.keyboardManager.getEventModifierKeyDescriptor(event);
variables["actionTiddler"] = titleString;
options.widget.invokeActionString(endActions,options.widget,event,variables);
} }
// Remove the dragging class on the element being dragged // Remove the dragging class on the element being dragged
$tw.utils.removeClass(domNode,"tc-dragging"); $tw.utils.removeClass(event.target,"tc-dragging");
// Delete the drag image element // Delete the drag image element
if(dragImage) { if(dragImage) {
dragImage.parentNode.removeChild(dragImage); dragImage.parentNode.removeChild(dragImage);

View File

@@ -36,9 +36,8 @@ Notifier.prototype.display = function(title,options) {
if(!tiddler) { if(!tiddler) {
return; return;
} }
// Add classes and roles // Add classes
$tw.utils.addClass(notification,"tc-notification"); $tw.utils.addClass(notification,"tc-notification");
notification.setAttribute("role","alert");
// Create the variables // Create the variables
var variables = $tw.utils.extend({currentTiddler: title},options.variables); var variables = $tw.utils.extend({currentTiddler: title},options.variables);
// Render the body of the notification // Render the body of the notification

View File

@@ -42,7 +42,7 @@ var TW_TextNode = function(text) {
this.textContent = text + ""; this.textContent = text + "";
}; };
Object.setPrototypeOf(TW_TextNode,TW_Node.prototype); TW_TextNode.prototype = Object.create(TW_Node.prototype);
Object.defineProperty(TW_TextNode.prototype, "nodeType", { Object.defineProperty(TW_TextNode.prototype, "nodeType", {
get: function() { get: function() {
@@ -67,7 +67,7 @@ var TW_Element = function(tag,namespace) {
this.namespaceURI = namespace || "http://www.w3.org/1999/xhtml"; this.namespaceURI = namespace || "http://www.w3.org/1999/xhtml";
}; };
Object.setPrototypeOf(TW_Element,TW_Node.prototype); TW_Element.prototype = Object.create(TW_Node.prototype);
Object.defineProperty(TW_Element.prototype, "style", { Object.defineProperty(TW_Element.prototype, "style", {
get: function() { get: function() {

View File

@@ -48,9 +48,7 @@ Logger.prototype.log = function(/* args */) {
this.saveBufferLogger.buffer = this.saveBufferLogger.buffer.slice(-this.saveBufferLogger.saveLimit); this.saveBufferLogger.buffer = this.saveBufferLogger.buffer.slice(-this.saveBufferLogger.saveLimit);
} }
if(console !== undefined && console.log !== undefined) { if(console !== undefined && console.log !== undefined) {
var logMessage = [$tw.utils.terminalColour(this.colour) + this.componentName + ":"].concat(Array.prototype.slice.call(arguments,0)); return Function.apply.call(console.log, console, [$tw.utils.terminalColour(this.colour),this.componentName + ":"].concat(Array.prototype.slice.call(arguments,0)).concat($tw.utils.terminalColour()));
logMessage[logMessage.length-1] += $tw.utils.terminalColour();
return Function.apply.call(console.log, console, logMessage);
} }
} }
}; };

View File

@@ -12,41 +12,9 @@ Parse tree utility functions.
/*global $tw: false */ /*global $tw: false */
"use strict"; "use strict";
/*
Add attribute to parse tree node
Can be invoked as (node,name,value) or (node,attr)
*/
exports.addAttributeToParseTreeNode = function(node,name,value) { exports.addAttributeToParseTreeNode = function(node,name,value) {
var attribute = typeof name === "object" ? name : {name: name, type: "string", value: value};
name = attribute.name;
node.attributes = node.attributes || {}; node.attributes = node.attributes || {};
node.orderedAttributes = node.orderedAttributes || []; node.attributes[name] = {type: "string", value: value};
node.attributes[name] = attribute;
var foundIndex = -1;
$tw.utils.each(node.orderedAttributes,function(attr,index) {
if(attr.name === name) {
foundIndex = index;
}
});
if(foundIndex === -1) {
node.orderedAttributes.push(attribute);
} else {
node.orderedAttributes[foundIndex] = attribute;
}
};
exports.getOrderedAttributesFromParseTreeNode = function(node) {
if(node.orderedAttributes) {
return node.orderedAttributes;
} else {
var attributes = [];
$tw.utils.each(node.attributes,function(attribute) {
attributes.push(attribute);
});
return attributes.sort(function(a,b) {
return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0);
});
}
}; };
exports.getAttributeValueFromParseTreeNode = function(node,name,defaultValue) { exports.getAttributeValueFromParseTreeNode = function(node,name,defaultValue) {
@@ -57,45 +25,26 @@ exports.getAttributeValueFromParseTreeNode = function(node,name,defaultValue) {
}; };
exports.addClassToParseTreeNode = function(node,classString) { exports.addClassToParseTreeNode = function(node,classString) {
var classes = [], var classes = [];
attribute;
node.attributes = node.attributes || {}; node.attributes = node.attributes || {};
attribute = node.attributes["class"]; node.attributes["class"] = node.attributes["class"] || {type: "string", value: ""};
if(!attribute) { if(node.attributes["class"].type === "string") {
// If the class attribute does not exist, we must create it first. if(node.attributes["class"].value !== "") {
attribute = {name: "class", type: "string", value: ""}; classes = node.attributes["class"].value.split(" ");
node.attributes["class"] = attribute;
if(node.orderedAttributes) {
// If there are orderedAttributes, we've got to add them there too.
node.orderedAttributes.push(attribute);
}
}
if(attribute.type === "string") {
if(attribute.value !== "") {
classes = attribute.value.split(" ");
} }
if(classString !== "") { if(classString !== "") {
$tw.utils.pushTop(classes,classString.split(" ")); $tw.utils.pushTop(classes,classString.split(" "));
} }
attribute.value = classes.join(" "); node.attributes["class"].value = classes.join(" ");
} }
}; };
exports.addStyleToParseTreeNode = function(node,name,value) { exports.addStyleToParseTreeNode = function(node,name,value) {
var attribute; node.attributes = node.attributes || {};
node.attributes = node.attributes || {}; node.attributes.style = node.attributes.style || {type: "string", value: ""};
attribute = node.attributes.style; if(node.attributes.style.type === "string") {
if(!attribute) { node.attributes.style.value += name + ":" + value + ";";
attribute = {name: "style", type: "string", value: ""};
node.attributes.style = attribute;
if(node.orderedAttributes) {
// If there are orderedAttributes, we've got to add them there too.
node.orderedAttributes.push(attribute);
} }
}
if(attribute.type === "string") {
attribute.value += name + ":" + value + ";";
}
}; };
exports.findParseTreeNode = function(nodeArray,search) { exports.findParseTreeNode = function(nodeArray,search) {

View File

@@ -95,20 +95,6 @@ exports.repeat = function(str,count) {
return result; return result;
}; };
/*
Check if a string starts with another string
*/
exports.startsWith = function(str,search) {
return str.substring(0, search.length) === search;
};
/*
Check if a string ends with another string
*/
exports.endsWith = function(str,search) {
return str.substring(str.length - search.length) === search;
};
/* /*
Trim whitespace from the start and end of a string Trim whitespace from the start and end of a string
Thanks to Steven Levithan, http://blog.stevenlevithan.com/archives/faster-trim-javascript Thanks to Steven Levithan, http://blog.stevenlevithan.com/archives/faster-trim-javascript
@@ -462,7 +448,7 @@ exports.formatDateString = function(date,template) {
// 'return raw UTC (tiddlywiki style) date string.' // 'return raw UTC (tiddlywiki style) date string.'
if(t.indexOf("[UTC]") == 0 ) { if(t.indexOf("[UTC]") == 0 ) {
if(t == "[UTC]YYYY0MM0DD0hh0mm0ssXXX") if(t == "[UTC]YYYY0MM0DD0hh0mm0ssXXX")
return $tw.utils.stringifyDate(date || new Date()); return $tw.utils.stringifyDate(new Date());
var offset = date.getTimezoneOffset() ; // in minutes var offset = date.getTimezoneOffset() ; // in minutes
date = new Date(date.getTime()+offset*60*1000) ; date = new Date(date.getTime()+offset*60*1000) ;
t = t.substr(5) ; t = t.substr(5) ;

View File

@@ -36,7 +36,7 @@ Compute the internal state of the widget
*/ */
DeleteFieldWidget.prototype.execute = function() { DeleteFieldWidget.prototype.execute = function() {
this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler")); this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
this.actionField = this.getAttribute("$field",null); this.actionField = this.getAttribute("$field");
}; };
/* /*
@@ -59,7 +59,7 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
tiddler = this.wiki.getTiddler(self.actionTiddler), tiddler = this.wiki.getTiddler(self.actionTiddler),
removeFields = {}, removeFields = {},
hasChanged = false; hasChanged = false;
if((this.actionField !== null) && tiddler) { if(this.actionField && tiddler) {
removeFields[this.actionField] = undefined; removeFields[this.actionField] = undefined;
if(this.actionField in tiddler.fields) { if(this.actionField in tiddler.fields) {
hasChanged = true; hasChanged = true;

View File

@@ -35,7 +35,7 @@ SetFieldWidget.prototype.render = function(parent,nextSibling) {
Compute the internal state of the widget Compute the internal state of the widget
*/ */
SetFieldWidget.prototype.execute = function() { SetFieldWidget.prototype.execute = function() {
this.actionTiddler = this.getAttribute("$tiddler") || (!this.hasParseTreeNodeAttribute("$tiddler") && this.getVariable("currentTiddler")); this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
this.actionField = this.getAttribute("$field"); this.actionField = this.getAttribute("$field");
this.actionIndex = this.getAttribute("$index"); this.actionIndex = this.getAttribute("$index");
this.actionValue = this.getAttribute("$value"); this.actionValue = this.getAttribute("$value");
@@ -46,7 +46,11 @@ SetFieldWidget.prototype.execute = function() {
Refresh the widget by ensuring our attributes are up to date Refresh the widget by ensuring our attributes are up to date
*/ */
SetFieldWidget.prototype.refresh = function(changedTiddlers) { SetFieldWidget.prototype.refresh = function(changedTiddlers) {
// Nothing to refresh var changedAttributes = this.computeAttributes();
if(changedAttributes["$tiddler"] || changedAttributes["$field"] || changedAttributes["$index"] || changedAttributes["$value"]) {
this.refreshSelf();
return true;
}
return this.refreshChildren(changedTiddlers); return this.refreshChildren(changedTiddlers);
}; };
@@ -56,17 +60,15 @@ Invoke the action associated with this widget
SetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) { SetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
var self = this, var self = this,
options = {}; options = {};
if(this.actionTiddler) { options.suppressTimestamp = !this.actionTimestamp;
options.suppressTimestamp = !this.actionTimestamp; if((typeof this.actionField == "string") || (typeof this.actionIndex == "string") || (typeof this.actionValue == "string")) {
if((typeof this.actionField == "string") || (typeof this.actionIndex == "string") || (typeof this.actionValue == "string")) { this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options);
this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options);
}
$tw.utils.each(this.attributes,function(attribute,name) {
if(name.charAt(0) !== "$") {
self.wiki.setText(self.actionTiddler,name,undefined,attribute,options);
}
});
} }
$tw.utils.each(this.attributes,function(attribute,name) {
if(name.charAt(0) !== "$") {
self.wiki.setText(self.actionTiddler,name,undefined,attribute,options);
}
});
return true; // Action was invoked return true; // Action was invoked
}; };

View File

@@ -46,8 +46,7 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
isPoppedUp = (this.popup || this.popupTitle) && this.isPoppedUp(); isPoppedUp = (this.popup || this.popupTitle) && this.isPoppedUp();
if(this.selectedClass) { if(this.selectedClass) {
if((this.set || this.setTitle) && this.setTo && this.isSelected()) { if((this.set || this.setTitle) && this.setTo && this.isSelected()) {
$tw.utils.pushTop(classes, this.selectedClass.split(" ")); $tw.utils.pushTop(classes,this.selectedClass.split(" "));
domNode.setAttribute("aria-checked", "true");
} }
if(isPoppedUp) { if(isPoppedUp) {
$tw.utils.pushTop(classes,this.selectedClass.split(" ")); $tw.utils.pushTop(classes,this.selectedClass.split(" "));
@@ -67,9 +66,6 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
if(this["aria-label"]) { if(this["aria-label"]) {
domNode.setAttribute("aria-label",this["aria-label"]); domNode.setAttribute("aria-label",this["aria-label"]);
} }
if (this.role) {
domNode.setAttribute("role", this.role);
}
if(this.popup || this.popupTitle) { if(this.popup || this.popupTitle) {
domNode.setAttribute("aria-expanded",isPoppedUp ? "true" : "false"); domNode.setAttribute("aria-expanded",isPoppedUp ? "true" : "false");
} }
@@ -210,7 +206,6 @@ ButtonWidget.prototype.execute = function() {
this.popup = this.getAttribute("popup"); this.popup = this.getAttribute("popup");
this.hover = this.getAttribute("hover"); this.hover = this.getAttribute("hover");
this["aria-label"] = this.getAttribute("aria-label"); this["aria-label"] = this.getAttribute("aria-label");
this.role = this.getAttribute("role");
this.tooltip = this.getAttribute("tooltip"); this.tooltip = this.getAttribute("tooltip");
this.style = this.getAttribute("style"); this.style = this.getAttribute("style");
this["class"] = this.getAttribute("class",""); this["class"] = this.getAttribute("class","");

View File

@@ -27,7 +27,6 @@ CheckboxWidget.prototype = new Widget();
Render this widget into the DOM Render this widget into the DOM
*/ */
CheckboxWidget.prototype.render = function(parent,nextSibling) { CheckboxWidget.prototype.render = function(parent,nextSibling) {
var isChecked;
// Save the parent dom node // Save the parent dom node
this.parentDomNode = parent; this.parentDomNode = parent;
// Compute our attributes // Compute our attributes
@@ -36,16 +35,11 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) {
this.execute(); this.execute();
// Create our elements // Create our elements
this.labelDomNode = this.document.createElement("label"); this.labelDomNode = this.document.createElement("label");
this.labelDomNode.setAttribute("class","tc-checkbox " + this.checkboxClass); this.labelDomNode.setAttribute("class",this.checkboxClass);
this.inputDomNode = this.document.createElement("input"); this.inputDomNode = this.document.createElement("input");
this.inputDomNode.setAttribute("type","checkbox"); this.inputDomNode.setAttribute("type","checkbox");
isChecked = this.getValue(); if(this.getValue()) {
if(isChecked) {
this.inputDomNode.setAttribute("checked","true"); this.inputDomNode.setAttribute("checked","true");
$tw.utils.addClass(this.labelDomNode,"tc-checkbox-checked");
}
if(isChecked === undefined && this.checkboxIndeterminate === "yes") {
this.inputDomNode.indeterminate = true;
} }
if(this.isDisabled === "yes") { if(this.isDisabled === "yes") {
this.inputDomNode.setAttribute("disabled",true); this.inputDomNode.setAttribute("disabled",true);
@@ -65,25 +59,20 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) {
CheckboxWidget.prototype.getValue = function() { CheckboxWidget.prototype.getValue = function() {
var tiddler = this.wiki.getTiddler(this.checkboxTitle); var tiddler = this.wiki.getTiddler(this.checkboxTitle);
if(tiddler || this.checkboxFilter) { if(tiddler) {
if(tiddler && this.checkboxTag) { if(this.checkboxTag) {
if(this.checkboxInvertTag === "yes") { if(this.checkboxInvertTag) {
return !tiddler.hasTag(this.checkboxTag); return !tiddler.hasTag(this.checkboxTag);
} else { } else {
return tiddler.hasTag(this.checkboxTag); return tiddler.hasTag(this.checkboxTag);
} }
} }
if(tiddler && (this.checkboxField || this.checkboxIndex)) { if(this.checkboxField) {
// Same logic applies to fields and indexes
var value; var value;
if(this.checkboxField) { if($tw.utils.hop(tiddler.fields,this.checkboxField)) {
if($tw.utils.hop(tiddler.fields,this.checkboxField)) { value = tiddler.fields[this.checkboxField] || "";
value = tiddler.fields[this.checkboxField] || "";
} else {
value = this.checkboxDefault || "";
}
} else { } else {
value = this.wiki.extractTiddlerDataItem(tiddler,this.checkboxIndex,this.checkboxDefault || ""); value = this.checkboxDefault || "";
} }
if(value === this.checkboxChecked) { if(value === this.checkboxChecked) {
return true; return true;
@@ -91,59 +80,15 @@ CheckboxWidget.prototype.getValue = function() {
if(value === this.checkboxUnchecked) { if(value === this.checkboxUnchecked) {
return false; return false;
} }
// Neither value found: were both specified?
if(this.checkboxChecked && !this.checkboxUnchecked) {
return false; // Absence of checked value
}
if(this.checkboxUnchecked && !this.checkboxChecked) {
return true; // Absence of unchecked value
}
if(this.checkboxChecked && this.checkboxUnchecked) {
// Both specified but neither found: indeterminate or false, depending
if(this.checkboxIndeterminate === "yes") {
return undefined;
} else {
return false;
}
}
} }
if(this.checkboxListField || this.checkboxListIndex || this.checkboxFilter) { if(this.checkboxIndex) {
// Same logic applies to lists and filters var value = this.wiki.extractTiddlerDataItem(tiddler,this.checkboxIndex,this.checkboxDefault || "");
var list; if(value === this.checkboxChecked) {
if(this.checkboxListField) {
if($tw.utils.hop(tiddler.fields,this.checkboxListField)) {
list = tiddler.getFieldList(this.checkboxListField);
} else {
list = $tw.utils.parseStringArray(this.checkboxDefault || "") || [];
}
} else if (this.checkboxListIndex) {
list = $tw.utils.parseStringArray(this.wiki.extractTiddlerDataItem(tiddler,this.checkboxListIndex,this.checkboxDefault || "")) || [];
} else {
list = this.wiki.filterTiddlers(this.checkboxFilter,this) || [];
}
if(list.indexOf(this.checkboxChecked) !== -1) {
return true; return true;
} }
if(list.indexOf(this.checkboxUnchecked) !== -1) { if(value === this.checkboxUnchecked) {
return false; return false;
} }
// Neither one present
if(this.checkboxChecked && !this.checkboxUnchecked) {
return false; // Absence of checked value
}
if(this.checkboxUnchecked && !this.checkboxChecked) {
return true; // Absence of unchecked value
}
if(this.checkboxChecked && this.checkboxUnchecked) {
// Both specified but neither found: indeterminate or false, depending
if(this.checkboxIndeterminate === "yes") {
return undefined;
} else {
return false;
}
}
// Neither specified, so empty list is false, non-empty is true
return !!list.length;
} }
} else { } else {
if(this.checkboxTag) { if(this.checkboxTag) {
@@ -169,8 +114,7 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
hasChanged = false, hasChanged = false,
tagCheck = false, tagCheck = false,
hasTag = tiddler && tiddler.hasTag(this.checkboxTag), hasTag = tiddler && tiddler.hasTag(this.checkboxTag),
value = checked ? this.checkboxChecked : this.checkboxUnchecked, value = checked ? this.checkboxChecked : this.checkboxUnchecked;
notValue = checked ? this.checkboxUnchecked : this.checkboxChecked;
if(this.checkboxTag && this.checkboxInvertTag === "yes") { if(this.checkboxTag && this.checkboxInvertTag === "yes") {
tagCheck = hasTag === checked; tagCheck = hasTag === checked;
} else { } else {
@@ -204,58 +148,9 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
hasChanged = true; hasChanged = true;
} }
} }
// Set the list field (or index) if specified
if(this.checkboxListField || this.checkboxListIndex) {
var fieldContents, listContents, oldPos, newPos;
if(this.checkboxListField) {
fieldContents = tiddler ? tiddler.fields[this.checkboxListField] : undefined;
} else {
fieldContents = this.wiki.extractTiddlerDataItem(this.checkboxTitle,this.checkboxListIndex);
}
if($tw.utils.isArray(fieldContents)) {
// Make a copy so we can modify it without changing original that's refrenced elsewhere
listContents = fieldContents.slice(0);
} else {
listContents = $tw.utils.parseStringArray(fieldContents) || [];
// No need to copy since parseStringArray returns a fresh array, not refrenced elsewhere
}
oldPos = notValue ? listContents.indexOf(notValue) : -1;
newPos = value ? listContents.indexOf(value) : -1;
if(oldPos === -1 && newPos !== -1) {
// old value absent, new value present: no change needed
} else if(oldPos === -1) {
// neither one was present
if(value) {
listContents.push(value);
hasChanged = true;
} else {
// value unspecified? then leave list unchanged
}
} else if(newPos === -1) {
// old value present, new value absent
if(value) {
listContents[oldPos] = value;
hasChanged = true;
} else {
listContents.splice(oldPos, 1)
hasChanged = true;
}
} else {
// both were present: just remove the old one, leave new alone
listContents.splice(oldPos, 1)
hasChanged = true;
}
if(this.checkboxListField) {
newFields[this.checkboxListField] = $tw.utils.stringifyList(listContents);
}
// The listIndex case will be handled in the if(hasChanged) block below
}
if(hasChanged) { if(hasChanged) {
if(this.checkboxIndex) { if(this.checkboxIndex) {
this.wiki.setText(this.checkboxTitle,"",this.checkboxIndex,value); this.wiki.setText(this.checkboxTitle,"",this.checkboxIndex,value);
} else if(this.checkboxListIndex) {
var listIndexValue = (listContents && listContents.length) ? $tw.utils.stringifyList(listContents) : undefined;
this.wiki.setText(this.checkboxTitle,"",this.checkboxListIndex,listIndexValue);
} else { } else {
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),fallbackFields,tiddler,newFields,this.wiki.getModificationFields())); this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),fallbackFields,tiddler,newFields,this.wiki.getModificationFields()));
} }
@@ -284,13 +179,9 @@ CheckboxWidget.prototype.execute = function() {
this.checkboxTag = this.getAttribute("tag"); this.checkboxTag = this.getAttribute("tag");
this.checkboxField = this.getAttribute("field"); this.checkboxField = this.getAttribute("field");
this.checkboxIndex = this.getAttribute("index"); this.checkboxIndex = this.getAttribute("index");
this.checkboxListField = this.getAttribute("listField");
this.checkboxListIndex = this.getAttribute("listIndex");
this.checkboxFilter = this.getAttribute("filter");
this.checkboxChecked = this.getAttribute("checked"); this.checkboxChecked = this.getAttribute("checked");
this.checkboxUnchecked = this.getAttribute("unchecked"); this.checkboxUnchecked = this.getAttribute("unchecked");
this.checkboxDefault = this.getAttribute("default"); this.checkboxDefault = this.getAttribute("default");
this.checkboxIndeterminate = this.getAttribute("indeterminate","no");
this.checkboxClass = this.getAttribute("class",""); this.checkboxClass = this.getAttribute("class","");
this.checkboxInvertTag = this.getAttribute("invertTag",""); this.checkboxInvertTag = this.getAttribute("invertTag","");
this.isDisabled = this.getAttribute("disabled","no"); this.isDisabled = this.getAttribute("disabled","no");
@@ -303,21 +194,14 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/ */
CheckboxWidget.prototype.refresh = function(changedTiddlers) { CheckboxWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes(); var changedAttributes = this.computeAttributes();
if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.listField || changedAttributes.listIndex || changedAttributes.filter || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes.indeterminate || changedAttributes["class"] || changedAttributes.disabled) { if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.disabled) {
this.refreshSelf(); this.refreshSelf();
return true; return true;
} else { } else {
var refreshed = false; var refreshed = false;
if(changedTiddlers[this.checkboxTitle]) { if(changedTiddlers[this.checkboxTitle]) {
var isChecked = this.getValue(); this.inputDomNode.checked = this.getValue();
this.inputDomNode.checked = !!isChecked;
this.inputDomNode.indeterminate = (isChecked === undefined);
refreshed = true; refreshed = true;
if(isChecked) {
$tw.utils.addClass(this.labelDomNode,"tc-checkbox-checked");
} else {
$tw.utils.removeClass(this.labelDomNode,"tc-checkbox-checked");
}
} }
return this.refreshChildren(changedTiddlers) || refreshed; return this.refreshChildren(changedTiddlers) || refreshed;
} }

View File

@@ -48,7 +48,7 @@ DraggableWidget.prototype.render = function(parent,nextSibling) {
if(this.draggableClasses) { if(this.draggableClasses) {
classes.push(this.draggableClasses); classes.push(this.draggableClasses);
} }
if(!this.dragHandleSelector && this.dragEnable) { if(!this.dragHandleSelector) {
classes.push("tc-draggable"); classes.push("tc-draggable");
} }
domNode.setAttribute("class",classes.join(" ")); domNode.setAttribute("class",classes.join(" "));
@@ -56,18 +56,16 @@ DraggableWidget.prototype.render = function(parent,nextSibling) {
parent.insertBefore(domNode,nextSibling); parent.insertBefore(domNode,nextSibling);
this.renderChildren(domNode,null); this.renderChildren(domNode,null);
// Add event handlers // Add event handlers
if(this.dragEnable) { $tw.utils.makeDraggable({
$tw.utils.makeDraggable({ domNode: domNode,
domNode: domNode, dragTiddlerFn: function() {return self.getAttribute("tiddler");},
dragTiddlerFn: function() {return self.getAttribute("tiddler");}, dragFilterFn: function() {return self.getAttribute("filter");},
dragFilterFn: function() {return self.getAttribute("filter");}, startActions: self.startActions,
startActions: self.startActions, endActions: self.endActions,
endActions: self.endActions, dragImageType: self.dragImageType,
dragImageType: self.dragImageType, widget: this,
widget: this, selector: self.dragHandleSelector
selector: self.dragHandleSelector });
});
}
this.domNodes.push(domNode); this.domNodes.push(domNode);
}; };
@@ -82,37 +80,16 @@ DraggableWidget.prototype.execute = function() {
this.endActions = this.getAttribute("endactions"); this.endActions = this.getAttribute("endactions");
this.dragImageType = this.getAttribute("dragimagetype"); this.dragImageType = this.getAttribute("dragimagetype");
this.dragHandleSelector = this.getAttribute("selector"); this.dragHandleSelector = this.getAttribute("selector");
this.dragEnable = this.getAttribute("enable","yes") === "yes";
// Make the child widgets // Make the child widgets
this.makeChildWidgets(); this.makeChildWidgets();
}; };
DraggableWidget.prototype.updateDomNodeClasses = function() {
var domNodeClasses = this.domNodes[0].className.split(" "),
oldClasses = this.draggableClasses.split(" ");
this.draggableClasses = this.getAttribute("class");
//Remove classes assigned from the old value of class attribute
$tw.utils.each(oldClasses,function(oldClass){
var i = domNodeClasses.indexOf(oldClass);
if(i !== -1) {
domNodeClasses.splice(i,1);
}
});
//Add new classes from updated class attribute.
$tw.utils.pushTop(domNodeClasses,this.draggableClasses);
this.domNodes[0].setAttribute("class",domNodeClasses.join(" "))
}
/* /*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/ */
DraggableWidget.prototype.refresh = function(changedTiddlers) { DraggableWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes(), var changedAttributes = this.computeAttributes();
changedAttributesCount = $tw.utils.count(changedAttributes); if(changedAttributes.tag || changedAttributes["class"]) {
if(changedAttributesCount === 1 && changedAttributes["class"]) {
this.updateDomNodeClasses();
} else if(changedAttributesCount > 0) {
this.refreshSelf(); this.refreshSelf();
return true; return true;
} }
@@ -121,4 +98,4 @@ DraggableWidget.prototype.refresh = function(changedTiddlers) {
exports.draggable = DraggableWidget; exports.draggable = DraggableWidget;
})(); })();

View File

@@ -42,22 +42,16 @@ ElementWidget.prototype.render = function(parent,nextSibling) {
this.tag = "h" + headingLevel; this.tag = "h" + headingLevel;
} }
// Select the namespace for the tag // Select the namespace for the tag
var XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml", var tagNamespaces = {
tagNamespaces = {
svg: "http://www.w3.org/2000/svg", svg: "http://www.w3.org/2000/svg",
math: "http://www.w3.org/1998/Math/MathML", math: "http://www.w3.org/1998/Math/MathML",
body: XHTML_NAMESPACE body: "http://www.w3.org/1999/xhtml"
}; };
this.namespace = tagNamespaces[this.tag]; this.namespace = tagNamespaces[this.tag];
if(this.namespace) { if(this.namespace) {
this.setVariable("namespace",this.namespace); this.setVariable("namespace",this.namespace);
} else { } else {
if(this.hasAttribute("xmlns")) { this.namespace = this.getVariable("namespace",{defaultValue: "http://www.w3.org/1999/xhtml"});
this.namespace = this.getAttribute("xmlns");
this.setVariable("namespace",this.namespace);
} else {
this.namespace = this.getVariable("namespace",{defaultValue: XHTML_NAMESPACE});
}
} }
// Invoke the th-rendering-element hook // Invoke the th-rendering-element hook
var parseTreeNodes = $tw.hooks.invokeHook("th-rendering-element",null,this); var parseTreeNodes = $tw.hooks.invokeHook("th-rendering-element",null,this);

View File

@@ -1,63 +0,0 @@
/*\
title: $:/core/modules/widgets/error.js
type: application/javascript
module-type: widget
Error widget
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var ErrorWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
ErrorWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
ErrorWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
var message = this.getAttribute("$message","Unknown error"),
domNode = this.document.createElement("span");
domNode.appendChild(this.document.createTextNode(message));
domNode.className = "tc-error";
parent.insertBefore(domNode,nextSibling);
this.domNodes.push(domNode);
};
/*
Compute the internal state of the widget
*/
ErrorWidget.prototype.execute = function() {
// Nothing to do for a text node
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
ErrorWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes["$message"]) {
this.refreshSelf();
return true;
} else {
return false;
}
};
exports.error = ErrorWidget;
})();

View File

@@ -72,7 +72,33 @@ EventWidget.prototype.render = function(parent,nextSibling) {
} }
// Only set up variables if we have actions to invoke // Only set up variables if we have actions to invoke
if(actions) { if(actions) {
variables = $tw.utils.collectDOMVariables(selectedNode,self.domNode,event); $tw.utils.each(selectedNode.attributes,function(attribute) {
variables["dom-" + attribute.name] = attribute.value.toString();
});
//Add a variable with a popup coordinate string for the selected node
variables["tv-popup-coords"] = "(" + selectedNode.offsetLeft + "," + selectedNode.offsetTop +"," + selectedNode.offsetWidth + "," + selectedNode.offsetHeight + ")";
//Add variables for offset of selected node
variables["tv-selectednode-posx"] = selectedNode.offsetLeft.toString();
variables["tv-selectednode-posy"] = selectedNode.offsetTop.toString();
variables["tv-selectednode-width"] = selectedNode.offsetWidth.toString();
variables["tv-selectednode-height"] = selectedNode.offsetHeight.toString();
if(event.clientX && event.clientY) {
//Add variables for event X and Y position relative to selected node
selectedNodeRect = selectedNode.getBoundingClientRect();
variables["event-fromselected-posx"] = (event.clientX - selectedNodeRect.left).toString();
variables["event-fromselected-posy"] = (event.clientY - selectedNodeRect.top).toString();
//Add variables for event X and Y position relative to event catcher node
catcherNodeRect = self.domNode.getBoundingClientRect();
variables["event-fromcatcher-posx"] = (event.clientX - catcherNodeRect.left).toString();
variables["event-fromcatcher-posy"] = (event.clientY - catcherNodeRect.top).toString();
//Add variables for event X and Y position relative to the viewport
variables["event-fromviewport-posx"] = event.clientX.toString();
variables["event-fromviewport-posy"] = event.clientY.toString();
}
} }
} }
// Execute our actions with the variables // Execute our actions with the variables

View File

@@ -1,108 +0,0 @@
/*\
title: $:/core/modules/widgets/genesis.js
type: application/javascript
module-type: widget
Genesis widget for dynamically creating widgets
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var GenesisWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
GenesisWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
GenesisWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes({filterFn: function(name) {
// Only compute our own attributes which start with a single dollar
return name.charAt(0) === "$" && name.charAt(1) !== "$";
}});
this.execute();
this.renderChildren(parent,nextSibling);
};
/*
Compute the internal state of the widget
*/
GenesisWidget.prototype.execute = function() {
var self = this;
// Collect attributes
this.genesisType = this.getAttribute("$type","element");
this.genesisRemappable = this.getAttribute("$remappable","yes") === "yes";
this.genesisNames = this.getAttribute("$names","");
this.genesisValues = this.getAttribute("$values","");
// Construct parse tree
var isElementWidget = this.genesisType.charAt(0) !== "$",
nodeType = isElementWidget ? "element" : this.genesisType.substr(1),
nodeTag = isElementWidget ? this.genesisType : undefined;
var parseTreeNodes = [{
type: nodeType,
tag: nodeTag,
attributes: {},
orderedAttributes: [],
children: this.parseTreeNode.children || [],
isNotRemappable: !this.genesisRemappable
}];
// Apply explicit attributes
$tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(this.parseTreeNode),function(attribute) {
var name = attribute.name;
if(name.charAt(0) === "$") {
if(name.charAt(1) === "$") {
// Double $$ is changed to a single $
name = name.substr(1);
} else {
// Single dollar is ignored
return;
}
}
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],$tw.utils.extend({},attribute,{name: name}));
});
// Apply attributes in $names/$values
this.attributeNames = [];
this.attributeValues = [];
if(this.genesisNames && this.genesisValues) {
this.attributeNames = this.wiki.filterTiddlers(self.genesisNames,this);
this.attributeValues = this.wiki.filterTiddlers(self.genesisValues,this);
$tw.utils.each(this.attributeNames,function(varname,index) {
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],varname,self.attributeValues[index] || "");
});
}
// Construct the child widgets
this.makeChildWidgets(parseTreeNodes);
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
GenesisWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes(),
filterNames = this.getAttribute("$names",""),
filterValues = this.getAttribute("$values",""),
attributeNames = this.wiki.filterTiddlers(filterNames,this),
attributeValues = this.wiki.filterTiddlers(filterValues,this);
if($tw.utils.count(changedAttributes) > 0 || !$tw.utils.isArrayEqual(this.attributeNames,attributeNames) || !$tw.utils.isArrayEqual(this.attributeValues,attributeValues)) {
this.refreshSelf();
return true;
} else {
return this.refreshChildren(changedTiddlers);
}
};
exports.genesis = GenesisWidget;
})();

View File

@@ -111,9 +111,6 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
if(this.imageAlt) { if(this.imageAlt) {
domNode.setAttribute("alt",this.imageAlt); domNode.setAttribute("alt",this.imageAlt);
} }
if(this.lazyLoading && tag === "img") {
domNode.setAttribute("loading",this.lazyLoading);
}
// Add classes when the image loads or fails // Add classes when the image loads or fails
$tw.utils.addClass(domNode,"tc-image-loading"); $tw.utils.addClass(domNode,"tc-image-loading");
domNode.addEventListener("load",function() { domNode.addEventListener("load",function() {
@@ -140,7 +137,6 @@ ImageWidget.prototype.execute = function() {
this.imageClass = this.getAttribute("class"); this.imageClass = this.getAttribute("class");
this.imageTooltip = this.getAttribute("tooltip"); this.imageTooltip = this.getAttribute("tooltip");
this.imageAlt = this.getAttribute("alt"); this.imageAlt = this.getAttribute("alt");
this.lazyLoading = this.getAttribute("loading");
}; };
/* /*

View File

@@ -39,10 +39,7 @@ Compute the internal state of the widget
ImportVariablesWidget.prototype.execute = function(tiddlerList) { ImportVariablesWidget.prototype.execute = function(tiddlerList) {
var widgetPointer = this; var widgetPointer = this;
// Got to flush all the accumulated variables // Got to flush all the accumulated variables
this.variables = Object.create(null); this.variables = new this.variablesConstructor();
if(this.parentWidget) {
Object.setPrototypeOf(this.variables,this.parentWidget.variables);
}
// Get our parameters // Get our parameters
this.filter = this.getAttribute("filter"); this.filter = this.getAttribute("filter");
// Compute the filter // Compute the filter

View File

@@ -48,12 +48,14 @@ LetWidget.prototype.computeAttributes = function() {
var changedAttributes = {}, var changedAttributes = {},
self = this; self = this;
this.currentValueFor = Object.create(null); this.currentValueFor = Object.create(null);
$tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(this.parseTreeNode),function(attribute) { $tw.utils.each(this.parseTreeNode.orderedAttributes,function(attribute,index) {
var value = self.computeAttribute(attribute), var value = self.computeAttribute(attribute),
name = attribute.name; name = attribute.name;
// Now that it's prepped, we're allowed to look this variable up if(name.charAt(0) !== "$") {
// when defining later variables // Now that it's prepped, we're allowed to look this variable up
self.currentValueFor[name] = value; // when defining later variables
self.currentValueFor[name] = value;
}
}); });
// Run through again, setting variables and looking for differences // Run through again, setting variables and looking for differences
$tw.utils.each(this.currentValueFor,function(value,name) { $tw.utils.each(this.currentValueFor,function(value,name) {

View File

@@ -159,8 +159,6 @@ ScrollableWidget.prototype.render = function(parent,nextSibling) {
// Create elements // Create elements
this.outerDomNode = this.document.createElement("div"); this.outerDomNode = this.document.createElement("div");
$tw.utils.setStyle(this.outerDomNode,[ $tw.utils.setStyle(this.outerDomNode,[
{overflowY: "auto"},
{overflowX: "auto"},
{webkitOverflowScrolling: "touch"} {webkitOverflowScrolling: "touch"}
]); ]);
this.innerDomNode = this.document.createElement("div"); this.innerDomNode = this.document.createElement("div");

View File

@@ -12,9 +12,6 @@ Widget base class
/*global $tw: false */ /*global $tw: false */
"use strict"; "use strict";
/* Maximum permitted depth of the widget tree for recursion detection */
var MAX_WIDGET_TREE_DEPTH = 1000;
/* /*
Create a widget object for a parse tree node Create a widget object for a parse tree node
parseTreeNode: reference to the parse tree node to be rendered parseTreeNode: reference to the parse tree node to be rendered
@@ -41,10 +38,9 @@ Widget.prototype.initialise = function(parseTreeNode,options) {
this.parseTreeNode = parseTreeNode; this.parseTreeNode = parseTreeNode;
this.wiki = options.wiki; this.wiki = options.wiki;
this.parentWidget = options.parentWidget; this.parentWidget = options.parentWidget;
this.variables = Object.create(null); this.variablesConstructor = function() {};
if(this.parentWidget) { this.variablesConstructor.prototype = this.parentWidget ? this.parentWidget.variables : {};
Object.setPrototypeOf(this.variables,this.parentWidget.variables); this.variables = new this.variablesConstructor();
}
this.document = options.document; this.document = options.document;
this.attributes = {}; this.attributes = {};
this.children = []; this.children = [];
@@ -293,19 +289,12 @@ Widget.prototype.computeAttribute = function(attribute) {
}; };
/* /*
Check for the presence of an evaluated attribute on the widget. Note that attributes set to a missing variable (ie attr=<<missing>>) will be treated as missing Check for the presence of an attribute
*/ */
Widget.prototype.hasAttribute = function(name) { Widget.prototype.hasAttribute = function(name) {
return $tw.utils.hop(this.attributes,name); return $tw.utils.hop(this.attributes,name);
}; };
/*
Check for the presence of a raw attribute on the widget parse tree node. Note that attributes set to a missing variable (ie attr=<<missing>>) will NOT be treated as missing
*/
Widget.prototype.hasParseTreeNodeAttribute = function(name) {
return $tw.utils.hop(this.parseTreeNode.attributes,name);
};
/* /*
Get the value of an attribute Get the value of an attribute
*/ */
@@ -361,20 +350,6 @@ Widget.prototype.assignAttributes = function(domNode,options) {
} }
}; };
/*
Get the number of ancestor widgets for this widget
*/
Widget.prototype.getAncestorCount = function() {
if(this.ancestorCount === undefined) {
if(this.parentWidget) {
this.ancestorCount = this.parentWidget.getAncestorCount() + 1;
} else {
this.ancestorCount = 0;
}
}
return this.ancestorCount;
};
/* /*
Make child widgets correspondng to specified parseTreeNodes Make child widgets correspondng to specified parseTreeNodes
*/ */
@@ -382,29 +357,21 @@ Widget.prototype.makeChildWidgets = function(parseTreeNodes,options) {
options = options || {}; options = options || {};
this.children = []; this.children = [];
var self = this; var self = this;
// Check for too much recursion // Create set variable widgets for each variable
if(this.getAncestorCount() > MAX_WIDGET_TREE_DEPTH) { $tw.utils.each(options.variables,function(value,name) {
this.children.push(this.makeChildWidget({type: "error", attributes: { var setVariableWidget = {
"$message": {type: "string", value: $tw.language.getString("Error/RecursiveTransclusion")} type: "set",
}})); attributes: {
} else { name: {type: "string", value: name},
// Create set variable widgets for each variable value: {type: "string", value: value}
$tw.utils.each(options.variables,function(value,name) { },
var setVariableWidget = { children: parseTreeNodes
type: "set", };
attributes: { parseTreeNodes = [setVariableWidget];
name: {type: "string", value: name}, });
value: {type: "string", value: value} $tw.utils.each(parseTreeNodes || (this.parseTreeNode && this.parseTreeNode.children),function(childNode) {
}, self.children.push(self.makeChildWidget(childNode));
children: parseTreeNodes });
};
parseTreeNodes = [setVariableWidget];
});
// Create the child widgets
$tw.utils.each(parseTreeNodes || (this.parseTreeNode && this.parseTreeNode.children),function(childNode) {
self.children.push(self.makeChildWidget(childNode));
});
}
}; };
/* /*

View File

@@ -50,7 +50,7 @@ exports.getTextReference = function(textRef,defaultText,currTiddlerTitle) {
if(tr.field) { if(tr.field) {
var tiddler = this.getTiddler(title); var tiddler = this.getTiddler(title);
if(tr.field === "title") { // Special case so we can return the title of a non-existent tiddler if(tr.field === "title") { // Special case so we can return the title of a non-existent tiddler
return title || defaultText; return title;
} else if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) { } else if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {
return tiddler.getFieldString(tr.field); return tiddler.getFieldString(tr.field);
} else { } else {

View File

@@ -11,7 +11,7 @@ alert-highlight: #FFD60A
alert-muted-foreground: <<colour muted-foreground>> alert-muted-foreground: <<colour muted-foreground>>
background: #282828 background: #282828
blockquote-bar: <<colour page-background>> blockquote-bar: <<colour page-background>>
button-foreground: <<colour foreground>> button-foreground: <<colour background>>
code-background: <<colour pre-background>> code-background: <<colour pre-background>>
code-border: <<colour pre-border>> code-border: <<colour pre-border>>
code-foreground: rgba(255, 255, 255, 0.54) code-foreground: rgba(255, 255, 255, 0.54)
@@ -52,7 +52,7 @@ pre-border: transparent
primary: #0A84FF primary: #0A84FF
select-tag-background: <<colour background>> select-tag-background: <<colour background>>
select-tag-foreground: <<colour foreground>> select-tag-foreground: <<colour foreground>>
sidebar-button-foreground: <<colour foreground>> sidebar-button-foreground: <<colour background>>
sidebar-controls-foreground-hover: #FF9F0A sidebar-controls-foreground-hover: #FF9F0A
sidebar-controls-foreground: #8E8E93 sidebar-controls-foreground: #8E8E93
sidebar-foreground-shadow: transparent sidebar-foreground-shadow: transparent
@@ -87,7 +87,7 @@ tiddler-border: transparent
tiddler-controls-foreground-hover: <<colour sidebar-controls-foreground-hover>> tiddler-controls-foreground-hover: <<colour sidebar-controls-foreground-hover>>
tiddler-controls-foreground-selected: <<colour sidebar-controls-foreground-hover>> tiddler-controls-foreground-selected: <<colour sidebar-controls-foreground-hover>>
tiddler-controls-foreground: #48484A tiddler-controls-foreground: #48484A
tiddler-editor-background: <<colour background>> tiddler-editor-background: transparent
tiddler-editor-border-image: tiddler-editor-border-image:
tiddler-editor-border: rgba(255, 255, 255, 0.08) tiddler-editor-border: rgba(255, 255, 255, 0.08)
tiddler-editor-fields-even: rgba(255, 255, 255, 0.1) tiddler-editor-fields-even: rgba(255, 255, 255, 0.1)

View File

@@ -12,7 +12,7 @@ alert-highlight: #d79921
alert-muted-foreground: #504945 alert-muted-foreground: #504945
background: #3c3836 background: #3c3836
blockquote-bar: <<colour muted-foreground>> blockquote-bar: <<colour muted-foreground>>
button-foreground: <<colour foreground>> button-foreground: <<colour page-background>>
code-background: #504945 code-background: #504945
code-border: #504945 code-border: #504945
code-foreground: #fb4934 code-foreground: #fb4934
@@ -63,7 +63,7 @@ select-tag-background: #665c54
select-tag-foreground: <<colour foreground>> select-tag-foreground: <<colour foreground>>
selection-background: #458588 selection-background: #458588
selection-foreground: <<colour foreground>> selection-foreground: <<colour foreground>>
sidebar-button-foreground: <<colour foreground>> sidebar-button-foreground: <<colour page-background>>
sidebar-controls-foreground-hover: #7c6f64 sidebar-controls-foreground-hover: #7c6f64
sidebar-controls-foreground: #504945 sidebar-controls-foreground: #504945
sidebar-foreground-shadow: transparent sidebar-foreground-shadow: transparent

View File

@@ -12,7 +12,7 @@ alert-highlight: #B48EAD
alert-muted-foreground: #4C566A alert-muted-foreground: #4C566A
background: #3b4252 background: #3b4252
blockquote-bar: <<colour muted-foreground>> blockquote-bar: <<colour muted-foreground>>
button-foreground: <<colour foreground>> button-foreground: <<colour page-background>>
code-background: #2E3440 code-background: #2E3440
code-border: #2E3440 code-border: #2E3440
code-foreground: #BF616A code-foreground: #BF616A
@@ -63,7 +63,7 @@ select-tag-background: #3b4252
select-tag-foreground: <<colour foreground>> select-tag-foreground: <<colour foreground>>
selection-background: #5E81AC selection-background: #5E81AC
selection-foreground: <<colour foreground>> selection-foreground: <<colour foreground>>
sidebar-button-foreground: <<colour foreground>> sidebar-button-foreground: <<colour page-background>>
sidebar-controls-foreground-hover: #D8DEE9 sidebar-controls-foreground-hover: #D8DEE9
sidebar-controls-foreground: #4C566A sidebar-controls-foreground: #4C566A
sidebar-foreground-shadow: transparent sidebar-foreground-shadow: transparent

View File

@@ -1,9 +1,9 @@
title: $:/core/save/lazy-all title: $:/core/save/lazy-all
\define saveTiddlerFilter() \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]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
\end \end
\define skinnySaveTiddlerFilter() \define skinnySaveTiddlerFilter()
[!is[system]] -[type[application/javascript]] [!is[system]]
\end \end
{{$:/core/templates/tiddlywiki5.html}} {{$:/core/templates/tiddlywiki5.html}}

View File

@@ -1,7 +1,7 @@
title: $:/core/templates/server/static.sidebar.wikitext title: $:/core/templates/server/static.sidebar.wikitext
\whitespace trim \whitespace trim
<div class="tc-sidebar-scrollable" style="overflow: auto;" role="region" aria-label={{$:/language/SideBar/Caption}}> <div class="tc-sidebar-scrollable" style="overflow: auto;">
<div class="tc-sidebar-header"> <div class="tc-sidebar-header">
<h1 class="tc-site-title"> <h1 class="tc-site-title">
<$transclude tiddler="$:/SiteTitle"/> <$transclude tiddler="$:/SiteTitle"/>

View File

@@ -19,8 +19,8 @@ title: $:/core/templates/server/static.tiddler.html
</head> </head>
<body class="tc-body"> <body class="tc-body">
<$transclude tiddler="$:/core/templates/server/static.sidebar.wikitext" mode="inline"/> <$transclude tiddler="$:/core/templates/server/static.sidebar.wikitext" mode="inline"/>
<section class="tc-story-river" role="main"> <section class="tc-story-river">
<div class="tc-tiddler-frame" role="article"> <div class="tc-tiddler-frame">
<$transclude tiddler="$:/core/templates/server/static.tiddler.wikitext" mode="inline"/> <$transclude tiddler="$:/core/templates/server/static.tiddler.wikitext" mode="inline"/>
</div> </div>
</section> </section>

View File

@@ -6,7 +6,6 @@ description: create a new image tiddler
image/$(imageType)$ image/$(imageType)$
\end \end
\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$ \define get-tags() $(textFieldTags)$ $(tagsFieldTags)$
\whitespace trim
<$vars imageType={{$:/config/NewImageType}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}}> <$vars imageType={{$:/config/NewImageType}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}}>
<$action-sendmessage $message="tm-new-tiddler" type=<<get-type>> tags=<<get-tags>>/> <$action-sendmessage $message="tm-new-tiddler" type=<<get-type>> tags=<<get-tags>>/>
</$vars> </$vars>

View File

@@ -3,9 +3,8 @@ tags: $:/tags/Actions
description: create a new journal tiddler description: create a new journal tiddler
\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$ \define get-tags() $(textFieldTags)$ $(tagsFieldTags)$
\whitespace trim
<$vars journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}> <$vars journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}>
<$wikify name="journalTitle" text="<$macrocall $name='now' format=<<journalTitleTemplate>>/>"> <$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$reveal type="nomatch" state=<<journalTitle>> text=""> <$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text={{{ [<journalTitle>get[]] }}}/> <$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text={{{ [<journalTitle>get[]] }}}/>
</$reveal> </$reveal>

View File

@@ -3,7 +3,6 @@ tags: $:/tags/Actions
description: create a new empty tiddler description: create a new empty tiddler
\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$ \define get-tags() $(textFieldTags)$ $(tagsFieldTags)$
\whitespace trim
<$vars textFieldTags={{$:/config/NewTiddler/Tags}} tagsFieldTags={{$:/config/NewTiddler/Tags!!tags}}> <$vars textFieldTags={{$:/config/NewTiddler/Tags}} tagsFieldTags={{$:/config/NewTiddler/Tags!!tags}}>
<$action-sendmessage $message="tm-new-tiddler" tags=<<get-tags>>/> <$action-sendmessage $message="tm-new-tiddler" tags=<<get-tags>>/>
</$vars> </$vars>

View File

@@ -2,7 +2,6 @@ title: $:/AdvancedSearch
icon: $:/core/images/advanced-search-button icon: $:/core/images/advanced-search-button
color: #bbb color: #bbb
\whitespace trim
<div class="tc-advanced-search"> <div class="tc-advanced-search">
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch]!has[draft.of]]" default="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<currentTab>>/>""" explicitState="$:/state/tab--1498284803"/> <$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch]!has[draft.of]]" default="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<currentTab>>/>""" explicitState="$:/state/tab--1498284803"/>
</div> </div>

View File

@@ -3,71 +3,31 @@ tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/Filter/Caption}} caption: {{$:/language/Search/Filter/Caption}}
\define lingo-base() $:/language/Search/ \define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after") \define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
<$macrocall $name="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="$beforeafter$"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\define cancel-search-actions() \define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list>
\whitespace trim
<$list
filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]"
emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />">
<$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/>
<$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/>
</$list>
\end
\define input-accept-actions() \define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
</$list>
\end
\define input-accept-variant-actions() \define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>">
<$list filter="[<__tiddler__>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
</$list></$list>
\end
\whitespace trim
<<lingo Filter/Hint>> <<lingo Filter/Hint>>
<div class="tc-search tc-advanced-search"> <div class="tc-search tc-advanced-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>> <$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>> <$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input" <$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
tiddler="$:/temp/advancedsearch/input" refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search"
storeTitle="$:/temp/advancedsearch" tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/temp/advancedsearch]]" firstSearchFilterField="text"
refreshTitle="$:/temp/advancedsearch/refresh" inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>>
selectionStateTitle="$:/temp/advancedsearch/selected-item" inputCancelActions=<<cancel-search-actions>>/>
type="search"
tag="input"
focus={{$:/config/Search/AutoFocus}}
configTiddlerFilter="[[$:/temp/advancedsearch]]"
firstSearchFilterField="text"
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
inputCancelActions=<<cancel-search-actions>>/>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
&#32;
<$list filter="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"><$transclude/></$list> <$list filter="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"><$transclude/></$list>
</div> </div>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>"> <$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>""">
<div class="tc-search-results"> <div class="tc-search-results">
<<lingo Filter/Matches>> <<lingo Filter/Matches>>
<$list filter={{$:/temp/advancedsearch}}> <$list filter={{$:/temp/advancedsearch}}>

View File

@@ -1,7 +1,6 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/clear title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/clear
tags: $:/tags/AdvancedSearch/FilterButton tags: $:/tags/AdvancedSearch/FilterButton
\whitespace trim
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible"> <$button class="tc-btn-invisible">
<<cancel-search-actions>> <<cancel-search-actions>>

View File

@@ -1,9 +1,8 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/delete title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/delete
tags: $:/tags/AdvancedSearch/FilterButton tags: $:/tags/AdvancedSearch/FilterButton
\whitespace trim
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button tooltip={{$:/language/Buttons/DeleteTiddlers/Hint}} popup=<<qualify "$:/state/filterDeleteDropdown">> class="tc-btn-invisible"> <$button popup=<<qualify "$:/state/filterDeleteDropdown">> class="tc-btn-invisible">
{{$:/core/images/delete-button}} {{$:/core/images/delete-button}}
</$button> </$button>
</$reveal> </$reveal>
@@ -13,13 +12,13 @@ tags: $:/tags/AdvancedSearch/FilterButton
<div class="tc-block-dropdown tc-edit-type-dropdown"> <div class="tc-block-dropdown tc-edit-type-dropdown">
<div class="tc-dropdown-item-plain"> <div class="tc-dropdown-item-plain">
<$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>"""> <$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>""">
{{$:/language/ConfirmDeleteTiddlers}} Are you sure you wish to delete <<resultCount>> tiddler(s)?
</$set> </$set>
</div> </div>
<div class="tc-dropdown-item-plain"> <div class="tc-dropdown-item-plain">
<$button class="tc-btn"> <$button class="tc-btn">
<$action-deletetiddler $filter={{$:/temp/advancedsearch}}/> <$action-deletetiddler $filter={{$:/temp/advancedsearch}}/>
{{$:/language/Buttons/DeleteTiddlers/Hint}} Delete these tiddlers
</$button> </$button>
</div> </div>
</div> </div>

View File

@@ -1,8 +1,6 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/dropdown title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/dropdown
tags: $:/tags/AdvancedSearch/FilterButton tags: $:/tags/AdvancedSearch/FilterButton
\whitespace trim
<span class="tc-popup-keep"> <span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/filterDropdown">> class="tc-btn-invisible"> <$button popup=<<qualify "$:/state/filterDropdown">> class="tc-btn-invisible">
{{$:/core/images/down-arrow}} {{$:/core/images/down-arrow}}
@@ -11,11 +9,10 @@ tags: $:/tags/AdvancedSearch/FilterButton
<$reveal state=<<qualify "$:/state/filterDropdown">> type="popup" position="belowleft" animate="yes"> <$reveal state=<<qualify "$:/state/filterDropdown">> type="popup" position="belowleft" animate="yes">
<$set name="tv-show-missing-links" value="yes"> <$set name="tv-show-missing-links" value="yes">
<$linkcatcher actions="<$action-setfield $tiddler='$:/temp/advancedsearch' text=<<navigateTo>>/><$action-setfield $tiddler='$:/temp/advancedsearch/input' text=<<navigateTo>>/><$action-setfield $tiddler='$:/temp/advancedsearch/refresh' text='yes'/><$action-sendmessage $message='tm-focus-selector' $param='.tc-advanced-search input' />"> <$linkcatcher actions="""<$action-setfield $tiddler="$:/temp/advancedsearch" text=<<navigateTo>>/><$action-setfield $tiddler="$:/temp/advancedsearch/input" text=<<navigateTo>>/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/><$action-sendmessage $message="tm-focus-selector" $param='.tc-advanced-search input' />""">
<div class="tc-block-dropdown-wrapper"> <div class="tc-block-dropdown-wrapper">
<div class="tc-block-dropdown tc-edit-type-dropdown"> <div class="tc-block-dropdown tc-edit-type-dropdown">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]"><$link to={{!!filter}}><$transclude field="description"/></$link>
<$link to={{!!filter}}><$transclude field="description"/></$link>
</$list> </$list>
</div> </div>
</div> </div>

View File

@@ -1,7 +1,6 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/export title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/export
tags: $:/tags/AdvancedSearch/FilterButton tags: $:/tags/AdvancedSearch/FilterButton
\whitespace trim
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$macrocall $name="exportButton" exportFilter={{$:/temp/advancedsearch}} lingoBase="$:/language/Buttons/ExportTiddlers/"/> <$macrocall $name="exportButton" exportFilter={{$:/temp/advancedsearch}} lingoBase="$:/language/Buttons/ExportTiddlers/"/>
</$reveal> </$reveal>

View File

@@ -5,68 +5,26 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
\define lingo-base() $:/language/Search/ \define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after") \define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
<$macrocall $name="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="$beforeafter$"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\define cancel-search-actions() \define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input"""/>
\whitespace trim
<$list
filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]"
emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />">
<$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/>
<$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/>
</$list>
<$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\end
\define input-accept-actions() \define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
</$list>
\end
\define input-accept-variant-actions() \define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>">
<$list filter="[<__tiddler__>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
</$list></$list>
\end
\whitespace trim
<<lingo Shadows/Hint>> <<lingo Shadows/Hint>>
<div class="tc-search"> <div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>> <$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>> <$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input" <$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
tiddler="$:/temp/advancedsearch/input" refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search"
storeTitle="$:/temp/advancedsearch" tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/core/ui/AdvancedSearch/Shadows]]"
refreshTitle="$:/temp/advancedsearch/refresh" inputCancelActions=<<cancel-search-actions>> inputAcceptActions=<<input-accept-actions>>
selectionStateTitle="$:/temp/advancedsearch/selected-item" inputAcceptVariantActions=<<input-accept-variant-actions>> filterMinLength={{$:/config/Search/MinLength}}/>
type="search"
tag="input"
focus={{$:/config/Search/AutoFocus}}
configTiddlerFilter="[[$:/core/ui/AdvancedSearch/Shadows]]"
inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
&#32;
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible"> <$button class="tc-btn-invisible">
<<cancel-search-actions>> <<cancel-search-actions>>
@@ -77,9 +35,9 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem"> <$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$set name="resultCount" value="<$count filter='[all[shadows]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]'/>"> <$set name="resultCount" value="""<$count filter="[all[shadows]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]"/>""">
<div class="tc-search-results"> <div class="tc-search-results">

View File

@@ -3,17 +3,15 @@ tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/Standard/Caption}} caption: {{$:/language/Search/Standard/Caption}}
\define lingo-base() $:/language/Search/ \define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/> \define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
\define next-search-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<nextTab>>/>"/> \define next-search-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/advancedsearch/standard/currentTab" text=<<nextTab>>/>"""/>
\define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />"><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/> \define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input"""/>
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list> \define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list> \define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\whitespace trim
<<lingo Standard/Hint>> <<lingo Standard/Hint>>
@@ -22,19 +20,12 @@ caption: {{$:/language/Search/Standard/Caption}}
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>> <$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$keyboard key="shift-alt-Right" actions=<<next-search-tab>>> <$keyboard key="shift-alt-Right" actions=<<next-search-tab>>>
<$keyboard key="shift-alt-Left" actions=<<next-search-tab "before">>> <$keyboard key="shift-alt-Left" actions=<<next-search-tab "before">>>
<$macrocall $name="keyboard-driven-input" <$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
tiddler="$:/temp/advancedsearch/input" refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search"
storeTitle="$:/temp/advancedsearch" tag="input" focus={{$:/config/Search/AutoFocus}} inputCancelActions=<<cancel-search-actions>>
refreshTitle="$:/temp/advancedsearch/refresh" inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>>
selectionStateTitle="$:/temp/advancedsearch/selected-item" configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"
type="search" filterMinLength={{$:/config/Search/MinLength}}/>
tag="input"
focus={{$:/config/Search/AutoFocus}}
inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"
filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
@@ -48,22 +39,14 @@ caption: {{$:/language/Search/Standard/Caption}}
</div> </div>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list <$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" <$vars userInput={{{ [[$:/temp/advancedsearch]get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} searchListState="$:/temp/advancedsearch/selected-item">
emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" <$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]" emptyMessage="""
variable="listItem"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]">
<$vars <$transclude/>
userInput={{{ [[$:/temp/advancedsearch]get[text]] }}} </$list>
configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} """>
searchListState="$:/temp/advancedsearch/selected-item"> <$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
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>">
<$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>
</$vars> </$vars>
</$list> </$list>

View File

@@ -4,68 +4,26 @@ caption: {{$:/language/Search/System/Caption}}
first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]] first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]
\define lingo-base() $:/language/Search/ \define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after",stateTitle,tag,defaultState,currentTabTiddler) \define set-next-input-tab(beforeafter:"after",stateTitle,tag,defaultState,currentTabTiddler) <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
<$macrocall $name="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="$beforeafter$"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\define cancel-search-actions() \define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input"""/>
\whitespace trim
<$list
filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]"
emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />">
<$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/>
<$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/>
</$list>
<$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\end
\define input-accept-actions() \define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
</$list>
\end
\define input-accept-variant-actions() \define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>">
<$list filter="[<__tiddler__>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
</$list></$list>
\end
\whitespace trim
<<lingo System/Hint>> <<lingo System/Hint>>
<div class="tc-search"> <div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>> <$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>> <$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input" <$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
tiddler="$:/temp/advancedsearch/input" refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item"
storeTitle="$:/temp/advancedsearch" type="search" tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/core/ui/AdvancedSearch/System]]"
refreshTitle="$:/temp/advancedsearch/refresh" inputCancelActions=<<cancel-search-actions>> inputAcceptActions=<<input-accept-actions>>
selectionStateTitle="$:/temp/advancedsearch/selected-item" inputAcceptVariantActions=<<input-accept-variant-actions>> filterMinLength={{$:/config/Search/MinLength}}/>
type="search"
tag="input"
focus={{$:/config/Search/AutoFocus}}
configTiddlerFilter="[[$:/core/ui/AdvancedSearch/System]]"
inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
&#32;
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible"> <$button class="tc-btn-invisible">
<<cancel-search-actions>> <<cancel-search-actions>>
@@ -76,9 +34,9 @@ first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/te
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem"> <$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$set name="resultCount" value="<$count filter='[is[system]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]'/>"> <$set name="resultCount" value="""<$count filter="[is[system]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]"/>""">
<div class="tc-search-results"> <div class="tc-search-results">

View File

@@ -1,21 +1,12 @@
title: $:/core/ui/AlertTemplate title: $:/core/ui/AlertTemplate
\whitespace trim
<div class="tc-alert"> <div class="tc-alert">
<div class="tc-alert-toolbar"> <div class="tc-alert-toolbar">
<$button class="tc-btn-invisible"><$action-deletetiddler $tiddler=<<currentTiddler>>/>{{$:/core/images/cancel-button}}</$button> <$button class="tc-btn-invisible"><$action-deletetiddler $tiddler=<<currentTiddler>>/>{{$:/core/images/cancel-button}}</$button>
</div> </div>
<div class="tc-alert-subtitle"> <div class="tc-alert-subtitle">
<$wikify name="format" text=<<lingo Tiddler/DateFormat>>> <$wikify name="format" text=<<lingo Tiddler/DateFormat>>>
<$view field="component"/> <$view field="component"/> - <$view field="modified" format="date" template=<<format>>/> <$reveal type="nomatch" state="!!count" text=""><span class="tc-alert-highlight">({{$:/language/Count}}: <$view field="count"/>)</span></$reveal>
&#32;-&#32;
<$view field="modified" format="date" template=<<format>>/>
&#32;
<$reveal type="nomatch" state="!!count" text="">
<span class="tc-alert-highlight">
({{$:/language/Count}}:&#32;<$view field="count"/>)
</span>
</$reveal>
</$wikify> </$wikify>
</div> </div>
<div class="tc-alert-body"> <div class="tc-alert-body">

View File

@@ -1,6 +1,5 @@
title: $:/core/ui/Components/tag-link title: $:/core/ui/Components/tag-link
\whitespace trim
<$link> <$link>
<$set name="backgroundColor" value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}> <$set name="backgroundColor" value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
<span style=<<tag-styles>> class="tc-tag-label"> <span style=<<tag-styles>> class="tc-tag-label">

View File

@@ -2,7 +2,6 @@ title: $:/ControlPanel
icon: $:/core/images/options-button icon: $:/core/images/options-button
color: #bbb color: #bbb
\whitespace trim
<div class="tc-control-panel"> <div class="tc-control-panel">
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/ControlPanel]!has[draft.of]]" default="$:/core/ui/ControlPanel/Info" explicitState="$:/state/tab-1749438307"/> <$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/ControlPanel]!has[draft.of]]" default="$:/core/ui/ControlPanel/Info" explicitState="$:/state/tab-1749438307"/>
</div> </div>

View File

@@ -2,7 +2,6 @@ title: $:/core/ui/ControlPanel/Advanced
tags: $:/tags/ControlPanel/Info tags: $:/tags/ControlPanel/Info
caption: {{$:/language/ControlPanel/Advanced/Caption}} caption: {{$:/language/ControlPanel/Advanced/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Advanced/Hint}} {{$:/language/ControlPanel/Advanced/Hint}}
<div class="tc-control-panel"> <div class="tc-control-panel">

View File

@@ -2,7 +2,6 @@ title: $:/core/ui/ControlPanel/Appearance
tags: $:/tags/ControlPanel tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Appearance/Caption}} caption: {{$:/language/ControlPanel/Appearance/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Appearance/Hint}} {{$:/language/ControlPanel/Appearance/Hint}}
<div class="tc-control-panel"> <div class="tc-control-panel">

View File

@@ -5,7 +5,6 @@ caption: {{$:/language/ControlPanel/Basics/Caption}}
\define lingo-base() $:/language/ControlPanel/Basics/ \define lingo-base() $:/language/ControlPanel/Basics/
\define show-filter-count(filter) \define show-filter-count(filter)
\whitespace trim
<$button class="tc-btn-invisible"> <$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/advancedsearch" $value="""$filter$"""/> <$action-setfield $tiddler="$:/temp/advancedsearch" $value="""$filter$"""/>
<$action-setfield $tiddler="$:/temp/advancedsearch/input" $value="""$filter$"""/> <$action-setfield $tiddler="$:/temp/advancedsearch/input" $value="""$filter$"""/>
@@ -14,11 +13,9 @@ caption: {{$:/language/ControlPanel/Basics/Caption}}
<$action-navigate $to="$:/AdvancedSearch"/> <$action-navigate $to="$:/AdvancedSearch"/>
<$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/> <$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
''<$count filter="""$filter$"""/>'' ''<$count filter="""$filter$"""/>''
&#32;
{{$:/core/images/advanced-search-button}} {{$:/core/images/advanced-search-button}}
</$button> </$button>
\end \end
\whitespace trim
|<<lingo Version/Prompt>> |''<<version>>'' | |<<lingo Version/Prompt>> |''<<version>>'' |
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> | |<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |

View File

@@ -2,7 +2,6 @@ title: $:/core/ui/ControlPanel/Cascades
tags: $:/tags/ControlPanel/Advanced tags: $:/tags/ControlPanel/Advanced
caption: {{$:/language/ControlPanel/Cascades/Caption}} caption: {{$:/language/ControlPanel/Cascades/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Cascades/Hint}} {{$:/language/ControlPanel/Cascades/Hint}}
<div class="tc-control-panel"> <div class="tc-control-panel">

View File

@@ -3,7 +3,6 @@ tags: $:/tags/ControlPanel/Advanced
caption: {{$:/language/ControlPanel/EditorTypes/Caption}} caption: {{$:/language/ControlPanel/EditorTypes/Caption}}
\define lingo-base() $:/language/ControlPanel/EditorTypes/ \define lingo-base() $:/language/ControlPanel/EditorTypes/
\whitespace trim
<<lingo Hint>> <<lingo Hint>>

View File

@@ -2,7 +2,6 @@ title: $:/core/ui/ControlPanel/Info
tags: $:/tags/ControlPanel tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Info/Caption}} caption: {{$:/language/ControlPanel/Info/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Info/Hint}} {{$:/language/ControlPanel/Info/Hint}}
<div class="tc-control-panel"> <div class="tc-control-panel">

View File

@@ -5,11 +5,8 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\define lingo-base() $:/language/ControlPanel/KeyboardShortcuts/ \define lingo-base() $:/language/ControlPanel/KeyboardShortcuts/
\define new-shortcut(title) \define new-shortcut(title)
\whitespace trim
<div class="tc-dropdown-item-plain"> <div class="tc-dropdown-item-plain">
<$edit-shortcut tiddler="$title$" placeholder={{$:/language/ControlPanel/KeyboardShortcuts/Add/Prompt}} focus="true" style="width:auto;"/> <$edit-shortcut tiddler="$title$" placeholder={{$:/language/ControlPanel/KeyboardShortcuts/Add/Prompt}} focus="true" style="width:auto;"/> <$button>
&#32;
<$button>
<<lingo Add/Caption>> <<lingo Add/Caption>>
<$action-listops <$action-listops
$tiddler="$(shortcutTitle)$" $tiddler="$(shortcutTitle)$"
@@ -24,7 +21,6 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\end \end
\define shortcut-list-item(caption) \define shortcut-list-item(caption)
\whitespace trim
<td> <td>
</td> </td>
<td style="text-align:right;font-size:0.7em;"> <td style="text-align:right;font-size:0.7em;">
@@ -35,16 +31,16 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
<$button popup=<<qualify "$:/state/dropdown/$(shortcutTitle)$">> class="tc-btn-invisible"> <$button popup=<<qualify "$:/state/dropdown/$(shortcutTitle)$">> class="tc-btn-invisible">
{{$:/core/images/edit-button}} {{$:/core/images/edit-button}}
</$button> </$button>
&#32;
<$macrocall $name="displayshortcuts" $output="text/html" shortcuts={{$(shortcutTitle)$}} prefix="<kbd>" separator="</kbd> <kbd>" suffix="</kbd>"/> <$macrocall $name="displayshortcuts" $output="text/html" shortcuts={{$(shortcutTitle)$}} prefix="<kbd>" separator="</kbd> <kbd>" suffix="</kbd>"/>
<$reveal state=<<qualify "$:/state/dropdown/$(shortcutTitle)$">> type="popup" position="below" animate="yes"> <$reveal state=<<qualify "$:/state/dropdown/$(shortcutTitle)$">> type="popup" position="below" animate="yes">
<div class="tc-block-dropdown-wrapper"> <div class="tc-block-dropdown-wrapper">
<div class="tc-block-dropdown tc-edit-type-dropdown tc-popup-keep"> <div class="tc-block-dropdown tc-edit-type-dropdown tc-popup-keep">
<$list <$list filter="[list[$(shortcutTitle)$!!text]sort[title]]" variable="shortcut" emptyMessage="""
filter="[list[$(shortcutTitle)$!!text]sort[title]]" <div class="tc-dropdown-item-plain">
variable="shortcut" //<<lingo NoShortcuts/Caption>>//
emptyMessage="<div class='tc-dropdown-item-plain'>//<<lingo NoShortcuts/Caption>>//</div>"> </div>
""">
<div class="tc-dropdown-item-plain"> <div class="tc-dropdown-item-plain">
<$button class="tc-btn-invisible" tooltip={{$:/language/ControlPanel/KeyboardShortcuts/Remove/Hint}}> <$button class="tc-btn-invisible" tooltip={{$:/language/ControlPanel/KeyboardShortcuts/Remove/Hint}}>
<$action-listops <$action-listops
@@ -54,7 +50,6 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
/> />
<small>{{$:/core/images/close-button}}</small> <small>{{$:/core/images/close-button}}</small>
</$button> </$button>
&#32;
<kbd> <kbd>
<$macrocall $name="displayshortcuts" $output="text/html" shortcuts=<<shortcut>>/> <$macrocall $name="displayshortcuts" $output="text/html" shortcuts=<<shortcut>>/>
</kbd> </kbd>
@@ -70,7 +65,6 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\end \end
\define shortcut-list(caption,prefix) \define shortcut-list(caption,prefix)
\whitespace trim
<tr> <tr>
<$list filter="[[$prefix$$(shortcutName)$]]" variable="shortcutTitle"> <$list filter="[[$prefix$$(shortcutName)$]]" variable="shortcutTitle">
<<shortcut-list-item "$caption$">> <<shortcut-list-item "$caption$">>
@@ -79,8 +73,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\end \end
\define shortcut-editor() \define shortcut-editor()
\whitespace trim <<shortcut-list "All" "$:/config/shortcuts/">>
<<shortcut-list "All" "$:/config/shortcuts/">>
<<shortcut-list "Mac" "$:/config/shortcuts-mac/">> <<shortcut-list "Mac" "$:/config/shortcuts-mac/">>
<<shortcut-list "NonMac" "$:/config/shortcuts-not-mac/">> <<shortcut-list "NonMac" "$:/config/shortcuts-not-mac/">>
<<shortcut-list "Linux" "$:/config/shortcuts-linux/">> <<shortcut-list "Linux" "$:/config/shortcuts-linux/">>
@@ -94,7 +87,6 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\end \end
\define shortcut-item-inner() \define shortcut-item-inner()
\whitespace trim
<tr> <tr>
<td> <td>
<$reveal type="nomatch" state=<<dropdownStateTitle>> text="open"> <$reveal type="nomatch" state=<<dropdownStateTitle>> text="open">
@@ -115,7 +107,6 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
{{$:/core/images/down-arrow}} {{$:/core/images/down-arrow}}
</$button> </$button>
</$reveal> </$reveal>
&#32;
''<$text text=<<shortcutName>>/>'' ''<$text text=<<shortcutName>>/>''
</td> </td>
<td> <td>
@@ -135,12 +126,10 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\end \end
\define shortcut-item() \define shortcut-item()
\whitespace trim
<$set name="dropdownStateTitle" value=<<qualify "$:/state/dropdown/keyboardshortcut/$(shortcutName)$">>> <$set name="dropdownStateTitle" value=<<qualify "$:/state/dropdown/keyboardshortcut/$(shortcutName)$">>>
<<shortcut-item-inner>> <<shortcut-item-inner>>
</$set> </$set>
\end \end
\whitespace trim
<table> <table>
<tbody> <tbody>

View File

@@ -2,7 +2,6 @@ title: $:/core/ui/ControlPanel/Modals/AddPlugins
subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/Add/Caption}} subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/Add/Caption}}
\define install-plugin-actions() \define install-plugin-actions()
\whitespace trim
<$action-sendmessage $message="tm-load-plugin-from-library" url={{!!url}} title={{$(assetInfo)$!!original-title}}/> <$action-sendmessage $message="tm-load-plugin-from-library" url={{!!url}} title={{$(assetInfo)$!!original-title}}/>
<$set name="url" value={{!!url}}> <$set name="url" value={{!!url}}>
<$set name="currentTiddler" value=<<assetInfo>>> <$set name="currentTiddler" value=<<assetInfo>>>
@@ -14,21 +13,18 @@ subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/
\end \end
\define install-plugin-button() \define install-plugin-button()
\whitespace trim
<div> <div>
<$set name="libraryVersion" value={{{ [<assetInfo>get[version]] }}}> <$set name="libraryVersion" value={{{ [<assetInfo>get[version]] }}}>
<$set name="installedVersion" value={{{ [<assetInfo>get[original-title]get[version]] }}}> <$set name="installedVersion" value={{{ [<assetInfo>get[original-title]get[version]] }}}>
<$set name="reinstall-type" value={{{ [<libraryVersion>compare:version:eq<installedVersion>then[tc-reinstall]] [<libraryVersion>compare:version:gt<installedVersion>then[tc-reinstall-upgrade]] [<libraryVersion>compare:version:lt<installedVersion>then[tc-reinstall-downgrade]] }}}> <$set name="reinstall-type" value={{{ [<libraryVersion>compare:version:eq<installedVersion>then[tc-reinstall]] [<libraryVersion>compare:version:gt<installedVersion>then[tc-reinstall-upgrade]] [<libraryVersion>compare:version:lt<installedVersion>then[tc-reinstall-downgrade]] }}}>
<$button actions=<<install-plugin-actions>> class={{{ [<assetInfo>get[original-title]has[version]then<reinstall-type>] tc-btn-invisible tc-install-plugin +[join[ ]] }}}> <$button actions=<<install-plugin-actions>> class={{{ [<assetInfo>get[original-title]has[version]then<reinstall-type>] tc-btn-invisible tc-install-plugin +[join[ ]] }}}>
{{$:/core/images/download-button}} {{$:/core/images/download-button}}
&#32;
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="ignore" emptyMessage="{{$:/language/ControlPanel/Plugins/Install/Caption}}"> <$list filter="[<assetInfo>get[original-title]get[version]]" variable="ignore" emptyMessage="{{$:/language/ControlPanel/Plugins/Install/Caption}}">
<$list filter="[<libraryVersion>compare:version:gt<installedVersion>]" variable="ignore" emptyMessage=" <$list filter="[<libraryVersion>compare:version:gt<installedVersion>]" variable="ignore" emptyMessage="""
\whitespace trim <$list filter="[<libraryVersion>compare:version:lt<installedVersion>]" variable="ignore" emptyMessage="{{$:/language/ControlPanel/Plugins/Reinstall/Caption}}">
<$list filter='[<libraryVersion>compare:version:lt<installedVersion>]' variable='ignore' emptyMessage='{{$:/language/ControlPanel/Plugins/Reinstall/Caption}}'>
{{$:/language/ControlPanel/Plugins/Downgrade/Caption}} {{$:/language/ControlPanel/Plugins/Downgrade/Caption}}
</$list> </$list>
"> """>
{{$:/language/ControlPanel/Plugins/Update/Caption}} {{$:/language/ControlPanel/Plugins/Update/Caption}}
</$list> </$list>
</$list> </$list>
@@ -47,7 +43,6 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end \end
\define display-plugin-info(type) \define display-plugin-info(type)
\whitespace trim
<$set name="popup-state" value=<<popup-state-macro>>> <$set name="popup-state" value=<<popup-state-macro>>>
<div class="tc-plugin-info"> <div class="tc-plugin-info">
<div class="tc-plugin-info-chunk tc-plugin-info-toggle"> <div class="tc-plugin-info-chunk tc-plugin-info-toggle">
@@ -68,9 +63,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
</$list> </$list>
</div> </div>
<div class="tc-plugin-info-chunk tc-plugin-info-description"> <div class="tc-plugin-info-chunk tc-plugin-info-description">
<h1><strong><$text text={{{ [<assetInfo>get[name]] ~[<assetInfo>get[original-title]split[/]last[1]] }}}/></strong>: <h1><strong><$text text={{{ [<assetInfo>get[name]] ~[<assetInfo>get[original-title]split[/]last[1]] }}}/></strong>: <$view tiddler=<<assetInfo>> field="description"/></h1>
&#32;
<$view tiddler=<<assetInfo>> field="description"/></h1>
<h2><$view tiddler=<<assetInfo>> field="original-title"/></h2> <h2><$view tiddler=<<assetInfo>> field="original-title"/></h2>
<div><em><$view tiddler=<<assetInfo>> field="version"/></em></div> <div><em><$view tiddler=<<assetInfo>> field="version"/></em></div>
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion"><div><em>{{$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint}}</em></div></$list> <$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion"><div><em>{{$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint}}</em></div></$list>
@@ -90,9 +83,9 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
<$set name="currentTiddler" value=<<assetInfo>>> <$set name="currentTiddler" value=<<assetInfo>>>
<$list filter="[enlist{!!dependents}] [<currentTiddler>get[parent-plugin]] +[limit[1]]" variable="ignore"> <$list filter="[enlist{!!dependents}] [<currentTiddler>get[parent-plugin]] +[limit[1]]" variable="ignore">
<div> <div>
{{$:/language/ControlPanel/Plugins/AlsoRequires}}&#32; {{$:/language/ControlPanel/Plugins/AlsoRequires}}
<$list filter="[enlist{!!dependents}] [{!!parent-plugin}] +[sort[name]]" variable="dependency"> <$list filter="[enlist{!!dependents}] [{!!parent-plugin}] +[sort[name]]" variable="dependency">
<$text text=<<dependency>>/>&#32; <$text text=<<dependency>>/>
</$list> </$list>
</div> </div>
</$list> </$list>
@@ -125,21 +118,16 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end \end
\define load-plugin-library-button() \define load-plugin-library-button()
\whitespace trim
<$list filter="[<currentTiddler>get[enabled]else[yes]match[yes]]" variable="ignore"> <$list filter="[<currentTiddler>get[enabled]else[yes]match[yes]]" variable="ignore">
<$button class="tc-btn-big-green"> <$button class="tc-btn-big-green">
<$action-sendmessage $message="tm-load-plugin-library" url={{!!url}} infoTitlePrefix="$:/temp/RemoteAssetInfo/"/> <$action-sendmessage $message="tm-load-plugin-library" url={{!!url}} infoTitlePrefix="$:/temp/RemoteAssetInfo/"/>
{{$:/core/images/chevron-right}}&#32;{{$:/language/ControlPanel/Plugins/OpenPluginLibrary}} {{$:/core/images/chevron-right}} {{$:/language/ControlPanel/Plugins/OpenPluginLibrary}}
</$button> </$button>
</$list> </$list>
\end \end
\define display-server-assets(type) \define display-server-assets(type)
\whitespace trim {{$:/language/Search/Search}}: <$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input"/>
{{$:/language/Search/Search}}:
&#32;
<$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input"/>
&#32;
<$reveal state="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" type="nomatch" text=""> <$reveal state="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" type="nomatch" text="">
<$button class="tc-btn-invisible"> <$button class="tc-btn-invisible">
<$action-setfield $tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" $field="text" $value=""/> <$action-setfield $tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" $field="text" $value=""/>
@@ -156,7 +144,6 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end \end
\define display-server-connection() \define display-server-connection()
\whitespace trim
<$list filter="[all[tiddlers+shadows]tag[$:/tags/ServerConnection]suffix{!!url}]" variable="connectionTiddler" emptyMessage=<<load-plugin-library-button>>> <$list filter="[all[tiddlers+shadows]tag[$:/tags/ServerConnection]suffix{!!url}]" variable="connectionTiddler" emptyMessage=<<load-plugin-library-button>>>
<$set name="transclusion" value=<<connectionTiddler>>> <$set name="transclusion" value=<<connectionTiddler>>>
@@ -169,18 +156,16 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end \end
\define close-library-button() \define close-library-button()
\whitespace trim
<$reveal type='nomatch' state='$:/temp/ServerConnection/$(PluginLibraryURL)$' text=''> <$reveal type='nomatch' state='$:/temp/ServerConnection/$(PluginLibraryURL)$' text=''>
<$button class='tc-btn-big-green'> <$button class='tc-btn-big-green'>
<$action-sendmessage $message="tm-unload-plugin-library" url={{!!url}}/> <$action-sendmessage $message="tm-unload-plugin-library" url={{!!url}}/>
{{$:/core/images/chevron-left}}&#32;{{$:/language/ControlPanel/Plugins/ClosePluginLibrary}} {{$:/core/images/chevron-left}} {{$:/language/ControlPanel/Plugins/ClosePluginLibrary}}
<$action-deletetiddler $filter="[prefix[$:/temp/ServerConnection/$(PluginLibraryURL)$]][prefix[$:/temp/RemoteAssetInfo/$(PluginLibraryURL)$]]"/> <$action-deletetiddler $filter="[prefix[$:/temp/ServerConnection/$(PluginLibraryURL)$]][prefix[$:/temp/RemoteAssetInfo/$(PluginLibraryURL)$]]"/>
</$button> </$button>
</$reveal> </$reveal>
\end \end
\define plugin-library-listing() \define plugin-library-listing()
\whitespace trim
<div class="tc-tab-set"> <div class="tc-tab-set">
<$set name="defaultTab" value={{{ [all[tiddlers+shadows]tag[$:/tags/PluginLibrary]] }}}> <$set name="defaultTab" value={{{ [all[tiddlers+shadows]tag[$:/tags/PluginLibrary]] }}}>
<div class="tc-tab-buttons"> <div class="tc-tab-buttons">
@@ -202,7 +187,6 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
<$set name=PluginLibraryURL value={{!!url}}> <$set name=PluginLibraryURL value={{!!url}}>
<<close-library-button>> <<close-library-button>>
</$set> </$set>
&#32;
<<display-server-connection>> <<display-server-connection>>
</$reveal> </$reveal>
</$list> </$list>
@@ -212,7 +196,6 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end \end
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] \import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
\whitespace trim
<div> <div>
<<plugin-library-listing>> <<plugin-library-listing>>

View File

@@ -5,7 +5,6 @@ caption: {{$:/language/ControlPanel/Parsing/Caption}}
\define lingo-base() $:/language/ControlPanel/Parsing/ \define lingo-base() $:/language/ControlPanel/Parsing/
\define toggle(Type) \define toggle(Type)
\whitespace trim
<$checkbox <$checkbox
tiddler="""$:/config/WikiParserRules/$Type$/$(rule)$""" tiddler="""$:/config/WikiParserRules/$Type$/$(rule)$"""
field="text" field="text"
@@ -17,12 +16,10 @@ default="enable">
\end \end
\define rules(type,Type) \define rules(type,Type)
\whitespace trim
<$list filter="[wikiparserrules[$type$]]" variable="rule"> <$list filter="[wikiparserrules[$type$]]" variable="rule">
<dd><<toggle $Type$>></dd> <dd><<toggle $Type$>></dd>
</$list> </$list>
\end \end
\whitespace trim
<<lingo Hint>> <<lingo Hint>>

View File

@@ -5,7 +5,6 @@ caption: {{$:/language/ControlPanel/Plugins/Caption}}
\define lingo-base() $:/language/ControlPanel/Plugins/ \define lingo-base() $:/language/ControlPanel/Plugins/
\define plugin-table(type) \define plugin-table(type)
\whitespace trim
<$set name="plugin-type" value="""$type$"""> <$set name="plugin-type" value="""$type$""">
<$set name="qualified-state" value=<<qualify "$:/state/plugin-info">>> <$set name="qualified-state" value=<<qualify "$:/state/plugin-info">>>
<$list filter="[!has[draft.of]plugin-type[$type$]sort[name]]" emptyMessage=<<lingo "Empty/Hint">> template="$:/core/ui/Components/plugin-info"/> <$list filter="[!has[draft.of]plugin-type[$type$]sort[name]]" emptyMessage=<<lingo "Empty/Hint">> template="$:/core/ui/Components/plugin-info"/>

View File

@@ -2,7 +2,6 @@ title: $:/core/ui/ControlPanel/Plugins/Add/Updates
caption: <$importvariables filter="$:/core/ui/ControlPanel/Plugins/Add/Updates">{{$:/language/ControlPanel/Plugins/Updates/Caption}} (<<update-count>>)</$importvariables> caption: <$importvariables filter="$:/core/ui/ControlPanel/Plugins/Add/Updates">{{$:/language/ControlPanel/Plugins/Updates/Caption}} (<<update-count>>)</$importvariables>
\define each-updateable-plugin(body) \define each-updateable-plugin(body)
\whitespace trim
<$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}sort[title]]" variable="assetInfo"> <$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}sort[title]]" variable="assetInfo">
<$set name="libraryVersion" value={{{ [<assetInfo>get[version]] }}}> <$set name="libraryVersion" value={{{ [<assetInfo>get[version]] }}}>
<$list filter="[<assetInfo>get[original-title]has[version]!version<libraryVersion>]" variable="ignore"> <$list filter="[<assetInfo>get[original-title]has[version]!version<libraryVersion>]" variable="ignore">
@@ -26,11 +25,8 @@ $body$
<$wikify name="count-filter" text=<<each-updateable-plugin "&#91;&#91;<$text text=<<assetInfo>>/>]]">>><$count filter=<<count-filter>>/></$wikify> <$wikify name="count-filter" text=<<each-updateable-plugin "&#91;&#91;<$text text=<<assetInfo>>/>]]">>><$count filter=<<count-filter>>/></$wikify>
\end \end
\whitespace trim
<$button actions=<<update-all-actions>> class="tc-btn-invisible tc-install-plugin tc-reinstall-upgrade"> <$button actions=<<update-all-actions>> class="tc-btn-invisible tc-install-plugin tc-reinstall-upgrade">
{{$:/core/images/download-button}} {{$:/core/images/download-button}} {{||$:/language/ControlPanel/Plugins/Updates/UpdateAll/Caption}}
&#32;
{{||$:/language/ControlPanel/Plugins/Updates/UpdateAll/Caption}}
</$button> </$button>
<div class="tc-plugin-library-listing"> <div class="tc-plugin-library-listing">

View File

@@ -1,10 +1,7 @@
title: $:/core/ui/ControlPanel/Plugins/AddPlugins title: $:/core/ui/ControlPanel/Plugins/AddPlugins
\define lingo-base() $:/language/ControlPanel/Plugins/ \define lingo-base() $:/language/ControlPanel/Plugins/
\whitespace trim
<$button message="tm-modal" param="$:/core/ui/ControlPanel/Modals/AddPlugins" tooltip={{$:/language/ControlPanel/Plugins/Add/Hint}} class="tc-btn-big-green tc-primary-btn"> <$button message="tm-modal" param="$:/core/ui/ControlPanel/Modals/AddPlugins" tooltip={{$:/language/ControlPanel/Plugins/Add/Hint}} class="tc-btn-big-green tc-primary-btn">
{{$:/core/images/download-button}} {{$:/core/images/download-button}} <<lingo Add/Caption>>
&#32;
<<lingo Add/Caption>>
</$button> </$button>

View File

@@ -2,7 +2,6 @@ title: $:/core/ui/ControlPanel/Saving
tags: $:/tags/ControlPanel tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Saving/Caption}} caption: {{$:/language/ControlPanel/Saving/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Saving/Hint}} {{$:/language/ControlPanel/Saving/Hint}}
<div class="tc-control-panel"> <div class="tc-control-panel">

View File

@@ -8,14 +8,13 @@ caption: {{$:/language/ControlPanel/Saving/TiddlySpot/Caption}}
http://$(userName)$.tiddlyspot.com/$path$/ http://$(userName)$.tiddlyspot.com/$path$/
\end \end
\define siteLink(path) \define siteLink(path)
\whitespace trim
<$reveal type="nomatch" state="$:/UploadName" text=""> <$reveal type="nomatch" state="$:/UploadName" text="">
<$set name="userName" value={{$:/UploadName}}> <$set name="userName" value={{$:/UploadName}}>
<$reveal type="match" state="$:/UploadURL" text=""> <$reveal type="match" state="$:/UploadURL" text="">
<<siteURL $path$>> <<siteURL $path$>>
</$reveal> </$reveal>
<$reveal type="nomatch" state="$:/UploadURL" text=""> <$reveal type="nomatch" state="$:/UploadURL" text="">
<$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}/> <$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}>>
</$reveal> </$reveal>
</$set> </$set>
</$reveal> </$reveal>

View File

@@ -3,7 +3,6 @@ tags: $:/tags/ControlPanel/Settings
title: $:/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab title: $:/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab
\define lingo-base() $:/language/ControlPanel/Settings/DefaultMoreSidebarTab/ \define lingo-base() $:/language/ControlPanel/Settings/DefaultMoreSidebarTab/
\whitespace trim
<$link to="$:/config/DefaultMoreSidebarTab"><<lingo Hint>></$link> <$link to="$:/config/DefaultMoreSidebarTab"><<lingo Hint>></$link>

View File

@@ -3,7 +3,6 @@ tags: $:/tags/ControlPanel/Settings
title: $:/core/ui/ControlPanel/Settings/DefaultSidebarTab title: $:/core/ui/ControlPanel/Settings/DefaultSidebarTab
\define lingo-base() $:/language/ControlPanel/Settings/DefaultSidebarTab/ \define lingo-base() $:/language/ControlPanel/Settings/DefaultSidebarTab/
\whitespace trim
<$link to="$:/config/DefaultSidebarTab"><<lingo Hint>></$link> <$link to="$:/config/DefaultSidebarTab"><<lingo Hint>></$link>

View File

@@ -3,7 +3,6 @@ tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/LinkToBehaviour/Caption}} caption: {{$:/language/ControlPanel/Settings/LinkToBehaviour/Caption}}
\define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/ \define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/
\whitespace trim
<$link to="$:/config/Navigation/openLinkFromInsideRiver"><<lingo "InsideRiver/Hint">></$link> <$link to="$:/config/Navigation/openLinkFromInsideRiver"><<lingo "InsideRiver/Hint">></$link>

View File

@@ -3,7 +3,6 @@ tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption}} caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption}}
\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/ \define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/
\whitespace trim
<$link to="$:/config/Toolbar/ButtonClass"><<lingo "Hint">></$link> <$link to="$:/config/Toolbar/ButtonClass"><<lingo "Hint">></$link>
<$select tiddler="$:/config/Toolbar/ButtonClass"> <$select tiddler="$:/config/Toolbar/ButtonClass">

View File

@@ -2,7 +2,6 @@ title: $:/core/ui/ControlPanel/Toolbars
tags: $:/tags/ControlPanel/Appearance tags: $:/tags/ControlPanel/Appearance
caption: {{$:/language/ControlPanel/Toolbars/Caption}} caption: {{$:/language/ControlPanel/Toolbars/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Toolbars/Hint}} {{$:/language/ControlPanel/Toolbars/Hint}}
<div class="tc-control-panel"> <div class="tc-control-panel">

View File

@@ -3,14 +3,7 @@ title: $:/core/ui/ControlPanel/Toolbars/EditorItemTemplate
\define config-title() \define config-title()
$(config-base)$$(currentTiddler)$ $(config-base)$$(currentTiddler)$
\end \end
\whitespace trim
<$draggable tiddler=<<currentTiddler>>> <$draggable tiddler=<<currentTiddler>>>
<$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/> <$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/> <span class="tc-icon-wrapper"><$transclude tiddler={{!!icon}}/></span> <$transclude field="caption"/> -- <i class="tc-muted"><$transclude field="description"/></i>
&#32;
<span class="tc-icon-wrapper"><$transclude tiddler={{!!icon}}/></span>
&#32;
<$transclude field="caption"/>
&#32;--&#32;
<i class="tc-muted"><$transclude field="description"/></i>
</$draggable> </$draggable>

View File

@@ -3,17 +3,7 @@ title: $:/core/ui/ControlPanel/Toolbars/ItemTemplate
\define config-title() \define config-title()
$(config-base)$$(currentTiddler)$ $(config-base)$$(currentTiddler)$
\end \end
\whitespace trim
<$draggable tiddler=<<currentTiddler>>> <$draggable tiddler=<<currentTiddler>>>
<$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/> <$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/> <span class="tc-icon-wrapper"> <$transclude field="caption"/> <i class="tc-muted">-- <$transclude field="description"/></i></span>
&#32;
<span class="tc-icon-wrapper">
&#32;
<$transclude field="caption"/>
&#32;
<i class="tc-muted">
--&#32;
<$transclude field="description"/>
</i></span>
</$draggable> </$draggable>

View File

@@ -5,7 +5,6 @@ first-search-filter: [!is[system]search:title<userInput>sort[title]limit[250]]
second-search-filter: [!is[system]search<userInput>sort[title]limit[250]] second-search-filter: [!is[system]search<userInput>sort[title]limit[250]]
\define searchResultList() \define searchResultList()
\whitespace trim
//<small>{{$:/language/Search/Matches/Title}}</small>// //<small>{{$:/language/Search/Matches/Title}}</small>//
<$list filter="[<userInput>minlength[1]]" variable="ignore"> <$list filter="[<userInput>minlength[1]]" variable="ignore">

View File

@@ -1,43 +1,19 @@
title: $:/core/ui/EditTemplate title: $:/core/ui/EditTemplate
\define delete-edittemplate-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [prefix<newFieldValueTiddlerPrefix>] [<newFieldNameInputTiddler>] [<newFieldNameSelectionTiddler>] [<newTagNameTiddler>] [<newTagNameInputTiddler>] [<newTagNameSelectionTiddler>] [<typeInputTiddler>] [<typeSelectionTiddler>]"/> \define delete-edittemplate-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [<newFieldValueTiddler>] [<newFieldNameInputTiddler>] [<newFieldNameSelectionTiddler>] [<newTagNameTiddler>] [<newTagNameInputTiddler>] [<newTagNameSelectionTiddler>] [<typeInputTiddler>] [<typeSelectionTiddler>]"/>
\define get-field-value-tiddler-filter() [subfilter<get-field-editor-filter>sha256[16]addprefix[/]addprefix<newFieldValueTiddlerPrefix>]
\define get-field-editor-filter() [<newFieldNameTiddler>get[text]else[]] :cascade[all[shadows+tiddlers]tag[$:/tags/FieldEditorFilter]!is[draft]get[text]] :and[!is[blank]else{$:/core/ui/EditTemplate/fieldEditor/default}]
\define save-tiddler-actions() \define save-tiddler-actions()
\whitespace trim
<$action-sendmessage $message="tm-add-tag" $param={{{ [<newTagNameTiddler>get[text]] }}}/> <$action-sendmessage $message="tm-add-tag" $param={{{ [<newTagNameTiddler>get[text]] }}}/>
<$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldNameTiddler>get[text]] :map[subfilter<get-field-value-tiddler-filter>get[text]] }}}/> <$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldValueTiddler>get[text]] }}}/>
<<delete-edittemplate-state-tiddlers>> <<delete-edittemplate-state-tiddlers>>
<$action-sendmessage $message="tm-save-tiddler"/> <$action-sendmessage $message="tm-save-tiddler"/>
\end \end
\define cancel-delete-tiddler-actions(message) \define cancel-delete-tiddler-actions(message)
\whitespace trim
<<delete-edittemplate-state-tiddlers>> <<delete-edittemplate-state-tiddlers>>
<$action-sendmessage $message="tm-$message$-tiddler"/> <$action-sendmessage $message="tm-$message$-tiddler"/>
\end \end
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class={{{ tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}>
\whitespace trim
<div
data-tiddler-title=<<currentTiddler>>
data-tags={{!!tags}}
class={{{ tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}
role="region"
aria-label={{$:/language/EditTemplate/Caption}}>
<$fieldmangler> <$fieldmangler>
<$vars <$vars storyTiddler=<<currentTiddler>> newTagNameTiddler=<<qualify "$:/temp/NewTagName">> newFieldNameTiddler=<<qualify "$:/temp/NewFieldName">> newFieldValueTiddler=<<qualify "$:/temp/NewFieldValue">> newFieldNameInputTiddler=<<qualify "$:/temp/NewFieldName/input">> newFieldNameSelectionTiddler=<<qualify "$:/temp/NewFieldName/selected-item">> newTagNameInputTiddler=<<qualify "$:/temp/NewTagName/input">> newTagNameSelectionTiddler=<<qualify "$:/temp/NewTagName/selected-item">> typeInputTiddler=<<qualify "$:/temp/Type/input">> typeSelectionTiddler=<<qualify "$:/temp/Type/selected-item">>>
storyTiddler=<<currentTiddler>>
newTagNameTiddler=<<qualify "$:/temp/NewTagName">>
newFieldNameTiddler=<<qualify "$:/temp/NewFieldName">>
newFieldValueTiddlerPrefix=<<qualify "$:/temp/NewFieldValue">>
newFieldNameInputTiddler=<<qualify "$:/temp/NewFieldName/input">>
newFieldNameSelectionTiddler=<<qualify "$:/temp/NewFieldName/selected-item">>
newTagNameInputTiddler=<<qualify "$:/temp/NewTagName/input">>
newTagNameSelectionTiddler=<<qualify "$:/temp/NewTagName/selected-item">>
typeInputTiddler=<<qualify "$:/temp/Type/input">>
typeSelectionTiddler=<<qualify "$:/temp/Type/selected-item">>>
<$keyboard key="((cancel-edit-tiddler))" actions=<<cancel-delete-tiddler-actions "cancel">> tag="div"> <$keyboard key="((cancel-edit-tiddler))" actions=<<cancel-delete-tiddler-actions "cancel">> tag="div">
<$keyboard key="((save-tiddler))" actions=<<save-tiddler-actions>> tag="div"> <$keyboard key="((save-tiddler))" actions=<<save-tiddler-actions>> tag="div">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem">

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