1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-05-18 03:12:19 +00:00

Merge branch 'master' into external-tasks

This commit is contained in:
Jermolene
2019-01-06 17:33:20 +00:00
292 changed files with 15320 additions and 763 deletions
+26
View File
@@ -0,0 +1,26 @@
language: node_js
- "node"
stages:
- name: install
if: branch = "master"
- name: test
- name: build
if: branch = "master"
- name: pre-deploy
if: branch = "master"
- name: deploy
if: branch = "master"
jobs:
include:
- stage: install
script: npm --force install tiddlywiki
- stage: test
script: ./bin/test.sh
- stage: build
script: ./bin/build-site.sh
- stage: pre-deploy
script: skip
- stage: deploy
script: ./bin/deploy-site.sh
-15
View File
@@ -1,15 +0,0 @@
@echo off
rem build TiddlyWiki 2.x
rem cook the TiddlyWiki 2.x.x index file
node .\tiddlywiki.js ^
editions\tw2 ^
--verbose ^
--output tmp\tw2 ^
--load editions\tw2\source\tiddlywiki.com\index.html.recipe ^
--rendertiddler $:/core/templates/tiddlywiki2.template.html index.html text/plain ^
|| exit 1
fc tmp\tw2\index.html editions\tw2\target\prebuilt.html
-15
View File
@@ -1,15 +0,0 @@
#!/bin/bash
# build TiddlyWiki 2.x
# cook the TiddlyWiki 2.x.x index file
node ./tiddlywiki.js \
editions/tw2 \
--verbose \
--output tmp/tw2 \
--load editions/tw2/source/tiddlywiki.com/index.html.recipe \
--rendertiddler $:/core/templates/tiddlywiki2.template.html index.html text/plain \
|| exit 1
diff -q tmp/tw2/index.html editions/tw2/target/prebuilt.html
+371
View File
@@ -0,0 +1,371 @@
#!/bin/bash
# Build all tiddlywiki.com assets
# Default to the current version number for building the plugin library
if [ -z "$TW5_BUILD_VERSION" ]; then
TW5_BUILD_VERSION=v5.1.19
fi
# Default to using tw5.com as the main edition for /index.html
if [ -z "$TW5_BUILD_MAIN_EDITION" ]; then
TW5_BUILD_MAIN_EDITION=./editions/tw5.com
fi
# Default to the version of TiddlyWiki installed in this repo
if [ -z "$TW5_BUILD_TIDDLYWIKI" ]; then
TW5_BUILD_TIDDLYWIKI=./tiddlywiki.js
fi
# Set up the build output directory
if [ -z "$TW5_BUILD_OUTPUT" ]; then
TW5_BUILD_OUTPUT=./output
fi
mkdir -p $TW5_BUILD_OUTPUT
if [ ! -d "$TW5_BUILD_OUTPUT" ]; then
echo 'A valid TW5_BUILD_OUTPUT environment variable must be set'
exit 1
fi
echo "Using TW5_BUILD_OUTPUT as [$TW5_BUILD_OUTPUT]"
# Make the CNAME file that GitHub Pages requires
echo "tiddlywiki.com" > $TW5_BUILD_OUTPUT/CNAME
# Delete any existing static content
mkdir -p $TW5_BUILD_OUTPUT/static
mkdir -p $TW5_BUILD_OUTPUT/dev
mkdir -p $TW5_BUILD_OUTPUT/dev/static
rm $TW5_BUILD_OUTPUT/static/*
rm $TW5_BUILD_OUTPUT/dev/static/*
# Redirects
echo "<a href='./plugins/tiddlywiki/tw2parser/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/tw2parser/index.html</a>" > $TW5_BUILD_OUTPUT/classicparserdemo.html
echo "<a href='./plugins/tiddlywiki/codemirror/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/codemirror/index.html</a>" > $TW5_BUILD_OUTPUT/codemirrordemo.html
echo "<a href='./plugins/tiddlywiki/d3/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/d3/index.html</a>" > $TW5_BUILD_OUTPUT/d3demo.html
echo "<a href='./plugins/tiddlywiki/highlight/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/highlight/index.html</a>" > $TW5_BUILD_OUTPUT/highlightdemo.html
echo "<a href='./plugins/tiddlywiki/markdown/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/markdown/index.html</a>" > $TW5_BUILD_OUTPUT/markdowndemo.html
echo "<a href='./plugins/tiddlywiki/tahoelafs/index.html'>Moved to http://tiddlywiki.com/plugins/tiddlywiki/tahoelafs/index.html</a>" > $TW5_BUILD_OUTPUT/tahoelafs.html
# ######################################################
# #
# # Core 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 $TW5_BUILD_TIDDLYWIKI \
# $TW5_BUILD_MAIN_EDITION \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --build favicon static index \
# || exit 1
# # /empty.html Empty
# # /empty.hta For Internet Explorer
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/empty \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --build empty \
# || exit 1
# # /dev/index.html Developer docs
# # /dev/favicon.ico Favicon for dev site
# # /dev/static.html Static rendering of default tiddlers
# # /dev/alltiddlers.html Static rendering of all tiddlers
# # /dev/static/* Static single tiddlers
# # /dev/static/static.css Static stylesheet
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/dev \
# --verbose \
# --output $TW5_BUILD_OUTPUT/dev \
# --build index favicon static \
# || exit 1
# # /upgrade.html Custom edition for performing upgrades
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/upgrade \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --build upgrade \
# || exit 1
# # /encrypted.html Copy of the main file encrypted with the password "password"
# node $TW5_BUILD_TIDDLYWIKI \
# $TW5_BUILD_MAIN_EDITION \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --build encrypted \
# || exit 1
# ######################################################
# #
# # Editions
# #
# ######################################################
# # /editions/xlsx-utils/index.html xlsx-utils edition
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/xlsx-utils \
# --verbose \
# --output $TW5_BUILD_OUTPUT/editions/xlsx-utils/ \
# --build index \
# || exit 1
# # /editions/resumebuilder/index.html Resume builder edition
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/resumebuilder \
# --verbose \
# --output $TW5_BUILD_OUTPUT/editions/resumebuilder/ \
# --build index \
# || exit 1
# # /editions/text-slicer/index.html Text slicer edition
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/text-slicer \
# --verbose \
# --output $TW5_BUILD_OUTPUT/editions/text-slicer/ \
# --build index \
# || exit 1
# # /editions/translators/index.html Translators edition
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/translators \
# --verbose \
# --output $TW5_BUILD_OUTPUT/editions/translators/ \
# --build index \
# || exit 1
# # /editions/introduction/index.html Introduction edition
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/introduction \
# --verbose \
# --output $TW5_BUILD_OUTPUT/editions/introduction/ \
# --build index \
# || exit 1
# # /editions/full/index.html Full edition
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/full \
# --verbose \
# --output $TW5_BUILD_OUTPUT/editions/full/ \
# --build index \
# || exit 1
# # /editions/tw5.com-docs/index.html tiddlywiki.com docs edition
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/tw5.com-docs \
# --verbose \
# --output $TW5_BUILD_OUTPUT/editions/tw5.com-docs/ \
# --build index \
# || exit 1
# ######################################################
# #
# # Plugin demos
# #
# ######################################################
# # /plugins/tiddlywiki/dynaview/index.html Demo wiki with DynaView plugin
# # /plugins/tiddlywiki/dynaview/empty.html Empty wiki with DynaView plugin
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/dynaviewdemo \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --rendertiddler $:/core/save/all plugins/tiddlywiki/dynaview/index.html text/plain \
# --rendertiddler $:/core/save/empty plugins/tiddlywiki/dynaview/empty.html text/plain \
# || exit 1
# # /plugins/tiddlywiki/katex/index.html Demo wiki with KaTeX plugin
# # /plugins/tiddlywiki/katex/empty.html Empty wiki with KaTeX plugin
# # TODO: Build the static file with the release of 5.1.3
# # --rendertiddler $:/core/templates/static.template.html plugins/tiddlywiki/katex/static.html text/plain \
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/katexdemo \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --rendertiddler $:/core/save/all plugins/tiddlywiki/katex/index.html text/plain \
# --rendertiddler $:/core/save/empty plugins/tiddlywiki/katex/empty.html text/plain \
# || exit 1
# # /plugins/tiddlywiki/tahoelafs/index.html Demo wiki with Tahoe-LAFS plugin
# # /plugins/tiddlywiki/tahoelafs/empty.html Empty wiki with Tahoe-LAFS plugin
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/tahoelafs \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --rendertiddler $:/core/save/all plugins/tiddlywiki/tahoelafs/index.html text/plain \
# --rendertiddler $:/core/save/empty plugins/tiddlywiki/tahoelafs/empty.html text/plain \
# || exit 1
# # /plugins/tiddlywiki/d3/index.html Demo wiki with D3 plugin
# # /plugins/tiddlywiki/d3/empty.html Empty wiki with D3 plugin
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/d3demo \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --rendertiddler $:/core/save/all plugins/tiddlywiki/d3/index.html text/plain \
# --rendertiddler $:/core/save/empty plugins/tiddlywiki/d3/empty.html text/plain \
# || exit 1
# # /plugins/tiddlywiki/codemirror/index.html Demo wiki with codemirror plugin
# # /plugins/tiddlywiki/codemirror/empty.html Empty wiki with codemirror plugin
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/codemirrordemo \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --rendertiddler $:/core/save/all plugins/tiddlywiki/codemirror/index.html text/plain \
# --rendertiddler $:/core/save/empty plugins/tiddlywiki/codemirror/empty.html text/plain \
# || exit 1
# # /plugins/tiddlywiki/markdown/index.html Demo wiki with Markdown plugin
# # /plugins/tiddlywiki/markdown/empty.html Empty wiki with Markdown plugin
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/markdowndemo \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --rendertiddler $:/core/save/all plugins/tiddlywiki/markdown/index.html text/plain \
# --rendertiddler $:/core/save/empty plugins/tiddlywiki/markdown/empty.html text/plain \
# || exit 1
# # /plugins/tiddlywiki/tw2parser/index.html Demo wiki with tw2parser plugin
# # /plugins/tiddlywiki/tw2parser/empty.html Empty wiki with tw2parser plugin
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/classicparserdemo \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --rendertiddler $:/core/save/all plugins/tiddlywiki/tw2parser/index.html text/plain \
# --rendertiddler $:/core/save/empty plugins/tiddlywiki/tw2parser/empty.html text/plain \
# || exit 1
# # /plugins/tiddlywiki/highlight/index.html Demo wiki with highlight plugin
# # /plugins/tiddlywiki/highlight/empty.html Empty wiki with highlight plugin
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/highlightdemo \
# --verbose \
# --output $TW5_BUILD_OUTPUT \
# --rendertiddler $:/core/save/all plugins/tiddlywiki/highlight/index.html text/plain \
# --rendertiddler $:/core/save/empty plugins/tiddlywiki/highlight/empty.html text/plain \
# || exit 1
# ######################################################
# #
# # Language editions
# #
# ######################################################
# # Delete any existing static content
# rm $TW5_BUILD_OUTPUT/languages/de-AT/static/*
# rm $TW5_BUILD_OUTPUT/languages/de-DE/static/*
# rm $TW5_BUILD_OUTPUT/languages/es-ES/static/*
# rm $TW5_BUILD_OUTPUT/languages/fr-FR/static/*
# rm $TW5_BUILD_OUTPUT/languages/ja-JP/static/*
# rm $TW5_BUILD_OUTPUT/languages/ko-KR/static/*
# rm $TW5_BUILD_OUTPUT/languages/zh-Hans/static/*
# rm $TW5_BUILD_OUTPUT/languages/zh-Hant/static/*
# # /languages/de-AT/index.html Demo wiki with de-AT language
# # /languages/de-AT/empty.html Empty wiki with de-AT language
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/de-AT \
# --verbose \
# --output $TW5_BUILD_OUTPUT/languages/de-AT \
# --build favicon empty static index \
# || exit 1
# # /languages/de-DE/index.html Demo wiki with de-DE language
# # /languages/de-DE/empty.html Empty wiki with de-DE language
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/de-DE \
# --verbose \
# --output $TW5_BUILD_OUTPUT/languages/de-DE \
# --build favicon empty static index \
# || exit 1
# # /languages/es-ES/index.html Demo wiki with es-ES language
# # /languages/es-ES/empty.html Empty wiki with es-ES language
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/es-ES \
# --verbose \
# --output $TW5_BUILD_OUTPUT/languages/es-ES \
# --build favicon empty static index \
# || exit 1
# # /languages/fr-FR/index.html Demo wiki with fr-FR language
# # /languages/fr-FR/empty.html Empty wiki with fr-FR language
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/fr-FR \
# --verbose \
# --output $TW5_BUILD_OUTPUT/languages/fr-FR \
# --build favicon empty static index \
# || exit 1
# # /languages/ja-JP/index.html Demo wiki with ja-JP language
# # /languages/ja-JP/empty.html Empty wiki with ja-JP language
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/ja-JP \
# --verbose \
# --output $TW5_BUILD_OUTPUT/languages/ja-JP \
# --build empty index \
# || exit 1
# # /languages/ko-KR/index.html Demo wiki with ko-KR language
# # /languages/ko-KR/empty.html Empty wiki with ko-KR language
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/ko-KR \
# --verbose \
# --output $TW5_BUILD_OUTPUT/languages/ko-KR \
# --build favicon empty static index \
# || exit 1
# # /languages/zh-Hans/index.html Demo wiki with zh-Hans language
# # /languages/zh-Hans/empty.html Empty wiki with zh-Hans language
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/zh-Hans \
# --verbose \
# --output $TW5_BUILD_OUTPUT/languages/zh-Hans \
# --build empty index \
# || exit 1
# # /languages/zh-Hant/index.html Demo wiki with zh-Hant language
# # /languages/zh-Hant/empty.html Empty wiki with zh-Hant language
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/zh-Hant \
# --verbose \
# --output $TW5_BUILD_OUTPUT/languages/zh-Hant \
# --build empty index \
# || exit 1
# ######################################################
# #
# # Plugin library
# #
# ######################################################
# node $TW5_BUILD_TIDDLYWIKI \
# ../TiddlyWiki5/editions/pluginlibrary \
# --verbose \
# --output $TW5_BUILD_OUTPUT/library/$TW5_BUILD_VERSION \
# --build \
# || exit 1
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# Deploy the output folder to github
# pushd ../jermolene.github.io
# git add --all || exit 1
# git commit -m "Updates" || exit 1
# git push origin || exit 1
# popd
echo "(Placeholdeer feploying to GitHub)"
+1
View File
@@ -7,6 +7,7 @@
node ./tiddlywiki.js \
./editions/test \
--verbose \
--version \
--rendertiddler $:/core/save/all test.html text/plain \
|| exit 1
+9
View File
@@ -0,0 +1,9 @@
title: $:/core/images/gitter
tags: $:/tags/Image
<svg class="tc-image-gitter tc-image-button" width="22pt" height="22pt" viewBox="0 0 18 25">
<rect x="15" y="5" width="2" height="10"></rect>
<rect x="10" y="5" width="2" height="20"></rect>
<rect x="5" y="5" width="2" height="20"></rect>
<rect width="2" height="15"></rect>
</svg>
+1
View File
@@ -22,6 +22,7 @@ Tags/Dropdown/Hint: Show tag list
Title/BadCharacterWarning: Warning: avoid using any of the characters <<bad-chars>> in tiddler titles
Title/Exists/Prompt: Target tiddler already exists
Title/Relink/Prompt: Update ''<$text text=<<fromTitle>>/>'' to ''<$text text=<<toTitle>>/>'' in the //tags// and //list// fields of other tiddlers
Title/References/Prompt: The following references to this tiddler will not be automatically updated:
Type/Dropdown/Caption: content type list
Type/Dropdown/Hint: Show content type list
Type/Delete/Caption: delete content type
+5 -2
View File
@@ -19,8 +19,8 @@ All parameters are optional with safe defaults, and can be specified in any orde
* ''username'' - optional username for basic authentication
* ''password'' - optional password for basic authentication
* ''authenticated-user-header'' - optional name of header to be used for trusted authentication
* ''readers'' - comma separated list of principals allowed to write to this wiki
* ''writers'' - comma separated list of principals allowed to read from this wiki
* ''readers'' - comma separated list of principals allowed to read from this wiki
* ''writers'' - comma separated list of principals allowed to write to this wiki
* ''csrf-disable'' - set to "yes" to disable CSRF checks (defaults to "no")
* ''root-tiddler'' - the tiddler to serve at the root (defaults to "$:/core/save/all")
* ''root-render-type'' - the content type to which the root tiddler should be rendered (defaults to "text/plain")
@@ -28,3 +28,6 @@ All parameters are optional with safe defaults, and can be specified in any orde
* ''tls-cert'' - pathname of TLS certificate file (relative to wiki folder)
* ''tls-key'' - pathname of TLS key file (relative to wiki folder)
* ''debug-level'' - optional debug level; set to "debug" to view request details (defaults to "none")
For information on opening up your instance to the entire local network, and possible security concerns, see the WebServer tiddler at TiddlyWiki.com.
+5 -2
View File
@@ -12,7 +12,7 @@ The parameters are:
* ''port'' - port number on which to listen; non-numeric values are interpreted as a system environment variable from which the port number is extracted (defaults to "8080")
* ''root-tiddler'' - the tiddler to serve at the root (defaults to "$:/core/save/all")
* ''root-render-type'' - the content type to which the root tiddler should be rendered (defaults to "text/plain")
* ''rooot-serve-type'' - the content type with which the root tiddler should be served (defaults to "text/html")
* ''root-serve-type'' - the content type with which the root tiddler should be served (defaults to "text/html")
* ''username'' - the default username for signing edits
* ''password'' - optional password for basic authentication
* ''host'' - optional hostname to serve from (defaults to "127.0.0.1" aka "localhost")
@@ -27,12 +27,15 @@ For example:
--server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd
```
The username and password can be specified as empty strings if you need to set the hostname or pathprefix and don't want to require a password:
The username and password can be specified as empty strings if you need to set the hostname or pathprefix and don't want to require a password.
```
--server 8080 $:/core/save/all text/plain text/html "" "" 192.168.0.245
```
Using an address like this exposes your system to the local network. For information on opening up your instance to the entire local network, and possible security concerns, see the WebServer tiddler at TiddlyWiki.com.
To run multiple TiddlyWiki servers at the same time you'll need to put each one on a different port. It can be useful to use an environment variable to pass the port number to the Node.js process. This example references an environment variable called "MY_PORT_NUMBER":
```
+1 -1
View File
@@ -39,7 +39,7 @@ Command.prototype.execute = function() {
variables: self.params
});
var nodeServer = this.server.listen();
$tw.hooks.invokeHook("th-server-command-post-start",this.server,nodeServer);
$tw.hooks.invokeHook("th-server-command-post-start",this.server,nodeServer,"tiddlywiki");
return null;
};
+1 -1
View File
@@ -46,7 +46,7 @@ Command.prototype.execute = function() {
}
});
var nodeServer = this.server.listen();
$tw.hooks.invokeHook("th-server-command-post-start",this.server,nodeServer);
$tw.hooks.invokeHook("th-server-command-post-start",this.server,nodeServer,"tiddlywiki");
return null;
};
+21 -2
View File
@@ -40,12 +40,23 @@ function parseFilterOperation(operators,filterString,p) {
nextBracketPos += p;
var bracket = filterString.charAt(nextBracketPos);
operator.operator = filterString.substring(p,nextBracketPos);
// Any suffix?
var colon = operator.operator.indexOf(':');
if(colon > -1) {
// The raw suffix for older filters
operator.suffix = operator.operator.substring(colon + 1);
operator.operator = operator.operator.substring(0,colon) || "field";
// The processed suffix for newer filters
operator.suffixes = [];
$tw.utils.each(operator.suffix.split(":"),function(subsuffix) {
operator.suffixes.push([]);
$tw.utils.each(subsuffix.split(","),function(entry) {
entry = $tw.utils.trim(entry);
if(entry) {
operator.suffixes[operator.suffixes.length - 1].push(entry);
}
});
});
}
// Empty operator means: title
else if(operator.operator === "") {
@@ -108,7 +119,7 @@ exports.parseFilter = function(filterString) {
p = 0, // Current position in the filter string
match;
var whitespaceRegExp = /(\s+)/mg,
operandRegExp = /((?:\+|\-)?)(?:(\[)|(?:"([^"]*)")|(?:'([^']*)')|([^\s\[\]]+))/mg;
operandRegExp = /((?:\+|\-|~)?)(?:(\[)|(?:"([^"]*)")|(?:'([^']*)')|([^\s\[\]]+))/mg;
while(p < filterString.length) {
// Skip any whitespace
whitespaceRegExp.lastIndex = p;
@@ -208,6 +219,7 @@ exports.compileFilter = function(filterString) {
operand: operand,
prefix: operator.prefix,
suffix: operator.suffix,
suffixes: operator.suffixes,
regexp: operator.regexp
},{
wiki: self,
@@ -247,6 +259,13 @@ exports.compileFilter = function(filterString) {
results.splice(0,results.length);
$tw.utils.pushTop(results,operationSubFunction(source,widget));
};
case "~": // This operation is unioned into the result only if the main result so far is empty
return function(results,source,widget) {
if(results.length === 0) {
// Main result so far is empty
$tw.utils.pushTop(results,operationSubFunction(source,widget));
}
};
}
})());
});
+9 -1
View File
@@ -34,8 +34,16 @@ exports.range = function(source,operator,options) {
}
switch(parts.length) {
case 1:
beg = 0;
end = parts[0];
if (end >= 1) {
beg = 1;
}
else if (end <= -1) {
beg = -1;
}
else {
return [];
}
inc = 1;
break;
case 2:
+25 -2
View File
@@ -17,11 +17,34 @@ Export our filter function
*/
exports.search = function(source,operator,options) {
var invert = operator.prefix === "!";
if(operator.suffix) {
if(operator.suffixes) {
var hasFlag = function(flag) {
return (operator.suffixes[1] || []).indexOf(flag) !== -1;
},
excludeFields = false,
fieldList = operator.suffixes[0] || [],
firstField = fieldList[0] || "",
firstChar = firstField.charAt(0),
fields;
if(firstChar === "-") {
fields = [firstField.slice(1)].concat(fieldList.slice(1));
excludeFields = true;
} else if(fieldList[0] === "*"){
fields = [];
excludeFields = true;
} else {
fields = fieldList.slice(0);
}
return options.wiki.search(operator.operand,{
source: source,
invert: invert,
field: operator.suffix
field: fields,
excludeField: excludeFields,
caseSensitive: hasFlag("casesensitive"),
literal: hasFlag("literal"),
whitespace: hasFlag("whitespace"),
regexp: hasFlag("regexp"),
words: hasFlag("words")
});
} else {
return options.wiki.search(operator.operand,{
+33
View File
@@ -0,0 +1,33 @@
/*\
title: $:/core/modules/filters/subfilter.js
type: application/javascript
module-type: filteroperator
Filter operator returning its operand evaluated as a filter
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.subfilter = function(source,operator,options) {
var list = options.wiki.filterTiddlers(operator.operand,options.widget,source);
if(operator.prefix === "!") {
var results = [];
source(function(tiddler,title) {
if(list.indexOf(title) === -1) {
results.push(title);
}
});
return results;
} else {
return list;
}
};
})();
+78 -4
View File
@@ -138,6 +138,17 @@ function KeyboardManager(options) {
});
// Save the platform-specific name of the "meta" key
this.metaKeyName = $tw.platform.isMac ? "cmd-" : "win-";
this.shortcutKeysList = [], // Stores the shortcut-key descriptors
this.shortcutActionList = [], // Stores the corresponding action strings
this.shortcutParsedList = []; // Stores the parsed key descriptors
this.lookupNames = ["shortcuts"];
this.lookupNames.push($tw.platform.isMac ? "shortcuts-mac" : "shortcuts-not-mac")
this.lookupNames.push($tw.platform.isWindows ? "shortcuts-windows" : "shortcuts-not-windows");
this.lookupNames.push($tw.platform.isLinux ? "shortcuts-linux" : "shortcuts-not-linux");
this.updateShortcutLists(this.getShortcutTiddlerList());
$tw.wiki.addEventListener("change",function(changes) {
self.handleShortcutChanges(changes);
});
}
/*
@@ -229,10 +240,9 @@ KeyboardManager.prototype.parseKeyDescriptors = function(keyDescriptors,options)
result.push.apply(result,self.parseKeyDescriptors(keyDescriptors,options));
}
};
lookupName("shortcuts");
lookupName($tw.platform.isMac ? "shortcuts-mac" : "shortcuts-not-mac");
lookupName($tw.platform.isWindows ? "shortcuts-windows" : "shortcuts-not-windows");
lookupName($tw.platform.isLinux ? "shortcuts-linux" : "shortcuts-not-linux");
$tw.utils.each(self.lookupNames,function(platformDescriptor) {
lookupName(platformDescriptor);
});
}
} else {
result.push(self.parseKeyDescriptor(keyDescriptor));
@@ -274,6 +284,70 @@ KeyboardManager.prototype.checkKeyDescriptors = function(event,keyInfoArray) {
return false;
};
KeyboardManager.prototype.getShortcutTiddlerList = function() {
return $tw.wiki.getTiddlersWithTag("$:/tags/KeyboardShortcut");
};
KeyboardManager.prototype.updateShortcutLists = function(tiddlerList) {
this.shortcutTiddlers = tiddlerList;
for(var i=0; i<tiddlerList.length; i++) {
var title = tiddlerList[i],
tiddlerFields = $tw.wiki.getTiddler(title).fields;
this.shortcutKeysList[i] = tiddlerFields.key !== undefined ? tiddlerFields.key : undefined;
this.shortcutActionList[i] = tiddlerFields.text;
this.shortcutParsedList[i] = this.shortcutKeysList[i] !== undefined ? this.parseKeyDescriptors(this.shortcutKeysList[i]) : undefined;
}
};
KeyboardManager.prototype.handleKeydownEvent = function(event) {
var key, action;
for(var i=0; i<this.shortcutTiddlers.length; i++) {
if(this.shortcutParsedList[i] !== undefined && this.checkKeyDescriptors(event,this.shortcutParsedList[i])) {
key = this.shortcutParsedList[i];
action = this.shortcutActionList[i];
}
}
if(key !== undefined) {
event.preventDefault();
event.stopPropagation();
$tw.rootWidget.invokeActionString(action,$tw.rootWidget);
return true;
}
return false;
};
KeyboardManager.prototype.detectNewShortcuts = function(changedTiddlers) {
var shortcutConfigTiddlers = [],
handled = false;
$tw.utils.each(this.lookupNames,function(platformDescriptor) {
var descriptorString = "$:/config/" + platformDescriptor + "/";
Object.keys(changedTiddlers).forEach(function(configTiddler) {
var configString = configTiddler.substr(0, configTiddler.lastIndexOf("/") + 1);
if(configString === descriptorString) {
shortcutConfigTiddlers.push(configTiddler);
handled = true;
}
});
});
if(handled) {
return $tw.utils.hopArray(changedTiddlers,shortcutConfigTiddlers);
} else {
return false;
}
};
KeyboardManager.prototype.handleShortcutChanges = function(changedTiddlers) {
var newList = this.getShortcutTiddlerList();
var hasChanged = $tw.utils.hopArray(changedTiddlers,this.shortcutTiddlers) ? true :
($tw.utils.hopArray(changedTiddlers,newList) ? true :
(this.detectNewShortcuts(changedTiddlers))
);
// Re-cache shortcuts if something changed
if(hasChanged) {
this.updateShortcutLists(newList);
}
};
exports.KeyboardManager = KeyboardManager;
})();
@@ -1,9 +1,9 @@
/*\
title: $:/core/modules/server/routes/get-login/basic.js
title: $:/core/modules/server/routes/get-login-basic.js
type: application/javascript
module-type: route
GET /login/basic -- force a Basic Authentication challenge
GET /login-basic -- force a Basic Authentication challenge
\*/
(function() {
@@ -14,7 +14,7 @@ GET /login/basic -- force a Basic Authentication challenge
exports.method = "GET";
exports.path = /^\/login\/basic$/;
exports.path = /^\/login-basic$/;
exports.handler = function(request,response,state) {
if(!state.authenticatedUsername) {
@@ -20,16 +20,18 @@ exports.handler = function(request,response,state) {
var title = decodeURIComponent(state.params[0]),
tiddler = state.wiki.getTiddler(title);
if(tiddler) {
var renderType,template;
// Render ordinary tiddlers as HTML, and system tiddlers in plain text
var renderType = tiddler.getFieldString("_render_type"),
renderTemplate = tiddler.getFieldString("_render_template");
// Tiddler fields '_render_type' and '_render_template' overwrite
// system wide settings for render type and template
if(state.wiki.isSystemTiddler(title)) {
renderType = state.server.get("system-tiddler-render-type");
template = state.server.get("system-tiddler-template");
renderType = renderType || state.server.get("system-tiddler-render-type");
renderTemplate = renderTemplate || state.server.get("system-tiddler-render-template");
} else {
renderType = state.server.get("tiddler-render-type");
template = state.server.get("tiddler-template");
renderType = renderType || state.server.get("tiddler-render-type");
renderTemplate = renderTemplate || state.server.get("tiddler-render-template");
}
var text = state.wiki.renderTiddler(renderType,template,{parseAsInline: true, variables: {currentTiddler: title}});
var text = state.wiki.renderTiddler(renderType,renderTemplate,{parseAsInline: true, variables: {currentTiddler: title}});
// Naughty not to set a content-type, but it's the easiest way to ensure the browser will see HTML pages as HTML, and accept plain text tiddlers as CSS or JS
response.writeHead(200);
response.end(text,"utf8");
+2 -2
View File
@@ -81,9 +81,9 @@ Server.prototype.defaultVariables = {
"root-render-type": "text/plain",
"root-serve-type": "text/html",
"tiddler-render-type": "text/html",
"tiddler-template": "$:/core/templates/server/static.tiddler.html",
"tiddler-render-template": "$:/core/templates/server/static.tiddler.html",
"system-tiddler-render-type": "text/plain",
"system-tiddler-template": "$:/core/templates/wikified-tiddler",
"system-tiddler-render-template": "$:/core/templates/wikified-tiddler",
"debug-level": "none"
};
+1 -1
View File
@@ -23,7 +23,7 @@ exports.startup = function() {
// Install the modal message mechanism
$tw.modal = new $tw.utils.Modal($tw.wiki);
$tw.rootWidget.addEventListener("tm-modal",function(event) {
$tw.modal.display(event.param,{variables: event.paramObject});
$tw.modal.display(event.param,{variables: event.paramObject, event: event});
});
// Install the notification mechanism
$tw.notifier = new $tw.utils.Notifier($tw.wiki);
+9 -1
View File
@@ -34,7 +34,7 @@ exports.startup = function() {
if($tw.browser) {
$tw.platform.isMac = /Mac/.test(navigator.platform);
$tw.platform.isWindows = /win/i.test(navigator.platform);
$tw.platform.isLinux = /Linux/i.test(navigator.appVersion);
$tw.platform.isLinux = /Linux/i.test(navigator.platform);
} else {
switch(require("os").platform()) {
case "darwin":
@@ -87,6 +87,14 @@ exports.startup = function() {
});
// Kick off the keyboard manager
$tw.keyboardManager = new $tw.KeyboardManager();
// Listen for shortcuts
if($tw.browser) {
$tw.utils.addEventListeners(document,[{
name: "keydown",
handlerObject: $tw.keyboardManager,
handlerMethod: "handleKeydownEvent"
}]);
}
// Create a root widget for attaching event handlers. By using it as the parentWidget for another widget tree, one can reuse the event handlers
$tw.rootWidget = new widget.widget({
type: "widget",
+12 -1
View File
@@ -31,6 +31,9 @@ var CONFIG_PERMALINKVIEW_COPY_TO_CLIPBOARD = "$:/config/Navigation/Permalinkview
var CONFIG_PERMALINKVIEW_UPDATE_ADDRESS_BAR = "$:/config/Navigation/Permalinkview/UpdateAddressBar"; // Can be "yes" (default) or "no"
// Links to help, if there is no param
var HELP_OPEN_EXTERNAL_WINDOW = "http://tiddlywiki.com/#WidgetMessage%3A%20tm-open-external-window";
exports.startup = function() {
// Open startup tiddlers
openStartupTiddlers();
@@ -56,6 +59,14 @@ exports.startup = function() {
$tw.rootWidget.addEventListener("tm-browser-refresh",function(event) {
window.location.reload(true);
});
// Listen for tm-open-external-window message
$tw.rootWidget.addEventListener("tm-open-external-window",function(event) {
var paramObject = event.paramObject || {},
strUrl = event.param || HELP_OPEN_EXTERNAL_WINDOW,
strWindowName = paramObject.windowName,
strWindowFeatures = paramObject.windowFeatures;
window.open(strUrl, strWindowName, strWindowFeatures);
});
// Listen for the tm-print message
$tw.rootWidget.addEventListener("tm-print",function(event) {
(event.event.view || window).print();
@@ -69,7 +80,7 @@ exports.startup = function() {
storyList = $tw.hooks.invokeHook("th-opening-default-tiddlers-list",storyList);
$tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: "", list: storyList},$tw.wiki.getModificationFields());
if(storyList[0]) {
$tw.wiki.addToHistory(storyList[0]);
$tw.wiki.addToHistory(storyList[0]);
}
});
// Listen for the tm-permalink message
+19 -1
View File
@@ -33,8 +33,16 @@ exports.startup = function() {
height = paramObject.height || "600",
variables = $tw.utils.extend({},paramObject,{currentTiddler: title});
// Open the window
var srcWindow = window.open("","external-" + title,"scrollbars,width=" + width + ",height=" + height),
var srcWindow,
srcDocument;
// In case that popup blockers deny opening a new window
try {
srcWindow = window.open("","external-" + title,"scrollbars,width=" + width + ",height=" + height),
srcDocument = srcWindow.document;
}
catch(e) {
return;
}
windows[title] = srcWindow;
// Check for reopening the same window
if(srcWindow.haveInitialisedWindow) {
@@ -70,6 +78,16 @@ exports.startup = function() {
widgetNode.refresh(changes);
};
$tw.wiki.addEventListener("change",refreshHandler);
// Listen for keyboard shortcuts
$tw.utils.addEventListeners(srcDocument,[{
name: "keydown",
handlerObject: $tw.keyboardManager,
handlerMethod: "handleKeydownEvent"
},{
name: "click",
handlerObject: $tw.popup,
handlerMethod: "handleEvent"
}]);
srcWindow.haveInitialisedWindow = true;
});
// Close open windows when unloading main window
+6 -5
View File
@@ -82,11 +82,12 @@ Returns:
y: vertical scroll position in pixels
}
*/
exports.getScrollPosition = function() {
if("scrollX" in window) {
return {x: window.scrollX, y: window.scrollY};
exports.getScrollPosition = function(srcWindow) {
var scrollWindow = srcWindow || window;
if("scrollX" in scrollWindow) {
return {x: scrollWindow.scrollX, y: scrollWindow.scrollY};
} else {
return {x: document.documentElement.scrollLeft, y: document.documentElement.scrollTop};
return {x: scrollWindow.document.documentElement.scrollLeft, y: scrollWindow.document.documentElement.scrollTop};
}
};
@@ -119,7 +120,7 @@ exports.resizeTextAreaToFit = function(domNode,minHeight) {
Gets the bounding rectangle of an element in absolute page coordinates
*/
exports.getBoundingPageRect = function(element) {
var scrollPos = $tw.utils.getScrollPosition(),
var scrollPos = $tw.utils.getScrollPosition(element.ownerDocument.defaultView),
clientRect = element.getBoundingClientRect();
return {
left: clientRect.left + scrollPos.x,
+28 -23
View File
@@ -28,6 +28,10 @@ Options include:
*/
Modal.prototype.display = function(title,options) {
options = options || {};
this.srcDocument = options.variables && (options.variables.rootwindow === "true" ||
options.variables.rootwindow === "yes") ? document :
(options.event.event ? options.event.event.target.ownerDocument : document);
this.srcWindow = this.srcDocument.defaultView;
var self = this,
refreshHandler,
duration = $tw.utils.getAnimationDuration(),
@@ -39,16 +43,16 @@ Modal.prototype.display = function(title,options) {
// Create the variables
var variables = $tw.utils.extend({currentTiddler: title},options.variables);
// Create the wrapper divs
var wrapper = document.createElement("div"),
modalBackdrop = document.createElement("div"),
modalWrapper = document.createElement("div"),
modalHeader = document.createElement("div"),
headerTitle = document.createElement("h3"),
modalBody = document.createElement("div"),
modalLink = document.createElement("a"),
modalFooter = document.createElement("div"),
modalFooterHelp = document.createElement("span"),
modalFooterButtons = document.createElement("span");
var wrapper = this.srcDocument.createElement("div"),
modalBackdrop = this.srcDocument.createElement("div"),
modalWrapper = this.srcDocument.createElement("div"),
modalHeader = this.srcDocument.createElement("div"),
headerTitle = this.srcDocument.createElement("h3"),
modalBody = this.srcDocument.createElement("div"),
modalLink = this.srcDocument.createElement("a"),
modalFooter = this.srcDocument.createElement("div"),
modalFooterHelp = this.srcDocument.createElement("span"),
modalFooterButtons = this.srcDocument.createElement("span");
// Up the modal count and adjust the body class
this.modalCount++;
this.adjustPageClass();
@@ -80,7 +84,7 @@ Modal.prototype.display = function(title,options) {
value: title
}}}],
parentWidget: $tw.rootWidget,
document: document,
document: this.srcDocument,
variables: variables,
importPageMacros: true
});
@@ -88,7 +92,7 @@ Modal.prototype.display = function(title,options) {
// Render the body of the message
var bodyWidgetNode = this.wiki.makeTranscludeWidget(title,{
parentWidget: $tw.rootWidget,
document: document,
document: this.srcDocument,
variables: variables,
importPageMacros: true
});
@@ -96,16 +100,16 @@ Modal.prototype.display = function(title,options) {
// Setup the link if present
if(options.downloadLink) {
modalLink.href = options.downloadLink;
modalLink.appendChild(document.createTextNode("Right-click to save changes"));
modalLink.appendChild(this.srcDocument.createTextNode("Right-click to save changes"));
modalBody.appendChild(modalLink);
}
// Render the footer of the message
if(tiddler && tiddler.fields && tiddler.fields.help) {
var link = document.createElement("a");
var link = this.srcDocument.createElement("a");
link.setAttribute("href",tiddler.fields.help);
link.setAttribute("target","_blank");
link.setAttribute("rel","noopener noreferrer");
link.appendChild(document.createTextNode("Help"));
link.appendChild(this.srcDocument.createTextNode("Help"));
modalFooterHelp.appendChild(link);
modalFooterHelp.style.float = "left";
}
@@ -129,7 +133,7 @@ Modal.prototype.display = function(title,options) {
}}}
]}],
parentWidget: $tw.rootWidget,
document: document,
document: this.srcDocument,
variables: variables,
importPageMacros: true
});
@@ -155,13 +159,13 @@ Modal.prototype.display = function(title,options) {
{opacity: "0"}
]);
$tw.utils.setStyle(modalWrapper,[
{transform: "translateY(" + window.innerHeight + "px)"}
{transform: "translateY(" + self.srcWindow.innerHeight + "px)"}
]);
// Set up an event for the transition end
window.setTimeout(function() {
self.srcWindow.setTimeout(function() {
if(wrapper.parentNode) {
// Remove the modal message from the DOM
document.body.removeChild(wrapper);
self.srcDocument.body.removeChild(wrapper);
}
},duration);
// Don't let anyone else handle the tm-close-tiddler message
@@ -176,10 +180,10 @@ Modal.prototype.display = function(title,options) {
]);
$tw.utils.setStyle(modalWrapper,[
{transformOrigin: "0% 0%"},
{transform: "translateY(" + (-window.innerHeight) + "px)"}
{transform: "translateY(" + (-this.srcWindow.innerHeight) + "px)"}
]);
// Put the message into the document
document.body.appendChild(wrapper);
this.srcDocument.body.appendChild(wrapper);
// Set up animation for the styles
$tw.utils.setStyle(modalBackdrop,[
{transition: "opacity " + duration + "ms ease-out"}
@@ -200,8 +204,9 @@ Modal.prototype.display = function(title,options) {
};
Modal.prototype.adjustPageClass = function() {
if($tw.pageContainer) {
$tw.utils.toggleClass($tw.pageContainer,"tc-modal-displayed",this.modalCount > 0);
var windowContainer = $tw.pageContainer ? ($tw.pageContainer === this.srcDocument.body.firstChild ? $tw.pageContainer : this.srcDocument.body.firstChild) : null;
if(windowContainer) {
$tw.utils.toggleClass(windowContainer,"tc-modal-displayed",this.modalCount > 0);
}
};
+8 -3
View File
@@ -114,6 +114,7 @@ Popup.prototype.show = function(options) {
var info = this.popupInfo(options.domNode);
// Cancel any higher level popups
this.cancel(info.popupLevel);
// Store the popup details if not already there
if(!options.floating && this.findPopup(options.title) === -1) {
this.popups.push({
@@ -134,9 +135,13 @@ Popup.prototype.show = function(options) {
height: options.domNode.offsetHeight
};
}
options.wiki.setTextReference(options.title,
"(" + rect.left + "," + rect.top + "," +
rect.width + "," + rect.height + ")");
var popupRect = "(" + rect.left + "," + rect.top + "," +
rect.width + "," + rect.height + ")";
if(options.noStateReference) {
options.wiki.setText(options.title,"text",undefined,popupRect);
} else {
options.wiki.setTextReference(options.title,popupRect);
}
// Add the click handler if we have any popups
if(this.popups.length > 0) {
this.rootElement.addEventListener("click",this,true);
+16 -15
View File
@@ -33,9 +33,9 @@ var PageScroller = function() {
};
};
PageScroller.prototype.cancelScroll = function() {
PageScroller.prototype.cancelScroll = function(srcWindow) {
if(this.idRequestFrame) {
this.cancelAnimationFrame.call(window,this.idRequestFrame);
this.cancelAnimationFrame.call(srcWindow,this.idRequestFrame);
this.idRequestFrame = null;
}
};
@@ -53,25 +53,26 @@ PageScroller.prototype.handleEvent = function(event) {
/*
Handle a scroll event hitting the page document
*/
PageScroller.prototype.scrollIntoView = function(element) {
PageScroller.prototype.scrollIntoView = function(element,callback) {
var self = this,
duration = $tw.utils.getAnimationDuration();
duration = $tw.utils.getAnimationDuration(),
srcWindow = element ? element.ownerDocument.defaultView : window;
// Now get ready to scroll the body
this.cancelScroll();
this.cancelScroll(srcWindow);
this.startTime = Date.now();
// Get the height of any position:fixed toolbars
var toolbar = document.querySelector(".tc-adjust-top-of-scroll"),
var toolbar = srcWindow.document.querySelector(".tc-adjust-top-of-scroll"),
offset = 0;
if(toolbar) {
offset = toolbar.offsetHeight;
}
// Get the client bounds of the element and adjust by the scroll position
var getBounds = function() {
var clientBounds = element.getBoundingClientRect(),
scrollPosition = $tw.utils.getScrollPosition();
var clientBounds = typeof callback === 'function' ? callback() : element.getBoundingClientRect(),
scrollPosition = $tw.utils.getScrollPosition(srcWindow);
return {
left: clientBounds.left + scrollPosition.x,
top: clientBounds.top + scrollPosition.y,
top: clientBounds.top + scrollPosition.y - offset,
width: clientBounds.width,
height: clientBounds.height
};
@@ -96,17 +97,17 @@ PageScroller.prototype.scrollIntoView = function(element) {
t = ((Date.now()) - self.startTime) / duration;
}
if(t >= 1) {
self.cancelScroll();
self.cancelScroll(srcWindow);
t = 1;
}
t = $tw.utils.slowInSlowOut(t);
var scrollPosition = $tw.utils.getScrollPosition(),
var scrollPosition = $tw.utils.getScrollPosition(srcWindow),
bounds = getBounds(),
endX = getEndPos(bounds.left,bounds.width,scrollPosition.x,window.innerWidth),
endY = getEndPos(bounds.top,bounds.height,scrollPosition.y,window.innerHeight);
window.scrollTo(scrollPosition.x + (endX - scrollPosition.x) * t,scrollPosition.y + (endY - scrollPosition.y - offset) * t);
endX = getEndPos(bounds.left,bounds.width,scrollPosition.x,srcWindow.innerWidth),
endY = getEndPos(bounds.top,bounds.height,scrollPosition.y,srcWindow.innerHeight);
srcWindow.scrollTo(scrollPosition.x + (endX - scrollPosition.x) * t,scrollPosition.y + (endY - scrollPosition.y) * t);
if(t < 1) {
self.idRequestFrame = self.requestAnimationFrame.call(window,drawFrame);
self.idRequestFrame = self.requestAnimationFrame.call(srcWindow,drawFrame);
}
};
drawFrame();
+12
View File
@@ -149,6 +149,18 @@ exports.isArrayEqual = function(array1,array2) {
});
};
/*
Determine whether an array-item is an object-property
*/
exports.hopArray = function(object,array) {
for(var i=0; i<array.length; i++) {
if($tw.utils.hop(object,array[i])) {
return true;
}
}
return false;
};
/*
Push entries onto an array, removing them first if they already exist in the array
array: array to modify (assumed to be free of duplicates)
+1
View File
@@ -55,6 +55,7 @@ NavigateWidget.prototype.refresh = function(changedTiddlers) {
Invoke the action associated with this widget
*/
NavigateWidget.prototype.invokeAction = function(triggeringWidget,event) {
event = event || {};
var bounds = triggeringWidget && triggeringWidget.getBoundingClientRect && triggeringWidget.getBoundingClientRect(),
suppressNavigation = event.metaKey || event.ctrlKey || (event.button === 1);
if(this.actionScroll === "yes") {
+35 -13
View File
@@ -41,9 +41,9 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
var domNode = this.document.createElement(tag);
// Assign classes
var classes = this["class"].split(" ") || [],
isPoppedUp = this.popup && this.isPoppedUp();
isPoppedUp = (this.popup || this.popupTitle) && this.isPoppedUp();
if(this.selectedClass) {
if(this.set && this.setTo && this.isSelected()) {
if((this.set || this.setTitle) && this.setTo && this.isSelected()) {
$tw.utils.pushTop(classes,this.selectedClass.split(" "));
}
if(isPoppedUp) {
@@ -78,11 +78,11 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
self.dispatchMessage(event);
handled = true;
}
if(self.popup) {
if(self.popup || self.popupTitle) {
self.triggerPopup(event);
handled = true;
}
if(self.set) {
if(self.set || self.setTitle) {
self.setTiddler();
handled = true;
}
@@ -122,11 +122,14 @@ ButtonWidget.prototype.getBoundingClientRect = function() {
};
ButtonWidget.prototype.isSelected = function() {
return this.wiki.getTextReference(this.set,this.defaultSetValue,this.getVariable("currentTiddler")) === this.setTo;
return this.setTitle ? (this.setField ? this.wiki.getTiddler(this.setTitle).getFieldString(this.setField) === this.setTo :
(this.setIndex ? this.wiki.extractTiddlerDataItem(this.setTitle,this.setIndex) === this.setTo :
this.wiki.getTiddlerText(this.setTitle))) || this.defaultSetValue || this.getVariable("currentTiddler") :
this.wiki.getTextReference(this.set,this.defaultSetValue,this.getVariable("currentTiddler")) === this.setTo;
};
ButtonWidget.prototype.isPoppedUp = function() {
var tiddler = this.wiki.getTiddler(this.popup);
var tiddler = this.popupTitle ? this.wiki.getTiddler(this.popupTitle) : this.wiki.getTiddler(this.popup);
var result = tiddler && tiddler.fields.text ? $tw.popup.readPopupState(tiddler.fields.text) : false;
return result;
};
@@ -150,15 +153,30 @@ ButtonWidget.prototype.dispatchMessage = function(event) {
};
ButtonWidget.prototype.triggerPopup = function(event) {
$tw.popup.triggerPopup({
domNode: this.domNodes[0],
title: this.popup,
wiki: this.wiki
});
if(this.popupTitle) {
$tw.popup.triggerPopup({
domNode: this.domNodes[0],
title: this.popupTitle,
wiki: this.wiki,
noStateReference: true
});
} else {
$tw.popup.triggerPopup({
domNode: this.domNodes[0],
title: this.popup,
wiki: this.wiki
});
}
};
ButtonWidget.prototype.setTiddler = function() {
this.wiki.setTextReference(this.set,this.setTo,this.getVariable("currentTiddler"));
if(this.setTitle) {
this.setField ? this.wiki.setText(this.setTitle,this.setField,undefined,this.setTo) :
(this.setIndex ? this.wiki.setText(this.setTitle,undefined,this.setIndex,this.setTo) :
this.wiki.setText(this.setTitle,"text",undefined,this.setTo));
} else {
this.wiki.setTextReference(this.set,this.setTo,this.getVariable("currentTiddler"));
}
};
/*
@@ -183,6 +201,10 @@ ButtonWidget.prototype.execute = function() {
this.buttonTag = this.getAttribute("tag");
this.dragTiddler = this.getAttribute("dragTiddler");
this.dragFilter = this.getAttribute("dragFilter");
this.setTitle = this.getAttribute("setTitle");
this.setField = this.getAttribute("setField");
this.setIndex = this.getAttribute("setIndex");
this.popupTitle = this.getAttribute("popupTitle");
// Make child widgets
this.makeChildWidgets();
};
@@ -192,7 +214,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.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes["class"] || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup])) {
if(changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes["class"] || 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) {
this.refreshSelf();
return true;
}
+12
View File
@@ -71,6 +71,7 @@ KeyboardWidget.prototype.dispatchMessage = function(event) {
Compute the internal state of the widget
*/
KeyboardWidget.prototype.execute = function() {
var self = this;
// Get attributes
this.actions = this.getAttribute("actions");
this.message = this.getAttribute("message");
@@ -79,6 +80,13 @@ KeyboardWidget.prototype.execute = function() {
this.tag = this.getAttribute("tag");
this.keyInfoArray = $tw.keyboardManager.parseKeyDescriptors(this.key);
this["class"] = this.getAttribute("class");
if(this.key.substr(0,2) === "((" && this.key.substr(-2,2) === "))") {
this.shortcutTiddlers = [];
var name = this.key.substring(2,this.key.length -2);
$tw.utils.each($tw.keyboardManager.lookupNames,function(platformDescriptor) {
self.shortcutTiddlers.push("$:/config/" + platformDescriptor + "/" + name);
});
}
// Make child widgets
this.makeChildWidgets();
};
@@ -92,6 +100,10 @@ KeyboardWidget.prototype.refresh = function(changedTiddlers) {
this.refreshSelf();
return true;
}
// Update the keyInfoArray if one of its shortcut-config-tiddlers has changed
if(this.shortcutTiddlers && $tw.utils.hopArray(changedTiddlers,this.shortcutTiddlers)) {
this.keyInfoArray = $tw.keyboardManager.parseKeyDescriptors(this.key);
}
return this.refreshChildren(changedTiddlers);
};
+2 -3
View File
@@ -13,7 +13,6 @@ Link widget
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var MISSING_LINK_CONFIG_TITLE = "$:/config/MissingLinks";
var LinkWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
@@ -182,7 +181,7 @@ LinkWidget.prototype.execute = function() {
// Determine the link characteristics
this.isMissing = !this.wiki.tiddlerExists(this.to);
this.isShadow = this.wiki.isShadowTiddler(this.to);
this.hideMissingLinks = ($tw.wiki.getTiddlerText(MISSING_LINK_CONFIG_TITLE,"yes") === "no");
this.hideMissingLinks = (this.getVariable("tv-show-missing-links") || "yes") === "no";
// Make the child widgets
this.makeChildWidgets();
};
@@ -192,7 +191,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
LinkWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.to || changedTiddlers[this.to] || changedAttributes["aria-label"] || changedAttributes.tooltip || changedTiddlers[MISSING_LINK_CONFIG_TITLE]) {
if(changedAttributes.to || changedTiddlers[this.to] || changedAttributes["aria-label"] || changedAttributes.tooltip) {
this.refreshSelf();
return true;
}
+3
View File
@@ -468,6 +468,9 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
// Update the story to insert the new draft at the top and remove any existing tiddler
if(storyList.indexOf(draftTitle) === -1) {
var slot = storyList.indexOf(event.navigateFromTitle);
if(slot === -1) {
slot = this.getAttribute("openLinkFromOutsideRiver","top") === "bottom" ? storyList.length - 1 : slot;
}
storyList.splice(slot + 1,0,draftTitle);
}
if(storyList.indexOf(title) !== -1) {
+66
View File
@@ -0,0 +1,66 @@
/*\
title: $:/core/modules/widgets/qualify.js
type: application/javascript
module-type: widget
Qualify text to a variable
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var QualifyWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
QualifyWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
QualifyWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
this.renderChildren(parent,nextSibling);
};
/*
Compute the internal state of the widget
*/
QualifyWidget.prototype.execute = function() {
// Get our parameters
this.qualifyName = this.getAttribute("name");
this.qualifyTitle = this.getAttribute("title");
// Set context variable
if(this.qualifyName) {
this.setVariable(this.qualifyName,this.qualifyTitle + "-" + this.getStateQualifier());
}
// Construct the child widgets
this.makeChildWidgets();
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
QualifyWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.name || changedAttributes.title) {
this.refreshSelf();
return true;
} else {
return this.refreshChildren(changedTiddlers);
}
};
exports.qualify = QualifyWidget;
})();
+14 -5
View File
@@ -102,7 +102,10 @@ RevealWidget.prototype.execute = function() {
this.openAnimation = this.animate === "no" ? undefined : "open";
this.closeAnimation = this.animate === "no" ? undefined : "close";
// Compute the title of the state tiddler and read it
this.stateTitle = this.state;
this.stateTiddlerTitle = this.state;
this.stateTitle = this.getAttribute("stateTitle");
this.stateField = this.getAttribute("stateField");
this.stateIndex = this.getAttribute("stateIndex");
this.readState();
// Construct the child widgets
var childNodes = this.isOpen ? this.parseTreeNode.children : [];
@@ -115,7 +118,13 @@ Read the state tiddler
*/
RevealWidget.prototype.readState = function() {
// Read the information from the state tiddler
var state = this.stateTitle ? this.wiki.getTextReference(this.stateTitle,this["default"],this.getVariable("currentTiddler")) : this["default"];
var state = this.stateTitle ? (this.stateField ? this.wiki.getTiddler(this.stateTitle).getFieldString(this.stateField) :
(this.stateIndex ? this.wiki.extractTiddlerDataItem(this.stateTitle,this.stateIndex) :
this.wiki.getTiddlerText(this.stateTitle))) || this["default"] || this.getVariable("currentTiddler") :
(this.stateTiddlerTitle ? this.wiki.getTextReference(this.state,this["default"],this.getVariable("currentTiddler")) : this["default"]);
if(state === null) {
state = this["default"];
}
switch(this.type) {
case "popup":
this.readPopupState(state);
@@ -170,13 +179,13 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
RevealWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.state || changedAttributes.type || changedAttributes.text || changedAttributes.position || changedAttributes["default"] || changedAttributes.animate) {
if(changedAttributes.state || changedAttributes.type || changedAttributes.text || changedAttributes.position || changedAttributes["default"] || changedAttributes.animate || changedAttributes.stateTitle || changedAttributes.stateField || changedAttributes.stateIndex) {
this.refreshSelf();
return true;
} else {
var currentlyOpen = this.isOpen;
this.readState();
if(this.isOpen !== currentlyOpen || (this.stateTitle && changedTiddlers[this.stateTitle])) {
if(this.isOpen !== currentlyOpen || (this.stateTiddlerTitle && changedTiddlers[this.stateTiddlerTitle])) {
if(this.retain === "yes") {
this.updateState();
} else {
@@ -218,7 +227,7 @@ RevealWidget.prototype.updateState = function() {
if(!self.isOpen) {
domNode.setAttribute("hidden","true");
}
}});
}});
}
};
+128 -58
View File
@@ -538,6 +538,45 @@ exports.findListingsOfTiddler = function(targetTitle,fieldName) {
Sorts an array of tiddler titles according to an ordered list
*/
exports.sortByList = function(array,listTitle) {
var self = this,
replacedTitles = Object.create(null);
function replaceItem(title) {
if(!$tw.utils.hop(replacedTitles, title)) {
replacedTitles[title] = true;
var newPos = -1,
tiddler = self.getTiddler(title);
if(tiddler) {
var beforeTitle = tiddler.fields["list-before"],
afterTitle = tiddler.fields["list-after"];
if(beforeTitle === "") {
newPos = 0;
} else if(afterTitle === "") {
newPos = titles.length;
} else if(beforeTitle) {
replaceItem(beforeTitle);
newPos = titles.indexOf(beforeTitle);
} else if(afterTitle) {
replaceItem(afterTitle);
newPos = titles.indexOf(afterTitle);
if(newPos >= 0) {
++newPos;
}
}
// We get the currPos //after// figuring out the newPos, because recursive replaceItem calls might alter title's currPos
var currPos = titles.indexOf(title);
if(newPos === -1) {
newPos = currPos;
}
if(currPos >= 0 && newPos !== currPos) {
titles.splice(currPos,1);
if(newPos >= currPos) {
newPos--;
}
titles.splice(newPos,0,title);
}
}
}
}
var list = this.getTiddlerList(listTitle);
if(!array || array.length === 0) {
return [];
@@ -558,46 +597,7 @@ exports.sortByList = function(array,listTitle) {
}
}
// Finally obey the list-before and list-after fields of each tiddler in turn
var sortedTitles = titles.slice(0),
replacedTitles = Object.create(null),
self = this;
function replaceItem(title) {
if(!$tw.utils.hop(replacedTitles, title)) {
replacedTitles[title] = true;
var newPos = -1,
tiddler = self.getTiddler(title);
if(tiddler) {
var beforeTitle = tiddler.fields["list-before"],
afterTitle = tiddler.fields["list-after"];
if(beforeTitle === "") {
newPos = 0;
} else if(afterTitle === "") {
newPos = titles.length;
} else if(beforeTitle) {
replaceItem(beforeTitle);
newPos = titles.indexOf(beforeTitle);
} else if(afterTitle) {
replaceItem(afterTitle);
newPos = titles.indexOf(afterTitle);
if(newPos >= 0) {
++newPos;
}
}
// We get the currPos //after// figuring out the newPos, because recursive replaceItem calls might alter title's currPos
var currPos = titles.indexOf(title);
if(newPos === -1) {
newPos = currPos;
}
if(currPos >= 0 && newPos !== currPos) {
titles.splice(currPos,1);
if(newPos >= currPos) {
newPos--;
}
titles.splice(newPos,0,title);
}
}
}
};
var sortedTitles = titles.slice(0);
for(t=0; t<sortedTitles.length; t++) {
title = sortedTitles[t];
replaceItem(title);
@@ -1047,8 +1047,13 @@ Options available:
exclude: An array of tiddler titles to exclude from the search
invert: If true returns tiddlers that do not contain the specified string
caseSensitive: If true forces a case sensitive search
literal: If true, searches for literal string, rather than separate search terms
field: If specified, restricts the search to the specified field
field: If specified, restricts the search to the specified field, or an array of field names
excludeField: If true, the field options are inverted to specify the fields that are not to be searched
The search mode is determined by the first of these boolean flags to be true
literal: searches for literal string
whitespace: same as literal except runs of whitespace are treated as a single space
regexp: treats the search term as a regular expression
words: (default) treats search string as a list of tokens, and matches if all tokens are found, regardless of adjacency or ordering
*/
exports.search = function(text,options) {
options = options || {};
@@ -1064,6 +1069,21 @@ exports.search = function(text,options) {
} else {
searchTermsRegExps = [new RegExp("(" + $tw.utils.escapeRegExp(text) + ")",flags)];
}
} else if(options.whitespace) {
terms = [];
$tw.utils.each(text.split(/\s+/g),function(term) {
if(term) {
terms.push($tw.utils.escapeRegExp(term));
}
});
searchTermsRegExps = [new RegExp("(" + terms.join("\\s+") + ")",flags)];
} else if(options.regexp) {
try {
searchTermsRegExps = [new RegExp("(" + text + ")",flags)];
} catch(e) {
searchTermsRegExps = null;
console.log("Regexp error parsing /(" + text + ")/" + flags + ": ",e);
}
} else {
terms = text.split(/ +/);
if(terms.length === 1 && terms[0] === "") {
@@ -1075,34 +1095,84 @@ exports.search = function(text,options) {
}
}
}
// Accumulate the array of fields to be searched or excluded from the search
var fields = [];
if(options.field) {
if($tw.utils.isArray(options.field)) {
$tw.utils.each(options.field,function(fieldName) {
if(fieldName) {
fields.push(fieldName);
}
});
} else {
fields.push(options.field);
}
}
// Use default fields if none specified and we're not excluding fields (excluding fields with an empty field array is the same as searching all fields)
if(fields.length === 0 && !options.excludeField) {
fields.push("title");
fields.push("tags");
fields.push("text");
}
// Function to check a given tiddler for the search term
var searchTiddler = function(title) {
if(!searchTermsRegExps) {
return true;
}
var notYetFound = searchTermsRegExps.slice();
var tiddler = self.getTiddler(title);
if(!tiddler) {
tiddler = new $tw.Tiddler({title: title, text: "", type: "text/vnd.tiddlywiki"});
}
var contentTypeInfo = $tw.config.contentTypeInfo[tiddler.fields.type] || $tw.config.contentTypeInfo["text/vnd.tiddlywiki"],
match;
for(var t=0; t<searchTermsRegExps.length; t++) {
match = false;
if(options.field) {
match = searchTermsRegExps[t].test(tiddler.getFieldString(options.field));
} else {
// Search title, tags and body
if(contentTypeInfo.encoding === "utf8") {
match = match || searchTermsRegExps[t].test(tiddler.fields.text);
searchFields;
// Get the list of fields we're searching
if(options.excludeField) {
searchFields = Object.keys(tiddler.fields);
$tw.utils.each(fields,function(fieldName) {
var p = searchFields.indexOf(fieldName);
if(p !== -1) {
searchFields.splice(p,1);
}
var tags = tiddler.fields.tags ? tiddler.fields.tags.join("\0") : "";
match = match || searchTermsRegExps[t].test(tags) || searchTermsRegExps[t].test(tiddler.fields.title);
}
if(!match) {
return false;
}
});
} else {
searchFields = fields;
}
return true;
for(var fieldIndex=0; notYetFound.length>0 && fieldIndex<searchFields.length; fieldIndex++) {
// Don't search the text field if the content type is binary
var fieldName = searchFields[fieldIndex];
if(fieldName === "text" && contentTypeInfo.encoding !== "utf8") {
break;
}
var str = tiddler.fields[fieldName],
t;
if(str) {
if($tw.utils.isArray(str)) {
// If the field value is an array, test each regexp against each field array entry and fail if each regexp doesn't match at least one field array entry
for(var s=0; s<str.length; s++) {
for(t=0; t<notYetFound.length;) {
if(notYetFound[t].test(str[s])) {
notYetFound.splice(t, 1);
} else {
t++;
}
}
}
} else {
// If the field isn't an array, force it to a string and test each regexp against it and fail if any do not match
str = tiddler.getFieldString(fieldName);
for(t=0; t<notYetFound.length;) {
if(notYetFound[t].test(str)) {
notYetFound.splice(t, 1);
} else {
t++;
}
}
}
}
};
return notYetFound.length == 0;
};
// Loop through all the tiddlers doing the search
var results = [],
+10
View File
@@ -0,0 +1,10 @@
title: $:/core/ui/Actions/new-image
tags: $:/tags/Actions
description: create a new image tiddler
\define get-type()
image/$(imageType)$
\end
<$vars imageType={{$:/config/NewImageType}}>
<$action-sendmessage $message="tm-new-tiddler" type=<<get-type>>/>
</$vars>
+14
View File
@@ -0,0 +1,14 @@
title: $:/core/ui/Actions/new-journal
tags: $:/tags/Actions
description: create a new journal tiddler
<$vars journalTitleTemplate={{$:/config/NewJournal/Title}} journalTags={{$:/config/NewJournal/Tags}} journalText={{$:/config/NewJournal/Text}}>
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text={{{ [<journalTitle>get[]] }}}/>
</$reveal>
<$reveal type="match" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text=<<journalText>>/>
</$reveal>
</$wikify>
</$vars>
+5
View File
@@ -0,0 +1,5 @@
title: $:/core/ui/Actions/new-tiddler
tags: $:/tags/Actions
description: create a new empty tiddler
<$action-sendmessage $message="tm-new-tiddler"/>
@@ -8,6 +8,7 @@ tags: $:/tags/AdvancedSearch/FilterButton
</span>
<$reveal state=<<qualify "$:/state/filterDropdown">> type="popup" position="belowleft" animate="yes">
<$set name="tv-show-missing-links" value="yes">
<$linkcatcher to="$:/temp/advancedsearch">
<div class="tc-block-dropdown-wrapper">
<div class="tc-block-dropdown tc-edit-type-dropdown">
@@ -16,4 +17,5 @@ tags: $:/tags/AdvancedSearch/FilterButton
</div>
</div>
</$linkcatcher>
</$set>
</$reveal>
+2
View File
@@ -65,6 +65,7 @@ $value={{$:/temp/newfieldvalue}}/>
<$button popup=<<qualify "$:/state/popup/field-dropdown">> class="tc-btn-invisible tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Field/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Field/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button>
<$reveal state=<<qualify "$:/state/popup/field-dropdown">> type="nomatch" text="" default="">
<div class="tc-block-dropdown tc-edit-type-dropdown">
<$set name="tv-show-missing-links" value="yes">
<$linkcatcher to="$:/temp/newfieldname">
<div class="tc-dropdown-item">
<<lingo Fields/Add/Dropdown/User>>
@@ -83,6 +84,7 @@ $value={{$:/temp/newfieldvalue}}/>
</$link>
</$list>
</$linkcatcher>
</$set>
</div>
</$reveal>
<span class="tc-edit-field-add-value">
+9 -6
View File
@@ -1,6 +1,8 @@
title: $:/core/ui/EditTemplate/tags
tags: $:/tags/EditTemplate
\whitespace trim
\define lingo-base() $:/language/EditTemplate/
\define tag-styles()
@@ -9,17 +11,18 @@ fill:$(foregroundColor)$;
color:$(foregroundColor)$;
\end
\define tag-body-inner(colour,fallbackTarget,colourA,colourB)
\define tag-body-inner(colour,fallbackTarget,colourA,colourB,icon)
\whitespace trim
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<span style=<<tag-styles>> class="tc-tag-label">
<$view field="title" format="text" />
<span style=<<tag-styles>> class="tc-tag-label tc-tag-list-item">
<$transclude tiddler="""$icon$"""/>&nbsp;<$view field="title" format="text" />
<$button message="tm-remove-tag" param={{!!title}} class="tc-btn-invisible tc-remove-tag-button">&times;</$button>
</span>
</$vars>
\end
\define tag-body(colour,palette)
<$macrocall $name="tag-body-inner" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}}/>
\define tag-body(colour,palette,icon)
<$macrocall $name="tag-body-inner" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} icon="""$icon$"""/>
\end
\define tag-picker-actions()
@@ -33,7 +36,7 @@ color:$(foregroundColor)$;
<div class="tc-edit-tags">
<$fieldmangler>
<$list filter="[all[current]tags[]sort[title]]" storyview="pop">
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}}/>
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}} icon={{!!icon}}/>
</$list>
</$fieldmangler>
<$macrocall $name="tag-picker" actions=<<tag-picker-actions>>/>
+19 -2
View File
@@ -35,10 +35,27 @@ tags: $:/tags/EditTemplate
<$checkbox tiddler="$:/config/RelinkOnRename" field="text" checked="yes" unchecked="no" default="no"> {{$:/language/EditTemplate/Title/Relink/Prompt}}</$checkbox>
<$vars stateTiddler=<<qualify "$:/state/edit/references">> >
<$reveal type="nomatch" state=<<stateTiddler>> text="show">
<$button set=<<stateTiddler>> setTo="show" class="tc-btn-invisible">{{$:/core/images/right-arrow}}
<<lingo EditTemplate/Title/References/Prompt>></$button>
</$reveal>
<$reveal type="match" state=<<stateTiddler>> text="show">
<$button set=<<stateTiddler>> setTo="hide" class="tc-btn-invisible">{{$:/core/images/down-arrow}}
<<lingo EditTemplate/Title/References/Prompt>></$button>
</$reveal>
<$reveal type="match" state=<<stateTiddler>> text="show">
<$tiddler tiddler=<<fromTitle>> >
<$transclude tiddler="$:/core/ui/TiddlerInfo/References"/>
</$tiddler>
</$reveal>
</$vars>
</$vars>
</$list>
</$reveal>
+3 -1
View File
@@ -7,6 +7,7 @@ tags: $:/tags/EditTemplate
</$fieldmangler></div>
<div class="tc-block-dropdown-wrapper">
<$set name="tv-show-missing-links" value="yes">
<$reveal state=<<qualify "$:/state/popup/type-dropdown">> type="nomatch" text="" default="">
<div class="tc-block-dropdown tc-edit-type-dropdown">
<$linkcatcher to="!!type">
@@ -20,4 +21,5 @@ tags: $:/tags/EditTemplate
</$linkcatcher>
</div>
</$reveal>
</div>
</$set>
</div>
+5 -5
View File
@@ -41,13 +41,13 @@ $(currentTiddler)$!!popup-$(payloadTiddler)$
<$checkbox field=<<selectionField>> checked="checked" unchecked="unchecked" default="checked"/>
</td>
<td>
<$reveal type="nomatch" state=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="yes">
<$reveal type="nomatch" stateTitle=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" setTitle=<<previewPopupState>> setTo="yes">
{{$:/core/images/right-arrow}}&nbsp;<$text text=<<payloadTiddler>>/>
</$button>
</$reveal>
<$reveal type="match" state=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="no">
<$reveal type="match" stateTitle=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" setTitle=<<previewPopupState>> setTo="no">
{{$:/core/images/down-arrow}}&nbsp;<$text text=<<payloadTiddler>>/>
</$button>
</$reveal>
@@ -58,7 +58,7 @@ $(currentTiddler)$!!popup-$(payloadTiddler)$
</tr>
<tr>
<td colspan="3">
<$reveal type="match" text="yes" state=<<previewPopupState>> tag="div">
<$reveal type="match" text="yes" stateTitle=<<previewPopupState>> tag="div">
<$list filter="[{$:/state/importpreviewtype}has[text]]" variable="listItem" emptyMessage={{$:/core/ui/ImportPreviews/Text}}>
<$transclude tiddler={{$:/state/importpreviewtype}}/>
</$list>
+7
View File
@@ -0,0 +1,7 @@
title: $:/core/ui/KeyboardShortcuts/new-image
tags: $:/tags/KeyboardShortcut
key: ((new-image))
<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
{{$:/core/ui/Actions/new-image}}
</$navigator>
@@ -0,0 +1,7 @@
title: $:/core/ui/KeyboardShortcuts/new-journal
tags: $:/tags/KeyboardShortcut
key: ((new-journal))
<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
{{$:/core/ui/Actions/new-journal}}
</$navigator>
@@ -0,0 +1,7 @@
title: $:/core/ui/KeyboardShortcuts/new-tiddler
tags: $:/tags/KeyboardShortcut
key: ((new-tiddler))
<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>
{{$:/core/ui/Actions/new-tiddler}}
</$navigator>
+1 -2
View File
@@ -3,8 +3,7 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/new-image-button}} {{$:/language/Buttons/NewImage/Caption}}
description: {{$:/language/Buttons/NewImage/Hint}}
<$button tooltip={{$:/language/Buttons/NewImage/Hint}} aria-label={{$:/language/Buttons/NewImage/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-new-tiddler" type="image/jpeg"/>
<$button tooltip={{$:/language/Buttons/NewImage/Hint}} aria-label={{$:/language/Buttons/NewImage/Caption}} class=<<tv-config-toolbar-class>> actions={{$:/core/ui/Actions/new-image}}>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-image-button}}
</$list>
+1 -16
View File
@@ -3,19 +3,8 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournal/Caption}}
description: {{$:/language/Buttons/NewJournal/Hint}}
\define journalActions()
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text={{{ [<journalTitle>get[]] }}}/>
</$reveal>
<$reveal type="match" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text=<<journalText>>/>
</$reveal>
</$wikify>
\end
\define journalButton()
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>> actions=<<journalActions>>>
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>> actions={{$:/core/ui/Actions/new-journal}}>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-journal-button}}
</$list>
@@ -24,8 +13,4 @@ description: {{$:/language/Buttons/NewJournal/Hint}}
</$list>
</$button>
\end
<$set name="journalTitleTemplate" value={{$:/config/NewJournal/Title}}>
<$set name="journalTags" value={{$:/config/NewJournal/Tags}}>
<$set name="journalText" value={{$:/config/NewJournal/Text}}>
<<journalButton>>
</$set></$set></$set>
+2 -2
View File
@@ -3,11 +3,11 @@ tags: $:/tags/PageControls
caption: {{$:/core/images/new-button}} {{$:/language/Buttons/NewTiddler/Caption}}
description: {{$:/language/Buttons/NewTiddler/Hint}}
<$button message="tm-new-tiddler" tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>>>
<$button actions={{$:/core/ui/Actions/new-tiddler}} tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTiddler/Caption}}/></span>
</$list>
</$button>
</$button>
+1 -1
View File
@@ -4,7 +4,7 @@ caption: {{$:/core/images/save-button}} {{$:/language/Buttons/SaveWiki/Caption}}
description: {{$:/language/Buttons/SaveWiki/Hint}}
<$button tooltip={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class=<<tv-config-toolbar-class>>>
<$wikify name="site-title" text="{{$:/SiteTitle}}.html">
<$wikify name="site-title" text={{$:/config/SaveWikiButton/Filename}}>
<$action-sendmessage $message="tm-save-wiki" $param={{$:/config/SaveWikiButton/Template}} filename=<<site-title>>/>
</$wikify>
<span class="tc-dirty-indicator">
+4
View File
@@ -11,6 +11,8 @@ tc-page-container tc-page-view-$(storyviewTitle)$ tc-language-$(languageTitle)$
<$set name="tv-config-toolbar-class" value={{$:/config/Toolbar/ButtonClass}}>
<$set name="tv-show-missing-links" value={{$:/config/MissingLinks}}>
<$set name="storyviewTitle" value={{$:/view}}>
<$set name="currentTiddler" value={{$:/language}}>
@@ -50,3 +52,5 @@ tc-page-container tc-page-view-$(storyviewTitle)$ tc-language-$(languageTitle)$
</$set>
</$set>
</$set>
+1
View File
@@ -2,6 +2,7 @@ title: $:/core/ui/SideBar/Open
tags: $:/tags/SideBar
caption: {{$:/language/SideBar/Open/Caption}}
\whitespace trim
\define lingo-base() $:/language/CloseAll/
\define drop-actions()
+11 -14
View File
@@ -13,10 +13,10 @@ caption: {{$:/language/TagManager/Caption}}
\end
\define iconEditor(title)
<div class="tc-drop-down-wrapper">
<$button popup=<<qualify "$:/state/popup/icon/$title$">> class="tc-btn-invisible tc-btn-dropdown">{{$:/core/images/down-arrow}}</$button>
<$reveal state=<<qualify "$:/state/popup/icon/$title$">> type="popup" position="belowleft" text="" default="">
<$button popupTitle={{{ [[$:/state/popup/icon/]addsuffix<__title__>] }}} class="tc-btn-invisible tc-btn-dropdown">{{$:/core/images/down-arrow}}</$button>
<$reveal stateTitle={{{ [[$:/state/popup/icon/]addsuffix<__title__>] }}} type="popup" position="belowleft" text="" default="">
<div class="tc-drop-down">
<$linkcatcher to="$title$!!icon">
<$linkcatcher actions="""<$action-setfield $tiddler=<<__title__>> icon=<<navigateTo>>/>""">
<<iconEditorTab type:"!">>
<hr/>
<<iconEditorTab type:"">>
@@ -25,17 +25,14 @@ caption: {{$:/language/TagManager/Caption}}
</$reveal>
</div>
\end
\define qualifyTitle(title)
$title$$(currentTiddler)$
\end
\define toggleButton(state)
<$reveal state="$state$" type="match" text="closed" default="closed">
<$button set="$state$" setTo="open" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
<$reveal stateTitle=<<__state__>> type="match" text="closed" default="closed">
<$button setTitle=<<__state__>> setTo="open" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
{{$:/core/images/info-button}}
</$button>
</$reveal>
<$reveal state="$state$" type="match" text="open" default="closed">
<$button set="$state$" setTo="closed" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
<$reveal stateTitle=<<__state__>> type="match" text="open" default="closed">
<$button setTitle=<<__state__>> setTo="closed" class="tc-btn-invisible tc-btn-dropdown" selectedClass="tc-selected">
{{$:/core/images/info-button}}
</$button>
</$reveal>
@@ -52,19 +49,19 @@ $title$$(currentTiddler)$
<$list filter="[tags[]!is[system]sort[title]]">
<tr>
<td><$edit-text field="color" tag="input" type="color"/></td>
<td><$macrocall $name="tag" tag=<<currentTiddler>>/></td>
<td>{{||$:/core/ui/TagTemplate}}</td>
<td><$count filter="[all[current]tagging[]]"/></td>
<td>
<$macrocall $name="iconEditor" title={{!!title}}/>
</td>
<td>
<$macrocall $name="toggleButton" state=<<qualifyTitle "$:/state/tag-manager/">> />
<$macrocall $name="toggleButton" state={{{ [[$:/state/tag-manager/]addsuffix<currentTiddler>] }}} />
</td>
</tr>
<tr>
<td></td>
<td colspan="4">
<$reveal state=<<qualifyTitle "$:/state/tag-manager/">> type="match" text="open" default="">
<$reveal stateTitle={{{ [[$:/state/tag-manager/]addsuffix<currentTiddler>] }}} type="match" text="open" default="">
<table>
<tbody>
<tr><td><<lingo Colour/Heading>></td><td><$edit-text field="color" tag="input" type="text" size="9"/></td></tr>
@@ -77,7 +74,7 @@ $title$$(currentTiddler)$
</$list>
<tr>
<td></td>
<td>
<td style="position:relative;">
{{$:/core/ui/UntaggedTemplate}}
</td>
<td>
+3
View File
@@ -1,10 +1,13 @@
title: $:/core/ui/TagTemplate
\whitespace trim
<span class="tc-tag-list-item">
<$set name="transclusion" value=<<currentTiddler>>>
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{!!icon}} colour={{!!color}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">> dragFilter='[all[current]tagging[]]' tag='span'"""/>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes" class="tc-drop-down">
<$set name="tv-show-missing-links" value="yes">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</$set>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem">
<$transclude tiddler=<<listItem>>/>
</$list>
+1 -1
View File
@@ -4,4 +4,4 @@ caption: {{$:/language/TiddlerInfo/References/Caption}}
\define lingo-base() $:/language/TiddlerInfo/
<$list filter="[all[current]backlinks[]sort[title]]" emptyMessage=<<lingo References/Empty>> template="$:/core/ui/ListItemTemplate">
</$list>
</$list>
+2 -2
View File
@@ -1,7 +1,7 @@
title: $:/core/ui/ViewTemplate/body
tags: $:/tags/ViewTemplate
<$reveal tag="div" class="tc-tiddler-body" type="nomatch" state=<<folded-state>> text="hide" retain="yes" animate="yes">
<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes">
<$list filter="[all[current]!has[plugin-type]!field:hide-body[yes]]">
@@ -13,4 +13,4 @@ tags: $:/tags/ViewTemplate
</$list>
</$reveal>
</$reveal>
+1 -1
View File
@@ -1,7 +1,7 @@
title: $:/core/ui/ViewTemplate/subtitle
tags: $:/tags/ViewTemplate
<$reveal type="nomatch" state=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-subtitle">
<$link to={{!!modifier}}>
<$view field="modifier"/>
+2 -2
View File
@@ -1,6 +1,6 @@
title: $:/core/ui/ViewTemplate/tags
tags: $:/tags/ViewTemplate
<$reveal type="nomatch" state=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-tags-wrapper"><$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>
</$reveal>
</$reveal>
+2 -2
View File
@@ -2,13 +2,13 @@ title: $:/core/ui/ViewTemplate/unfold
tags: $:/tags/ViewTemplate
<$reveal tag="div" type="nomatch" state="$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/fold-bar" text="hide">
<$reveal tag="div" type="nomatch" state=<<folded-state>> text="hide" default="show" retain="yes" animate="yes">
<$reveal tag="div" type="nomatch" stateTitle=<<folded-state>> text="hide" default="show" retain="yes" animate="yes">
<$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class="tc-fold-banner">
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
{{$:/core/images/chevron-up}}
</$button>
</$reveal>
<$reveal tag="div" type="nomatch" state=<<folded-state>> text="show" default="show" retain="yes" animate="yes">
<$reveal tag="div" type="nomatch" stateTitle=<<folded-state>> text="show" default="show" retain="yes" animate="yes">
<$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class="tc-unfold-banner">
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
{{$:/core/images/chevron-down}}
+3 -3
View File
@@ -4,7 +4,7 @@ caption: {{$:/core/images/fold-button}} {{$:/language/Buttons/Fold/Caption}}
description: {{$:/language/Buttons/Fold/Hint}}
\whitespace trim
<$reveal type="nomatch" state=<<folded-state>> text="hide" default="show">
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" default="show">
<$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
@@ -18,7 +18,7 @@ description: {{$:/language/Buttons/Fold/Hint}}
</$list>
</$button>
</$reveal>
<$reveal type="match" state=<<folded-state>> text="hide" default="show">
<$reveal type="match" stateTitle=<<folded-state>> text="hide" default="show">
<$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
@@ -31,4 +31,4 @@ description: {{$:/language/Buttons/Fold/Hint}}
</span>
</$list>
</$button>
</$reveal>
</$reveal>
+2
View File
@@ -0,0 +1,2 @@
title: $:/config/NewImageType
text: jpeg
+1 -1
View File
@@ -1,6 +1,6 @@
title: $:/config/OfficialPluginLibrary
tags: $:/tags/PluginLibrary
url: https://tiddlywiki.com/library/v5.1.17/index.html
url: https://tiddlywiki.com/library/v5.1.19/index.html
caption: {{$:/language/OfficialPluginLibrary}}
{{$:/language/OfficialPluginLibrary/Hint}}
+3
View File
@@ -15,6 +15,9 @@ list-bullet: {{$:/language/Buttons/ListBullet/Hint}}
list-number: {{$:/language/Buttons/ListNumber/Hint}}
mono-block: {{$:/language/Buttons/MonoBlock/Hint}}
mono-line: {{$:/language/Buttons/MonoLine/Hint}}
new-image: {{$:/language/Buttons/NewImage/Hint}}
new-journal: {{$:/language/Buttons/NewJournal/Hint}}
new-tiddler: {{$:/language/Buttons/NewTiddler/Hint}}
picture: {{$:/language/Buttons/Picture/Hint}}
preview: {{$:/language/Buttons/Preview/Hint}}
quote: {{$:/language/Buttons/Quote/Hint}}
@@ -3,3 +3,6 @@ title: $:/config/shortcuts-mac/
bold: meta-B
italic: meta-I
underline: meta-U
new-image: ctrl-I
new-journal: ctrl-J
new-tiddler: ctrl-N
@@ -3,3 +3,6 @@ title: $:/config/shortcuts-not-mac/
bold: ctrl-B
italic: ctrl-I
underline: ctrl-U
new-image: alt-I
new-journal: alt-J
new-tiddler: alt-N
+17 -12
View File
@@ -50,28 +50,33 @@ tags: $:/tags/Macro
</$vars>
\end
\define list-tagged-draggable-drop-actions()
\define list-tagged-draggable-drop-actions(tag)
<!-- Save the current ordering of the tiddlers with this tag -->
<$set name="order" filter="[<tag>tagging[]]">
<$set name="order" filter="[<__tag__>tagging[]]">
<!-- Remove any list-after or list-before fields from the tiddlers with this tag -->
<$list filter="[<tag>tagging[]]">
<$list filter="[<__tag__>tagging[]]">
<$action-deletefield $field="list-before"/>
<$action-deletefield $field="list-after"/>
</$list>
<!-- Assign the list field of the tag with the current ordering -->
<$action-setfield $tiddler=<<tag>> $field="list" $value=<<order>>/>
<!-- Add the newly inserted item to the list -->
<$action-listops $tiddler=<<tag>> $field="list" $subfilter="+[insertbefore:currentTiddler<actionTiddler>]"/>
<!-- Save the new order to the Tag Tiddler -->
<$action-listops $tiddler=<<__tag__>> $field="list" $filter="+[enlist<order>] +[insertbefore:currentTiddler<actionTiddler>]"/>
<!-- Make sure the newly added item has the right tag -->
<$action-listops $tiddler=<<actionTiddler>> $tags="[<tag>]"/>
<!-- Removing this line makes dragging tags within the dropdown work as intended -->
<!--<$action-listops $tiddler=<<actionTiddler>> $tags=<<__tag__>>/>-->
<!-- Using the following 5 lines as replacement makes dragging titles from outside into the dropdown apply the tag -->
<$list filter="[<actionTiddler>!contains:tags<__tag__>]">
<$fieldmangler tiddler=<<actionTiddler>>>
<$action-sendmessage $message="tm-add-tag" $param=<<__tag__>>/>
</$fieldmangler>
</$list>
</$set>
\end
\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div")
<$set name="tag" value="""$tag$""">
<$list filter="[<tag>tagging[]$subFilter$]" emptyMessage=<<__emptyMessage__>>>
<$set name="tag" value=<<__tag__>>>
<$list filter="[<__tag__>tagging[]$subFilter$]" emptyMessage=<<__emptyMessage__>>>
<$elementTag$ class="tc-menu-list-item">
<$droppable actions=<<list-tagged-draggable-drop-actions>>>
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""">
<$elementTag$ class="tc-droppable-placeholder">
&nbsp;
</$elementTag$>
@@ -86,7 +91,7 @@ tags: $:/tags/Macro
</$elementTag$>
</$list>
<$tiddler tiddler="">
<$droppable actions=<<list-tagged-draggable-drop-actions>>>
<$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""">
<$elementTag$ class="tc-droppable-placeholder">
&nbsp;
</$elementTag$>
+3 -3
View File
@@ -10,18 +10,18 @@ color:$(foregroundColor)$;
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<$element-tag$ $element-attributes$ class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>>>
$actions$<$transclude tiddler="""$icon$"""/> <$view tiddler="""$tag$""" field="title" format="text" />
$actions$<$transclude tiddler="""$icon$"""/> <$view tiddler=<<__tag__>> field="title" format="text" />
</$element-tag$>
</$vars>
\end
\define tag-pill-body(tag,icon,colour,palette,element-tag,element-attributes,actions)
<$macrocall $name="tag-pill-inner" tag="""$tag$""" icon="""$icon$""" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
<$macrocall $name="tag-pill-inner" tag=<<__tag__>> icon="""$icon$""" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
\end
\define tag-pill(tag,element-tag:"span",element-attributes:"",actions:"")
<span class="tc-tag-list-item">
<$macrocall $name="tag-pill-body" tag="""$tag$""" icon={{$tag$!!icon}} colour={{$tag$!!color}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
<$macrocall $name="tag-pill-body" tag=<<__tag__>> icon={{{ [<__tag__>get[icon]] }}} colour={{{ [<__tag__>get[color]] }}} palette={{$:/palette}} element-tag="""$element-tag$""" element-attributes="""$element-attributes$""" actions="""$actions$"""/>
</span>
\end
+31 -39
View File
@@ -32,57 +32,53 @@ tags: $:/tags/Macro
\define toc-linked-expandable-body(tag,sort:"",itemClassFilter,exclude,path)
<!-- helper function -->
<$wikify name="toc-state" text="""
<$macrocall $name="qualify" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}} />
""">
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item" value="toc-item-selected">
<li class=<<toc-item-class>>>
<$link>
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/right-arrow}}
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/down-arrow}}
</$button>
</$reveal>
<<toc-caption>>
</$link>
<$reveal type="match" state=<<toc-state>> text="open">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>>/>
</$reveal>
</li>
</$set>
</$wikify>
</$qualify>
\end
\define toc-unlinked-expandable-body(tag,sort:"",itemClassFilter:" ",exclude,path)
<!-- helper function -->
<$wikify name="toc-state" text="""
<$macrocall $name="qualify" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}} />
""">
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item" value="toc-item-selected">
<li class=<<toc-item-class>>>
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/right-arrow}}
<<toc-caption>>
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/down-arrow}}
<<toc-caption>>
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$macrocall $name="toc-expandable" tag=<<currentTiddler>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>>/>
</$reveal>
</li>
</$set>
</$wikify>
</$qualify>
\end
\define toc-expandable-empty-message()
@@ -102,60 +98,56 @@ tags: $:/tags/Macro
\end
\define toc-linked-selective-expandable-body(tag,sort:"",itemClassFilter:" ",exclude,path)
<$wikify name="toc-state" text="""
<$macrocall $name="qualify" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}} />
""">
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item" value="toc-item-selected" >
<li class=<<toc-item-class>>>
<$link>
<$list filter="[all[current]tagging[]limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button>">
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/right-arrow}}
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/down-arrow}}
</$button>
</$reveal>
</$list>
<<toc-caption>>
</$link>
<$reveal type="match" state=<<toc-state>> text="open">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>>/>
</$reveal>
</li>
</$set>
</$wikify>
</$qualify>
\end
\define toc-unlinked-selective-expandable-body(tag,sort:"",itemClassFilter:" ",exclude,path)
<$wikify name="toc-state" text="""
<$macrocall $name="qualify" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}} />
""">
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item" value="toc-item-selected">
<li class=<<toc-item-class>>>
<$list filter="[all[current]tagging[]limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <$view field='caption'><$view field='title'/></$view>">
<$reveal type="nomatch" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/right-arrow}}
<<toc-caption>>
</$button>
</$reveal>
<$reveal type="match" state=<<toc-state>> text="open">
<$button set=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="close" class="tc-btn-invisible tc-popup-keep">
{{$:/core/images/down-arrow}}
<<toc-caption>>
</$button>
</$reveal>
</$list>
<$reveal type="match" state=<<toc-state>> text="open">
<$reveal type="match" stateTitle=<<toc-state>> text="open">
<$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>>/>
</$reveal>
</li>
</$set>
</$wikify>
</$qualify>
\end
\define toc-selective-expandable-empty-message()
@@ -167,7 +159,7 @@ tags: $:/tags/Macro
<ol class="tc-toc toc-selective-expandable">
<$list filter="""[all[shadows+tiddlers]tag<__tag__>!has[draft.of]$sort$] -[<__tag__>] -[enlist<__exclude__>]""">
<$list filter="[all[current]toc-link[no]]" variable="ignore" emptyMessage=<<toc-selective-expandable-empty-message>> >
<$macrocall $name=toc-unlinked-selective-expandable-body tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>> >
<$macrocall $name="toc-unlinked-selective-expandable-body" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>>/>
</$list>
</$list>
</ol>
@@ -183,13 +175,13 @@ tags: $:/tags/Macro
</div>
</$linkcatcher>
<div class="tc-tabbed-table-of-contents-content">
<$reveal state=<<__selectedTiddler__>> type="nomatch" text="">
<$reveal stateTitle=<<__selectedTiddler__>> type="nomatch" text="">
<$transclude mode="block" tiddler=<<__template__>>>
<h1><<toc-caption>></h1>
<$transclude mode="block">$missingText$</$transclude>
</$transclude>
</$reveal>
<$reveal state=<<__selectedTiddler__>> type="match" text="">
<$reveal stateTitle=<<__selectedTiddler__>> type="match" text="">
$unselectedText$
</$reveal>
</div>
+31 -27
View File
@@ -1,53 +1,57 @@
title: $:/core/macros/tree
tags: $:/tags/Macro
\define leaf-node(prefix)
\define leaf-link(full-title, chunk)
<$link to=<<__full-title__>>><$text text=<<__chunk__>>/></$link>
\end
\define leaf-node(prefix, chunk)
<li>
<$list filter="""[[$prefix$$(chunk)$]is[shadow]] [[$prefix$$(chunk)$]is[tiddler]] +[removeprefix[$prefix$]] +[limit[1]]"""
emptyMessage="""<$text text="$prefix$$(chunk)$"/>""">
<span>{{$:/core/images/file}}</span> <$link to="""$prefix$$(chunk)$""">
<$view field="title"/>
</$link>
<$list filter="[<__prefix__>addsuffix<__chunk__>is[shadow]] [<__prefix__>addsuffix<__chunk__>is[tiddler]]" variable="full-title">
<$list filter="[<full-title>removeprefix<__prefix__>]" variable="chunk">
<span>{{$:/core/images/file}}</span> <$macrocall $name="leaf-link" full-title=<<full-title>> chunk=<<chunk>>/>
</$list>
</$list>
</li>
\end
\define branch-node(prefix)
<$reveal type="nomatch" text="" default="""$(chunk)$""">
<li>
<$list filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]] +[limit[1]]""">
<$reveal type="nomatch" state="""$:/state/tree/$prefix$$(chunk)$""" text="show">
<$button set="""$:/state/tree/$prefix$$(chunk)$""" setTo="show" class="tc-btn-invisible">{{$:/core/images/folder}} <$text text="""$(chunk)$"""/></$button>
\define branch-node(prefix, chunk)
<li>
<$set name="reveal-state" value={{{ [[$:/state/tree/]addsuffix<__prefix__>addsuffix<__chunk__>] }}}>
<$reveal type="nomatch" stateTitle=<<reveal-state>> text="show">
<$button setTitle=<<reveal-state>> setTo="show" class="tc-btn-invisible">
{{$:/core/images/folder}} <$text text=<<__chunk__>>/>
</$button>
</$reveal>
<$reveal type="match" state="""$:/state/tree/$prefix$$(chunk)$""" text="show">
<$button set="""$:/state/tree/$prefix$$(chunk)$""" setTo="hide" class="tc-btn-invisible">{{$:/core/images/folder}} <$text text="""$(chunk)$"""/></$button>
<$reveal type="match" stateTitle=<<reveal-state>> text="show">
<$button setTitle=<<reveal-state>> setTo="hide" class="tc-btn-invisible">
{{$:/core/images/folder}} <$text text=<<__chunk__>>/>
</$button>
</$reveal>
</$list>
<$list filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]] +[limit[1]]"""><span>(<$count filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]]"""/>)</span>
<$reveal type="match" state="""$:/state/tree/$prefix$$(chunk)$""" text="show">
<$macrocall $name="tree-node" prefix="""$prefix$$(chunk)$"""/>
<span>(<$count filter="[all[shadows+tiddlers]removeprefix<__prefix__>removeprefix<__chunk__>] -[<__prefix__>addsuffix<__chunk__>]"/>)</span>
<$reveal type="match" stateTitle=<<reveal-state>> text="show">
<$macrocall $name="tree-node" prefix={{{ [<__prefix__>addsuffix<__chunk__>] }}}/>
</$reveal>
</$list>
</$set>
</li>
</$reveal>
\end
\define tree-node(prefix)
<ol>
<$list filter="[all[shadows+tiddlers]removeprefix[$prefix$]splitbefore[/]sort[title]] +[!suffix[/]]" variable="chunk">
<<leaf-node """$prefix$""">>
<$list filter="[all[shadows+tiddlers]removeprefix<__prefix__>splitbefore[/]sort[]!suffix[/]]" variable="chunk">
<$macrocall $name="leaf-node" prefix=<<__prefix__>> chunk=<<chunk>>/>
</$list>
<$list filter="[all[shadows+tiddlers]removeprefix[$prefix$]splitbefore[/]sort[title]] +[suffix[/]]" variable="chunk">
<<branch-node """$prefix$""">>
<$list filter="[all[shadows+tiddlers]removeprefix<__prefix__>splitbefore[/]sort[]suffix[/]]" variable="chunk">
<$macrocall $name="branch-node" prefix=<<__prefix__>> chunk=<<chunk>>/>
</$list>
</ol>
\end
\define tree(prefix)
\define tree(prefix: "$:/")
<div class="tc-tree">
<span><$text text="""$prefix$"""/></span>
<span><$text text=<<__prefix__>>/></span>
<div>
<$macrocall $name="tree-node" prefix="""$prefix$"""/>
<$macrocall $name="tree-node" prefix=<<__prefix__>>/>
</div>
</div>
\end
@@ -14,5 +14,7 @@ Hook function parameters:
** Defined in core/modules/commands/server.js
* NodeJS HTTP Server instance
** See the NodeJS docs at [ext[https://nodejs.org/docs/latest-v8.x/api/http.html#http_class_http_server]]
* Name of server invoking this hook (for special handling of the NodeJS HTTP server instance argument).
** Current known values: `tiddlywiki`, `tiddlyserver`.
Return value is ignored.
@@ -0,0 +1,5 @@
title: $:/DefaultTiddlers
HelloThere
$:/plugins/tiddlywiki/dynaview
[list[Alice in Wonderland:]]
@@ -0,0 +1,11 @@
title: HelloThere
This edition demonstrates some of the capabilities of the ~DynaView plugin. See the [[plugin tiddler|$:/plugins/tiddlywiki/dynaview]] below for the plugin documentation and some simple examples.
This wiki demonstrates how to use DynaView's dynamic rendering features to customise the story river such that tiddlers are only rendered when they are scrolled into view.
The following customisations are made:
! $:/core/ui/ViewTemplate
<<compareTiddlerText sourceTiddlerTitle:"$:/core" sourceSubTiddlerTitle:"$:/core/ui/ViewTemplate" destTiddlerTitle:"$:/core/ui/ViewTemplate">>
@@ -0,0 +1,2 @@
title: $:/config/Performance/Instrumentation
text: yes
@@ -0,0 +1,36 @@
title: $:/core/ui/SideBar/Open
tags: $:/tags/SideBar
caption: {{$:/language/SideBar/Open/Caption}}
\define lingo-base() $:/language/CloseAll/
\define drop-actions()
<$action-listops $tiddler="$:/StoryList" $subfilter="+[insertbefore:currentTiddler<actionTiddler>]"/>
\end
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" storyview="pop">
<div style="position: relative;">
<$droppable actions=<<drop-actions>>>
<div class="tc-droppable-placeholder">
&nbsp;
</div>
<div>
<$button message="tm-close-tiddler" tooltip={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class="tc-btn-invisible tc-btn-mini">&times;</$button> <$link to={{!!title}}><$view field="title"/></$link>
<$set name="state" value={{{ [[$:/state/viewtemplate/visibility/]addsuffix<currentTiddler>] }}}>
<$set name="visibility" tiddler=<<state>>>
- <$text text=<<visibility>>/>
</$set>
</$set>
</div>
</$droppable>
</div>
</$list>
<$tiddler tiddler="">
<$droppable actions=<<drop-actions>>>
<div class="tc-droppable-placeholder">
&nbsp;
</div>
<$button message="tm-close-all-tiddlers" class="tc-btn-invisible tc-btn-mini"><<lingo Button>></$button>
</$droppable>
</$tiddler>
@@ -0,0 +1,3 @@
title: $:/SiteSubtitle
a demo of the ~DynaView plugin for TiddlyWiki5
@@ -0,0 +1,3 @@
title: $:/SiteTitle
~DynaView Demo
@@ -0,0 +1,30 @@
title: $:/core/ui/ViewTemplate
\whitespace trim
\define frame-classes()
tc-tiddler-frame tc-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$ $(tiddlerTagClasses)$ $(userClass)$
\end
\define folded-state()
$:/state/folded/$(currentTiddler)$
\end
<$vars storyTiddler=<<currentTiddler>> tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">> userClass={{!!class}}>
<$tiddler tiddler=<<currentTiddler>>>
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class=<<frame-classes>>>
<$set name="state" value={{{ [[$:/state/viewtemplate/visibility/]addsuffix<currentTiddler>] }}}>
<$reveal stateTitle=<<state>> type="match" text="true" tag="div">
<div class="tc-dynaview-set-tiddler-when-visible tc-dynaview-expand-viewport" data-dynaview-set-tiddler=<<state>> data-dynaview-set-value="true" data-dynaview-unset-tiddler=<<state>> data-dynaview-unset-value="false" data-dynaview-has-triggered={{{ [<state>get[text]] }}}>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem">
<$transclude tiddler=<<listItem>>/>
</$list>
</div>
</$reveal>
<$reveal stateTitle=<<state>> type="nomatch" text="true" tag="div">
<div class="tc-dynaview-set-tiddler-when-visible tc-dynaview-expand-viewport" style="min-height: 5em;" data-dynaview-set-tiddler=<<state>> data-dynaview-set-value="true" data-dynaview-unset-tiddler=<<state>> data-dynaview-unset-value="false" data-dynaview-has-triggered={{{ [<state>get[text]] }}}>
</div>
</$reveal>
</$set>
</div>
</$tiddler>
</$vars>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,330 @@
title: Alice in Wonderland License
type: text/plain
THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
To protect the Project Gutenberg-tm mission of promoting the free
distribution of electronic works, by using or distributing this work
(or any other work associated in any way with the phrase "Project
Gutenberg"), you agree to comply with all the terms of the Full Project
Gutenberg-tm License (available with this file or online at
http://gutenberg.org/license).
Section 1. General Terms of Use and Redistributing Project Gutenberg-tm
electronic works
1.A. By reading or using any part of this Project Gutenberg-tm
electronic work, you indicate that you have read, understand, agree to
and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or destroy
all copies of Project Gutenberg-tm electronic works in your possession.
If you paid a fee for obtaining a copy of or access to a Project
Gutenberg-tm electronic work and you do not agree to be bound by the
terms of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.
1.B. "Project Gutenberg" is a registered trademark. It may only be
used on or associated in any way with an electronic work by people who
agree to be bound by the terms of this agreement. There are a few
things that you can do with most Project Gutenberg-tm electronic works
even without complying with the full terms of this agreement. See
paragraph 1.C below. There are a lot of things you can do with Project
Gutenberg-tm electronic works if you follow the terms of this agreement
and help preserve free future access to Project Gutenberg-tm electronic
works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation"
or PGLAF), owns a compilation copyright in the collection of Project
Gutenberg-tm electronic works. Nearly all the individual works in the
collection are in the public domain in the United States. If an
individual work is in the public domain in the United States and you are
located in the United States, we do not claim a right to prevent you from
copying, distributing, performing, displaying or creating derivative
works based on the work as long as all references to Project Gutenberg
are removed. Of course, we hope that you will support the Project
Gutenberg-tm mission of promoting free access to electronic works by
freely sharing Project Gutenberg-tm works in compliance with the terms of
this agreement for keeping the Project Gutenberg-tm name associated with
the work. You can easily comply with the terms of this agreement by
keeping this work in the same format with its attached full Project
Gutenberg-tm License when you share it without charge with others.
1.D. The copyright laws of the place where you are located also govern
what you can do with this work. Copyright laws in most countries are in
a constant state of change. If you are outside the United States, check
the laws of your country in addition to the terms of this agreement
before downloading, copying, displaying, performing, distributing or
creating derivative works based on this work or any other Project
Gutenberg-tm work. The Foundation makes no representations concerning
the copyright status of any work in any country outside the United
States.
1.E. Unless you have removed all references to Project Gutenberg:
1.E.1. The following sentence, with active links to, or other immediate
access to, the full Project Gutenberg-tm License must appear prominently
whenever any copy of a Project Gutenberg-tm work (any work on which the
phrase "Project Gutenberg" appears, or with which the phrase "Project
Gutenberg" is associated) is accessed, displayed, performed, viewed,
copied or distributed:
This eBook is for the use of anyone anywhere at no cost and with
almost no restrictions whatsoever. You may copy it, give it away or
re-use it under the terms of the Project Gutenberg License included
with this eBook or online at www.gutenberg.org
1.E.2. If an individual Project Gutenberg-tm electronic work is derived
from the public domain (does not contain a notice indicating that it is
posted with permission of the copyright holder), the work can be copied
and distributed to anyone in the United States without paying any fees
or charges. If you are redistributing or providing access to a work
with the phrase "Project Gutenberg" associated with or appearing on the
work, you must comply either with the requirements of paragraphs 1.E.1
through 1.E.7 or obtain permission for the use of the work and the
Project Gutenberg-tm trademark as set forth in paragraphs 1.E.8 or
1.E.9.
1.E.3. If an individual Project Gutenberg-tm electronic work is posted
with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any additional
terms imposed by the copyright holder. Additional terms will be linked
to the Project Gutenberg-tm License for all works posted with the
permission of the copyright holder found at the beginning of this work.
1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm
License terms from this work, or any files containing a part of this
work or any other work associated with Project Gutenberg-tm.
1.E.5. Do not copy, display, perform, distribute or redistribute this
electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1 with
active links or immediate access to the full terms of the Project
Gutenberg-tm License.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form, including any
word processing or hypertext form. However, if you provide access to or
distribute copies of a Project Gutenberg-tm work in a format other than
"Plain Vanilla ASCII" or other format used in the official version
posted on the official Project Gutenberg-tm web site (www.gutenberg.org),
you must, at no additional cost, fee or expense to the user, provide a
copy, a means of exporting a copy, or a means of obtaining a copy upon
request, of the work in its original "Plain Vanilla ASCII" or other
form. Any alternate format must include the full Project Gutenberg-tm
License as specified in paragraph 1.E.1.
1.E.7. Do not charge a fee for access to, viewing, displaying,
performing, copying or distributing any Project Gutenberg-tm works
unless you comply with paragraph 1.E.8 or 1.E.9.
1.E.8. You may charge a reasonable fee for copies of or providing
access to or distributing Project Gutenberg-tm electronic works provided
that
- You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg-tm works calculated using the method
you already use to calculate your applicable taxes. The fee is
owed to the owner of the Project Gutenberg-tm trademark, but he
has agreed to donate royalties under this paragraph to the
Project Gutenberg Literary Archive Foundation. Royalty payments
must be paid within 60 days following each date on which you
prepare (or are legally required to prepare) your periodic tax
returns. Royalty payments should be clearly marked as such and
sent to the Project Gutenberg Literary Archive Foundation at the
address specified in Section 4, "Information about donations to
the Project Gutenberg Literary Archive Foundation."
- You provide a full refund of any money paid by a user who notifies
you in writing (or by e-mail) within 30 days of receipt that s/he
does not agree to the terms of the full Project Gutenberg-tm
License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg-tm works.
- You provide, in accordance with paragraph 1.F.3, a full refund of any
money paid for a work or a replacement copy, if a defect in the
electronic work is discovered and reported to you within 90 days
of receipt of the work.
- You comply with all other terms of this agreement for free
distribution of Project Gutenberg-tm works.
1.E.9. If you wish to charge a fee or distribute a Project Gutenberg-tm
electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
both the Project Gutenberg Literary Archive Foundation and Michael
Hart, the owner of the Project Gutenberg-tm trademark. Contact the
Foundation as set forth in Section 3 below.
1.F.
1.F.1. Project Gutenberg volunteers and employees expend considerable
effort to identify, do copyright research on, transcribe and proofread
public domain works in creating the Project Gutenberg-tm
collection. Despite these efforts, Project Gutenberg-tm electronic
works, and the medium on which they may be stored, may contain
"Defects," such as, but not limited to, incomplete, inaccurate or
corrupt data, transcription errors, a copyright or other intellectual
property infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be read by
your equipment.
1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right
of Replacement or Refund" described in paragraph 1.F.3, the Project
Gutenberg Literary Archive Foundation, the owner of the Project
Gutenberg-tm trademark, and any other party distributing a Project
Gutenberg-tm electronic work under this agreement, disclaim all
liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE
PROVIDED IN PARAGRAPH F3. YOU AGREE THAT THE FOUNDATION, THE
TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE
LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR
INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH
DAMAGE.
1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a
defect in this electronic work within 90 days of receiving it, you can
receive a refund of the money (if any) you paid for it by sending a
written explanation to the person you received the work from. If you
received the work on a physical medium, you must return the medium with
your written explanation. The person or entity that provided you with
the defective work may elect to provide a replacement copy in lieu of a
refund. If you received the work electronically, the person or entity
providing it to you may choose to give you a second opportunity to
receive the work electronically in lieu of a refund. If the second copy
is also defective, you may demand a refund in writing without further
opportunities to fix the problem.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you 'AS-IS' WITH NO OTHER
WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR ANY PURPOSE.
1.F.5. Some states do not allow disclaimers of certain implied
warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted by
the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the
trademark owner, any agent or employee of the Foundation, anyone
providing copies of Project Gutenberg-tm electronic works in accordance
with this agreement, and any volunteers associated with the production,
promotion and distribution of Project Gutenberg-tm electronic works,
harmless from all liability, costs and expenses, including legal fees,
that arise directly or indirectly from any of the following which you do
or cause to occur: (a) distribution of this or any Project Gutenberg-tm
work, (b) alteration, modification, or additions or deletions to any
Project Gutenberg-tm work, and (c) any Defect you cause.
Section 2. Information about the Mission of Project Gutenberg-tm
Project Gutenberg-tm is synonymous with the free distribution of
electronic works in formats readable by the widest variety of computers
including obsolete, old, middle-aged and new computers. It exists
because of the efforts of hundreds of volunteers and donations from
people in all walks of life.
Volunteers and financial support to provide volunteers with the
assistance they need, is critical to reaching Project Gutenberg-tm's
goals and ensuring that the Project Gutenberg-tm collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a secure
and permanent future for Project Gutenberg-tm and future generations.
To learn more about the Project Gutenberg Literary Archive Foundation
and how your efforts and donations can help, see Sections 3 and 4
and the Foundation web page at http://www.pglaf.org.
Section 3. Information about the Project Gutenberg Literary Archive
Foundation
The Project Gutenberg Literary Archive Foundation is a non profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation's EIN or federal tax identification
number is 64-6221541. Its 501(c)(3) letter is posted at
http://pglaf.org/fundraising. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state's laws.
The Foundation's principal office is located at 4557 Melan Dr. S.
Fairbanks, AK, 99712., but its volunteers and employees are scattered
throughout numerous locations. Its business office is located at
809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887, email
business@pglaf.org. Email contact links and up to date contact
information can be found at the Foundation's web site and official
page at http://pglaf.org
For additional contact information:
Dr. Gregory B. Newby
Chief Executive and Director
gbnewby@pglaf.org
Section 4. Information about Donations to the Project Gutenberg
Literary Archive Foundation
Project Gutenberg-tm depends upon and cannot survive without wide
spread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can be
freely distributed in machine readable form accessible by the widest
array of equipment including outdated equipment. Many small donations
($1 to $5,000) are particularly important to maintaining tax exempt
status with the IRS.
The Foundation is committed to complying with the laws regulating
charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and keep up
with these requirements. We do not solicit donations in locations
where we have not received written confirmation of compliance. To
SEND DONATIONS or determine the status of compliance for any
particular state visit http://pglaf.org
While we cannot and do not solicit contributions from states where we
have not met the solicitation requirements, we know of no prohibition
against accepting unsolicited donations from donors in such states who
approach us with offers to donate.
International donations are gratefully accepted, but we cannot make
any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.
Please check the Project Gutenberg Web pages for current donation
methods and addresses. Donations are accepted in a number of other
ways including checks, online payments and credit card donations.
To donate, please visit: http://pglaf.org/donate
Section 5. General Information About Project Gutenberg-tm electronic
works.
Professor Michael S. Hart is the originator of the Project Gutenberg-tm
concept of a library of electronic works that could be freely shared
with anyone. For thirty years, he produced and distributed Project
Gutenberg-tm eBooks with only a loose network of volunteer support.
Project Gutenberg-tm eBooks are often created from several printed
editions, all of which are confirmed as Public Domain in the U.S.
unless a copyright notice is included. Thus, we do not necessarily
keep eBooks in compliance with any particular paper edition.
Most people start at our Web site which has the main PG search facility:
http://www.gutenberg.org
This Web site includes information about Project Gutenberg-tm,
including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how to
subscribe to our email newsletter to hear about new eBooks.
File diff suppressed because it is too large Load Diff
+14
View File
@@ -0,0 +1,14 @@
{
"description": "Demo of the DynaView plugin",
"plugins": [
"tiddlywiki/dynaview"
],
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
],
"build": {
"index": [
"--rendertiddler","$:/core/save/all","index.html","text/plain"]
}
}
+3
View File
@@ -9,6 +9,9 @@
"build": {
"index": [
"--rendertiddler","$:/core/save/all","index.html","text/plain"],
"empty": [
"--rendertiddler","$:/core/save/all","empty.html","text/plain",
"--rendertiddler","$:/core/save/all","empty.hta","text/plain"],
"externalimages": [
"--savetiddlers","[is[image]]","images",
"--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
@@ -1,29 +1,50 @@
caption: Librería oficial de plugins
created: 20160107222352710
es-title: Cómo instalar plugins desde la librería oficial
modified: 20160504155725022
modified: 20181123220449416
tags: Plugins
title: Installing a plugin from the plugin library
type: text/vnd.tiddlywiki
! Configuración de escritorio
Seguir instrucciones cuando se utiliza TiddlyWiki en versión archivo HTML:
# Sólo [[por si acaso|The First Rule of Using TiddlyWiki]], haz copia de seguridad de tu archivo HTML de ~TiddlyWiki
# Abre ~TiddlyWiki en el navegador
# Abre la pestaña <<.controlpanel-tab Plugins>> del [[Panel de control|$:/ControlPanel]]
# Pincha en el botón <<.word "Obtén complementos y extensiones">> para abrir la librería oficial
# Abre el [[panel de control|$:/ControlPanel]] {{$:/core/images/options-button}}, clic en la pestaña ''Plugins'' y luego en botón {{$:/core/images/download-button}} ''Obten complementos y extensiones''
# Pincha en el botón {{$:/core/images/chevron-right}} ''Abrir biblioteca de complementos y extensiones'' para abrir la librería oficial
# Cuando se haya cargado la librería:
## Selecciona la pestaña adecuada al tipo de plugin que buscas
## Selecciona la pestaña adecuada al tipo complemento que buscas ''Plugins'', ''Temas'' o ''Idiomas''
## Desplázate o usa el cuadro para encontrar lo que buscas
# Pincha el botón <<.word "instalar>>
# Guarda los cambios con el botón <<.button save-wiki>>
# Recarga la página
# Pincha el botón ''instalar''
# Guarda los cambios con el botón {{$:/core/images/save-button}}
# Recarga la página {{$:/core/images/refresh-button}}
# El plugin está instalado y listo para su uso
! Configuración cliente-servidor
Seguir instrucciones cuando se utiliza TiddlyWiki en versión servidor Node.js:
# Identificar el plugin que desea instalar usando la pestaña ''Plugins'' en el [[panel de control|$:/ControlPanel]] ('sin embargo no instalar el plugin desde aquí). Los plugins se identifican por su tipo (''Plugins'', ''Temas'' o ''Idiomas''), editor y título. Por ejemplo, el plugin `$:/plugins/tiddlywiki/internals` es identificado como ''tiddlywiki/internals''
# Detener el servidor si está en ejecución.
# Editar el archivo `tiddlywiki.info` (está en formato JSON) y ubicar la sección `plugins`, `themes` or `languages` (ver abajo)
# Agreagar las entradas correspondientes a los plugins que desea instalar. (Tener cuidado de separar los ítems con coma, pero al último ítem no colocarle)
# Reiniciar el servidor
```
{
"plugins": [
"tiddlywiki/codemirror"
],
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
],
"languages": [
"es-ES",
"fr-FR",
"en-EN"
]
}
```
+86 -4
View File
@@ -1,6 +1,6 @@
title: HelloThere
This is a TiddlyWiki plugin for mathematical typesetting based on KaTeX from Khan Academy.
This is a TiddlyWiki plugin for mathematical and chemical typesetting based on KaTeX from Khan Academy.
It is completely self-contained, and doesn't need an Internet connection in order to work. It works both in the browser and under Node.js.
@@ -16,9 +16,9 @@ The usual way to include ~LaTeX is to use `$$`, as shown in the examples below.
The underlying KaTeX widget is provided under the name `<$latex>` and is also available under the alias `<$katex>`. It's better to use the generic `<$latex>` name unless you are running multiple ~LaTeX plugins and wish to specifically target KaTeX.
! Examples
! Examples - mathematical typesetting
These examples are taken from http://khan.github.io/KaTeX/
These examples are taken from [ext[http://khan.github.io/KaTeX/]]
!! Example 1
@@ -69,7 +69,7 @@ For more flexibility the KaTeX widget can also be used via the full widget synta
<$latex text="f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi" displayMode="true"></$latex>
! Error Handling
! ''Error Handling''
Any LaTeX syntax errors are flagged with the problematic syntax highlighted. For example:
@@ -79,3 +79,85 @@ $$ f(x) = \int_{-\infty}^\infinity\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi $$
$$ f(x) = \int_{-\infty}^\infinity\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi $$
<hr>
! Examples - chemical typesetting
These examples are taken from [ext[https://mhchem.github.io/MathJax-mhchem/]]
!! Example 1
```
$$
\ce{CO2 + C -> 2 CO}
$$
```
$$
\ce{CO2 + C -> 2 CO}
$$
!! Example 2
```
$$
\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}
$$
```
$$
\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}
$$
!! Example 3
```
$$
\ce{x Na(NH4)HPO4 ->[\Delta] (NaPO3)_x + x NH3 ^ + x H2O}
$$
```
$$
\ce{x Na(NH4)HPO4 ->[\Delta] (NaPO3)_x + x NH3 ^ + x H2O}
$$
!! Example 4
```
$$
\ce{A\bond{~--}B\bond{~=}C\bond{-~-}D}
$$
```
$$
\ce{A\bond{~--}B\bond{~=}C\bond{-~-}D}
$$
!! Example 5
```
$$
\ce{Li^x_{Li,1-2x}Mg^._{Li,x}$V$'_{Li,x}Cl^x_{Cl}}
$$
```
$$
\ce{Li^x_{Li,1-2x}Mg^._{Li,x}$V$'_{Li,x}Cl^x_{Cl}}
$$
!! Example 6
```
$$
\ce{Zn^2+ <=>[+ 2OH-][+ 2H+] $\underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}$ <=>[+ 2OH-][+ 2H+] $\underset{\text{Hydroxozikat}}{\ce{[Zn(OH)4]^2-}}$}
$$
```
$$
\ce{Zn^2+ <=>[+ 2OH-][+ 2H+] $\underset{\text{amphoteres Hydroxid}}{\ce{Zn(OH)2 v}}$ <=>[+ 2OH-][+ 2H+] $\underset{\text{Hydroxozikat}}{\ce{[Zn(OH)4]^2-}}$}
$$
@@ -1,92 +0,0 @@
caption: 5.1.18
created: 20180512112829164
modified: 20180821123858749
tags: ReleaseNotes
title: Release 5.1.18
type: text/vnd.tiddlywiki
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.1.17...v5.1.18]]//
!! Major Improvements
!!! Node.js HTTP Server
The HTTP WebServer functionality has been significantly improved:
* Adds ability to make a wiki that is read-only for anonymous users (with the editing UI hidden), but allows editing for users who log in
* Adds support for serving static file attachments over HTTP
* Adds support for multiple user credentials for basic authentication via a CSV file containing usernames/passwords
* Hides UI features like the new tiddler button and the edit button when the user only has read-only access to the wiki
* Adds support for serving over HTTPS as well as HTTP
* Adds support for authentication via a trusted header, making it easier to integrate with corporate single sign on (and Windows authentication)
* Adds support for more fine grained authorisation (ie granting/denying individual users read/write permission to resources)
* Better debugging information
* Experimental support for a new, plain HTML single tiddler per page view
* Adds a simple level of [[CSRF protection|WebServer Parameter: csrf-disable]]
* Deprecating the existing `--server` command in favour of a new `--listen` command using the new NamedCommandParameters support for named parameters that can be specified in any order
* Refactoring routes as separate modules, making it easier to extend the server with new functionality
See WebServer for more details, or [[see the changes on GitHub|https://github.com/Jermolene/TiddlyWiki5/pull/2679]].
!! Comment Plugin
This release [[adds|https://github.com/Jermolene/TiddlyWiki5/commit/acaa07a964a004759ddb8fb755484918b3322815]] a new commenting plugin -- see $:/plugins/tiddlywiki/comments
!! Translation Improvements
New and improved translations:
*
!! Usability Improvements
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/3bfa9c6f100cfd7107f2c5bf4cfc5dd40a93d54d]] persistent indicators at the bottom of the window showing any hidden drafts
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/7dbe117bc55a9cda91ce7b480525a2b2a70b8229]] current username (if set) to the title of draft tiddlers, making them easier to identify in multiuser scenarios
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/6b14969cf60bdcad16ac5978030bf1d929a712c6]] a warning for binary tiddlers in view mode
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/issues/3255]] permalink/permaview to copy the URL to the clipboard as well as updating the address bar. This behaviour can be customised in $:/ControlPanel settings
* [[Improved|https://github.com/Jermolene/TiddlyWiki5/commit/d96c84426484747ab19d92b1d9f49e01c9dad985]] saving to use the $:/SiteTitle as the basis of the filename
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/09112ed455e7c4be2e50e88c00f370d726d71f64]] support for [[webp|https://en.wikipedia.org/wiki/WebP]], [[heic and heif|https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format]] image formats
!! Hackability Improvements
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/763f8afaf2dc7dcaa2d4a492887a944d84c4fed2]] new [[contains Operator]] for searching within list fields
* [[Added|https://github.com/Jermolene/TiddlyWiki5/issues/3396]] support for a navigation scroll offset to avoid navigating to tiddlers resulting in them being obscured under a `position:fixed` top menu bar
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/commit/3140ff9e490cc2e725c0d02edab8db93009d74b2]] [[WidgetMessage: tm-full-screen]] message to support forcing the status instead of just toggling it
* [[Refactored|https://github.com/Jermolene/TiddlyWiki5/pull/2758]] the sidebar to make it be dynamically built from the tag <<tag "$:/tags/SideBarSegment">>
* [[Added|https://github.com/Jermolene/TiddlyWiki5/pull/3346]] new [[range Operator]] for generating ranges of numbers
* [[Added|https://github.com/Jermolene/TiddlyWiki5/pull/3360]] palette support for `<select>` element colouring
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/bef3242075b6d962b7963b9c9c7042c39198fc8f]] new text editor operation ''save-selection'' -- see [[WidgetMessage: tm-edit-text-operation]]
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/f54a0a11bce9e47542df32610fae489f4a1dba8c]] support for editor toolbar buttons to have action widgets
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/2e51f08bef8656fdca83fff6163dc67cbaefa2d4]] support for rebasing headings at render time -- see [[tv-adjust-heading-level Variable]]
!! Bug Fixes
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/issues/3371]] with [[WidgetMessage: tm-new-tiddler]] overwriting creation fields of existing tiddlers
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/35cbb127a3c21b7047517f1eeeff571a420b82ae]] problem with unwanted variable substitutions by restricting variable substitutions to macros defined with the ''define'' pragma
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/c72e4f01f1a3051e169593a217bffab8eec279f6]] problem with the 'excise' editor toolbar button not showing if the tiddler type is "text/vnd.tiddlywiki"
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/929b0c98330ad25aa4a32cd201274a6e89cd8902]] problem with generation of wifi QR codes
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/pull/3334]] problem with using full screen on secondary windows
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/a3a4c28143138ca2bde1b8426c910b5e3d6a7110]] subtle bug whereby the RevealWidget was not refreshing properly when the state tiddler of a popup changed
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/issues/3373]] problem with malformed HTML entities
!! Developer Bug Fixes and Improvements
*
! Contributors
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
* [[@AnthonyMuscio|https://github.com/AnthonyMuscio]]
* [[@Arlen22|https://github.com/Arlen22]]
* [[@bimlas|https://github.com/bimlas]]
* [[@BramChen|https://github.com/BramChen]]
* [[@BurningTreeC|https://github.com/BurningTreeC]]
* [[@Drakor|https://github.com/Drakor]]
* [[@EvanBalster|https://github.com/EvanBalster]]
* [[@jho1965us|https://github.com/jho1965us]]
* [[@Marxsal|https://github.com/Marxsal]]
* [[@pmario|https://github.com/pmario]]
* [[@talha131|https://github.com/talha131]]
* [[@TechLifeWeb|https://github.com/TechLifeWeb]]
* [[@twMat|https://github.com/twMat]]
@@ -0,0 +1,14 @@
caption: 5.1.20
created: 20181220163418974
modified: 20181220163418974
tags: ReleaseNotes
title: Release 5.1.20
type: text/vnd.tiddlywiki
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.1.19...v5.1.20]]//
! Contributors
[[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki:
@@ -1,6 +1,6 @@
title: $:/config/LocalPluginLibrary
tags: $:/tags/PluginLibrary
url: http://127.0.0.1:8080/prerelease/library/v5.1.18/index.html
url: http://127.0.0.1:8080/prerelease/library/v5.1.20/index.html
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease Local)
A locally installed version of the official ~TiddlyWiki plugin library at tiddlywiki.com for testing and debugging. //Requires a local web server to share the library//
@@ -1,6 +1,6 @@
title: $:/config/OfficialPluginLibrary
tags: $:/tags/PluginLibrary
url: https://tiddlywiki.com/prerelease/library/v5.1.18/index.html
url: https://tiddlywiki.com/prerelease/library/v5.1.20/index.html
caption: {{$:/language/OfficialPluginLibrary}} (Prerelease)
The prerelease version of the official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
@@ -14,6 +14,26 @@ Tests the filtering mechanism.
describe("Filter tests", function() {
// Test filter parsing
it("should parse new-style rich operator suffixes", function() {
expect($tw.wiki.parseFilter("[search:: four, , five,, six [operand]]")).toEqual(
[ { prefix : '', operators : [ { operator : 'search', suffix : ': four, , five,, six ', suffixes : [ [ ], [ 'four', 'five', 'six' ] ], operand : 'operand' } ] } ]
);
expect($tw.wiki.parseFilter("[search: one, two ,three :[operand]]")).toEqual(
[ { prefix : '', operators : [ { operator : 'search', suffix : ' one, two ,three :', suffixes : [ [ 'one', 'two', 'three' ], [ ] ], operand : 'operand' } ] } ]
);
expect($tw.wiki.parseFilter("[search: one, two ,three :[operand]]")).toEqual(
[ { prefix : '', operators : [ { operator : 'search', suffix : ' one, two ,three :', suffixes : [ [ 'one', 'two', 'three' ], [ ] ], operand : 'operand' } ] } ]
);
expect($tw.wiki.parseFilter("[search: one, two ,three : four, , five,, six [operand]]")).toEqual(
[ { prefix : '', operators : [ { operator : 'search', suffix : ' one, two ,three : four, , five,, six ', suffixes : [ [ 'one', 'two', 'three' ], [ 'four', 'five', 'six' ] ], operand : 'operand' } ] } ]
);
expect($tw.wiki.parseFilter("[search: , : [operand]]")).toEqual(
[ { prefix : '', operators : [ { operator : 'search', suffix : ' , : ', suffixes : [ [ ], [ ] ], operand : 'operand' } ] } ]
);
});
// Create a wiki
var wiki = new $tw.Wiki({
shadowTiddlers: {
@@ -82,6 +102,13 @@ describe("Filter tests", function() {
// Our tests
it("should handle the ~ prefix", function() {
expect(wiki.filterTiddlers("[modifier[JoeBloggs]] ~[[No such tiddler]]").join(",")).toBe("TiddlerOne");
expect(wiki.filterTiddlers("[modifier[JaneBloggs]] ~[[No such tiddler]]").join(",")).toBe("No such tiddler");
expect(wiki.filterTiddlers("~[[No such tiddler]]").join(",")).toBe("No such tiddler");
expect(wiki.filterTiddlers("[my-field[present]] ~[[No such tiddler]]").join(",")).toBe("No such tiddler");
});
it("should handle the lookup operator", function() {
expect(wiki.filterTiddlers("Six Seventh 8 +[lookup[Tiddler]]").join(",")).toBe("Missing inaction from TiddlerOne,,Tidd");
expect(wiki.filterTiddlers("Six Seventh 8 +[lookup:8[Tiddler]]").join(",")).toBe("Missing inaction from TiddlerOne,Tidd,Tidd");
@@ -228,6 +255,17 @@ describe("Filter tests", function() {
it("should handle the search operator", function() {
expect(wiki.filterTiddlers("[search[the]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne");
expect(wiki.filterTiddlers("[search{Tiddler8}sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne");
expect(wiki.filterTiddlers("[search:modifier[og]sort[title]]").join(",")).toBe("TiddlerOne");
expect(wiki.filterTiddlers("[search:modifier,authors:casesensitive[Do]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three");
expect(wiki.filterTiddlers("[search:modifier,authors:casesensitive[do]sort[title]]").join(",")).toBe("");
expect(wiki.filterTiddlers("[search:authors:casesensitive,whitespace[John Doe]sort[title]]").join(",")).toBe("$:/TiddlerTwo");
expect(wiki.filterTiddlers("[search:modifier:regexp[(d|bl)o(ggs|e)]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne");
expect(wiki.filterTiddlers("[search:-modifier,authors:[g]sort[title]]").join(",")).toBe("Tiddler Three");
expect(wiki.filterTiddlers("[search:*:[g]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
});
it("should yield search results that have search tokens spread across different fields", function() {
expect(wiki.filterTiddlers("[search[fox one]sort[title]]").join(",")).toBe("TiddlerOne");
});
it("should handle the each operator", function() {
@@ -13,6 +13,8 @@ The ~TiddlyWiki discussion groups are mailing lists for talking about ~TiddlyWik
** An enhanced group search facility is available on [[mail-archive.com|https://www.mail-archive.com/tiddlywiki@googlegroups.com/]]
* Watch recordings of our regular [[TiddlyWiki Hangouts]]
* Follow [[@TiddlyWiki on Twitter|http://twitter.com/TiddlyWiki]] for the latest news
* ''New: Join us on our live chat at https://gitter.im/TiddlyWiki/public !''
! Developers
@@ -21,6 +23,7 @@ The ~TiddlyWiki discussion groups are mailing lists for talking about ~TiddlyWik
** An enhanced group search facility is available on [[mail-archive.com|https://www.mail-archive.com/tiddlywikidev@googlegroups.com/]]
* Follow [[@TiddlyWiki on Twitter|http://twitter.com/#!/TiddlyWiki]] for the latest news
* Get involved in the [[development on GitHub|https://github.com/Jermolene/TiddlyWiki5]]
* Chat at https://gitter.im/TiddlyWiki/public (development room coming soon)
New releases of TiddlyWiki, TiddlyDesktop and TiddlyFox are announced via the discussion groups and [[Twitter|https://twitter.com/TiddlyWiki]] (you can also subscribe to an Atom/RSS feed of [[TiddlyWiki releases from GitHub|https://github.com/jermolene/tiddlywiki5/releases.atom]])
@@ -0,0 +1,10 @@
created: 20181108094230499
modified: 20181108095858434
tags: Resources
title: Code styles and auto format settings for IDEs
type: text/vnd.tiddlywiki
url: https://gitlab.com/bimlas/tw5-code-style-auto-format
Implementation of TiddlyWiki [[Coding Style Guidelines|https://tiddlywiki.com/dev/#TiddlyWiki%20Coding%20Style%20Guidelines]] for different IDEs.
{{!!url}}
@@ -0,0 +1,75 @@
created: 20181012161505447
modified: 20181012184124165
tags: Resources
title: "TiddlyWiki Toolmap" by David Gifford
type: text/vnd.tiddlywiki
url: https://dynalist.io/d/zUP-nIWu2FFoXH-oM7L7d9DM
A topical index of known plugins, tutorials, themes, and other helpful tools for ~TiddlyWiki.
{{!!url}}
Some of the topics indexed so far include:
* Background images and background colors
* Breadcrumbs
* Business - examples
* CSS / Styles, general
* Calendars, dates and timelines
* Checklists
* Collaboration
* Color palettes
* Colors
* Data visualizations
* Developer / advanced tools
* Diplay tiddlers horizontally
* Dropdowns
* Educational
* External files
* Fields
* Fonts
* Fun and games
* Home and lifestyle
* IFrames and embedding media
* Image galleries, modals and lightboxes
* Images, icons, emojis
* Importing and exporting between TiddlyWiki files
* Includes scaffolding within a tiddler, dragging to reorder tiddlers, choosing the number of columns
* Interfacing with, importing and exporting to and from other formats
* Knowledge bases, dictionaries and glossaries
* Layout/UI
* Lightboxes
* Links, linking
* Lists and filters
* Maps and geography
* Masonry, scaffolding
* Math
* ~MindMapping
* Mobile tools
* Music and sound
* Navigation
* node.js
* Note-taking
* Open the "filter" tab
* Partially hidden tiddlers
* Personal websites (examples)
* Presentations and slideshows
* Printing
* Project management
* Publishing and hosting TiddlyWikis on the web
* Searching tools
* Security and backup tools
* Social media, sharing, comments
* Spreadsheets and math
* Startup
* Sticky titles
* Story and screenplay creation
* Table of contents
* Tables, charts and graphs (cf data visualizations)
* Tabs
* Tags, tagging
* Task management and productivity - to do lists
* Themes
* Understanding TiddlyWiki
* Writing and editing
@@ -3,7 +3,7 @@ created: 20180830194141190
delivery: Browser Extension & Executable
description: Browser extension & executable for desktops
method: save
modified: 20180830195059704
modified: 20181012165153986
tags: Windows Linux Chrome Firefox Saving Resources plugins
title: "Timimi" Extension and executable by Riz
type: text/vnd.tiddlywiki
@@ -11,4 +11,6 @@ url: https://github.com/ibnishak/Timimi
`Timimi` is a Web Extension and executable for Firefox, Chrome and Chromium that allows it to save standalone ~TiddlyWiki files.
{{!!url}}
This is an addon using native messaging, essentially handing over the contents to a webextension host (executable) which does the actual saving. Once installed, you can save the standalone TW from anywhere in your hard drive without any more interactions, like the original Tiddlyfox addon.
@@ -0,0 +1,12 @@
title: Keyboard Shortcut Tiddler
tags: Concepts
A ''Keyboard Shortcut Tiddler'' is made of three parts:
* The ''Tag'' <<tag-pill $:/tags/KeyboardShortcut>>
* The ''field'' `key` with a [[Keyboard Shortcut Descriptor]] as its ''value''
* Actions in its ''text'' field
If the [[Keyboard Shortcut Descriptor]] has the form `((my-shortcut))` it's a ''reference'' to a ''configuration Tiddler'' that stores the corresponding [[Keyboard Shortcut|KeyboardShortcuts]]
In order to make a ''shortcut'' editable through the <<.controlpanel-tab KeyboardShortcuts>> Tab in the $:/ControlPanel it's sufficient to create a tiddler `$:/config/ShortcutInfo/my-shortcut`, where the ''suffix'' is the ''reference'' used for the [[Keyboard Shortcut|KeyboardShortcuts]]
@@ -6,6 +6,8 @@ type: text/vnd.tiddlywiki
~WikiText is a concise, expressive way of typing a wide range of text formatting, hypertext and interactive features. It allows you to focus on writing without a complex user interface getting in the way. It is designed to be familiar for users of [[MarkDown|http://daringfireball.net/projects/markdown/]], but with more of a focus on linking and the interactive features.
~WikiText can also be inserted to the text field using the [[Editor toolbar]].
See [[Formatting text in TiddlyWiki]] for an introduction to WikiText.
The following elements of WikiText syntax are built into the core:
@@ -0,0 +1,47 @@
title: Keyboard Shortcut Descriptor
tags: Definitions
`Keyboard Shortcut Descriptors` are used by the [[KeyboardWidget]] and within Tiddlers tagged <<tag-pill $:/tags/KeyboardShortcut>> to link actions with a keyboard combination
A `Keyboard Shortcut Descriptor` has the following format:
```
ctrl+enter
ctrl+shift+alt+A
alt-shift-T
alt-Space
```
It can have multiple Key combinations:
```
ctrl+enter alt+shift+A ctrl+alt+9 alt-Space ctrl-Backspace
```
There are ''two ways'' Keyboard Shortcut Descriptors can be used:
* directly
** passing the attribute `key="ctrl-enter"` to the KeyboardWidget
** setting `ctrl-enter` as the ''value'' of the `key` ''field'' in a Tiddler tagged <<tag-pill $:/tags/KeyboardShortcut>>
* with a ''reference'' to a configuration Tiddler
** A ''configuration Tiddler'' for Keyboard Shortcuts follows some naming rules:
*** The title starts with `$:/config/`
*** Followed by either the string `shortcuts` or one of the following ''platform descriptors'':
**** <<.tid shortcuts-linux>>
**** <<.tid shortcuts-not-linux>>
**** <<.tid shortcuts-mac>>
**** <<.tid shortcuts-not-mac>>
**** <<.tid shortcuts-windows>>
**** <<.tid shortcuts-not-windows>>
*** The title ends with another `/` followed by a suffix that can be chosen freely
**** This suffix is the ''identifier'' for the `Keyboard Shortcut Descriptor` (A)
** The ''reference'' to the configuration Tiddler is made of `((` + the ''identifier'' (A) + `))`
*** Example: `((my-shortcut))` is the ''reference'' to these configuration Tiddlers:
**** <<.tid $:/config/shortcuts/my-shortcut>>
**** <<.tid $:/config/shortcuts-linux/my-shortcut>>
**** <<.tid $:/config/shortcuts-not-linux/my-shortcut>>
**** <<.tid $:/config/shortcuts-mac/my-shortcut>>
**** <<.tid $:/config/shortcuts-not-mac/my-shortcut>>
**** <<.tid $:/config/shortcuts-windows/my-shortcut>>
**** <<.tid $:/config/shortcuts-not-windows/my-shortcut>>
** Finally, the referenced configuration Tiddler stores the Keyboard Shortcut Descriptor in its ''text'' field
@@ -1,5 +1,5 @@
created: 20140126125259638
modified: 20171113161541234
modified: 20171118195316103
tags: Definitions Platforms
title: TiddlyDesktop
type: text/vnd.tiddlywiki
@@ -16,4 +16,4 @@ TiddlyDesktop is based on the OpenSource project [[NW.js]]. The source is on Git
https://github.com/Jermolene/TiddlyDesktop/
See [[TiddlyDesktop Releases]]
See [[TiddlyDesktop Releases]] and [[How to Customize TiddlyDesktop]]

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