diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index e3d0735c3..a1e80f7e3 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -20,3 +20,11 @@ A clear and concise description of any alternative solutions or features you've 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. + +## 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) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f377b3921..8daf2f468 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,3 +72,6 @@ jobs: - run: "./bin/ci-push.sh" env: GH_TOKEN: ${{ secrets.GITHUBPUSHTOKEN }} + - run: "./bin/build-tw-org.sh" + env: + GH_TOKEN: ${{ secrets.GITHUBPUSHTOKEN }} diff --git a/bin/build-site.sh b/bin/build-site.sh index bdb622104..eca15dd63 100755 --- a/bin/build-site.sh +++ b/bin/build-site.sh @@ -5,7 +5,7 @@ # Default to the current version number for building the plugin library if [ -z "$TW5_BUILD_VERSION" ]; then - TW5_BUILD_VERSION=v5.2.2 + TW5_BUILD_VERSION=v5.2.3 fi echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]" diff --git a/bin/build-tw-org.sh b/bin/build-tw-org.sh new file mode 100755 index 000000000..eb76baa85 --- /dev/null +++ b/bin/build-tw-org.sh @@ -0,0 +1,97 @@ +#!/bin/bash + +# Build tiddlywiki.org assets. + +# Default to the version of TiddlyWiki installed in this repo + +if [ -z "$TWORG_BUILD_TIDDLYWIKI" ]; then + TWORG_BUILD_TIDDLYWIKI=./tiddlywiki.js +fi + +echo "Using TWORG_BUILD_TIDDLYWIKI as [$TWORG_BUILD_TIDDLYWIKI]" + +# Set up the build details + +if [ -z "$TWORG_BUILD_DETAILS" ]; then + TWORG_BUILD_DETAILS="$(git symbolic-ref --short HEAD)-$(git rev-parse HEAD) from $(git remote get-url origin)" +fi + +echo "Using TWORG_BUILD_DETAILS as [$TWORG_BUILD_DETAILS]" + +if [ -z "$TWORG_BUILD_COMMIT" ]; then + TWORG_BUILD_COMMIT="$(git rev-parse HEAD)" +fi + +echo "Using TWORG_BUILD_COMMIT as [$TWORG_BUILD_COMMIT]" + +# Set up the build output directory + +if [ -z "$TWORG_BUILD_OUTPUT" ]; then + TWORG_BUILD_OUTPUT=$(mktemp -d) +fi + +mkdir -p $TWORG_BUILD_OUTPUT + +if [ ! -d "$TWORG_BUILD_OUTPUT" ]; then + echo 'A valid TWORG_BUILD_OUTPUT environment variable must be set' + exit 1 +fi + +echo "Using TWORG_BUILD_OUTPUT as [$TWORG_BUILD_OUTPUT]" + +# Pull existing GitHub pages content + +git clone --depth=1 --branch=main "https://github.com/TiddlyWiki/tiddlywiki.org-gh-pages.git" $TWORG_BUILD_OUTPUT + +# Make the CNAME file that GitHub Pages requires + +echo "tiddlywiki.org" > $TWORG_BUILD_OUTPUT/CNAME + +# Delete any existing static content + +mkdir -p $TWORG_BUILD_OUTPUT/static +rm $TWORG_BUILD_OUTPUT/static/* + +# Put the build details into a .tid file so that it can be included in each build (deleted at the end of this script) + +echo -e -n "title: $:/build\ncommit: $TWORG_BUILD_COMMIT\n\n$TWORG_BUILD_DETAILS\n" > $TWORG_BUILD_OUTPUT/build.tid + +###################################################### +# +# tiddlywiki.org distribution +# +###################################################### + +# /index.html Main site +# /favicon.ico Favicon for main site +# /static.html Static rendering of default tiddlers +# /alltiddlers.html Static rendering of all tiddlers +# /static/* Static single tiddlers +# /static/static.css Static stylesheet +# /static/favicon.ico Favicon for static pages +node $TWORG_BUILD_TIDDLYWIKI \ + editions/tw.org \ + --verbose \ + --version \ + --load $TWORG_BUILD_OUTPUT/build.tid \ + --output $TWORG_BUILD_OUTPUT \ + --build favicon static index \ + || exit 1 + +# Delete the temporary build tiddler + +rm $TWORG_BUILD_OUTPUT/build.tid || exit 1 + +# Push output back to GitHub + +# Exit script immediately if any command fails +set -e + +pushd $TWORG_BUILD_OUTPUT +git config --global user.email "actions@github.com" +git config --global user.name "GitHub Actions" +git add -A . +git commit --message "GitHub build: $GITHUB_RUN_NUMBER of $TW5_BUILD_BRANCH ($(date +'%F %T %Z'))" +git remote add deploy "https://$GH_TOKEN@github.com/TiddlyWiki/tiddlywiki.org-gh-pages.git" &>/dev/null +git push deploy main &>/dev/null +popd diff --git a/boot/boot.js b/boot/boot.js index 6839a8e92..f902e9956 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -2596,7 +2596,7 @@ $tw.boot.isStartupTaskEligible = function(taskModule) { for(t=0; tContributing to TiddlyWiki5

Here we focus on contributions via GitHub Pull Requests but there are many other ways that anyone can help the TiddlyWiki project, such as reporting bugs or helping to improve our documentation.

Rules for Pull Requests

PRs must meet these minimum requirements before they can be considered for merging:

Imperative Mood for PR Titles

The "imperative mood" means written as if giving a command or instruction. See this post for more details, but the gist is that the title of the PR should make sense when used to complete the sentence "If applied, this commit will...". So for example, these are good PR titles:

These a poorly worded PR titles:

PR titles may also include a short prefix to indicate the subsystem to which they apply. For example:

Commenting on Pull Requests

One of the principles of open source is that many pairs of eyes on the code can improve quality. So, we welcome comments and critiques of pending PRs. Conventional Comments has some techniques to help make comments as constructive and actionable as possible. Notably, they recommend prefixing a comment with a label to clarify the intention:

praisePraises highlight something positive. Try to leave at least one of these comments per review. Do not leave false praise (which can actually be damaging). Do look for something to sincerely praise
nitpickNitpicks are small, trivial, but necessary changes. Distinguishing nitpick comments significantly helps direct the reader's attention to comments requiring more involvement
suggestionSuggestions are specific requests to improve the subject under review. It is assumed that we all want to do what's best, so these comments are never dismissed as “mere suggestions”, but are taken seriously
issueIssues represent user-facing problems. If possible, it's great to follow this kind of comment with a suggestion
questionQuestions are appropriate if you have a potential concern but are not quite sure if it's relevant or not. Asking the author for clarification or investigation can lead to a quick resolution
thoughtThoughts represent an idea that popped up from reviewing. These comments are non-blocking by nature, but they are extremely valuable and can lead to more focused initiatives and mentoring opportunities
choreChores are simple tasks that must be done before the subject can be “officially” accepted. Usually, these comments reference some common process. Try to leave a link to the process description so that the reader knows how to resolve the chore

Contributor License Agreement

Like other OpenSource projects, TiddlyWiki5 needs a signed contributor license agreement from individual contributors. This is a legal agreement that allows contributors to assert that they own the copyright of their contribution, and that they agree to license it to the UnaMesa Association (the legal entity that owns TiddlyWiki on behalf of the community).

How to sign the CLA

Create a GitHub pull request to add your name to cla-individual.md or cla-entity.md, with the date in the format (YYYY/MM/DD).

step by step

  1. Navigate to licenses/CLA-individual or licenses/CLA-entity according to whether you are signing as an individual or representative of an organisation
  2. Ensure that the "branch" dropdown at the top left is set to tiddlywiki-com
  3. Click the "edit" button at the top-right corner (clicking this button will fork the project so you can edit the file)
  4. Add your name at the bottom
    • eg: Jeremy Ruston, @Jermolene, 2011/11/22
  5. Below the edit box for the CLA text you should see a box labelled Propose file change
  6. Enter a brief title to explain the change (eg, "Signing the CLA")
  7. Click the green button labelled Propose file change
  8. On the following screen, click the green button labelled Create pull request

The CLA documents used for this project were created using Harmony Project Templates. "HA-CLA-I-LIST Version 1.0" for "CLA-individual" and "HA-CLA-E-LIST Version 1.0" for "CLA-entity". +

Contributing to TiddlyWiki5

Here we focus on contributions via GitHub Pull Requests but there are many other ways that anyone can help the TiddlyWiki project, such as reporting bugs or helping to improve our documentation.

Rules for Pull Requests

PRs must meet these minimum requirements before they can be considered for merging:

Imperative Mood for PR Titles

The "imperative mood" means written as if giving a command or instruction. See this post for more details, but the gist is that the title of the PR should make sense when used to complete the sentence "If applied, this commit will...". So for example, these are good PR titles:

These a poorly worded PR titles:

PR titles may also include a short prefix to indicate the subsystem to which they apply. For example:

Commenting on Pull Requests

One of the principles of open source is that many pairs of eyes on the code can improve quality. So, we welcome comments and critiques of pending PRs. Conventional Comments has some techniques to help make comments as constructive and actionable as possible. Notably, they recommend prefixing a comment with a label to clarify the intention:

praisePraises highlight something positive. Try to leave at least one of these comments per review. Do not leave false praise (which can actually be damaging). Do look for something to sincerely praise
nitpickNitpicks are small, trivial, but necessary changes. Distinguishing nitpick comments significantly helps direct the reader's attention to comments requiring more involvement
suggestionSuggestions are specific requests to improve the subject under review. It is assumed that we all want to do what's best, so these comments are never dismissed as “mere suggestions”, but are taken seriously
issueIssues represent user-facing problems. If possible, it's great to follow this kind of comment with a suggestion
questionQuestions are appropriate if you have a potential concern but are not quite sure if it's relevant or not. Asking the author for clarification or investigation can lead to a quick resolution
thoughtThoughts represent an idea that popped up from reviewing. These comments are non-blocking by nature, but they are extremely valuable and can lead to more focused initiatives and mentoring opportunities
choreChores are simple tasks that must be done before the subject can be “officially” accepted. Usually, these comments reference some common process. Try to leave a link to the process description so that the reader knows how to resolve the chore

Contributor License Agreement

Like other OpenSource projects, TiddlyWiki5 needs a signed contributor license agreement from individual contributors. This is a legal agreement that allows contributors to assert that they own the copyright of their contribution, and that they agree to license it to the UnaMesa Association (the legal entity that owns TiddlyWiki on behalf of the community).

How to sign the CLA

Create a GitHub pull request to add your name to cla-individual.md or cla-entity.md, with the date in the format (YYYY/MM/DD).

step by step

  1. Navigate to licenses/CLA-individual or licenses/CLA-entity according to whether you are signing as an individual or representative of an organisation
  2. Ensure that the "branch" dropdown at the top left is set to tiddlywiki-com
  3. Click the "edit" button at the top-right corner (clicking this button will fork the project so you can edit the file)
  4. Add your name at the bottom
    • eg: Jeremy Ruston, @Jermolene, 2011/11/22
  5. Below the edit box for the CLA text you should see a box labelled Propose file change
  6. Enter a brief title to explain the change (eg, "Signing the CLA")
  7. Click the green button labelled Propose file change
  8. On the following screen, click the green button labelled Create pull request

The CLA documents used for this project were created using Harmony Project Templates. "HA-CLA-I-LIST Version 1.0" for "CLA-individual" and "HA-CLA-E-LIST Version 1.0" for "CLA-entity".

This file was automatically generated by TiddlyWiki5

\ No newline at end of file diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index f81ca0bbd..dec7c12df 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -36,6 +36,8 @@ EditorTypes/Hint: These tiddlers determine which editor is used to edit specific EditorTypes/Type/Caption: Type EditTemplateBody/Caption: Edit Template Body EditTemplateBody/Hint: This rule cascade is used by the default edit template to dynamically choose the template for editing the body of a tiddler. +FieldEditor/Caption: Field Editor +FieldEditor/Hint: This rules cascade is used to dynamically choose the template for rendering a tiddler field based on its name. It is used within the Edit Template. Info/Caption: Info Info/Hint: Information about this TiddlyWiki KeyboardShortcuts/Add/Prompt: Type shortcut here @@ -226,4 +228,4 @@ Tools/Download/Full/Caption: Download full wiki ViewTemplateBody/Caption: View Template Body ViewTemplateBody/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the body of a tiddler. ViewTemplateTitle/Caption: View Template Title -ViewTemplateTitle/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the title of a tiddler. \ No newline at end of file +ViewTemplateTitle/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the title of a tiddler. diff --git a/core/language/en-GB/Help/default.tid b/core/language/en-GB/Help/default.tid index 0a8fce44c..1ca0926a9 100644 --- a/core/language/en-GB/Help/default.tid +++ b/core/language/en-GB/Help/default.tid @@ -3,6 +3,7 @@ title: $:/language/Help/default \define commandTitle() $:/language/Help/$(command)$ \end +\whitespace trim ``` usage: tiddlywiki [] [-- [...]...] ``` @@ -11,7 +12,9 @@ Available commands:
    <$list filter="[commands[]sort[title]]" variable="command"> -
  • <$link to=<>><$macrocall $name="command" $type="text/plain" $output="text/plain"/>: <$transclude tiddler=<> field="description"/>
  • +
  • <$link to=<>><$macrocall $name="command" $type="text/plain" $output="text/plain"/>: + +<$transclude tiddler=<> field="description"/>
diff --git a/core/modules/commands/save.js b/core/modules/commands/save.js index d8c44e1f3..21839177a 100644 --- a/core/modules/commands/save.js +++ b/core/modules/commands/save.js @@ -8,46 +8,54 @@ Saves individual tiddlers in their raw text or binary format to the specified fi \*/ (function(){ -/*jslint node: true, browser: true */ -/*global $tw: false */ -"use strict"; - -exports.info = { - name: "save", - synchronous: true -}; - -var Command = function(params,commander,callback) { - this.params = params; - this.commander = commander; - this.callback = callback; -}; - -Command.prototype.execute = function() { - if(this.params.length < 1) { - 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 + "\""); + /*jslint node: true, browser: true */ + /*global $tw: false */ + "use strict"; + + exports.info = { + name: "save", + synchronous: true + }; + + var Command = function(params,commander,callback) { + this.params = params; + this.commander = commander; + this.callback = callback; + }; + + Command.prototype.execute = function() { + if(this.params.length < 1) { + return "Missing filename filter"; } - $tw.utils.createFileDirectories(filepath); - fs.writeFileSync(filepath,tiddler.fields.text,contentTypeInfo.encoding); - }); - return null; -}; - -exports.Command = Command; - -})(); + var self = this, + fs = require("fs"), + path = require("path"), + result = null, + wiki = this.commander.wiki, + tiddlerFilter = this.params[0], + filenameFilter = this.params[1] || "[is[tiddler]]", + tiddlers = wiki.filterTiddlers(tiddlerFilter); + $tw.utils.each(tiddlers,function(title) { + if(!result) { + var tiddler = self.commander.wiki.getTiddler(title); + if(tiddler) { + var 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 + "\""); + } + $tw.utils.createFileDirectories(filepath); + fs.writeFileSync(filepath,tiddler.fields.text,contentTypeInfo.encoding); + } else { + result = "Tiddler '" + title + "' not found"; + } + } + }); + return result; + }; + + exports.Command = Command; + + })(); + \ No newline at end of file diff --git a/core/modules/filters/listops.js b/core/modules/filters/listops.js index ab194339a..02d92831a 100644 --- a/core/modules/filters/listops.js +++ b/core/modules/filters/listops.js @@ -87,7 +87,8 @@ exports.butlast = function(source,operator,options) { source(function(tiddler,title) { results.push(title); }); - return results.slice(0,-count); + var index = count === 0 ? results.length : -count; + return results.slice(0,index); }; exports.bl = exports.butlast; diff --git a/core/modules/savers/put.js b/core/modules/savers/put.js index a6c27c891..de9ba9465 100644 --- a/core/modules/savers/put.js +++ b/core/modules/savers/put.js @@ -80,6 +80,7 @@ PutSaver.prototype.save = function(text,method,callback) { if(this.etag) { headers["If-Match"] = this.etag; } + $tw.notifier.display("$:/language/Notifications/Save/Starting"); $tw.utils.httpRequest({ url: this.uri(), type: "PUT", @@ -87,17 +88,20 @@ PutSaver.prototype.save = function(text,method,callback) { data: text, callback: function(err,data,xhr) { if(err) { - // response is textual: "XMLHttpRequest error code: 412" - var status = Number(err.substring(err.indexOf(':') + 2, err.length)) + var status = xhr.status, + errorMsg = err; if(status === 412) { // file changed on server - callback($tw.language.getString("Error/PutEditConflict")); + errorMsg = $tw.language.getString("Error/PutEditConflict"); } else if(status === 401) { // authentication required - callback($tw.language.getString("Error/PutUnauthorized")); + errorMsg = $tw.language.getString("Error/PutUnauthorized"); } else if(status === 403) { // permission denied - callback($tw.language.getString("Error/PutForbidden")); - } else { - callback(err); // fail + errorMsg = $tw.language.getString("Error/PutForbidden"); } + if (xhr.responseText) { + // treat any server response like a plain text error explanation + errorMsg = errorMsg + "\n\n" + xhr.responseText; + } + callback(errorMsg); // fail } else { self.etag = xhr.getResponseHeader("ETag"); if(self.etag == null) { diff --git a/core/modules/savers/upload.js b/core/modules/savers/upload.js index 6ac056ba9..ade545000 100644 --- a/core/modules/savers/upload.js +++ b/core/modules/savers/upload.js @@ -64,6 +64,7 @@ UploadSaver.prototype.save = function(text,method,callback) { var tail = "\r\n--" + boundary + "--\r\n", data = head.join("\r\n") + text + tail; // Do the HTTP post + $tw.notifier.display("$:/language/Notifications/Save/Starting"); var http = new XMLHttpRequest(); http.open("POST",url,true,username,password); http.setRequestHeader("Content-Type","multipart/form-data; charset=UTF-8; boundary=" + boundary); @@ -81,7 +82,6 @@ UploadSaver.prototype.save = function(text,method,callback) { } catch(ex) { return callback($tw.language.getString("Error/Caption") + ":" + ex); } - $tw.notifier.display("$:/language/Notifications/Save/Starting"); return true; }; diff --git a/core/modules/startup/render.js b/core/modules/startup/render.js index 682291365..e50512463 100644 --- a/core/modules/startup/render.js +++ b/core/modules/startup/render.js @@ -42,12 +42,17 @@ exports.startup = function() { $tw.styleWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_STYLESHEET_TITLE,{document: $tw.fakeDocument}); $tw.styleContainer = $tw.fakeDocument.createElement("style"); $tw.styleWidgetNode.render($tw.styleContainer,null); + $tw.styleWidgetNode.assignedStyles = $tw.styleContainer.textContent; $tw.styleElement = document.createElement("style"); - $tw.styleElement.innerHTML = $tw.styleContainer.textContent; + $tw.styleElement.innerHTML = $tw.styleWidgetNode.assignedStyles; document.head.insertBefore($tw.styleElement,document.head.firstChild); $tw.wiki.addEventListener("change",$tw.perf.report("styleRefresh",function(changes) { if($tw.styleWidgetNode.refresh(changes,$tw.styleContainer,null)) { - $tw.styleElement.innerHTML = $tw.styleContainer.textContent; + var newStyles = $tw.styleContainer.textContent; + if(newStyles !== $tw.styleWidgetNode.assignedStyles) { + $tw.styleWidgetNode.assignedStyles = newStyles; + $tw.styleElement.innerHTML = $tw.styleWidgetNode.assignedStyles; + } } })); // Display the $:/core/ui/PageTemplate tiddler to kick off the display diff --git a/core/modules/startup/windows.js b/core/modules/startup/windows.js index 95207a9ec..384961b7b 100644 --- a/core/modules/startup/windows.js +++ b/core/modules/startup/windows.js @@ -20,6 +20,8 @@ exports.synchronous = true; // Global to keep track of open windows (hashmap by title) $tw.windows = {}; +// Default template to use for new windows +var DEFAULT_WINDOW_TEMPLATE = "$:/core/templates/single.tiddler.window"; exports.startup = function() { // Handle open window message @@ -29,24 +31,25 @@ exports.startup = function() { title = event.param || event.tiddlerTitle, paramObject = event.paramObject || {}, windowTitle = paramObject.windowTitle || title, - template = paramObject.template || "$:/core/templates/single.tiddler.window", + windowID = paramObject.windowID || title, + template = paramObject.template || DEFAULT_WINDOW_TEMPLATE, width = paramObject.width || "700", height = paramObject.height || "600", top = paramObject.top, left = paramObject.left, - variables = $tw.utils.extend({},paramObject,{currentTiddler: title}); + variables = $tw.utils.extend({},paramObject,{currentTiddler: title, "tv-window-id": windowID}); // Open the window var srcWindow, srcDocument; // In case that popup blockers deny opening a new window try { - srcWindow = window.open("","external-" + title,"scrollbars,width=" + width + ",height=" + height + (top ? ",top=" + top : "" ) + (left ? ",left=" + left : "" )), + srcWindow = window.open("","external-" + windowID,"scrollbars,width=" + width + ",height=" + height + (top ? ",top=" + top : "" ) + (left ? ",left=" + left : "" )), srcDocument = srcWindow.document; } catch(e) { return; } - $tw.windows[title] = srcWindow; + $tw.windows[windowID] = srcWindow; // Check for reopening the same window if(srcWindow.haveInitialisedWindow) { return; @@ -56,7 +59,7 @@ exports.startup = function() { srcDocument.close(); srcDocument.title = windowTitle; srcWindow.addEventListener("beforeunload",function(event) { - delete $tw.windows[title]; + delete $tw.windows[windowID]; $tw.wiki.removeEventListener("change",refreshHandler); },false); // Set up the styles @@ -90,13 +93,21 @@ exports.startup = function() { srcWindow.document.documentElement.addEventListener("click",$tw.popup,true); srcWindow.haveInitialisedWindow = true; }); - // Close open windows when unloading main window - $tw.addUnloadTask(function() { + $tw.rootWidget.addEventListener("tm-close-window",function(event) { + var windowID = event.param, + win = $tw.windows[windowID]; + if(win) { + win.close(); + } + }); + var closeAllWindows = function() { $tw.utils.each($tw.windows,function(win) { win.close(); }); - }); - + } + $tw.rootWidget.addEventListener("tm-close-all-windows",closeAllWindows); + // Close open windows when unloading main window + $tw.addUnloadTask(closeAllWindows); }; })(); diff --git a/core/modules/utils/parsetree.js b/core/modules/utils/parsetree.js index c61c728fd..52dc203e8 100644 --- a/core/modules/utils/parsetree.js +++ b/core/modules/utils/parsetree.js @@ -13,8 +13,12 @@ Parse tree utility functions. "use strict"; exports.addAttributeToParseTreeNode = function(node,name,value) { + var attribute = {name: name, type: "string", value: value}; node.attributes = node.attributes || {}; - node.attributes[name] = {type: "string", value: value}; + node.attributes[name] = attribute; + if(node.orderedAttributes) { + node.orderedAttributes.push(attribute); + } }; exports.getAttributeValueFromParseTreeNode = function(node,name,defaultValue) { @@ -25,26 +29,45 @@ exports.getAttributeValueFromParseTreeNode = function(node,name,defaultValue) { }; exports.addClassToParseTreeNode = function(node,classString) { - var classes = []; + var classes = [], + attribute; node.attributes = node.attributes || {}; - node.attributes["class"] = node.attributes["class"] || {type: "string", value: ""}; - if(node.attributes["class"].type === "string") { - if(node.attributes["class"].value !== "") { - classes = node.attributes["class"].value.split(" "); + attribute = node.attributes["class"]; + if(!attribute) { + // If the class attribute does not exist, we must create it first. + attribute = {name: "class", type: "string", value: ""}; + 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 !== "") { $tw.utils.pushTop(classes,classString.split(" ")); } - node.attributes["class"].value = classes.join(" "); + attribute.value = classes.join(" "); } }; exports.addStyleToParseTreeNode = function(node,name,value) { - node.attributes = node.attributes || {}; - node.attributes.style = node.attributes.style || {type: "string", value: ""}; - if(node.attributes.style.type === "string") { - node.attributes.style.value += name + ":" + value + ";"; + var attribute; + node.attributes = node.attributes || {}; + attribute = node.attributes.style; + if(!attribute) { + 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) { diff --git a/core/modules/widgets/action-listops.js b/core/modules/widgets/action-listops.js index 802fcaa76..b3d93a657 100644 --- a/core/modules/widgets/action-listops.js +++ b/core/modules/widgets/action-listops.js @@ -71,8 +71,8 @@ ActionListopsWidget.prototype.invokeAction = function(triggeringWidget, } if(this.subfilter) { var inputList = this.wiki.getTiddlerList(this.target,field,index), - subfilter = $tw.utils.stringifyList(inputList) + " " + this.subfilter; - this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(this.wiki.filterTiddlers(subfilter,this))); + subfilter = "[all[]] " + this.subfilter; + this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(this.wiki.filterTiddlers(subfilter,this,this.wiki.makeTiddlerIterator(inputList)))); } if(this.filtertags) { var tiddler = this.wiki.getTiddler(this.target), diff --git a/core/modules/widgets/button.js b/core/modules/widgets/button.js index 4b96e6b2b..107977ac0 100644 --- a/core/modules/widgets/button.js +++ b/core/modules/widgets/button.js @@ -247,7 +247,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of */ ButtonWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled) { + if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled || changedAttributes["default"]) { this.refreshSelf(); return true; } else if(changedAttributes["class"]) { diff --git a/core/modules/widgets/checkbox.js b/core/modules/widgets/checkbox.js index 8ea47deb4..23ad9fdfd 100644 --- a/core/modules/widgets/checkbox.js +++ b/core/modules/widgets/checkbox.js @@ -35,11 +35,12 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) { this.execute(); // Create our elements this.labelDomNode = this.document.createElement("label"); - this.labelDomNode.setAttribute("class",this.checkboxClass); + this.labelDomNode.setAttribute("class","tc-checkbox " + this.checkboxClass); this.inputDomNode = this.document.createElement("input"); this.inputDomNode.setAttribute("type","checkbox"); if(this.getValue()) { this.inputDomNode.setAttribute("checked","true"); + $tw.utils.addClass(this.labelDomNode,"tc-checkbox-checked"); } if(this.isDisabled === "yes") { this.inputDomNode.setAttribute("disabled",true); @@ -59,7 +60,7 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) { CheckboxWidget.prototype.getValue = function() { var tiddler = this.wiki.getTiddler(this.checkboxTitle); - if(tiddler) { + if(tiddler || this.checkboxFilter) { if(this.checkboxTag) { if(this.checkboxInvertTag) { return !tiddler.hasTag(this.checkboxTag); @@ -67,12 +68,17 @@ CheckboxWidget.prototype.getValue = function() { return tiddler.hasTag(this.checkboxTag); } } - if(this.checkboxField) { + if(this.checkboxField || this.checkboxIndex) { + // Same logic applies to fields and indexes var value; - if($tw.utils.hop(tiddler.fields,this.checkboxField)) { - value = tiddler.fields[this.checkboxField] || ""; + if(this.checkboxField) { + if($tw.utils.hop(tiddler.fields,this.checkboxField)) { + value = tiddler.fields[this.checkboxField] || ""; + } else { + value = this.checkboxDefault || ""; + } } else { - value = this.checkboxDefault || ""; + value = this.wiki.extractTiddlerDataItem(tiddler,this.checkboxIndex,this.checkboxDefault || ""); } if(value === this.checkboxChecked) { return true; @@ -80,15 +86,46 @@ CheckboxWidget.prototype.getValue = function() { if(value === this.checkboxUnchecked) { 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.checkboxIndex) { - var value = this.wiki.extractTiddlerDataItem(tiddler,this.checkboxIndex,this.checkboxDefault || ""); - if(value === this.checkboxChecked) { + if(this.checkboxListField || this.checkboxListIndex || this.checkboxFilter) { + // Same logic applies to lists and filters + var list; + 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; } - if(value === this.checkboxUnchecked) { + if(list.indexOf(this.checkboxUnchecked) !== -1) { 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) { + return false; // Both specified but neither found: default to false + } + // Neither specified, so empty list is false, non-empty is true + return !!list.length; } } else { if(this.checkboxTag) { @@ -114,7 +151,8 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) { hasChanged = false, tagCheck = false, 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") { tagCheck = hasTag === checked; } else { @@ -148,9 +186,51 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) { hasChanged = true; } } + // Set the list field (or index) if specified + if(this.checkboxListField || this.checkboxListIndex) { + var listContents, oldPos, newPos; + if(this.checkboxListField) { + listContents = tiddler.getFieldList(this.checkboxListField); + } else { + listContents = $tw.utils.parseStringArray(this.wiki.extractTiddlerDataItem(this.checkboxTitle,this.checkboxListIndex) || "") || []; + } + 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(this.checkboxIndex) { 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 { this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),fallbackFields,tiddler,newFields,this.wiki.getModificationFields())); } @@ -179,6 +259,9 @@ CheckboxWidget.prototype.execute = function() { this.checkboxTag = this.getAttribute("tag"); this.checkboxField = this.getAttribute("field"); 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.checkboxUnchecked = this.getAttribute("unchecked"); this.checkboxDefault = this.getAttribute("default"); @@ -194,14 +277,20 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of */ CheckboxWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.disabled) { + if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.listField || changedAttributes.filter || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.disabled) { this.refreshSelf(); return true; } else { var refreshed = false; if(changedTiddlers[this.checkboxTitle]) { - this.inputDomNode.checked = this.getValue(); + var isChecked = this.getValue(); + this.inputDomNode.checked = isChecked; 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; } diff --git a/core/modules/widgets/eventcatcher.js b/core/modules/widgets/eventcatcher.js index 7a905d51e..2087cef59 100644 --- a/core/modules/widgets/eventcatcher.js +++ b/core/modules/widgets/eventcatcher.js @@ -46,6 +46,7 @@ EventWidget.prototype.render = function(parent,nextSibling) { $tw.utils.each(this.types,function(type) { domNode.addEventListener(type,function(event) { var selector = self.getAttribute("selector"), + matchSelector = self.getAttribute("matchSelector"), actions = self.getAttribute("$"+type) || self.getAttribute("actions-"+type), stopPropagation = self.getAttribute("stopPropagation","onaction"), selectedNode = event.target, @@ -56,46 +57,49 @@ EventWidget.prototype.render = function(parent,nextSibling) { if(selectedNode.nodeType === 3) { selectedNode = selectedNode.parentNode; } + // Check that the selected node matches any matchSelector + if(matchSelector && !$tw.utils.domMatchesSelector(selectedNode,matchSelector)) { + return false; + } if(selector) { // Search ancestors for a node that matches the selector while(!$tw.utils.domMatchesSelector(selectedNode,selector) && selectedNode !== domNode) { selectedNode = selectedNode.parentNode; } - // If we found one, copy the attributes as variables, otherwise exit - if($tw.utils.domMatchesSelector(selectedNode,selector)) { - // Only set up variables if we have actions to invoke - if(actions) { - $tw.utils.each(selectedNode.attributes,function(attribute) { - variables["dom-" + attribute.name] = attribute.value.toString(); - }); - //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(); - } - } - } else { + // Exit if we didn't find one + if(selectedNode === domNode) { return false; } + // Only set up variables if we have actions to invoke + if(actions) { + $tw.utils.each(selectedNode.attributes,function(attribute) { + variables["dom-" + attribute.name] = attribute.value.toString(); + }); + //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 if(actions) { diff --git a/core/modules/widgets/scrollable.js b/core/modules/widgets/scrollable.js index eb541c263..aadc040df 100644 --- a/core/modules/widgets/scrollable.js +++ b/core/modules/widgets/scrollable.js @@ -159,6 +159,8 @@ ScrollableWidget.prototype.render = function(parent,nextSibling) { // Create elements this.outerDomNode = this.document.createElement("div"); $tw.utils.setStyle(this.outerDomNode,[ + {overflowY: "auto"}, + {overflowX: "auto"}, {webkitOverflowScrolling: "touch"} ]); this.innerDomNode = this.document.createElement("div"); diff --git a/core/ui/AdvancedSearch/FilterButtons/delete.tid b/core/ui/AdvancedSearch/FilterButtons/delete.tid index fea48a667..85d9b224e 100644 --- a/core/ui/AdvancedSearch/FilterButtons/delete.tid +++ b/core/ui/AdvancedSearch/FilterButtons/delete.tid @@ -1,6 +1,7 @@ title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/delete tags: $:/tags/AdvancedSearch/FilterButton +\whitespace trim <$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$button popup=<> class="tc-btn-invisible"> {{$:/core/images/delete-button}} diff --git a/core/ui/AdvancedSearch/Standard.tid b/core/ui/AdvancedSearch/Standard.tid index d3616de33..0690130e4 100644 --- a/core/ui/AdvancedSearch/Standard.tid +++ b/core/ui/AdvancedSearch/Standard.tid @@ -3,15 +3,17 @@ tags: $:/tags/AdvancedSearch caption: {{$:/language/Search/Standard/Caption}} \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=<>/>"""/> +\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=<>/>"/> -\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=<>/>"""/> +\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=<>/>"/> -\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"/><$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"/><$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]] }}}/>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> +\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]] }}}/>"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> -\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 filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> +\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 filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> + +\whitespace trim <> @@ -20,12 +22,19 @@ caption: {{$:/language/Search/Standard/Caption}} <$keyboard key="((input-tab-left))" actions=<>> <$keyboard key="shift-alt-Right" actions=<>> <$keyboard key="shift-alt-Left" actions=<>> -<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch" - refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search" - tag="input" focus={{$:/config/Search/AutoFocus}} inputCancelActions=<> - inputAcceptActions=<> inputAcceptVariantActions=<> - configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" - filterMinLength={{$:/config/Search/MinLength}}/> +<$macrocall $name="keyboard-driven-input" + tiddler="$:/temp/advancedsearch/input" + storeTitle="$:/temp/advancedsearch" + refreshTitle="$:/temp/advancedsearch/refresh" + selectionStateTitle="$:/temp/advancedsearch/selected-item" + type="search" + tag="input" + focus={{$:/config/Search/AutoFocus}} + inputCancelActions=<> + inputAcceptActions=<> + inputAcceptVariantActions=<> + configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" + filterMinLength={{$:/config/Search/MinLength}}/> @@ -39,14 +48,22 @@ caption: {{$:/language/Search/Standard/Caption}} <$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> -<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""
{{$:/language/Search/Search/TooShort}}
""" variable="listItem"> -<$vars userInput={{{ [[$:/temp/advancedsearch]get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} searchListState="$:/temp/advancedsearch/selected-item"> -<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]" emptyMessage=""" -<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"> -<$transclude/> - -"""> -<$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=<>/>""" explicitState="$:/state/tab/search-results/advancedsearch" /> +<$list + filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" + emptyMessage="
{{$:/language/Search/Search/TooShort}}
" + variable="listItem"> +<$vars + userInput={{{ [[$:/temp/advancedsearch]get[text]] }}} + configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} + searchListState="$:/temp/advancedsearch/selected-item"> +<$list + filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]" + emptyMessage="<$list filter='[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]'><$transclude/>"> +<$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=<>/>" + explicitState="$:/state/tab/search-results/advancedsearch" /> diff --git a/core/ui/ControlPanel/Advanced.tid b/core/ui/ControlPanel/Advanced.tid index 0316089f9..9ce5b54c0 100644 --- a/core/ui/ControlPanel/Advanced.tid +++ b/core/ui/ControlPanel/Advanced.tid @@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Advanced tags: $:/tags/ControlPanel/Info caption: {{$:/language/ControlPanel/Advanced/Caption}} +\whitespace trim {{$:/language/ControlPanel/Advanced/Hint}}
diff --git a/core/ui/ControlPanel/Appearance.tid b/core/ui/ControlPanel/Appearance.tid index f8f88f6ab..5c03ae967 100644 --- a/core/ui/ControlPanel/Appearance.tid +++ b/core/ui/ControlPanel/Appearance.tid @@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Appearance tags: $:/tags/ControlPanel caption: {{$:/language/ControlPanel/Appearance/Caption}} +\whitespace trim {{$:/language/ControlPanel/Appearance/Hint}}
diff --git a/core/ui/ControlPanel/Basics.tid b/core/ui/ControlPanel/Basics.tid index 4897d232a..46df7e77c 100644 --- a/core/ui/ControlPanel/Basics.tid +++ b/core/ui/ControlPanel/Basics.tid @@ -5,6 +5,7 @@ caption: {{$:/language/ControlPanel/Basics/Caption}} \define lingo-base() $:/language/ControlPanel/Basics/ \define show-filter-count(filter) +\whitespace trim <$button class="tc-btn-invisible"> <$action-setfield $tiddler="$:/temp/advancedsearch" $value="""$filter$"""/> <$action-setfield $tiddler="$:/temp/advancedsearch/input" $value="""$filter$"""/> @@ -13,9 +14,11 @@ caption: {{$:/language/ControlPanel/Basics/Caption}} <$action-navigate $to="$:/AdvancedSearch"/> <$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/> ''<$count filter="""$filter$"""/>'' + {{$:/core/images/advanced-search-button}} \end +\whitespace trim |<> |''<>'' | |<$link to="$:/SiteTitle"><> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> | diff --git a/core/ui/ControlPanel/Cascades.tid b/core/ui/ControlPanel/Cascades.tid index bbd5a3750..3fb48da8b 100644 --- a/core/ui/ControlPanel/Cascades.tid +++ b/core/ui/ControlPanel/Cascades.tid @@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Cascades tags: $:/tags/ControlPanel/Advanced caption: {{$:/language/ControlPanel/Cascades/Caption}} +\whitespace trim {{$:/language/ControlPanel/Cascades/Hint}}
diff --git a/core/ui/ControlPanel/Cascades/FieldEditor.tid b/core/ui/ControlPanel/Cascades/FieldEditor.tid new file mode 100644 index 000000000..46d3ecdf5 --- /dev/null +++ b/core/ui/ControlPanel/Cascades/FieldEditor.tid @@ -0,0 +1,9 @@ +title: $:/core/ui/ControlPanel/FieldEditor +tags: $:/tags/ControlPanel/Cascades +caption: {{$:/language/ControlPanel/FieldEditor/Caption}} + +\define lingo-base() $:/language/ControlPanel/FieldEditor/ + +<> + +{{$:/tags/FieldEditorFilter||$:/snippets/ListTaggedCascade}} diff --git a/core/ui/ControlPanel/EditorTypes.tid b/core/ui/ControlPanel/EditorTypes.tid index e8d3e3a0a..833275fc4 100644 --- a/core/ui/ControlPanel/EditorTypes.tid +++ b/core/ui/ControlPanel/EditorTypes.tid @@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Advanced caption: {{$:/language/ControlPanel/EditorTypes/Caption}} \define lingo-base() $:/language/ControlPanel/EditorTypes/ +\whitespace trim <> diff --git a/core/ui/ControlPanel/Info.tid b/core/ui/ControlPanel/Info.tid index 8d357395f..37c56c1e2 100644 --- a/core/ui/ControlPanel/Info.tid +++ b/core/ui/ControlPanel/Info.tid @@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Info tags: $:/tags/ControlPanel caption: {{$:/language/ControlPanel/Info/Caption}} +\whitespace trim {{$:/language/ControlPanel/Info/Hint}}
diff --git a/core/ui/ControlPanel/KeyboardShortcuts.tid b/core/ui/ControlPanel/KeyboardShortcuts.tid index 764d69b05..83cce70d9 100644 --- a/core/ui/ControlPanel/KeyboardShortcuts.tid +++ b/core/ui/ControlPanel/KeyboardShortcuts.tid @@ -5,8 +5,11 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}} \define lingo-base() $:/language/ControlPanel/KeyboardShortcuts/ \define new-shortcut(title) +\whitespace trim
-<$edit-shortcut tiddler="$title$" placeholder={{$:/language/ControlPanel/KeyboardShortcuts/Add/Prompt}} focus="true" style="width:auto;"/> <$button> +<$edit-shortcut tiddler="$title$" placeholder={{$:/language/ControlPanel/KeyboardShortcuts/Add/Prompt}} focus="true" style="width:auto;"/> + +<$button> <> <$action-listops $tiddler="$(shortcutTitle)$" @@ -21,6 +24,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}} \end \define shortcut-list-item(caption) +\whitespace trim @@ -31,16 +35,16 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}} <$button popup=<> class="tc-btn-invisible"> {{$:/core/images/edit-button}} + <$macrocall $name="displayshortcuts" $output="text/html" shortcuts={{$(shortcutTitle)$}} prefix="" separator=" " suffix=""/> <$reveal state=<> type="popup" position="below" animate="yes">
-<$list filter="[list[$(shortcutTitle)$!!text]sort[title]]" variable="shortcut" emptyMessage=""" -
-//<>// -
-"""> +<$list + filter="[list[$(shortcutTitle)$!!text]sort[title]]" + variable="shortcut" + emptyMessage="
//<>//
">
<$button class="tc-btn-invisible" tooltip={{$:/language/ControlPanel/KeyboardShortcuts/Remove/Hint}}> <$action-listops @@ -50,6 +54,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}} /> {{$:/core/images/close-button}} + <$macrocall $name="displayshortcuts" $output="text/html" shortcuts=<>/> @@ -65,6 +70,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}} \end \define shortcut-list(caption,prefix) +\whitespace trim <$list filter="[[$prefix$$(shortcutName)$]]" variable="shortcutTitle"> <> @@ -73,7 +79,8 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}} \end \define shortcut-editor() -<> +\whitespace trim +<> <> <> <> @@ -87,6 +94,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}} \end \define shortcut-item-inner() +\whitespace trim <$reveal type="nomatch" state=<> text="open"> @@ -107,6 +115,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}} {{$:/core/images/down-arrow}} + ''<$text text=<>/>'' @@ -126,10 +135,12 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}} \end \define shortcut-item() +\whitespace trim <$set name="dropdownStateTitle" value=<>> <> \end +\whitespace trim diff --git a/core/ui/ControlPanel/Modals/AddPlugins.tid b/core/ui/ControlPanel/Modals/AddPlugins.tid index ead756408..ce8612b72 100644 --- a/core/ui/ControlPanel/Modals/AddPlugins.tid +++ b/core/ui/ControlPanel/Modals/AddPlugins.tid @@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Modals/AddPlugins subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/Add/Caption}} \define install-plugin-actions() +\whitespace trim <$action-sendmessage $message="tm-load-plugin-from-library" url={{!!url}} title={{$(assetInfo)$!!original-title}}/> <$set name="url" value={{!!url}}> <$set name="currentTiddler" value=<>> @@ -13,18 +14,21 @@ subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/ \end \define install-plugin-button() +\whitespace trim
<$set name="libraryVersion" value={{{ [get[version]] }}}> <$set name="installedVersion" value={{{ [get[original-title]get[version]] }}}> <$set name="reinstall-type" value={{{ [compare:version:eqthen[tc-reinstall]] [compare:version:gtthen[tc-reinstall-upgrade]] [compare:version:ltthen[tc-reinstall-downgrade]] }}}> <$button actions=<> class={{{ [get[original-title]has[version]then] tc-btn-invisible tc-install-plugin +[join[ ]] }}}> {{$:/core/images/download-button}} + <$list filter="[get[original-title]get[version]]" variable="ignore" emptyMessage="{{$:/language/ControlPanel/Plugins/Install/Caption}}"> -<$list filter="[compare:version:gt]" variable="ignore" emptyMessage=""" -<$list filter="[compare:version:lt]" variable="ignore" emptyMessage="{{$:/language/ControlPanel/Plugins/Reinstall/Caption}}"> +<$list filter="[compare:version:gt]" variable="ignore" emptyMessage=" +\whitespace trim +<$list filter='[compare:version:lt]' variable='ignore' emptyMessage='{{$:/language/ControlPanel/Plugins/Reinstall/Caption}}'> {{$:/language/ControlPanel/Plugins/Downgrade/Caption}} -"""> +"> {{$:/language/ControlPanel/Plugins/Update/Caption}} @@ -43,6 +47,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$ \end \define display-plugin-info(type) +\whitespace trim <$set name="popup-state" value=<>>
@@ -63,7 +68,9 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
-

<$text text={{{ [get[name]] ~[get[original-title]split[/]last[1]] }}}/>: <$view tiddler=<> field="description"/>

+

<$text text={{{ [get[name]] ~[get[original-title]split[/]last[1]] }}}/>: + +<$view tiddler=<> field="description"/>

<$view tiddler=<> field="original-title"/>

<$view tiddler=<> field="version"/>
<$list filter="[get[original-title]get[version]]" variable="installedVersion">
{{$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint}}
@@ -83,9 +90,9 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$ <$set name="currentTiddler" value=<>> <$list filter="[enlist{!!dependents}] [get[parent-plugin]] +[limit[1]]" variable="ignore">
-{{$:/language/ControlPanel/Plugins/AlsoRequires}} +{{$:/language/ControlPanel/Plugins/AlsoRequires}} <$list filter="[enlist{!!dependents}] [{!!parent-plugin}] +[sort[name]]" variable="dependency"> -<$text text=<>/> +<$text text=<>/>
@@ -118,16 +125,21 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$ \end \define load-plugin-library-button() +\whitespace trim <$list filter="[get[enabled]else[yes]match[yes]]" variable="ignore"> <$button class="tc-btn-big-green"> <$action-sendmessage $message="tm-load-plugin-library" url={{!!url}} infoTitlePrefix="$:/temp/RemoteAssetInfo/"/> -{{$:/core/images/chevron-right}} {{$:/language/ControlPanel/Plugins/OpenPluginLibrary}} +{{$:/core/images/chevron-right}} {{$:/language/ControlPanel/Plugins/OpenPluginLibrary}} \end \define display-server-assets(type) -{{$:/language/Search/Search}}: <$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input"/> +\whitespace trim +{{$:/language/Search/Search}}: + +<$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input"/> + <$reveal state="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" type="nomatch" text=""> <$button class="tc-btn-invisible"> <$action-setfield $tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" $field="text" $value=""/> @@ -144,6 +156,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$ \end \define display-server-connection() +\whitespace trim <$list filter="[all[tiddlers+shadows]tag[$:/tags/ServerConnection]suffix{!!url}]" variable="connectionTiddler" emptyMessage=<>> <$set name="transclusion" value=<>> @@ -156,16 +169,18 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$ \end \define close-library-button() +\whitespace trim <$reveal type='nomatch' state='$:/temp/ServerConnection/$(PluginLibraryURL)$' text=''> <$button class='tc-btn-big-green'> <$action-sendmessage $message="tm-unload-plugin-library" url={{!!url}}/> -{{$:/core/images/chevron-left}} {{$:/language/ControlPanel/Plugins/ClosePluginLibrary}} +{{$:/core/images/chevron-left}} {{$:/language/ControlPanel/Plugins/ClosePluginLibrary}} <$action-deletetiddler $filter="[prefix[$:/temp/ServerConnection/$(PluginLibraryURL)$]][prefix[$:/temp/RemoteAssetInfo/$(PluginLibraryURL)$]]"/> \end \define plugin-library-listing() +\whitespace trim
<$set name="defaultTab" value={{{ [all[tiddlers+shadows]tag[$:/tags/PluginLibrary]] }}}>
@@ -187,6 +202,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$ <$set name=PluginLibraryURL value={{!!url}}> <> + <> @@ -196,6 +212,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$ \end \import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] +\whitespace trim
<> diff --git a/core/ui/ControlPanel/Parsing.tid b/core/ui/ControlPanel/Parsing.tid index 4ba0f0ae1..818d1f292 100644 --- a/core/ui/ControlPanel/Parsing.tid +++ b/core/ui/ControlPanel/Parsing.tid @@ -5,6 +5,7 @@ caption: {{$:/language/ControlPanel/Parsing/Caption}} \define lingo-base() $:/language/ControlPanel/Parsing/ \define toggle(Type) +\whitespace trim <$checkbox tiddler="""$:/config/WikiParserRules/$Type$/$(rule)$""" field="text" @@ -16,10 +17,12 @@ default="enable"> \end \define rules(type,Type) +\whitespace trim <$list filter="[wikiparserrules[$type$]]" variable="rule">
<>
\end +\whitespace trim <> diff --git a/core/ui/ControlPanel/Plugins.tid b/core/ui/ControlPanel/Plugins.tid index fa4292fec..995a6bdf0 100644 --- a/core/ui/ControlPanel/Plugins.tid +++ b/core/ui/ControlPanel/Plugins.tid @@ -5,6 +5,7 @@ caption: {{$:/language/ControlPanel/Plugins/Caption}} \define lingo-base() $:/language/ControlPanel/Plugins/ \define plugin-table(type) +\whitespace trim <$set name="plugin-type" value="""$type$"""> <$set name="qualified-state" value=<>> <$list filter="[!has[draft.of]plugin-type[$type$]sort[name]]" emptyMessage=<> template="$:/core/ui/Components/plugin-info"/> diff --git a/core/ui/ControlPanel/Plugins/Add/Updates.tid b/core/ui/ControlPanel/Plugins/Add/Updates.tid index 239889fd2..c9f2402b2 100644 --- a/core/ui/ControlPanel/Plugins/Add/Updates.tid +++ b/core/ui/ControlPanel/Plugins/Add/Updates.tid @@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Plugins/Add/Updates caption: <$importvariables filter="$:/core/ui/ControlPanel/Plugins/Add/Updates">{{$:/language/ControlPanel/Plugins/Updates/Caption}} (<>) \define each-updateable-plugin(body) +\whitespace trim <$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}sort[title]]" variable="assetInfo"> <$set name="libraryVersion" value={{{ [get[version]] }}}> <$list filter="[get[original-title]has[version]!version]" variable="ignore"> @@ -25,8 +26,11 @@ $body$ <$wikify name="count-filter" text=<>/>]]">>><$count filter=<>/> \end +\whitespace trim <$button actions=<> class="tc-btn-invisible tc-install-plugin tc-reinstall-upgrade"> -{{$:/core/images/download-button}} {{||$:/language/ControlPanel/Plugins/Updates/UpdateAll/Caption}} +{{$:/core/images/download-button}} + +{{||$:/language/ControlPanel/Plugins/Updates/UpdateAll/Caption}}
diff --git a/core/ui/ControlPanel/Plugins/AddPlugins.tid b/core/ui/ControlPanel/Plugins/AddPlugins.tid index 8fc3c324e..669e4dd54 100644 --- a/core/ui/ControlPanel/Plugins/AddPlugins.tid +++ b/core/ui/ControlPanel/Plugins/AddPlugins.tid @@ -1,7 +1,10 @@ title: $:/core/ui/ControlPanel/Plugins/AddPlugins \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"> -{{$:/core/images/download-button}} <> +{{$:/core/images/download-button}} + +<> diff --git a/core/ui/ControlPanel/Saving.tid b/core/ui/ControlPanel/Saving.tid index 760b4e4b5..d54b2eef3 100644 --- a/core/ui/ControlPanel/Saving.tid +++ b/core/ui/ControlPanel/Saving.tid @@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Saving tags: $:/tags/ControlPanel caption: {{$:/language/ControlPanel/Saving/Caption}} +\whitespace trim {{$:/language/ControlPanel/Saving/Hint}}
diff --git a/core/ui/ControlPanel/Saving/TiddlySpot.tid b/core/ui/ControlPanel/Saving/TiddlySpot.tid index cb8c9edf3..a36115ec4 100644 --- a/core/ui/ControlPanel/Saving/TiddlySpot.tid +++ b/core/ui/ControlPanel/Saving/TiddlySpot.tid @@ -8,13 +8,14 @@ caption: {{$:/language/ControlPanel/Saving/TiddlySpot/Caption}} http://$(userName)$.tiddlyspot.com/$path$/ \end \define siteLink(path) +\whitespace trim <$reveal type="nomatch" state="$:/UploadName" text=""> <$set name="userName" value={{$:/UploadName}}> <$reveal type="match" state="$:/UploadURL" text=""> <> <$reveal type="nomatch" state="$:/UploadURL" text=""> -<$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}>> +<$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}/> diff --git a/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab.tid b/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab.tid index e6077f2a2..47f277bd4 100644 --- a/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab.tid +++ b/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab.tid @@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings title: $:/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab \define lingo-base() $:/language/ControlPanel/Settings/DefaultMoreSidebarTab/ +\whitespace trim <$link to="$:/config/DefaultMoreSidebarTab"><> diff --git a/core/ui/ControlPanel/Settings/DefaultSidebarTab.tid b/core/ui/ControlPanel/Settings/DefaultSidebarTab.tid index 538e15ca8..acd3421c7 100644 --- a/core/ui/ControlPanel/Settings/DefaultSidebarTab.tid +++ b/core/ui/ControlPanel/Settings/DefaultSidebarTab.tid @@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings title: $:/core/ui/ControlPanel/Settings/DefaultSidebarTab \define lingo-base() $:/language/ControlPanel/Settings/DefaultSidebarTab/ +\whitespace trim <$link to="$:/config/DefaultSidebarTab"><> diff --git a/core/ui/ControlPanel/Settings/LinkToBehaviour.tid b/core/ui/ControlPanel/Settings/LinkToBehaviour.tid index 0dbd1973c..92d46601e 100644 --- a/core/ui/ControlPanel/Settings/LinkToBehaviour.tid +++ b/core/ui/ControlPanel/Settings/LinkToBehaviour.tid @@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings caption: {{$:/language/ControlPanel/Settings/LinkToBehaviour/Caption}} \define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/ +\whitespace trim <$link to="$:/config/Navigation/openLinkFromInsideRiver"><> diff --git a/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid b/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid index 5054b32f6..a25b2a39e 100644 --- a/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid +++ b/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid @@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption}} \define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/ +\whitespace trim <$link to="$:/config/Toolbar/ButtonClass"><> <$select tiddler="$:/config/Toolbar/ButtonClass"> diff --git a/core/ui/ControlPanel/Toolbars.tid b/core/ui/ControlPanel/Toolbars.tid index 9cff67ce6..63034dbc3 100644 --- a/core/ui/ControlPanel/Toolbars.tid +++ b/core/ui/ControlPanel/Toolbars.tid @@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Toolbars tags: $:/tags/ControlPanel/Appearance caption: {{$:/language/ControlPanel/Toolbars/Caption}} +\whitespace trim {{$:/language/ControlPanel/Toolbars/Hint}}
diff --git a/core/ui/ControlPanel/Toolbars/EditorItemTemplate.tid b/core/ui/ControlPanel/Toolbars/EditorItemTemplate.tid index e417e766c..b648c476a 100644 --- a/core/ui/ControlPanel/Toolbars/EditorItemTemplate.tid +++ b/core/ui/ControlPanel/Toolbars/EditorItemTemplate.tid @@ -3,7 +3,14 @@ title: $:/core/ui/ControlPanel/Toolbars/EditorItemTemplate \define config-title() $(config-base)$$(currentTiddler)$ \end +\whitespace trim <$draggable tiddler=<>> -<$checkbox tiddler=<> field="text" checked="show" unchecked="hide" default="show"/> <$transclude tiddler={{!!icon}}/> <$transclude field="caption"/> -- <$transclude field="description"/> +<$checkbox tiddler=<> field="text" checked="show" unchecked="hide" default="show"/> + +<$transclude tiddler={{!!icon}}/> + +<$transclude field="caption"/> + -- +<$transclude field="description"/> diff --git a/core/ui/ControlPanel/Toolbars/ItemTemplate.tid b/core/ui/ControlPanel/Toolbars/ItemTemplate.tid index 6b92d8189..ba41b1b8a 100644 --- a/core/ui/ControlPanel/Toolbars/ItemTemplate.tid +++ b/core/ui/ControlPanel/Toolbars/ItemTemplate.tid @@ -3,7 +3,17 @@ title: $:/core/ui/ControlPanel/Toolbars/ItemTemplate \define config-title() $(config-base)$$(currentTiddler)$ \end +\whitespace trim <$draggable tiddler=<>> -<$checkbox tiddler=<> field="text" checked="show" unchecked="hide" default="show"/> <$transclude field="caption"/> -- <$transclude field="description"/> +<$checkbox tiddler=<> field="text" checked="show" unchecked="hide" default="show"/> + + + +<$transclude field="caption"/> + + +-- +<$transclude field="description"/> + diff --git a/core/ui/DefaultSearchResultList.tid b/core/ui/DefaultSearchResultList.tid index 3c31c4e48..223efe6d7 100644 --- a/core/ui/DefaultSearchResultList.tid +++ b/core/ui/DefaultSearchResultList.tid @@ -5,6 +5,7 @@ first-search-filter: [!is[system]search:titlesort[title]limit[250]] second-search-filter: [!is[system]searchsort[title]limit[250]] \define searchResultList() +\whitespace trim //{{$:/language/Search/Matches/Title}}// <$list filter="[minlength[1]]" variable="ignore"> diff --git a/core/ui/EditTemplate.tid b/core/ui/EditTemplate.tid index bf99cd70c..58852067a 100644 --- a/core/ui/EditTemplate.tid +++ b/core/ui/EditTemplate.tid @@ -1,21 +1,40 @@ title: $:/core/ui/EditTemplate \define delete-edittemplate-state-tiddlers() <$action-deletetiddler $filter="[] [] [] [] [] [] [] [] []"/> + \define save-tiddler-actions() +\whitespace trim <$action-sendmessage $message="tm-add-tag" $param={{{ [get[text]] }}}/> -<$action-sendmessage $message="tm-add-field" $name={{{ [get[text]] }}} $value={{{ [get[text]] }}}/> +<$action-sendmessage $message="tm-add-field" $name={{{ [get[text]] }}} $value={{{ [get[text]] :map[get] }}}/> <> <$action-sendmessage $message="tm-save-tiddler"/> \end + \define cancel-delete-tiddler-actions(message) -<> +\whitespace trim +<> <$action-sendmessage $message="tm-$message$-tiddler"/> \end -
> data-tags={{!!tags}} class={{{ tc-tiddler-frame tc-tiddler-edit-frame [is[tiddler]then[tc-tiddler-exists]] [is[missing]!is[shadow]then[tc-tiddler-missing]] [is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [is[system]then[tc-tiddler-system]] [{!!class}] [tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}> + +\whitespace trim +
> + data-tags={{!!tags}} + class={{{ tc-tiddler-frame tc-tiddler-edit-frame [is[tiddler]then[tc-tiddler-exists]] [is[missing]!is[shadow]then[tc-tiddler-missing]] [is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [is[system]then[tc-tiddler-system]] [{!!class}] [tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}> <$fieldmangler> -<$vars storyTiddler=<> newTagNameTiddler=<> newFieldNameTiddler=<> newFieldValueTiddler=<> newFieldNameInputTiddler=<> newFieldNameSelectionTiddler=<> newTagNameInputTiddler=<> newTagNameSelectionTiddler=<> typeInputTiddler=<> typeSelectionTiddler=<>> -<$keyboard key="((cancel-edit-tiddler))" actions=<>> -<$keyboard key="((save-tiddler))" actions=<>> +<$vars + storyTiddler=<> + newTagNameTiddler=<> + newFieldNameTiddler=<> + newFieldValueTiddler=<> + newFieldNameInputTiddler=<> + newFieldNameSelectionTiddler=<> + newTagNameInputTiddler=<> + newTagNameSelectionTiddler=<> + typeInputTiddler=<> + typeSelectionTiddler=<>> +<$keyboard key="((cancel-edit-tiddler))" actions=<> tag="div"> +<$keyboard key="((save-tiddler))" actions=<> tag="div"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem"> <$set name="tv-config-toolbar-class" filter="[] [encodeuricomponent[]addprefix[tc-btn-]]"> <$transclude tiddler=<>/> diff --git a/core/ui/EditTemplate/body-editor.tid b/core/ui/EditTemplate/body-editor.tid index 4897aff77..374567acd 100644 --- a/core/ui/EditTemplate/body-editor.tid +++ b/core/ui/EditTemplate/body-editor.tid @@ -1,5 +1,7 @@ title: $:/core/ui/EditTemplate/body/editor +\whitespace trim + <$edit field="text" diff --git a/core/ui/EditTemplate/body/default.tid b/core/ui/EditTemplate/body/default.tid index c9dadc6c4..9f98efcba 100644 --- a/core/ui/EditTemplate/body/default.tid +++ b/core/ui/EditTemplate/body/default.tid @@ -8,9 +8,13 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$ <$action-popup $state=<> $coords="(0,0,0,0)" $floating="yes"/> \end -<$set name="edit-preview-state" value={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[] }}}> -<$vars importTitle=<> importState=<> > -<$dropzone importTitle=<> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<> ><$reveal stateTitle=<> type="match" text="yes"> +\whitespace trim +<$let + edit-preview-state={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[] }}} + importTitle=<> + importState=<> > +<$dropzone importTitle=<> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<> > +<$reveal stateTitle=<> type="match" text="yes" tag="div">
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/> @@ -28,11 +32,10 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
-<$reveal stateTitle=<> type="nomatch" text="yes"> +<$reveal stateTitle=<> type="nomatch" text="yes" tag="div"> <$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/> - - + diff --git a/core/ui/EditTemplate/controls.tid b/core/ui/EditTemplate/controls.tid index e2dcab626..3e2f5e3f3 100644 --- a/core/ui/EditTemplate/controls.tid +++ b/core/ui/EditTemplate/controls.tid @@ -4,6 +4,7 @@ tags: $:/tags/EditTemplate \define config-title() $:/config/EditToolbarButtons/Visibility/$(listItem)$ \end +\whitespace trim
<$view field="title"/> <$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$reveal type="nomatch" state=<> text="hide"><$transclude tiddler=<>/> diff --git a/core/ui/EditTemplate/fieldEditor-default.tid b/core/ui/EditTemplate/fieldEditor-default.tid new file mode 100644 index 000000000..f3242657d --- /dev/null +++ b/core/ui/EditTemplate/fieldEditor-default.tid @@ -0,0 +1,3 @@ +title: $:/core/ui/EditTemplate/fieldEditor/default + +<$edit-text tiddler=<> field=<> default="" class="tc-edit-texteditor tc-edit-fieldeditor" placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} tabindex={{$:/config/EditTabIndex}} cancelPopups="yes"/> \ No newline at end of file diff --git a/core/ui/EditTemplate/fields.tid b/core/ui/EditTemplate/fields.tid index 91578a99a..c57bfb679 100644 --- a/core/ui/EditTemplate/fields.tid +++ b/core/ui/EditTemplate/fields.tid @@ -15,7 +15,8 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$ \end \define new-field-actions() -<$action-sendmessage $message="tm-add-field" $name={{{ [get[text]] }}} $value={{{ [get[text]] }}}/> +\whitespace trim +<$action-sendmessage $message="tm-add-field" $name={{{ [get[text]] }}} $value={{{ [get[text]] :map[get] }}}/> <$action-deletetiddler $filter="[] [] [] []"/> <$action-sendmessage $message="tm-focus-selector" $param=<>/> \end @@ -23,26 +24,34 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$ \define delete-state-tiddlers() <$action-deletetiddler $filter="[] [] []"/> \define cancel-search-actions-inner() -<$list filter="[has[text]] [has[text]]" variable="ignore" emptyMessage="""<>"""> +\whitespace trim +<$list + filter="[has[text]] [has[text]]" + variable="ignore" + emptyMessage="<>"> <> \end \define cancel-search-actions() +\whitespace trim <$set name="userInput" value={{{ [get[text]] }}}> -<$list filter="[get[text]!match]" emptyMessage="""<>"""> +<$list + filter="[get[text]!match]" + emptyMessage="<>"> <$action-setfield $tiddler=<> text=<>/><$action-setfield $tiddler=<> text="yes"/> \end \define new-field() +\whitespace trim <$vars name={{{ [get[text]] }}}> <$reveal type="nomatch" text="" default=<>> <$button tooltip=<>> <$action-sendmessage $message="tm-add-field" $name=<> -$value={{{ [get[text]] }}}/> +$value={{{ [get] }}}/> <$action-deletetiddler $filter="[] [] [] []"/> <> @@ -66,7 +75,7 @@ $value={{{ [get[text]] }}}/> <$text text=<>/>:
<$keyboard key="((delete-field))" actions="""<$action-deletefield $field=<>/><$set name="currentTiddlerCSSescaped" value={{{ [escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<>/>"""> -<$edit-text tiddler=<> field=<> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} tabindex={{$:/config/EditTabIndex}} cancelPopups="yes"/> +<$transclude tiddler={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/FieldEditorFilter]!is[draft]get[text]] :and[!is[blank]else{$:/core/ui/EditTemplate/fieldEditor/default}] }}} /> @@ -126,16 +135,18 @@ $value={{{ [get[text]] }}}/> +<$let currentTiddler=<> currentField={{{ [get[text]] }}}> <$set name="currentTiddlerCSSescaped" value={{{ [escapecss[]] }}}> <$keyboard key="((add-field))" actions=<>> -<$edit-text tiddler=<> tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} class="tc-edit-texteditor" tabindex={{$:/config/EditTabIndex}} cancelPopups="yes"/> +<$transclude tiddler={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/FieldEditorFilter]!is[draft]get[text]] :and[!is[blank]else{$:/core/ui/EditTemplate/fieldEditor/default}] }}} /> <$macrocall $name="new-field"/> + diff --git a/core/ui/EditTemplate/shadow.tid b/core/ui/EditTemplate/shadow.tid index 7bdff4e27..3ae3e0a1f 100644 --- a/core/ui/EditTemplate/shadow.tid +++ b/core/ui/EditTemplate/shadow.tid @@ -3,10 +3,12 @@ tags: $:/tags/EditTemplate \define lingo-base() $:/language/EditTemplate/Shadow/ \define pluginLinkBody() +\whitespace trim <$link to="""$(pluginTitle)$"""> <$text text="""$(pluginTitle)$"""/> \end +\whitespace trim <$list filter="[all[current]get[draft.of]is[shadow]!is[tiddler]]"> <$list filter="[all[current]shadowsource[]]" variable="pluginTitle"> diff --git a/core/ui/EditTemplate/title.tid b/core/ui/EditTemplate/title.tid index daac829f6..5228ad7c0 100644 --- a/core/ui/EditTemplate/title.tid +++ b/core/ui/EditTemplate/title.tid @@ -1,6 +1,7 @@ title: $:/core/ui/EditTemplate/title tags: $:/tags/EditTemplate +\whitespace trim <$edit-text field="draft.title" class="tc-titlebar tc-edit-texteditor" focus={{{ [{$:/config/AutoFocus}match[title]then[true]] ~[[false]] }}} tabindex={{$:/config/EditTabIndex}} cancelPopups="yes"/> <$vars pattern="""[\|\[\]{}]""" bad-chars="""`| [ ] { }`"""> @@ -9,7 +10,7 @@ tags: $:/tags/EditTemplate
-{{$:/core/images/warning}} {{$:/language/EditTemplate/Title/BadCharacterWarning}} +{{$:/core/images/warning}} {{$:/language/EditTemplate/Title/BadCharacterWarning}}
@@ -23,7 +24,7 @@ tags: $:/tags/EditTemplate
-{{$:/core/images/warning}} {{$:/language/EditTemplate/Title/Exists/Prompt}}: <$link to={{!!draft.title}} /> +{{$:/core/images/warning}} {{$:/language/EditTemplate/Title/Exists/Prompt}}: <$link to={{!!draft.title}} />
@@ -33,18 +34,22 @@ tags: $:/tags/EditTemplate <$vars fromTitle={{!!draft.of}} toTitle={{!!draft.title}}> -<$checkbox tiddler="$:/config/RelinkOnRename" field="text" checked="yes" unchecked="no" default="no"> {{$:/language/EditTemplate/Title/Relink/Prompt}} +<$checkbox tiddler="$:/config/RelinkOnRename" field="text" checked="yes" unchecked="no" default="no"> {{$:/language/EditTemplate/Title/Relink/Prompt}} <$list filter="[titlebacklinks[]limit[1]]" variable="listItem"> <$vars stateTiddler=<> > <$reveal type="nomatch" state=<> text="show"> -<$button set=<> setTo="show" class="tc-btn-invisible">{{$:/core/images/right-arrow}} +<$button set=<> setTo="show" class="tc-btn-invisible"> +{{$:/core/images/right-arrow}} + <> <$reveal type="match" state=<> text="show"> -<$button set=<> setTo="hide" class="tc-btn-invisible">{{$:/core/images/down-arrow}} +<$button set=<> setTo="hide" class="tc-btn-invisible"> +{{$:/core/images/down-arrow}} + <> diff --git a/core/ui/EditorToolbar/editor-height.tid b/core/ui/EditorToolbar/editor-height.tid index eeb1e22c7..e684733e2 100644 --- a/core/ui/EditorToolbar/editor-height.tid +++ b/core/ui/EditorToolbar/editor-height.tid @@ -7,6 +7,7 @@ description: {{$:/language/Buttons/EditorHeight/Hint}} condition: [type[]] [get[type]prefix[text/]] [get[type]match[application/javascript]] [get[type]match[application/json]] [get[type]match[application/x-tiddler-dictionary]] [get[type]match[image/svg+xml]] +[first[]] dropdown: $:/core/ui/EditorToolbar/editor-height-dropdown +\whitespace trim <$reveal tag="span" state="$:/config/TextEditor/EditorHeight/Mode" type="match" text="fixed"> {{$:/core/images/fixed-height}} diff --git a/core/ui/EditorToolbar/excise-dropdown.tid b/core/ui/EditorToolbar/excise-dropdown.tid index 47aa27c8b..28888b4b5 100644 --- a/core/ui/EditorToolbar/excise-dropdown.tid +++ b/core/ui/EditorToolbar/excise-dropdown.tid @@ -3,9 +3,10 @@ title: $:/core/ui/EditorToolbar/excise-dropdown \define lingo-base() $:/language/Buttons/Excise/ \define body(config-title) +\whitespace trim ''<>'' -<> <$edit-text tag="input" tiddler="$config-title$/new-title" default="" focus="true"/> +<> <$edit-text tag="input" tiddler="$config-title$/new-title" default="" focus="true"/> <$set name="new-title" value={{$config-title$/new-title}}> <$list filter="""[is[tiddler]]"""> @@ -15,16 +16,16 @@ title: $:/core/ui/EditorToolbar/excise-dropdown -<$checkbox tiddler="""$config-title$/tagnew""" field="text" checked="yes" unchecked="no" default="false"> <> +<$checkbox tiddler="""$config-title$/tagnew""" field="text" checked="yes" unchecked="no" default="false"> <> -<> <$select tiddler="""$config-title$/type""" default="transclude"> +<> <$select tiddler="""$config-title$/type""" default="transclude"> <$reveal state="""$config-title$/type""" type="match" text="macro"> -<> <$edit-text tag="input" tiddler="""$config-title$/macro-title""" default="translink"/> +<> <$edit-text tag="input" tiddler="""$config-title$/macro-title""" default="translink"/> <$button> diff --git a/core/ui/EditorToolbar/file-import.tid b/core/ui/EditorToolbar/file-import.tid index d8024f3d8..20cff547d 100644 --- a/core/ui/EditorToolbar/file-import.tid +++ b/core/ui/EditorToolbar/file-import.tid @@ -13,6 +13,7 @@ condition: [!has[type]] [type[text/vnd.tiddlywiki] \define replacement-text-file() [[$title$]] \define postImportActions() +\whitespace trim <$list filter="[links[]] :reduce[get[type]prefix[image]thenelsesearch-replace[$title$],addprefix]" variable="imageTitle"> <$action-sendmessage $message="tm-edit-text-operation" @@ -24,10 +25,13 @@ condition: [!has[type]] [type[text/vnd.tiddlywiki] \end \define buttons() +\whitespace trim <$button class="tc-btn-invisible" actions=<> ><> + <$button class="tc-btn-invisible" message="tm-perform-import" param=<> actions=<> ><> \end +\whitespace trim <$reveal type="popup" state=<> tag="div" class="tc-editor-importpopup">
<$list filter="[field:plugin-type[import]]"> diff --git a/core/ui/EditorToolbar/link-dropdown.tid b/core/ui/EditorToolbar/link-dropdown.tid index eacb17547..e2766935b 100644 --- a/core/ui/EditorToolbar/link-dropdown.tid +++ b/core/ui/EditorToolbar/link-dropdown.tid @@ -3,6 +3,7 @@ title: $:/core/ui/EditorToolbar/link-dropdown \define lingo-base() $:/language/Buttons/Link/ \define add-link-actions() +\whitespace trim <$action-sendmessage $message="tm-edit-text-operation" $param="make-link" text={{$(linkTiddler)$}} /> <$action-deletetiddler $filter="[] [] [] [] []"/> \end @@ -10,20 +11,22 @@ title: $:/core/ui/EditorToolbar/link-dropdown \define get-focus-selector() [data-tiddler-title="$(cssEscapedTitle)$"] .tc-create-wikitext-link input \define cancel-search-actions-inner() -<$set name="userInput" value={{{ [get[text]] }}}><$list filter="[get[text]!match]" emptyMessage="""<$action-deletetiddler $filter="[] [] [] []"/>"""><$action-setfield $tiddler=<> text=<>/><$action-setfield $tiddler=<> text="yes"/> +<$set name="userInput" value={{{ [get[text]] }}}><$list filter="[get[text]!match]" emptyMessage="<$action-deletetiddler $filter='[] [] [] []'/>"><$action-setfield $tiddler=<> text=<>/><$action-setfield $tiddler=<> text="yes"/> \end -\define cancel-search-actions() <$list filter="[!has[text]] +[!has[text]]" emptyMessage="""<>"""><$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/> +\define cancel-search-actions() <$list filter="[!has[text]] +[!has[text]]" emptyMessage="<>"><$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/> \define external-link() +\whitespace trim <$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;" actions=<>> {{$:/core/images/chevron-right}} \end -\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/search/currentTab" text=<>/>"""/> +\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/search/currentTab' text=<>/>"/> \define body(config-title) +\whitespace trim ''<>'' <$vars searchTiddler="""$config-title$/search""" linkTiddler="""$config-title$/link""" linktext="" searchListState=<> refreshTitle=<> storeTitle=<>> @@ -33,13 +36,15 @@ title: $:/core/ui/EditorToolbar/link-dropdown <$keyboard key="((input-tab-left))" actions=<> class="tc-create-wikitext-link"> <$macrocall $name="keyboard-driven-input" tiddler=<> storeTitle=<> selectionStateTitle=<> refreshTitle=<> type="search" filterMinLength="1" - tag="input" focus="true" class="tc-popup-handle" inputCancelActions=<> - inputAcceptActions=<> placeholder={{$:/language/Search/Search}} default="" + tag="input" focus="true" class="tc-popup-handle" inputCancelActions=<> + inputAcceptActions=<> placeholder={{$:/language/Search/Search}} default="" configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" /> + <$reveal tag="span" state=<> type="nomatch" text=""> <> + <$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;"> <><$set name="cssEscapedTitle" value={{{ [escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<>/> {{$:/core/images/close-button}} diff --git a/core/ui/EditorToolbar/more-dropdown.tid b/core/ui/EditorToolbar/more-dropdown.tid index 289f74011..c22d7b3dc 100644 --- a/core/ui/EditorToolbar/more-dropdown.tid +++ b/core/ui/EditorToolbar/more-dropdown.tid @@ -5,10 +5,14 @@ $:/config/EditorToolbarButtons/Visibility/$(toolbarItem)$ \end \define conditional-button() +\whitespace trim <$list filter={{$(toolbarItem)$!!condition}} variable="condition"> -<$transclude tiddler="$:/core/ui/EditTemplate/body/toolbar/button" mode="inline"/> <$transclude tiddler=<> field="description"/> +<$transclude tiddler="$:/core/ui/EditTemplate/body/toolbar/button" mode="inline"/> + +<$transclude tiddler=<> field="description"/> \end +\whitespace trim
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditorToolbar]!has[draft.of]] -[[$:/core/ui/EditorToolbar/more]]"> diff --git a/core/ui/EditorToolbar/paint.tid b/core/ui/EditorToolbar/paint.tid index 6fb8cd0c2..a807e1397 100644 --- a/core/ui/EditorToolbar/paint.tid +++ b/core/ui/EditorToolbar/paint.tid @@ -9,6 +9,7 @@ dropdown: $:/core/ui/EditorToolbar/paint-dropdown \define toolbar-paint()
\end +\whitespace trim <$set name="colour-picker-value" value={{$:/config/BitmapEditor/Colour}}> <> diff --git a/core/ui/EditorToolbar/preview.tid b/core/ui/EditorToolbar/preview.tid index b41002152..106b28d3c 100644 --- a/core/ui/EditorToolbar/preview.tid +++ b/core/ui/EditorToolbar/preview.tid @@ -8,6 +8,7 @@ condition: [] button-classes: tc-text-editor-toolbar-item-start-group shortcuts: ((preview)) +\whitespace trim <$reveal state=<> type="match" text="yes" tag="span"> {{$:/core/images/preview-open}} <$action-setfield $tiddler=<> $value="no"/> diff --git a/core/ui/EditorToolbar/size-dropdown.tid b/core/ui/EditorToolbar/size-dropdown.tid index 96e4ec7d9..11023bf37 100644 --- a/core/ui/EditorToolbar/size-dropdown.tid +++ b/core/ui/EditorToolbar/size-dropdown.tid @@ -33,9 +33,14 @@ title: $:/core/ui/EditorToolbar/size-dropdown \end \define toolbar-button-size(config-title) +\whitespace trim ''{{$:/language/Buttons/Size/Hint}}'' -<> <$edit-text tag="input" tiddler="""$config-title$/new-width""" default=<> focus="true" size="8"/> <> <$edit-text tag="input" tiddler="""$config-title$/new-height""" default=<> size="8"/> <$button popup="""$config-title$/presets-popup""" class="tc-btn-invisible tc-popup-keep" style="width: auto; display: inline-block; background-colour: inherit;" selectedClass="tc-selected"> +<> <$edit-text tag="input" tiddler="""$config-title$/new-width""" default=<> focus="true" size="8"/> + +<> <$edit-text tag="input" tiddler="""$config-title$/new-height""" default=<> size="8"/> + +<$button popup="""$config-title$/presets-popup""" class="tc-btn-invisible tc-popup-keep" style="width: auto; display: inline-block; background-colour: inherit;" selectedClass="tc-selected"> {{$:/core/images/down-arrow}} diff --git a/core/ui/ExportTiddlyWikiCore.tid b/core/ui/ExportTiddlyWikiCore.tid index a6bb68c13..8c85c87a4 100644 --- a/core/ui/ExportTiddlyWikiCore.tid +++ b/core/ui/ExportTiddlyWikiCore.tid @@ -3,20 +3,30 @@ title: $:/core/ui/ExportTiddlyWikiCore \define jsFileName() tiddlywikicore-$(version)$.js \define noExportMsg() It appears that you have a wiki with an external ~TiddlyWiki core. The export action cannot be performed. -

You will need to view the page source in your browser. Then go to the very bottom the the source, find the last `