diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 75c3bb8d3..ed16d707d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -10,12 +10,12 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v1
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
- run: "./bin/ci-test.sh"
- - uses: actions/upload-artifact@v3
+ - uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
@@ -30,8 +30,8 @@ jobs:
TW5_BUILD_MAIN_EDITION: "./editions/prerelease"
TW5_BUILD_OUTPUT: "./output/prerelease"
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v1
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
- run: "./bin/ci-pre-build.sh"
@@ -62,8 +62,8 @@ jobs:
TW5_BUILD_OUTPUT: "./output"
TW5_BUILD_ARCHIVE: "./output"
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v1
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
- run: "./bin/ci-pre-build.sh"
diff --git a/.github/workflows/pr-check-build-size.yml b/.github/workflows/pr-check-build-size.yml
new file mode 100644
index 000000000..77450a71f
--- /dev/null
+++ b/.github/workflows/pr-check-build-size.yml
@@ -0,0 +1,50 @@
+name: Calculate PR build size
+on:
+ pull_request_target:
+ types: [opened, reopened, synchronize]
+
+jobs:
+ calculate-build-size:
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: read
+ contents: read
+ outputs:
+ pr_size: ${{ steps.get_sizes.outputs.pr_size }}
+ base_size: ${{ steps.get_sizes.outputs.base_size }}
+ steps:
+ - name: build-size-check
+ id: get_sizes
+ uses: TiddlyWiki/cerebrus@v4
+ with:
+ pr_number: ${{ github.event.pull_request.number }}
+ repo: ${{ github.repository }}
+ base_ref: ${{ github.base_ref }}
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ mode: size:calc
+
+ dispatch-followup:
+ needs: calculate-build-size
+ runs-on: ubuntu-latest
+ permissions:
+ actions: write # Required to dispatch another workflow
+ pull-requests: write
+ contents: read
+ steps:
+ - name: Trigger follow-up workflow
+ uses: actions/github-script@v6
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ await github.rest.actions.createWorkflowDispatch({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ workflow_id: 'pr-comment-build-size.yml',
+ ref: 'master',
+ inputs: {
+ pr_number: '${{ github.event.pull_request.number }}',
+ base_ref: '${{ github.event.pull_request.base.ref }}',
+ pr_size: '${{ needs.calculate-build-size.outputs.pr_size }}',
+ base_size: '${{ needs.calculate-build-size.outputs.base_size }}'
+ }
+ });
\ No newline at end of file
diff --git a/.github/workflows/pr-comment-build-size.yml b/.github/workflows/pr-comment-build-size.yml
new file mode 100644
index 000000000..8421d99c8
--- /dev/null
+++ b/.github/workflows/pr-comment-build-size.yml
@@ -0,0 +1,36 @@
+name: Comment on PR build size (Trusted workflow)
+
+on:
+ workflow_dispatch:
+ inputs:
+ pr_number:
+ required: true
+ type: string
+ base_ref:
+ required: true
+ type: string
+ pr_size:
+ required: true
+ type: string
+ base_size:
+ required: true
+ type: string
+
+jobs:
+ comment-on-pr:
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
+ contents: read
+
+ steps:
+ - name: Build and check size
+ uses: TiddlyWiki/cerebrus@v4
+ with:
+ pr_number: ${{ inputs.pr_number }}
+ repo: ${{ github.repository }}
+ base_ref: ${{ inputs.base_ref }}
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ mode: size:comment
+ pr_size: ${{ inputs.pr_size }}
+ base_size: ${{ inputs.base_size }}
diff --git a/.github/workflows/pr-path-validation.yml b/.github/workflows/pr-path-validation.yml
new file mode 100644
index 000000000..674a9115b
--- /dev/null
+++ b/.github/workflows/pr-path-validation.yml
@@ -0,0 +1,18 @@
+name: Validate PR Paths
+
+on:
+ pull_request_target:
+ types: [opened, reopened, synchronize]
+
+jobs:
+ validate-pr:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Validate PR
+ uses: TiddlyWiki/cerebrus@v4
+ with:
+ pr_number: ${{ github.event.pull_request.number }}
+ repo: ${{ github.repository }}
+ base_ref: ${{ github.base_ref }}
+ github_token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/bin/build-site.sh b/bin/build-site.sh
index f1fe649e7..40b9b447e 100755
--- a/bin/build-site.sh
+++ b/bin/build-site.sh
@@ -5,7 +5,7 @@
# Default to the current version number for building the plugin library
if [ -z "$TW5_BUILD_VERSION" ]; then
- TW5_BUILD_VERSION=v5.3.6
+ TW5_BUILD_VERSION=v5.3.7
fi
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"
@@ -105,6 +105,7 @@ node $TW5_BUILD_TIDDLYWIKI \
fi
# /index.html Main site
+# /external-(version).html External core version of main site
# /favicon.ico Favicon for main site
# /static.html Static rendering of default tiddlers
# /alltiddlers.html Static rendering of all tiddlers
@@ -117,7 +118,7 @@ node $TW5_BUILD_TIDDLYWIKI \
--version \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
- --build favicon static index \
+ --build favicon static index external-js \
|| exit 1
# /empty.html Empty
@@ -155,7 +156,7 @@ node $TW5_BUILD_TIDDLYWIKI \
node $TW5_BUILD_TIDDLYWIKI \
./editions/tour \
--output $TW5_BUILD_OUTPUT \
- --rendertiddler $:/core/save/all tour.html text/plain \
+ --rendertiddler $:/core/save/all-external-js tour.html text/plain \
|| exit 1
# /share.html Custom edition for sharing via the URL
@@ -194,7 +195,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/xlsx-utils \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT/editions/xlsx-utils/ \
- --build index \
+ --build external \
|| exit 1
# /editions/resumebuilder/index.html Resume builder edition
@@ -210,7 +211,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/text-slicer \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT/editions/text-slicer/ \
- --build index \
+ --build external \
|| exit 1
# /editions/translators/index.html Translators edition
@@ -242,7 +243,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/tw5.com-docs \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT/editions/tw5.com-docs/ \
- --build index \
+ --build external \
|| exit 1
# /editions/twitter-archivist/index.html Twitter Archivist edition
@@ -265,7 +266,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/innerwikidemo \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
- --rendertiddler $:/core/save/all plugins/tiddlywiki/innerwiki/index.html text/plain \
+ --rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/innerwiki/index.html text/plain \
|| exit 1
# /plugins/tiddlywiki/dynaview/index.html Demo wiki with DynaView plugin
@@ -275,7 +276,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/dynaviewdemo \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
- --rendertiddler $:/core/save/all plugins/tiddlywiki/dynaview/index.html text/plain \
+ --rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/dynaview/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/dynaview/empty.html text/plain \
|| exit 1
@@ -289,7 +290,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/katexdemo \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
- --rendertiddler $:/core/save/all plugins/tiddlywiki/katex/index.html text/plain \
+ --rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/katex/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/katex/empty.html text/plain \
|| exit 1
@@ -319,7 +320,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/codemirrordemo \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
- --rendertiddler $:/core/save/all plugins/tiddlywiki/codemirror/index.html text/plain \
+ --rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/codemirror/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/codemirror/empty.html text/plain \
|| exit 1
@@ -329,7 +330,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/markdowndemo \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
- --rendertiddler $:/core/save/all plugins/tiddlywiki/markdown/index.html text/plain \
+ --rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/markdown/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/markdown/empty.html text/plain \
|| exit 1
@@ -339,7 +340,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/classicparserdemo \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
- --rendertiddler $:/core/save/all plugins/tiddlywiki/tw2parser/index.html text/plain \
+ --rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/tw2parser/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/tw2parser/empty.html text/plain \
|| exit 1
@@ -349,7 +350,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/highlightdemo \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
- --rendertiddler $:/core/save/all plugins/tiddlywiki/highlight/index.html text/plain \
+ --rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/highlight/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/highlight/empty.html text/plain \
|| exit 1
@@ -359,7 +360,7 @@ node $TW5_BUILD_TIDDLYWIKI \
./editions/geospatialdemo \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
- --rendertiddler $:/core/save/all plugins/tiddlywiki/geospatial/index.html text/plain \
+ --rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/geospatial/index.html text/plain \
--rendertiddler $:/core/save/empty plugins/tiddlywiki/geospatial/empty.html text/plain \
|| exit 1
diff --git a/boot/boot.js b/boot/boot.js
index b4bdc00f2..20a639731 100644
--- a/boot/boot.js
+++ b/boot/boot.js
@@ -232,10 +232,10 @@ $tw.utils.error = function(err) {
var link = dm("a"),
text = JSON.stringify(tiddlers);
if(Blob !== undefined) {
- var blob = new Blob([text], {type: "text/html"});
+ var blob = new Blob([text], {type: "application/json"});
link.setAttribute("href", URL.createObjectURL(blob));
} else {
- link.setAttribute("href","data:text/html," + encodeURIComponent(text));
+ link.setAttribute("href","data:application/json," + encodeURIComponent(text));
}
link.setAttribute("download","emergency-tiddlers-" + (new Date()) + ".json");
document.body.appendChild(link);
@@ -1470,17 +1470,15 @@ $tw.Wiki = function(options) {
// Unpack the currently registered plugins, creating shadow tiddlers for their constituent tiddlers
this.unpackPluginTiddlers = function() {
var self = this;
- // Sort the plugin titles by the `plugin-priority` field
- pluginTiddlers.sort(function(a,b) {
- if("plugin-priority" in a.fields && "plugin-priority" in b.fields) {
- return a.fields["plugin-priority"] - b.fields["plugin-priority"];
- } else if("plugin-priority" in a.fields) {
+ // Sort the plugin titles by the `plugin-priority` field, if this field is missing, default to 1
+ pluginTiddlers.sort(function(a, b) {
+ var priorityA = "plugin-priority" in a.fields ? a.fields["plugin-priority"] : 1;
+ var priorityB = "plugin-priority" in b.fields ? b.fields["plugin-priority"] : 1;
+ if (priorityA !== priorityB) {
+ return priorityA - priorityB;
+ } else if (a.fields.title < b.fields.title) {
return -1;
- } else if("plugin-priority" in b.fields) {
- return +1;
- } else if(a.fields.title < b.fields.title) {
- return -1;
- } else if(a.fields.title === b.fields.title) {
+ } else if (a.fields.title === b.fields.title) {
return 0;
} else {
return +1;
@@ -1904,8 +1902,16 @@ $tw.loadTiddlersFromFile = function(filepath,fields) {
extensionInfo = $tw.utils.getFileExtensionInfo(ext),
type = extensionInfo ? extensionInfo.type : null,
typeInfo = type ? $tw.config.contentTypeInfo[type] : null,
- data = fs.readFileSync(filepath,typeInfo ? typeInfo.encoding : "utf8"),
- tiddlers = $tw.wiki.deserializeTiddlers(ext,data,fields),
+ fileSize = fs.statSync(filepath).size,
+ data;
+ if(fileSize > $tw.config.maxEditFileSize) {
+ data = "File " + filepath + "not loaded because it is too large";
+ console.log("Warning: " + data);
+ ext = ".txt";
+ } else {
+ data = fs.readFileSync(filepath,typeInfo ? typeInfo.encoding : "utf8");
+ }
+ var tiddlers = $tw.wiki.deserializeTiddlers(ext,data,fields),
metadata = $tw.loadMetadataForFile(filepath);
if(metadata) {
if(type === "application/json") {
@@ -1994,7 +2000,7 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) {
var value = tiddler[name];
switch(fieldInfo.source) {
case "subdirectories":
- value = path.relative(rootPath, filename).split(path.sep).slice(0, -1);
+ value = $tw.utils.stringifyList(path.relative(rootPath, filename).split(path.sep).slice(0, -1));
break;
case "filepath":
value = path.relative(rootPath, filename).split(path.sep).join('/');
@@ -2015,10 +2021,10 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) {
value = path.extname(filename);
break;
case "created":
- value = new Date(fs.statSync(pathname).birthtime);
+ value = $tw.utils.stringifyDate(new Date(fs.statSync(pathname).birthtime));
break;
case "modified":
- value = new Date(fs.statSync(pathname).mtime);
+ value = $tw.utils.stringifyDate(new Date(fs.statSync(pathname).mtime));
break;
}
if(fieldInfo.prefix) {
@@ -2465,13 +2471,15 @@ $tw.boot.initStartup = function(options) {
$tw.utils.registerFileType("image/webp","base64",".webp",{flags:["image"]});
$tw.utils.registerFileType("image/heic","base64",".heic",{flags:["image"]});
$tw.utils.registerFileType("image/heif","base64",".heif",{flags:["image"]});
+ $tw.utils.registerFileType("image/avif","base64",".avif",{flags:["image"]});
$tw.utils.registerFileType("image/svg+xml","utf8",".svg",{flags:["image"]});
$tw.utils.registerFileType("image/vnd.microsoft.icon","base64",".ico",{flags:["image"]});
$tw.utils.registerFileType("image/x-icon","base64",".ico",{flags:["image"]});
$tw.utils.registerFileType("application/wasm","base64",".wasm");
- $tw.utils.registerFileType("application/font-woff","base64",".woff");
- $tw.utils.registerFileType("application/x-font-ttf","base64",".woff");
- $tw.utils.registerFileType("application/font-woff2","base64",".woff2");
+ $tw.utils.registerFileType("font/woff","base64",".woff");
+ $tw.utils.registerFileType("font/woff2","base64",".woff2");
+ $tw.utils.registerFileType("font/ttf","base64",".ttf");
+ $tw.utils.registerFileType("font/otf","base64",".otf");
$tw.utils.registerFileType("audio/ogg","base64",".ogg");
$tw.utils.registerFileType("audio/mp4","base64",[".mp4",".m4a"]);
$tw.utils.registerFileType("video/ogg","base64",[".ogm",".ogv",".ogg"]);
diff --git a/boot/bootprefix.js b/boot/bootprefix.js
index 4dae1b28f..92785d823 100644
--- a/boot/bootprefix.js
+++ b/boot/bootprefix.js
@@ -19,6 +19,10 @@ var _bootprefix = (function($tw) {
$tw = $tw || Object.create(null);
$tw.boot = $tw.boot || Object.create(null);
+// Config
+$tw.config = $tw.config || Object.create(null);
+$tw.config.maxEditFileSize = 100 * 1024 * 1024; // 100MB
+
// Detect platforms
if(!("browser" in $tw)) {
$tw.browser = typeof(window) !== "undefined" && typeof(document) !== "undefined" ? {} : null;
diff --git a/core/acknowledgements.tid b/core/acknowledgements.tid
index cb54e3d23..e1015e2c9 100644
--- a/core/acknowledgements.tid
+++ b/core/acknowledgements.tid
@@ -5,7 +5,3 @@ TiddlyWiki incorporates code from these fine OpenSource projects:
* [[The Stanford Javascript Crypto Library|http://bitwiseshiftleft.github.io/sjcl/]]
* [[The Jasmine JavaScript Test Framework|https://jasmine.github.io/]]
* [[Normalize.css by Nicolas Gallagher|http://necolas.github.io/normalize.css/]]
-
-And media from these projects:
-
-* World flag icons from [[Wikipedia|http://commons.wikimedia.org/wiki/Category:SVG_flags_by_country]]
diff --git a/core/copyright.tid b/core/copyright.tid
index 3f52380cc..233295ce2 100644
--- a/core/copyright.tid
+++ b/core/copyright.tid
@@ -4,7 +4,7 @@ type: text/plain
TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)
Copyright (c) 2004-2007, Jeremy Ruston
-Copyright (c) 2007-2024, UnaMesa Association
+Copyright (c) 2007-2025, UnaMesa Association
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/core/images/language.tid b/core/images/language.tid
new file mode 100644
index 000000000..bb4061495
--- /dev/null
+++ b/core/images/language.tid
@@ -0,0 +1,5 @@
+title: $:/core/images/language
+tags: $:/tags/Image
+
+\parameters (size:"22pt")
+
\ No newline at end of file
diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids
index 2c41f215e..129dab0b4 100644
--- a/core/language/en-GB/ControlPanel.multids
+++ b/core/language/en-GB/ControlPanel.multids
@@ -206,10 +206,10 @@ Settings/MissingLinks/Hint: Choose whether to link to tiddlers that do not exist
Settings/MissingLinks/Description: Enable links to missing tiddlers
SocialCard/Caption: Social Media Card
SocialCard/Domain/Prompt: Domain name to display for the link (for example, ''tiddlywiki.com'')
-SocialCard/Hint: This information is used by social and messaging services to display a preview card for links to this TiddlyWiki when hosted online
-SocialCard/PreviewUrl/Prompt: Full URL to preview image for this TiddlyWiki
+SocialCard/Hint: This information is used by social and messaging services to display a preview card for links to this ~TiddlyWiki when hosted online
+SocialCard/PreviewUrl/Prompt: Full URL to preview image for this ~TiddlyWiki
SocialCard/PreviewUrl/Preview: Preview image:
-SocialCard/Url/Prompt: Full URL of this TiddlyWiki
+SocialCard/Url/Prompt: Full URL of this ~TiddlyWiki
StoryTiddler/Caption: Story Tiddler
StoryTiddler/Hint: This rule cascade is used to dynamically choose the template for displaying a tiddler in the story river.
StoryView/Caption: Story View
diff --git a/core/language/en-GB/Fields.multids b/core/language/en-GB/Fields.multids
index 9830e96c1..61835821a 100644
--- a/core/language/en-GB/Fields.multids
+++ b/core/language/en-GB/Fields.multids
@@ -4,12 +4,12 @@ _canonical_uri: The full URI of an external image tiddler
author: Name of the author of a plugin
bag: The name of the bag from which a tiddler came
caption: The text to be displayed on a tab or button
-class: The CSS class applied to a tiddler when rendering it - see [[Custom styles by user-class]]. Also used for [[Modals]]
+class: The CSS class applied to a tiddler when rendering it. Also used for Modals
code-body: The view template will display the tiddler as code if set to ''yes''
color: The CSS color value associated with a tiddler
-component: The name of the component responsible for an [[alert tiddler|AlertMechanism]]
+component: The name of the component responsible for an alert tiddler
core-version: For a plugin, indicates what version of TiddlyWiki with which it is compatible
-current-tiddler: Used to cache the top tiddler in a [[history list|HistoryMechanism]]
+current-tiddler: Used to cache the top tiddler in a history list
created: The date a tiddler was created
creator: The name of the person who created a tiddler
dependents: For a plugin, lists the dependent plugin titles
diff --git a/core/language/en-GB/icon.tid b/core/language/en-GB/icon.tid
deleted file mode 100644
index 1967b895f..000000000
--- a/core/language/en-GB/icon.tid
+++ /dev/null
@@ -1,13 +0,0 @@
-title: $:/languages/en-GB/icon
-type: image/svg+xml
-
-
diff --git a/core/modules/commander.js b/core/modules/commander.js
index b55679a2e..b73e39b0f 100644
--- a/core/modules/commander.js
+++ b/core/modules/commander.js
@@ -6,10 +6,7 @@ module-type: global
The $tw.Commander class is a command interpreter
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -173,5 +170,3 @@ Commander.initCommands = function(moduleType) {
};
exports.Commander = Commander;
-
-})();
diff --git a/core/modules/commands/build.js b/core/modules/commands/build.js
index 60456372d..cbb7663f1 100644
--- a/core/modules/commands/build.js
+++ b/core/modules/commands/build.js
@@ -6,10 +6,7 @@ module-type: command
Command to build a build target
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -48,5 +45,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/clearpassword.js b/core/modules/commands/clearpassword.js
index 9f714a3ef..915c60d23 100644
--- a/core/modules/commands/clearpassword.js
+++ b/core/modules/commands/clearpassword.js
@@ -6,10 +6,7 @@ module-type: command
Clear password for crypto operations
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -29,5 +26,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/commands.js b/core/modules/commands/commands.js
index 813f19064..ddaa387db 100644
--- a/core/modules/commands/commands.js
+++ b/core/modules/commands/commands.js
@@ -7,10 +7,6 @@ Runs the commands returned from a filter
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -38,5 +34,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/deletetiddlers.js b/core/modules/commands/deletetiddlers.js
index 3d8b855d9..797a6428a 100644
--- a/core/modules/commands/deletetiddlers.js
+++ b/core/modules/commands/deletetiddlers.js
@@ -6,10 +6,7 @@ module-type: command
Command to delete tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -38,5 +35,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/editions.js b/core/modules/commands/editions.js
index cc802b9f5..c46489d09 100644
--- a/core/modules/commands/editions.js
+++ b/core/modules/commands/editions.js
@@ -6,10 +6,7 @@ module-type: command
Command to list the available editions
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -35,5 +32,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/fetch.js b/core/modules/commands/fetch.js
index 07cda691c..be076eb3c 100644
--- a/core/modules/commands/fetch.js
+++ b/core/modules/commands/fetch.js
@@ -6,10 +6,7 @@ module-type: command
Commands to fetch external tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -171,5 +168,3 @@ Command.prototype.processBody = function(body,type,options,url) {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/help.js b/core/modules/commands/help.js
index 90c190829..861c8f6d8 100644
--- a/core/modules/commands/help.js
+++ b/core/modules/commands/help.js
@@ -6,10 +6,7 @@ module-type: command
Help command
\*/
-(function(){
-/*jshint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -37,5 +34,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/import.js b/core/modules/commands/import.js
index 9465c3da1..7c7b6740d 100644
--- a/core/modules/commands/import.js
+++ b/core/modules/commands/import.js
@@ -6,10 +6,7 @@ module-type: command
Command to import tiddlers from a file
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -44,5 +41,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/init.js b/core/modules/commands/init.js
index 2d053ae3c..ed48a5494 100644
--- a/core/modules/commands/init.js
+++ b/core/modules/commands/init.js
@@ -6,10 +6,7 @@ module-type: command
Command to initialise an empty wiki folder
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -55,5 +52,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/listen.js b/core/modules/commands/listen.js
index ca6e6e076..80cb18293 100644
--- a/core/modules/commands/listen.js
+++ b/core/modules/commands/listen.js
@@ -6,10 +6,7 @@ module-type: command
Listen for HTTP requests and serve tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Server = require("$:/core/modules/server/server.js").Server;
@@ -44,5 +41,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/load.js b/core/modules/commands/load.js
index 8fd9cba10..e19ecd59a 100644
--- a/core/modules/commands/load.js
+++ b/core/modules/commands/load.js
@@ -6,10 +6,7 @@ module-type: command
Command to load tiddlers from a file or directory
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -47,5 +44,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/makelibrary.js b/core/modules/commands/makelibrary.js
index 3af2e4943..b8ad2e5b6 100644
--- a/core/modules/commands/makelibrary.js
+++ b/core/modules/commands/makelibrary.js
@@ -6,10 +6,7 @@ module-type: command
Command to pack all of the plugins in the library into a plugin tiddler of type "library"
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -41,5 +38,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/output.js b/core/modules/commands/output.js
index 0532f58d7..d43eb2596 100644
--- a/core/modules/commands/output.js
+++ b/core/modules/commands/output.js
@@ -6,10 +6,7 @@ module-type: command
Command to set the default output location (defaults to current working directory)
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -34,5 +31,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/password.js b/core/modules/commands/password.js
index 85d53fa33..27139a9ed 100644
--- a/core/modules/commands/password.js
+++ b/core/modules/commands/password.js
@@ -6,10 +6,7 @@ module-type: command
Save password for crypto operations
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -32,5 +29,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/render.js b/core/modules/commands/render.js
index bd8b23171..c85feda92 100644
--- a/core/modules/commands/render.js
+++ b/core/modules/commands/render.js
@@ -6,10 +6,7 @@ module-type: command
Render individual tiddlers and save the results to the specified files
\*/
-(function(){
- /*jslint node: true, browser: true */
- /*global $tw: false */
"use strict";
var widget = require("$:/core/modules/widgets/widget.js");
@@ -66,6 +63,3 @@ Render individual tiddlers and save the results to the specified files
};
exports.Command = Command;
-
- })();
-
\ No newline at end of file
diff --git a/core/modules/commands/rendertiddler.js b/core/modules/commands/rendertiddler.js
index 41812aea1..2a996c8c1 100755
--- a/core/modules/commands/rendertiddler.js
+++ b/core/modules/commands/rendertiddler.js
@@ -6,10 +6,7 @@ module-type: command
Command to render a tiddler and save it to a file
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -53,5 +50,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/rendertiddlers.js b/core/modules/commands/rendertiddlers.js
index 78272cc33..f392ba704 100644
--- a/core/modules/commands/rendertiddlers.js
+++ b/core/modules/commands/rendertiddlers.js
@@ -6,10 +6,7 @@ module-type: command
Command to render several tiddlers to a folder of files
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var widget = require("$:/core/modules/widgets/widget.js");
@@ -65,5 +62,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/save.js b/core/modules/commands/save.js
index 3cb7ef08c..1d9155623 100644
--- a/core/modules/commands/save.js
+++ b/core/modules/commands/save.js
@@ -6,10 +6,7 @@ module-type: command
Saves individual tiddlers in their raw text or binary format to the specified files
\*/
-(function(){
- /*jslint node: true, browser: true */
- /*global $tw: false */
"use strict";
exports.info = {
@@ -64,6 +61,3 @@ Saves individual tiddlers in their raw text or binary format to the specified fi
};
exports.Command = Command;
-
- })();
-
\ No newline at end of file
diff --git a/core/modules/commands/savelibrarytiddlers.js b/core/modules/commands/savelibrarytiddlers.js
index af42d7c8a..431960edd 100644
--- a/core/modules/commands/savelibrarytiddlers.js
+++ b/core/modules/commands/savelibrarytiddlers.js
@@ -16,10 +16,7 @@ The pathname specifies the pathname to the folder in which the JSON files should
The skinnylisting specifies the title of the tiddler to which a JSON catalogue of the subtiddlers will be saved. The JSON file contains the same data as the bundle tiddler but with the `text` field removed.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -94,5 +91,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/savetiddler.js b/core/modules/commands/savetiddler.js
index efc484ec7..492fe9f12 100644
--- a/core/modules/commands/savetiddler.js
+++ b/core/modules/commands/savetiddler.js
@@ -6,10 +6,7 @@ module-type: command
Command to save the content of a tiddler to a file
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -47,5 +44,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/savetiddlers.js b/core/modules/commands/savetiddlers.js
index 9c750e204..0e15d5edc 100644
--- a/core/modules/commands/savetiddlers.js
+++ b/core/modules/commands/savetiddlers.js
@@ -6,10 +6,7 @@ module-type: command
Command to save several tiddlers to a folder of files
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var widget = require("$:/core/modules/widgets/widget.js");
@@ -52,5 +49,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/savewikifolder.js b/core/modules/commands/savewikifolder.js
index 461ff6f04..751e0e54e 100644
--- a/core/modules/commands/savewikifolder.js
+++ b/core/modules/commands/savewikifolder.js
@@ -15,10 +15,7 @@ The following options are supported:
Supports backward compatibility with --savewikifolder [] [ [=] ]*
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -221,5 +218,3 @@ WikiFolderMaker.prototype.saveFile = function(filename,encoding,data) {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/server.js b/core/modules/commands/server.js
index 507d1281d..d1ee487a2 100644
--- a/core/modules/commands/server.js
+++ b/core/modules/commands/server.js
@@ -6,10 +6,7 @@ module-type: command
Deprecated legacy command for serving tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Server = require("$:/core/modules/server/server.js").Server;
@@ -51,5 +48,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/setfield.js b/core/modules/commands/setfield.js
index 3f8ec1d14..7be8cbdca 100644
--- a/core/modules/commands/setfield.js
+++ b/core/modules/commands/setfield.js
@@ -6,10 +6,7 @@ module-type: command
Command to modify selected tiddlers to set a field to the text of a template tiddler that has been wikified with the selected tiddler as the current tiddler.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var widget = require("$:/core/modules/widgets/widget.js");
@@ -54,5 +51,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/unpackplugin.js b/core/modules/commands/unpackplugin.js
index 6f85c066f..5e2bd33c0 100644
--- a/core/modules/commands/unpackplugin.js
+++ b/core/modules/commands/unpackplugin.js
@@ -6,10 +6,7 @@ module-type: command
Command to extract the shadow tiddlers from within a plugin
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -40,5 +37,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/verbose.js b/core/modules/commands/verbose.js
index 6b0117829..23b5303c7 100644
--- a/core/modules/commands/verbose.js
+++ b/core/modules/commands/verbose.js
@@ -6,10 +6,7 @@ module-type: command
Verbose command
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -30,5 +27,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/commands/version.js b/core/modules/commands/version.js
index 24edc97f7..e14c635de 100644
--- a/core/modules/commands/version.js
+++ b/core/modules/commands/version.js
@@ -6,10 +6,7 @@ module-type: command
Version command
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.info = {
@@ -28,5 +25,3 @@ Command.prototype.execute = function() {
};
exports.Command = Command;
-
-})();
diff --git a/core/modules/config.js b/core/modules/config.js
index fdcf94d0f..3546a21bc 100644
--- a/core/modules/config.js
+++ b/core/modules/config.js
@@ -6,10 +6,7 @@ module-type: config
Core configuration constants
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.preferences = {};
@@ -37,5 +34,3 @@ exports.htmlVoidElements = "area,base,br,col,command,embed,hr,img,input,keygen,l
exports.htmlBlockElements = "address,article,aside,audio,blockquote,canvas,dd,details,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,nav,ol,p,pre,section,summary,table,tfoot,ul,video".split(",");
exports.htmlUnsafeElements = "script".split(",");
-
-})();
diff --git a/core/modules/deserializers.js b/core/modules/deserializers.js
index bff4aaea1..972a41bb0 100644
--- a/core/modules/deserializers.js
+++ b/core/modules/deserializers.js
@@ -6,10 +6,7 @@ module-type: tiddlerdeserializer
Functions to deserialise tiddlers from a block of text
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["application/x-tiddler-html-div"] = function(text,fields) {
@@ -181,5 +178,3 @@ var deserializeTiddlerDiv = function(text /* [,fields] */) {
}
return undefined;
};
-
-})();
diff --git a/core/modules/editor/engines/framed.js b/core/modules/editor/engines/framed.js
index 34d11dec7..9b1c8cd81 100644
--- a/core/modules/editor/engines/framed.js
+++ b/core/modules/editor/engines/framed.js
@@ -6,10 +6,7 @@ module-type: library
Text editor engine based on a simple input or textarea within an iframe. This is done so that the selection is preserved even when clicking away from the textarea
\*/
-(function(){
-/*jslint node: true,browser: true */
-/*global $tw: false */
"use strict";
var HEIGHT_VALUE_TITLE = "$:/config/TextEditor/EditorHeight/Height";
@@ -273,5 +270,3 @@ FramedEngine.prototype.executeTextOperation = function(operation) {
};
exports.FramedEngine = FramedEngine;
-
-})();
diff --git a/core/modules/editor/engines/simple.js b/core/modules/editor/engines/simple.js
index 809dc58ea..93f021522 100644
--- a/core/modules/editor/engines/simple.js
+++ b/core/modules/editor/engines/simple.js
@@ -6,10 +6,7 @@ module-type: library
Text editor engine based on a simple input or textarea tag
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var HEIGHT_VALUE_TITLE = "$:/config/TextEditor/EditorHeight/Height";
@@ -172,5 +169,3 @@ SimpleEngine.prototype.executeTextOperation = function(operation) {
};
exports.SimpleEngine = SimpleEngine;
-
-})();
diff --git a/core/modules/editor/factory.js b/core/modules/editor/factory.js
index 6157ec67f..984cc76ba 100644
--- a/core/modules/editor/factory.js
+++ b/core/modules/editor/factory.js
@@ -6,10 +6,7 @@ module-type: library
Factory for constructing text editor widgets with specified engines for the toolbar and non-toolbar cases
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var DEFAULT_MIN_TEXT_AREA_HEIGHT = "100px"; // Minimum height of textareas in pixels
@@ -386,5 +383,3 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
}
exports.editTextWidgetFactory = editTextWidgetFactory;
-
-})();
diff --git a/core/modules/editor/operations/bitmap/clear.js b/core/modules/editor/operations/bitmap/clear.js
index cb86b43a1..48d5772d5 100644
--- a/core/modules/editor/operations/bitmap/clear.js
+++ b/core/modules/editor/operations/bitmap/clear.js
@@ -6,10 +6,7 @@ module-type: bitmapeditoroperation
Bitmap editor operation to clear the image
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["clear"] = function(event) {
@@ -20,5 +17,3 @@ exports["clear"] = function(event) {
// Save changes
this.strokeEnd();
};
-
-})();
diff --git a/core/modules/editor/operations/bitmap/resize.js b/core/modules/editor/operations/bitmap/resize.js
index 12059a5cb..683cfa11a 100644
--- a/core/modules/editor/operations/bitmap/resize.js
+++ b/core/modules/editor/operations/bitmap/resize.js
@@ -6,10 +6,7 @@ module-type: bitmapeditoroperation
Bitmap editor operation to resize the image
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["resize"] = function(event) {
@@ -25,5 +22,3 @@ exports["resize"] = function(event) {
// Save the image into the tiddler
this.saveChanges();
};
-
-})();
diff --git a/core/modules/editor/operations/bitmap/rotate-left.js b/core/modules/editor/operations/bitmap/rotate-left.js
index 6e1b15d3e..25aa77300 100644
--- a/core/modules/editor/operations/bitmap/rotate-left.js
+++ b/core/modules/editor/operations/bitmap/rotate-left.js
@@ -6,10 +6,7 @@ module-type: bitmapeditoroperation
Bitmap editor operation to rotate the image left by 90 degrees
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["rotate-left"] = function(event) {
@@ -20,5 +17,3 @@ exports["rotate-left"] = function(event) {
// Save the image into the tiddler
this.saveChanges();
};
-
-})();
diff --git a/core/modules/editor/operations/text/excise.js b/core/modules/editor/operations/text/excise.js
index 0753705c5..c0920cf09 100644
--- a/core/modules/editor/operations/text/excise.js
+++ b/core/modules/editor/operations/text/excise.js
@@ -6,10 +6,7 @@ module-type: texteditoroperation
Text editor operation to excise the selection to a new tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
function isMarkdown(mediaType) {
@@ -53,5 +50,3 @@ exports["excise"] = function(event,operation) {
operation.newSelStart = operation.selStart;
operation.newSelEnd = operation.selStart + operation.replacement.length;
};
-
-})();
diff --git a/core/modules/editor/operations/text/focus-editor.js b/core/modules/editor/operations/text/focus-editor.js
index 0b36f731c..19e4a8997 100644
--- a/core/modules/editor/operations/text/focus-editor.js
+++ b/core/modules/editor/operations/text/focus-editor.js
@@ -4,14 +4,9 @@ type: application/javascript
module-type: texteditoroperation
Simply focus the Text editor
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["focus-editor"] = function(event,operation) {
operation = null;
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/editor/operations/text/insert-text.js b/core/modules/editor/operations/text/insert-text.js
index 784714968..0e24d7413 100644
--- a/core/modules/editor/operations/text/insert-text.js
+++ b/core/modules/editor/operations/text/insert-text.js
@@ -6,10 +6,7 @@ module-type: texteditoroperation
Text editor operation insert text at the caret position. If there is a selection it is replaced.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["insert-text"] = function(event,operation) {
@@ -19,5 +16,3 @@ exports["insert-text"] = function(event,operation) {
operation.newSelStart = operation.selStart + operation.replacement.length;
operation.newSelEnd = operation.newSelStart;
};
-
-})();
diff --git a/core/modules/editor/operations/text/make-link.js b/core/modules/editor/operations/text/make-link.js
index e8caf21c5..ca11f34c6 100644
--- a/core/modules/editor/operations/text/make-link.js
+++ b/core/modules/editor/operations/text/make-link.js
@@ -6,10 +6,7 @@ module-type: texteditoroperation
Text editor operation to make a link
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["make-link"] = function(event,operation) {
@@ -25,5 +22,3 @@ exports["make-link"] = function(event,operation) {
operation.newSelStart = operation.selStart + operation.replacement.length;
operation.newSelEnd = operation.newSelStart;
};
-
-})();
diff --git a/core/modules/editor/operations/text/prefix-lines.js b/core/modules/editor/operations/text/prefix-lines.js
index 0a005c96f..0f3412b67 100644
--- a/core/modules/editor/operations/text/prefix-lines.js
+++ b/core/modules/editor/operations/text/prefix-lines.js
@@ -6,10 +6,7 @@ module-type: texteditoroperation
Text editor operation to add a prefix to the selected lines
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["prefix-lines"] = function(event,operation) {
@@ -51,5 +48,3 @@ exports["prefix-lines"] = function(event,operation) {
operation.newSelEnd = operation.newSelStart + operation.replacement.length;
}
};
-
-})();
diff --git a/core/modules/editor/operations/text/replace-all.js b/core/modules/editor/operations/text/replace-all.js
index fc1541935..f6fe0b24c 100644
--- a/core/modules/editor/operations/text/replace-all.js
+++ b/core/modules/editor/operations/text/replace-all.js
@@ -6,10 +6,7 @@ module-type: texteditoroperation
Text editor operation to replace the entire text
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["replace-all"] = function(event,operation) {
@@ -19,5 +16,3 @@ exports["replace-all"] = function(event,operation) {
operation.newSelStart = 0;
operation.newSelEnd = operation.replacement.length;
};
-
-})();
diff --git a/core/modules/editor/operations/text/replace-selection.js b/core/modules/editor/operations/text/replace-selection.js
index 740a41fb1..24ef9c70f 100644
--- a/core/modules/editor/operations/text/replace-selection.js
+++ b/core/modules/editor/operations/text/replace-selection.js
@@ -6,10 +6,7 @@ module-type: texteditoroperation
Text editor operation to replace the selection
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["replace-selection"] = function(event,operation) {
@@ -19,5 +16,3 @@ exports["replace-selection"] = function(event,operation) {
operation.newSelStart = operation.selStart;
operation.newSelEnd = operation.selStart + operation.replacement.length;
};
-
-})();
diff --git a/core/modules/editor/operations/text/save-selection.js b/core/modules/editor/operations/text/save-selection.js
index 484e6ff3c..00b7174b6 100644
--- a/core/modules/editor/operations/text/save-selection.js
+++ b/core/modules/editor/operations/text/save-selection.js
@@ -6,10 +6,7 @@ module-type: texteditoroperation
Text editor operation to save the current selection in a specified tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["save-selection"] = function(event,operation) {
@@ -19,5 +16,3 @@ exports["save-selection"] = function(event,operation) {
this.wiki.setText(tiddler,field,null,operation.text.substring(operation.selStart,operation.selEnd));
}
};
-
-})();
diff --git a/core/modules/editor/operations/text/wrap-lines.js b/core/modules/editor/operations/text/wrap-lines.js
index 2e4f22943..9e85d50ca 100644
--- a/core/modules/editor/operations/text/wrap-lines.js
+++ b/core/modules/editor/operations/text/wrap-lines.js
@@ -6,10 +6,7 @@ module-type: texteditoroperation
Text editor operation to wrap the selected lines with a prefix and suffix
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["wrap-lines"] = function(event,operation) {
@@ -43,5 +40,3 @@ exports["wrap-lines"] = function(event,operation) {
operation.newSelEnd = operation.newSelStart + (operation.cutEnd - operation.cutStart);
}
};
-
-})();
diff --git a/core/modules/editor/operations/text/wrap-selection.js b/core/modules/editor/operations/text/wrap-selection.js
index 665d72eb4..4fb463b74 100644
--- a/core/modules/editor/operations/text/wrap-selection.js
+++ b/core/modules/editor/operations/text/wrap-selection.js
@@ -6,10 +6,7 @@ module-type: texteditoroperation
Text editor operation to wrap the selection with the specified prefix and suffix
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["wrap-selection"] = function(event,operation) {
@@ -134,5 +131,3 @@ exports["wrap-selection"] = function(event,operation) {
addPrefixSuffix();
}
};
-
-})();
diff --git a/core/modules/filterrunprefixes/all.js b/core/modules/filterrunprefixes/all.js
index 652936de0..7d57ce408 100644
--- a/core/modules/filterrunprefixes/all.js
+++ b/core/modules/filterrunprefixes/all.js
@@ -7,10 +7,7 @@ Union of sets without de-duplication.
Equivalent to = filter run prefix.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -21,5 +18,3 @@ exports.all = function(operationSubFunction) {
results.push.apply(results, operationSubFunction(source,widget));
};
};
-
-})();
diff --git a/core/modules/filterrunprefixes/and.js b/core/modules/filterrunprefixes/and.js
index 309c228e6..c394b243e 100644
--- a/core/modules/filterrunprefixes/and.js
+++ b/core/modules/filterrunprefixes/and.js
@@ -7,10 +7,7 @@ Intersection of sets.
Equivalent to + filter run prefix.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -24,5 +21,3 @@ exports.and = function(operationSubFunction,options) {
results.pushTop(operationSubFunction(source,widget));
};
};
-
-})();
diff --git a/core/modules/filterrunprefixes/cascade.js b/core/modules/filterrunprefixes/cascade.js
index 486e75f45..98044579c 100644
--- a/core/modules/filterrunprefixes/cascade.js
+++ b/core/modules/filterrunprefixes/cascade.js
@@ -3,10 +3,7 @@ title: $:/core/modules/filterrunprefixes/cascade.js
type: application/javascript
module-type: filterrunprefix
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -39,5 +36,3 @@ exports.cascade = function(operationSubFunction,options) {
}
}
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/filterrunprefixes/else.js b/core/modules/filterrunprefixes/else.js
index 6e9ef29b3..89635069c 100644
--- a/core/modules/filterrunprefixes/else.js
+++ b/core/modules/filterrunprefixes/else.js
@@ -6,10 +6,7 @@ module-type: filterrunprefix
Equivalent to ~ filter run prefix.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -23,5 +20,3 @@ exports.else = function(operationSubFunction) {
}
};
};
-
-})();
diff --git a/core/modules/filterrunprefixes/except.js b/core/modules/filterrunprefixes/except.js
index 659f14228..5ebed7fea 100644
--- a/core/modules/filterrunprefixes/except.js
+++ b/core/modules/filterrunprefixes/except.js
@@ -7,10 +7,7 @@ Difference of sets.
Equivalent to - filter run prefix.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -21,5 +18,3 @@ exports.except = function(operationSubFunction) {
results.remove(operationSubFunction(source,widget));
};
};
-
-})();
diff --git a/core/modules/filterrunprefixes/filter.js b/core/modules/filterrunprefixes/filter.js
index 4ab057109..0c6ed150f 100644
--- a/core/modules/filterrunprefixes/filter.js
+++ b/core/modules/filterrunprefixes/filter.js
@@ -4,10 +4,7 @@ type: application/javascript
module-type: filterrunprefix
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -35,5 +32,3 @@ exports.filter = function(operationSubFunction,options) {
}
}
};
-
-})();
diff --git a/core/modules/filterrunprefixes/intersection.js b/core/modules/filterrunprefixes/intersection.js
index 34d36066f..ce9ea4546 100644
--- a/core/modules/filterrunprefixes/intersection.js
+++ b/core/modules/filterrunprefixes/intersection.js
@@ -4,10 +4,7 @@ type: application/javascript
module-type: filterrunprefix
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -27,5 +24,3 @@ exports.intersection = function(operationSubFunction) {
}
};
};
-
-})();
diff --git a/core/modules/filterrunprefixes/map.js b/core/modules/filterrunprefixes/map.js
index b756d6699..c7f1ae5eb 100644
--- a/core/modules/filterrunprefixes/map.js
+++ b/core/modules/filterrunprefixes/map.js
@@ -3,10 +3,7 @@ title: $:/core/modules/filterrunprefixes/map.js
type: application/javascript
module-type: filterrunprefix
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -40,5 +37,3 @@ exports.map = function(operationSubFunction,options) {
}
}
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/filterrunprefixes/or.js b/core/modules/filterrunprefixes/or.js
index 82eff083a..c4ffb2014 100644
--- a/core/modules/filterrunprefixes/or.js
+++ b/core/modules/filterrunprefixes/or.js
@@ -6,10 +6,7 @@ module-type: filterrunprefix
Equivalent to a filter run with no prefix.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -20,5 +17,3 @@ exports.or = function(operationSubFunction) {
results.pushTop(operationSubFunction(source,widget));
};
};
-
-})();
diff --git a/core/modules/filterrunprefixes/reduce.js b/core/modules/filterrunprefixes/reduce.js
index ee2998837..351d976bd 100644
--- a/core/modules/filterrunprefixes/reduce.js
+++ b/core/modules/filterrunprefixes/reduce.js
@@ -3,10 +3,7 @@ title: $:/core/modules/filterrunprefixes/reduce.js
type: application/javascript
module-type: filterrunprefix
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -36,5 +33,3 @@ exports.reduce = function(operationSubFunction,options) {
}
}
};
-
-})();
diff --git a/core/modules/filterrunprefixes/sort.js b/core/modules/filterrunprefixes/sort.js
index d8d376126..126376887 100644
--- a/core/modules/filterrunprefixes/sort.js
+++ b/core/modules/filterrunprefixes/sort.js
@@ -4,10 +4,7 @@ type: application/javascript
module-type: filterrunprefix
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -48,5 +45,3 @@ exports.sort = function(operationSubFunction,options) {
}
}
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/filterrunprefixes/then.js b/core/modules/filterrunprefixes/then.js
index 9f6d5c76a..0f37fb37f 100644
--- a/core/modules/filterrunprefixes/then.js
+++ b/core/modules/filterrunprefixes/then.js
@@ -6,10 +6,7 @@ module-type: filterrunprefix
Replace results of previous runs unless empty
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -28,5 +25,3 @@ exports.then = function(operationSubFunction) {
}
};
};
-
-})();
diff --git a/core/modules/filters.js b/core/modules/filters.js
index aa82a352a..321f5a211 100644
--- a/core/modules/filters.js
+++ b/core/modules/filters.js
@@ -6,10 +6,7 @@ module-type: wikimethod
Adds tiddler filtering methods to the $tw.Wiki object.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var widgetClass = require("$:/core/modules/widgets/widget.js").widget;
@@ -367,5 +364,3 @@ exports.compileFilter = function(filterString) {
this.filterCacheCount++;
return fnMeasured;
};
-
-})();
diff --git a/core/modules/filters/addprefix.js b/core/modules/filters/addprefix.js
index d1f0a822b..497af1f3b 100644
--- a/core/modules/filters/addprefix.js
+++ b/core/modules/filters/addprefix.js
@@ -8,10 +8,7 @@ especially useful in contexts where only a filter expression is allowed
and macro substitution isn't available.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -24,5 +21,3 @@ exports.addprefix = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/addsuffix.js b/core/modules/filters/addsuffix.js
index fb80c2573..27ca659e9 100644
--- a/core/modules/filters/addsuffix.js
+++ b/core/modules/filters/addsuffix.js
@@ -8,10 +8,7 @@ especially useful in contexts where only a filter expression is allowed
and macro substitution isn't available.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -24,5 +21,3 @@ exports.addsuffix = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/after.js b/core/modules/filters/after.js
index 6e5f3c77c..9840a73fa 100644
--- a/core/modules/filters/after.js
+++ b/core/modules/filters/after.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning the tiddler from the current list that is after the tiddler named in the operand.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -27,5 +24,3 @@ exports.after = function(source,operator,options) {
return [results[index + 1]];
}
};
-
-})();
diff --git a/core/modules/filters/all.js b/core/modules/filters/all.js
index 3554a74b3..790afeca5 100644
--- a/core/modules/filters/all.js
+++ b/core/modules/filters/all.js
@@ -8,10 +8,7 @@ Filter operator for selecting tiddlers
[all[shadows+tiddlers]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var allFilterOperators;
@@ -54,5 +51,3 @@ exports.all = function(source,operator,options) {
}
return results.makeTiddlerIterator(options.wiki);
};
-
-})();
diff --git a/core/modules/filters/all/current.js b/core/modules/filters/all/current.js
index 82ad8cca3..098fa85f0 100644
--- a/core/modules/filters/all/current.js
+++ b/core/modules/filters/all/current.js
@@ -6,10 +6,7 @@ module-type: allfilteroperator
Filter function for [all[current]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -23,5 +20,3 @@ exports.current = function(source,prefix,options) {
return [];
}
};
-
-})();
diff --git a/core/modules/filters/all/missing.js b/core/modules/filters/all/missing.js
index 4ba932089..c87e43c98 100644
--- a/core/modules/filters/all/missing.js
+++ b/core/modules/filters/all/missing.js
@@ -6,10 +6,7 @@ module-type: allfilteroperator
Filter function for [all[missing]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -18,5 +15,3 @@ Export our filter function
exports.missing = function(source,prefix,options) {
return options.wiki.getMissingTitles();
};
-
-})();
diff --git a/core/modules/filters/all/orphans.js b/core/modules/filters/all/orphans.js
index d5b4fc270..a2e29ba97 100644
--- a/core/modules/filters/all/orphans.js
+++ b/core/modules/filters/all/orphans.js
@@ -6,10 +6,7 @@ module-type: allfilteroperator
Filter function for [all[orphans]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -18,5 +15,3 @@ Export our filter function
exports.orphans = function(source,prefix,options) {
return options.wiki.getOrphanTitles();
};
-
-})();
diff --git a/core/modules/filters/all/shadows.js b/core/modules/filters/all/shadows.js
index 51654fee2..7946afa73 100644
--- a/core/modules/filters/all/shadows.js
+++ b/core/modules/filters/all/shadows.js
@@ -6,10 +6,7 @@ module-type: allfilteroperator
Filter function for [all[shadows]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -18,5 +15,3 @@ Export our filter function
exports.shadows = function(source,prefix,options) {
return options.wiki.allShadowTitles();
};
-
-})();
diff --git a/core/modules/filters/all/tags.js b/core/modules/filters/all/tags.js
index 2aaa9dec2..de243453f 100644
--- a/core/modules/filters/all/tags.js
+++ b/core/modules/filters/all/tags.js
@@ -6,10 +6,7 @@ module-type: allfilteroperator
Filter function for [all[tags]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -18,5 +15,3 @@ Export our filter function
exports.tags = function(source,prefix,options) {
return Object.keys(options.wiki.getTagMap());
};
-
-})();
diff --git a/core/modules/filters/all/tiddlers.js b/core/modules/filters/all/tiddlers.js
index 9a6e43875..4e480bf4d 100644
--- a/core/modules/filters/all/tiddlers.js
+++ b/core/modules/filters/all/tiddlers.js
@@ -6,10 +6,7 @@ module-type: allfilteroperator
Filter function for [all[tiddlers]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -18,5 +15,3 @@ Export our filter function
exports.tiddlers = function(source,prefix,options) {
return options.wiki.allTitles();
};
-
-})();
diff --git a/core/modules/filters/backlinks.js b/core/modules/filters/backlinks.js
index f066d936a..f8bd4903a 100644
--- a/core/modules/filters/backlinks.js
+++ b/core/modules/filters/backlinks.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning all the backlinks from a tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,5 +19,3 @@ exports.backlinks = function(source,operator,options) {
});
return results.makeTiddlerIterator(options.wiki);
};
-
-})();
diff --git a/core/modules/filters/backtranscludes.js b/core/modules/filters/backtranscludes.js
index 253b9dd7b..07ef9b254 100644
--- a/core/modules/filters/backtranscludes.js
+++ b/core/modules/filters/backtranscludes.js
@@ -6,10 +6,6 @@ module-type: filteroperator
Filter operator for returning all the backtranscludes from a tiddler
\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,5 +18,3 @@ exports.backtranscludes = function(source,operator,options) {
});
return results.makeTiddlerIterator(options.wiki);
};
-
-})();
diff --git a/core/modules/filters/before.js b/core/modules/filters/before.js
index 292cc619d..1d3473b69 100644
--- a/core/modules/filters/before.js
+++ b/core/modules/filters/before.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning the tiddler from the current list that is before the tiddler named in the operand.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -27,5 +24,3 @@ exports.before = function(source,operator,options) {
return [results[index - 1]];
}
};
-
-})();
diff --git a/core/modules/filters/commands.js b/core/modules/filters/commands.js
index 5ab575a78..753c8b8db 100644
--- a/core/modules/filters/commands.js
+++ b/core/modules/filters/commands.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the names of the commands available in this wiki
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -23,5 +20,3 @@ exports.commands = function(source,operator,options) {
results.sort();
return results;
};
-
-})();
diff --git a/core/modules/filters/compare.js b/core/modules/filters/compare.js
index fd509a28e..ac84f8da2 100644
--- a/core/modules/filters/compare.js
+++ b/core/modules/filters/compare.js
@@ -6,10 +6,7 @@ module-type: filteroperator
General purpose comparison operator
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.compare = function(source,operator,options) {
@@ -36,5 +33,3 @@ var modes = {
"lteq": function(value) {return value <= 0;},
"lt": function(value) {return value < 0;}
}
-
-})();
diff --git a/core/modules/filters/contains.js b/core/modules/filters/contains.js
index 918f415cd..910b43a4a 100644
--- a/core/modules/filters/contains.js
+++ b/core/modules/filters/contains.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for finding values in array fields
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -41,5 +38,3 @@ exports.contains = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/count.js b/core/modules/filters/count.js
index 638b135df..3a7be70ad 100644
--- a/core/modules/filters/count.js
+++ b/core/modules/filters/count.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning the number of entries in the current list.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,5 +19,3 @@ exports.count = function(source,operator,options) {
});
return [count + ""];
};
-
-})();
diff --git a/core/modules/filters/crypto.js b/core/modules/filters/crypto.js
index cfb524d06..8b05220b2 100644
--- a/core/modules/filters/crypto.js
+++ b/core/modules/filters/crypto.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operators for cryptography, using the Stanford JavaScript library
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.sha256 = function(source,operator,options) {
@@ -20,5 +17,3 @@ exports.sha256 = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/days.js b/core/modules/filters/days.js
index 318d72567..663416d64 100644
--- a/core/modules/filters/days.js
+++ b/core/modules/filters/days.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator that selects tiddlers with a specified date field within a specified date interval.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -46,5 +43,3 @@ exports.days = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/deserialize.js b/core/modules/filters/deserialize.js
index 5511f29e8..cebab43d3 100644
--- a/core/modules/filters/deserialize.js
+++ b/core/modules/filters/deserialize.js
@@ -4,10 +4,7 @@ type: application/javascript
module-type: filteroperator
Filter operator for deserializing string data into JSON representing tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["deserialize"] = function(source,operator,options) {
@@ -35,5 +32,3 @@ exports["deserialize"] = function(source,operator,options) {
}
return results;
}
-
-})();
\ No newline at end of file
diff --git a/core/modules/filters/deserializers.js b/core/modules/filters/deserializers.js
index ddca998ea..7ab96fbae 100644
--- a/core/modules/filters/deserializers.js
+++ b/core/modules/filters/deserializers.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the names of the deserializers in this wiki
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -23,5 +20,3 @@ exports.deserializers = function(source,operator,options) {
results.sort();
return results;
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/filters/duplicateslugs.js b/core/modules/filters/duplicateslugs.js
index dbd2f23e7..30b6da0a7 100644
--- a/core/modules/filters/duplicateslugs.js
+++ b/core/modules/filters/duplicateslugs.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter function for [duplicateslugs[]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.duplicateslugs = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/each.js b/core/modules/filters/each.js
index 5c2c29077..0a389b5c3 100644
--- a/core/modules/filters/each.js
+++ b/core/modules/filters/each.js
@@ -7,10 +7,7 @@ Filter operator that selects one tiddler for each unique value of the specified
With suffix "list", selects all tiddlers that are values in a specified list field.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -63,5 +60,3 @@ exports.each = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/eachday.js b/core/modules/filters/eachday.js
index 6fdccf879..86f343e25 100644
--- a/core/modules/filters/eachday.js
+++ b/core/modules/filters/eachday.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator that selects one tiddler for each unique day covered by the specified date field
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -35,5 +32,3 @@ exports.eachday = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/editiondescription.js b/core/modules/filters/editiondescription.js
index 2ee387163..ce526a9a9 100644
--- a/core/modules/filters/editiondescription.js
+++ b/core/modules/filters/editiondescription.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the descriptions of the specified edition names
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -29,5 +26,3 @@ exports.editiondescription = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/editions.js b/core/modules/filters/editions.js
index 05ae57c31..919dacfe9 100644
--- a/core/modules/filters/editions.js
+++ b/core/modules/filters/editions.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the names of the available editions in this wiki
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -28,5 +25,3 @@ exports.editions = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/else.js b/core/modules/filters/else.js
index c3829371e..cffcf33ef 100644
--- a/core/modules/filters/else.js
+++ b/core/modules/filters/else.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for replacing an empty input list with a constant, passing a non-empty input list straight through
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -26,5 +23,3 @@ exports.else = function(source,operator,options) {
return results;
}
};
-
-})();
diff --git a/core/modules/filters/encodings.js b/core/modules/filters/encodings.js
index 231e4d119..ecb0d7289 100644
--- a/core/modules/filters/encodings.js
+++ b/core/modules/filters/encodings.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for applying decodeURIComponent() to each item.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -116,5 +113,3 @@ exports.escapecss = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/enlist.js b/core/modules/filters/enlist.js
index 0baaa9366..69aa9e9e0 100644
--- a/core/modules/filters/enlist.js
+++ b/core/modules/filters/enlist.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning its operand parsed as a list
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -38,5 +35,3 @@ exports.enlist = function(source,operator,options) {
return list;
}
};
-
-})();
diff --git a/core/modules/filters/field.js b/core/modules/filters/field.js
index 3a07c0c27..8dd608d45 100644
--- a/core/modules/filters/field.js
+++ b/core/modules/filters/field.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for comparing fields for equality
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -71,5 +68,3 @@ exports.field = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/fields.js b/core/modules/filters/fields.js
index 2f0bf26dc..e569f0e5e 100644
--- a/core/modules/filters/fields.js
+++ b/core/modules/filters/fields.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the names of the fields on the selected tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -41,5 +38,3 @@ exports.fields = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/filter.js b/core/modules/filters/filter.js
index f15cbefc5..466d43f8b 100644
--- a/core/modules/filters/filter.js
+++ b/core/modules/filters/filter.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning those input titles that pass a subfilter
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -30,5 +27,3 @@ exports.filter = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/format.js b/core/modules/filters/format.js
index 2fc786d88..944007797 100644
--- a/core/modules/filters/format.js
+++ b/core/modules/filters/format.js
@@ -4,10 +4,7 @@ type: application/javascript
module-type: filteroperator
Filter operator for formatting strings
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var formatFilterOperators;
@@ -42,5 +39,3 @@ exports.format = function(source,operator,options) {
return results;
}
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/filters/format/date.js b/core/modules/filters/format/date.js
index fcf1a5cad..c74df3444 100644
--- a/core/modules/filters/format/date.js
+++ b/core/modules/filters/format/date.js
@@ -3,10 +3,7 @@ title: $:/core/modules/filters/format/date.js
type: application/javascript
module-type: formatfilteroperator
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,5 +19,3 @@ exports.date = function(source,operand,options) {
});
return results;
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/filters/format/json.js b/core/modules/filters/format/json.js
index 2130a76ed..5db3658e7 100644
--- a/core/modules/filters/format/json.js
+++ b/core/modules/filters/format/json.js
@@ -3,10 +3,7 @@ title: $:/core/modules/filters/format/json.js
type: application/javascript
module-type: formatfilteroperator
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -31,5 +28,3 @@ exports.json = function(source,operand,options) {
});
return results;
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/filters/format/relativedate.js b/core/modules/filters/format/relativedate.js
index f771bb339..ab9c02d72 100644
--- a/core/modules/filters/format/relativedate.js
+++ b/core/modules/filters/format/relativedate.js
@@ -3,10 +3,7 @@ title: $:/core/modules/filters/format/relativedate.js
type: application/javascript
module-type: formatfilteroperator
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,5 +19,3 @@ exports.relativedate = function(source,operand,options) {
});
return results;
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/filters/format/timestamp.js b/core/modules/filters/format/timestamp.js
index d6f5afe30..9be351c33 100644
--- a/core/modules/filters/format/timestamp.js
+++ b/core/modules/filters/format/timestamp.js
@@ -3,10 +3,7 @@ title: $:/core/modules/filters/format/timestamp.js
type: application/javascript
module-type: formatfilteroperator
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,4 +19,3 @@ exports.timestamp = function(source,operand,options) {
});
return results;
};
-})();
\ No newline at end of file
diff --git a/core/modules/filters/format/titlelist.js b/core/modules/filters/format/titlelist.js
index 47608323d..9e9c827ef 100644
--- a/core/modules/filters/format/titlelist.js
+++ b/core/modules/filters/format/titlelist.js
@@ -3,10 +3,7 @@ title: $:/core/modules/filters/format/titlelist.js
type: application/javascript
module-type: formatfilteroperator
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -21,5 +18,3 @@ exports.titlelist = function(source,operand,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/function.js b/core/modules/filters/function.js
index 79210fb78..b6f2fa636 100644
--- a/core/modules/filters/function.js
+++ b/core/modules/filters/function.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning those input titles that are returned from a function
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -17,20 +14,23 @@ Export our filter function
*/
exports.function = function(source,operator,options) {
var functionName = operator.operands[0],
- params = [];
+ params = [],
+ results;
$tw.utils.each(operator.operands.slice(1),function(param) {
params.push({value: param});
});
+ // console.log(`Calling ${functionName} with params ${JSON.stringify(params)}`);
var variableInfo = options.widget && options.widget.getVariableInfo && options.widget.getVariableInfo(functionName,{params: params, source: source});
if(variableInfo && variableInfo.srcVariable && variableInfo.srcVariable.isFunctionDefinition) {
- return variableInfo.resultList ? variableInfo.resultList : [variableInfo.text];
+ results = variableInfo.resultList ? variableInfo.resultList : [variableInfo.text];
}
// Return the input list if the function wasn't found
- var results = [];
- source(function(tiddler,title) {
- results.push(title);
- });
+ if(!results) {
+ results = [];
+ source(function(tiddler,title) {
+ results.push(title);
+ });
+ }
+ // console.log(`function ${functionName} with params ${JSON.stringify(params)} results: ${JSON.stringify(results)}`);
return results;
};
-
-})();
diff --git a/core/modules/filters/get.js b/core/modules/filters/get.js
index feae6684e..8c078ec85 100644
--- a/core/modules/filters/get.js
+++ b/core/modules/filters/get.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for replacing tiddler titles by the value of the field specified in the operand.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -27,5 +24,3 @@ exports.get = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/getindex.js b/core/modules/filters/getindex.js
index b604d4ec8..ce34b3356 100644
--- a/core/modules/filters/getindex.js
+++ b/core/modules/filters/getindex.js
@@ -6,10 +6,7 @@ module-type: filteroperator
returns the value at a given index of datatiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -28,5 +25,3 @@ exports.getindex = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/getvariable.js b/core/modules/filters/getvariable.js
index 43451abed..eab697194 100644
--- a/core/modules/filters/getvariable.js
+++ b/core/modules/filters/getvariable.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for replacing input values by the value of the variable with the same name, or blank if the variable is missing
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,5 +19,3 @@ exports.getvariable = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/has.js b/core/modules/filters/has.js
index f081809a3..ceb117f9c 100644
--- a/core/modules/filters/has.js
+++ b/core/modules/filters/has.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for checking if a tiddler has the specified field or index
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -66,5 +63,3 @@ exports.has = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/haschanged.js b/core/modules/filters/haschanged.js
index 4c63b7758..43d660cb9 100644
--- a/core/modules/filters/haschanged.js
+++ b/core/modules/filters/haschanged.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returns tiddlers from the list that have a non-zero changecount.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.haschanged = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/indexes.js b/core/modules/filters/indexes.js
index 3bbb22659..1de730217 100644
--- a/core/modules/filters/indexes.js
+++ b/core/modules/filters/indexes.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the indexes of a data tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -26,5 +23,3 @@ exports.indexes = function(source,operator,options) {
results.sort();
return results;
};
-
-})();
diff --git a/core/modules/filters/insertafter.js b/core/modules/filters/insertafter.js
index 79c84cb95..a8f1edf12 100644
--- a/core/modules/filters/insertafter.js
+++ b/core/modules/filters/insertafter.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Insert an item after another item in a list
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -42,5 +39,3 @@ exports.insertafter = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/insertbefore.js b/core/modules/filters/insertbefore.js
index 4a032daf9..33e41887f 100644
--- a/core/modules/filters/insertbefore.js
+++ b/core/modules/filters/insertbefore.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Insert an item before another item in a list
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -42,5 +39,3 @@ exports.insertbefore = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is.js b/core/modules/filters/is.js
index b75943786..87861a6e9 100644
--- a/core/modules/filters/is.js
+++ b/core/modules/filters/is.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for checking tiddler properties
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var isFilterOperators;
@@ -44,5 +41,3 @@ exports.is = function(source,operator,options) {
return results;
}
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/filters/is/binary.js b/core/modules/filters/is/binary.js
index 01b9aabd3..7fb02772e 100644
--- a/core/modules/filters/is/binary.js
+++ b/core/modules/filters/is/binary.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[binary]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.binary = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/blank.js b/core/modules/filters/is/blank.js
index 8f500da45..274d3eba1 100644
--- a/core/modules/filters/is/blank.js
+++ b/core/modules/filters/is/blank.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[blank]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.blank = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/current.js b/core/modules/filters/is/current.js
index b5b88f616..1853c5e28 100644
--- a/core/modules/filters/is/current.js
+++ b/core/modules/filters/is/current.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[current]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -33,5 +30,3 @@ exports.current = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/draft.js b/core/modules/filters/is/draft.js
index 016da3f49..caba7849f 100644
--- a/core/modules/filters/is/draft.js
+++ b/core/modules/filters/is/draft.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[draft]] analagous to [has[draft.of]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.draft = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/image.js b/core/modules/filters/is/image.js
index 3527540d3..be276c834 100644
--- a/core/modules/filters/is/image.js
+++ b/core/modules/filters/is/image.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[image]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.image = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/missing.js b/core/modules/filters/is/missing.js
index 8ebf90d41..7720ac472 100644
--- a/core/modules/filters/is/missing.js
+++ b/core/modules/filters/is/missing.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[missing]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.missing = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/orphan.js b/core/modules/filters/is/orphan.js
index 94d09ad61..8827da4c9 100644
--- a/core/modules/filters/is/orphan.js
+++ b/core/modules/filters/is/orphan.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[orphan]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -33,5 +30,3 @@ exports.orphan = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/shadow.js b/core/modules/filters/is/shadow.js
index cfb6b926c..4f1335c69 100644
--- a/core/modules/filters/is/shadow.js
+++ b/core/modules/filters/is/shadow.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[shadow]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.shadow = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/system.js b/core/modules/filters/is/system.js
index 84d0656fd..b27feb392 100644
--- a/core/modules/filters/is/system.js
+++ b/core/modules/filters/is/system.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[system]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.system = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/tag.js b/core/modules/filters/is/tag.js
index d614029c4..69d1713be 100644
--- a/core/modules/filters/is/tag.js
+++ b/core/modules/filters/is/tag.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[tag]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -33,5 +30,3 @@ exports.tag = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/tiddler.js b/core/modules/filters/is/tiddler.js
index d97cd7892..24ca5cee2 100644
--- a/core/modules/filters/is/tiddler.js
+++ b/core/modules/filters/is/tiddler.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[tiddler]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.tiddler = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/is/variable.js b/core/modules/filters/is/variable.js
index 110d9a7c8..624a179d7 100644
--- a/core/modules/filters/is/variable.js
+++ b/core/modules/filters/is/variable.js
@@ -6,10 +6,7 @@ module-type: isfilteroperator
Filter function for [is[variable]]
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.variable = function(source,prefix,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/json-ops.js b/core/modules/filters/json-ops.js
index 0c58964eb..8f16ad417 100644
--- a/core/modules/filters/json-ops.js
+++ b/core/modules/filters/json-ops.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operators for JSON operations
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports["jsonget"] = function(source,operator,options) {
@@ -279,6 +276,3 @@ function setDataItem(data,indexes,value) {
}
return data;
}
-
-})();
-
\ No newline at end of file
diff --git a/core/modules/filters/limit.js b/core/modules/filters/limit.js
index c878c1ac7..9b440155e 100644
--- a/core/modules/filters/limit.js
+++ b/core/modules/filters/limit.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for chopping the results to a specified maximum number of entries
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -30,5 +27,3 @@ exports.limit = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/links.js b/core/modules/filters/links.js
index 0305f4b7f..0b56a8871 100644
--- a/core/modules/filters/links.js
+++ b/core/modules/filters/links.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning all the links from a tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,5 +19,3 @@ exports.links = function(source,operator,options) {
});
return results.makeTiddlerIterator(options.wiki);
};
-
-})();
diff --git a/core/modules/filters/list.js b/core/modules/filters/list.js
index 1b23b9382..2a5e7b8bb 100644
--- a/core/modules/filters/list.js
+++ b/core/modules/filters/list.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning the tiddlers whose title is listed in the operand tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -31,5 +28,3 @@ exports.list = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/listed.js b/core/modules/filters/listed.js
index 8cb1c2f68..610305245 100644
--- a/core/modules/filters/listed.js
+++ b/core/modules/filters/listed.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning all tiddlers that have the selected tiddlers in a list
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -23,5 +20,3 @@ exports.listed = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/listops.js b/core/modules/filters/listops.js
index 89bd8eeb7..ccd81b9fe 100644
--- a/core/modules/filters/listops.js
+++ b/core/modules/filters/listops.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operators for manipulating the current selection list
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -116,5 +113,3 @@ exports.zth = function(source,operator,options) {
});
return results.slice(count,count + 1);
};
-
-})();
diff --git a/core/modules/filters/lookup.js b/core/modules/filters/lookup.js
index aaf81729d..f500b87dd 100644
--- a/core/modules/filters/lookup.js
+++ b/core/modules/filters/lookup.js
@@ -12,10 +12,7 @@ field or index value. If the 2nd suffix does not exist, it defaults to field.
If the second operand is missing it defaults to "text" for fields, and "0" for indexes
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -49,5 +46,3 @@ exports.lookup = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/match.js b/core/modules/filters/match.js
index 34caf487e..ce0b2b9d4 100644
--- a/core/modules/filters/match.js
+++ b/core/modules/filters/match.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for checking if a title matches a string
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -49,5 +46,3 @@ exports.match = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/math.js b/core/modules/filters/math.js
index ed8e5eed6..4c2a9168a 100644
--- a/core/modules/filters/math.js
+++ b/core/modules/filters/math.js
@@ -13,10 +13,7 @@ Note that strings are converted to numbers automatically. Trailing non-digits ar
* "12kk" converts to 12
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.negate = makeNumericBinaryOperator(
@@ -128,7 +125,7 @@ exports.minall = makeNumericReducingOperator(
exports.median = makeNumericArrayOperator(
function(values) {
var len = values.length, median;
- values.sort();
+ values.sort(function(a,b) {return a-b});
if(len % 2) {
// Odd, return the middle number
median = values[(len - 1) / 2];
@@ -243,5 +240,3 @@ function makeNumericArrayOperator(fnCalc) {
return results;
};
};
-
-})();
diff --git a/core/modules/filters/minlength.js b/core/modules/filters/minlength.js
index d4e679bef..4428049f8 100644
--- a/core/modules/filters/minlength.js
+++ b/core/modules/filters/minlength.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for filtering out titles that don't meet the minimum length in the operand
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -25,5 +22,3 @@ exports.minlength = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/moduleproperty.js b/core/modules/filters/moduleproperty.js
index 8f3559b09..67b994d52 100644
--- a/core/modules/filters/moduleproperty.js
+++ b/core/modules/filters/moduleproperty.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter [[module-name]moduleproperty[name]] retrieve a module property
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -18,13 +15,18 @@ Export our filter function
exports.moduleproperty = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
- var value = require(title)[operator.operand || ""];
- if(value !== undefined) {
- results.push(value);
+ try {
+ var value = require(title)[operator.operand || ""];
+ if(value !== undefined) {
+ if(typeof value !== "string") {
+ value = JSON.stringify(value);
+ }
+ results.push(value);
+ }
+ } catch(e) {
+ // Do nothing. It probably wasn't a module.
}
});
results.sort();
return results;
};
-
-})();
diff --git a/core/modules/filters/modules.js b/core/modules/filters/modules.js
index a9e185018..b09d8d825 100644
--- a/core/modules/filters/modules.js
+++ b/core/modules/filters/modules.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the titles of the modules of a given type in this wiki
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -37,5 +34,3 @@ exports.modules = function(source,operator,options) {
results.sort();
return results;
};
-
-})();
diff --git a/core/modules/filters/moduletypes.js b/core/modules/filters/moduletypes.js
index 67321caea..752c383ac 100644
--- a/core/modules/filters/moduletypes.js
+++ b/core/modules/filters/moduletypes.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the names of the module types in this wiki
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -23,5 +20,3 @@ exports.moduletypes = function(source,operator,options) {
results.sort();
return results;
};
-
-})();
diff --git a/core/modules/filters/next.js b/core/modules/filters/next.js
index c12295bf5..01c7e1f90 100644
--- a/core/modules/filters/next.js
+++ b/core/modules/filters/next.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning the tiddler whose title occurs next in the list supplied in the operand tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -28,5 +25,3 @@ exports.next = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/plugintiddlers.js b/core/modules/filters/plugintiddlers.js
index 489ec52e5..c56f88a91 100644
--- a/core/modules/filters/plugintiddlers.js
+++ b/core/modules/filters/plugintiddlers.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the titles of the shadow tiddlers within a plugin
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -28,5 +25,3 @@ exports.plugintiddlers = function(source,operator,options) {
results.sort();
return results;
};
-
-})();
diff --git a/core/modules/filters/prefix.js b/core/modules/filters/prefix.js
index 97dd56f4e..9b53cd78e 100644
--- a/core/modules/filters/prefix.js
+++ b/core/modules/filters/prefix.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for checking if a title starts with a prefix
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -50,5 +47,3 @@ exports.prefix = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/previous.js b/core/modules/filters/previous.js
index ed975458c..2d76aa59f 100644
--- a/core/modules/filters/previous.js
+++ b/core/modules/filters/previous.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning the tiddler whose title occurs immediately prior in the list supplied in the operand tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -28,5 +25,3 @@ exports.previous = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/range.js b/core/modules/filters/range.js
index 09b8d0334..7932e8548 100644
--- a/core/modules/filters/range.js
+++ b/core/modules/filters/range.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for generating a numeric range.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -99,5 +96,3 @@ exports.range = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/reduce.js b/core/modules/filters/reduce.js
index efe8aea4a..112a927bc 100644
--- a/core/modules/filters/reduce.js
+++ b/core/modules/filters/reduce.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator evaluates a subfilter for each item, making the running total available in the variable `accumulator`, and the current index available in the variable `index`
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -44,5 +41,3 @@ exports.reduce = function(source,operator,options) {
return [];
}
};
-
-})();
diff --git a/core/modules/filters/regexp.js b/core/modules/filters/regexp.js
index 837e77575..b9d3e2377 100644
--- a/core/modules/filters/regexp.js
+++ b/core/modules/filters/regexp.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for regexp matching
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -68,5 +65,3 @@ exports.regexp = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/removeprefix.js b/core/modules/filters/removeprefix.js
index 185e1fc87..5e9e4919e 100644
--- a/core/modules/filters/removeprefix.js
+++ b/core/modules/filters/removeprefix.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for removing a prefix from each title in the list. Titles that do not start with the prefix are removed.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -34,5 +31,3 @@ exports.removeprefix = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/removesuffix.js b/core/modules/filters/removesuffix.js
index 76c0c7b35..98f4f9ba5 100644
--- a/core/modules/filters/removesuffix.js
+++ b/core/modules/filters/removesuffix.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for removing a suffix from each title in the list. Titles that do not end with the suffix are removed.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -38,5 +35,3 @@ exports.removesuffix = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/sameday.js b/core/modules/filters/sameday.js
index 5dfc35128..91e3e55e3 100644
--- a/core/modules/filters/sameday.js
+++ b/core/modules/filters/sameday.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator that selects tiddlers with a modified date field on the same day as the provided value.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -29,5 +26,3 @@ exports.sameday = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/search.js b/core/modules/filters/search.js
index dcb534c07..532cdc839 100644
--- a/core/modules/filters/search.js
+++ b/core/modules/filters/search.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for searching for the text in the operand tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -55,5 +52,3 @@ exports.search = function(source,operator,options) {
});
}
};
-
-})();
diff --git a/core/modules/filters/shadowsource.js b/core/modules/filters/shadowsource.js
index f16e2bcc7..279759991 100644
--- a/core/modules/filters/shadowsource.js
+++ b/core/modules/filters/shadowsource.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the source plugins for shadow tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -26,5 +23,3 @@ exports.shadowsource = function(source,operator,options) {
results.sort();
return results;
};
-
-})();
diff --git a/core/modules/filters/slugify.js b/core/modules/filters/slugify.js
index afc12423e..694426d2a 100644
--- a/core/modules/filters/slugify.js
+++ b/core/modules/filters/slugify.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for slugifying a tiddler title
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.slugify = function(source,operator,options) {
@@ -19,5 +16,3 @@ exports.slugify = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/sort.js b/core/modules/filters/sort.js
index 176cd4740..cdfe79728 100644
--- a/core/modules/filters/sort.js
+++ b/core/modules/filters/sort.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for sorting
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -52,5 +49,3 @@ var prepare_results = function (source) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/sortsub.js b/core/modules/filters/sortsub.js
index d328be09c..291829992 100644
--- a/core/modules/filters/sortsub.js
+++ b/core/modules/filters/sortsub.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for sorting by a subfilter
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -48,5 +45,3 @@ exports.sortsub = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/splitbefore.js b/core/modules/filters/splitbefore.js
index 071cead3e..c38b5480d 100644
--- a/core/modules/filters/splitbefore.js
+++ b/core/modules/filters/splitbefore.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator that splits each result on the first occurance of the specified separator and returns the unique values.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -27,5 +24,3 @@ exports.splitbefore = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/storyviews.js b/core/modules/filters/storyviews.js
index 41fffed92..df097582a 100644
--- a/core/modules/filters/storyviews.js
+++ b/core/modules/filters/storyviews.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the names of the story views in this wiki
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -25,5 +22,3 @@ exports.storyviews = function(source,operator,options) {
results.sort();
return results;
};
-
-})();
diff --git a/core/modules/filters/strings.js b/core/modules/filters/strings.js
index 11f7634b7..4183bac7f 100644
--- a/core/modules/filters/strings.js
+++ b/core/modules/filters/strings.js
@@ -8,10 +8,7 @@ Filter operators for strings. Unary/binary operators work on each item in turn,
Sum/product/maxall/minall operate on the entire list, returning a single item.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.length = makeStringBinaryOperator(
@@ -293,5 +290,3 @@ exports.charcode = function(source,operator,options) {
});
return [chars.join("")];
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/filters/subfilter.js b/core/modules/filters/subfilter.js
index 79ae82777..5e35f7cd1 100644
--- a/core/modules/filters/subfilter.js
+++ b/core/modules/filters/subfilter.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning its operand evaluated as a filter
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -29,5 +26,3 @@ exports.subfilter = function(source,operator,options) {
return list;
}
};
-
-})();
diff --git a/core/modules/filters/substitute.js b/core/modules/filters/substitute.js
index 655ef7321..925e59286 100644
--- a/core/modules/filters/substitute.js
+++ b/core/modules/filters/substitute.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for substituting variables and embedded filter expressions with their corresponding values
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ exports.substitute = function(source,operator,options) {
return results;
};
-})();
-
\ No newline at end of file
diff --git a/core/modules/filters/subtiddlerfields.js b/core/modules/filters/subtiddlerfields.js
index 681dd243d..d16150706 100644
--- a/core/modules/filters/subtiddlerfields.js
+++ b/core/modules/filters/subtiddlerfields.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the names of the fields on the selected subtiddlers of the plugin named in the operand
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -27,5 +24,3 @@ exports.subtiddlerfields = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/suffix.js b/core/modules/filters/suffix.js
index 96b32c4a9..e31d40568 100644
--- a/core/modules/filters/suffix.js
+++ b/core/modules/filters/suffix.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for checking if a title ends with a suffix
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -54,5 +51,3 @@ exports.suffix = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/tag.js b/core/modules/filters/tag.js
index 951a28c6b..fdb67af79 100644
--- a/core/modules/filters/tag.js
+++ b/core/modules/filters/tag.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for checking for the presence of a tag
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -54,5 +51,3 @@ exports.tag = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/tagging.js b/core/modules/filters/tagging.js
index a7fea68ec..0efff01ef 100644
--- a/core/modules/filters/tagging.js
+++ b/core/modules/filters/tagging.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning all tiddlers that are tagged with the selected tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,5 +19,3 @@ exports.tagging = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/tags.js b/core/modules/filters/tags.js
index 4a73fd83f..c4ce719c8 100644
--- a/core/modules/filters/tags.js
+++ b/core/modules/filters/tags.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning all the tags of the selected tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -27,5 +24,3 @@ exports.tags = function(source,operator,options) {
});
return Object.keys(tags);
};
-
-})();
diff --git a/core/modules/filters/then.js b/core/modules/filters/then.js
index 994775c08..5d9c75a08 100644
--- a/core/modules/filters/then.js
+++ b/core/modules/filters/then.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for replacing any titles with a constant
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,5 +19,3 @@ exports.then = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/title.js b/core/modules/filters/title.js
index 88ac6f132..a1dff909b 100644
--- a/core/modules/filters/title.js
+++ b/core/modules/filters/title.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for comparing title fields for equality
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -28,5 +25,3 @@ exports.title = function(source,operator,options) {
}
return results;
};
-
-})();
diff --git a/core/modules/filters/transcludes.js b/core/modules/filters/transcludes.js
index 8f42b3bae..5032e4255 100644
--- a/core/modules/filters/transcludes.js
+++ b/core/modules/filters/transcludes.js
@@ -6,10 +6,6 @@ module-type: filteroperator
Filter operator for returning all the transcludes from a tiddler
\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,5 +18,3 @@ exports.transcludes = function(source,operator,options) {
});
return results.makeTiddlerIterator(options.wiki);
};
-
-})();
diff --git a/core/modules/filters/unknown.js b/core/modules/filters/unknown.js
index 6ae5baaf0..8fe2a6889 100644
--- a/core/modules/filters/unknown.js
+++ b/core/modules/filters/unknown.js
@@ -8,10 +8,7 @@ Filter operator for handling unknown filter operators.
Not intended to be used directly by end users, hence the square brackets around the name.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var fieldFilterOperatorFn = require("$:/core/modules/filters/field.js").field;
@@ -45,5 +42,3 @@ exports["[unknown]"] = function(source,operator,options) {
// Otherwise, use the "field" operator
return fieldFilterOperatorFn(source,operator,options);
};
-
-})();
diff --git a/core/modules/filters/untagged.js b/core/modules/filters/untagged.js
index d16de87f8..22f3f6d0c 100644
--- a/core/modules/filters/untagged.js
+++ b/core/modules/filters/untagged.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator returning all the selected tiddlers that are untagged
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -25,5 +22,3 @@ exports.untagged = function(source,operator,options) {
});
return results;
};
-
-})();
diff --git a/core/modules/filters/variables.js b/core/modules/filters/variables.js
index c92b780d2..f35885cb0 100644
--- a/core/modules/filters/variables.js
+++ b/core/modules/filters/variables.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the names of the active variables
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -28,5 +25,3 @@ exports.variables = function(source,operator,options) {
}
return names.sort();
};
-
-})();
diff --git a/core/modules/filters/wikiparserrules.js b/core/modules/filters/wikiparserrules.js
index 213298515..5bdbcdfdf 100644
--- a/core/modules/filters/wikiparserrules.js
+++ b/core/modules/filters/wikiparserrules.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Filter operator for returning the names of the wiki parser rules in this wiki
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -27,5 +24,3 @@ exports.wikiparserrules = function(source,operator,options) {
results.sort();
return results;
};
-
-})();
diff --git a/core/modules/filters/x-listops.js b/core/modules/filters/x-listops.js
index ae17297a5..2f305d0ca 100644
--- a/core/modules/filters/x-listops.js
+++ b/core/modules/filters/x-listops.js
@@ -6,10 +6,7 @@ module-type: filteroperator
Extended filter operators to manipulate the current list.
\*/
-(function () {
- /*jslint node: true, browser: true */
- /*global $tw: false */
"use strict";
/*
@@ -231,5 +228,3 @@ Extended filter operators to manipulate the current list.
}
return cycleValueInArray(results,operands,step);
}
-
-})();
diff --git a/core/modules/indexers/field-indexer.js b/core/modules/indexers/field-indexer.js
index 3aefc99ac..47e89de34 100644
--- a/core/modules/indexers/field-indexer.js
+++ b/core/modules/indexers/field-indexer.js
@@ -6,10 +6,7 @@ module-type: indexer
Indexes the tiddlers with each field value
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global modules: false */
"use strict";
var DEFAULT_MAXIMUM_INDEXED_VALUE_LENGTH = 128;
@@ -139,5 +136,3 @@ FieldIndexer.prototype.lookup = function(name,value) {
};
exports.FieldIndexer = FieldIndexer;
-
-})();
diff --git a/core/modules/indexers/tag-indexer.js b/core/modules/indexers/tag-indexer.js
index 4721fea08..7844173c6 100644
--- a/core/modules/indexers/tag-indexer.js
+++ b/core/modules/indexers/tag-indexer.js
@@ -6,10 +6,7 @@ module-type: indexer
Indexes the tiddlers with each tag
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global modules: false */
"use strict";
function TagIndexer(wiki) {
@@ -94,5 +91,3 @@ TagSubIndexer.prototype.lookup = function(tag) {
exports.TagIndexer = TagIndexer;
-
-})();
diff --git a/core/modules/info/platform.js b/core/modules/info/platform.js
index 0eb0b9ea8..9775b2d6b 100644
--- a/core/modules/info/platform.js
+++ b/core/modules/info/platform.js
@@ -6,10 +6,7 @@ module-type: info
Initialise basic platform $:/info/ tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.getInfoTiddlerFields = function(updateInfoTiddlersCallback) {
@@ -48,5 +45,3 @@ exports.getInfoTiddlerFields = function(updateInfoTiddlersCallback) {
}
return infoTiddlerFields;
};
-
-})();
diff --git a/core/modules/keyboard.js b/core/modules/keyboard.js
index 1740ba35b..8adab9e81 100644
--- a/core/modules/keyboard.js
+++ b/core/modules/keyboard.js
@@ -6,10 +6,7 @@ module-type: global
Keyboard handling utilities
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var namedKeys = {
@@ -383,5 +380,3 @@ KeyboardManager.prototype.handleShortcutChanges = function(changedTiddlers) {
};
exports.KeyboardManager = KeyboardManager;
-
-})();
diff --git a/core/modules/language.js b/core/modules/language.js
index 5e44d6696..b0409ee4d 100644
--- a/core/modules/language.js
+++ b/core/modules/language.js
@@ -6,10 +6,7 @@ module-type: global
The $tw.Language() manages translateable strings
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -41,5 +38,3 @@ Language.prototype.getRawString = function(title) {
};
exports.Language = Language;
-
-})();
diff --git a/core/modules/macros/changecount.js b/core/modules/macros/changecount.js
index 2d0f62e5a..871ce630d 100644
--- a/core/modules/macros/changecount.js
+++ b/core/modules/macros/changecount.js
@@ -6,10 +6,7 @@ module-type: macro
Macro to return the changecount for the current tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -26,5 +23,3 @@ Run the macro
exports.run = function() {
return this.wiki.getChangeCount(this.getVariable("currentTiddler")) + "";
};
-
-})();
diff --git a/core/modules/macros/contrastcolour.js b/core/modules/macros/contrastcolour.js
index eab6f0108..8134bdeff 100644
--- a/core/modules/macros/contrastcolour.js
+++ b/core/modules/macros/contrastcolour.js
@@ -6,10 +6,7 @@ module-type: macro
Macro to choose which of two colours has the highest contrast with a base colour
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -51,5 +48,3 @@ exports.run = function(target,fallbackTarget,colourA,colourB) {
brightnessB = rgbColourB[0] * 0.299 + rgbColourB[1] * 0.587 + rgbColourB[2] * 0.114;
return Math.abs(brightnessTarget - brightnessA) > Math.abs(brightnessTarget - brightnessB) ? colourA : colourB;
};
-
-})();
diff --git a/core/modules/macros/csvtiddlers.js b/core/modules/macros/csvtiddlers.js
index a492fd81c..e5d2f9137 100644
--- a/core/modules/macros/csvtiddlers.js
+++ b/core/modules/macros/csvtiddlers.js
@@ -6,10 +6,7 @@ module-type: macro
Macro to output tiddlers matching a filter to CSV
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -75,5 +72,3 @@ exports.run = function(filter,format) {
function quoteAndEscape(value) {
return "\"" + value.replace(/"/mg,"\"\"") + "\"";
}
-
-})();
diff --git a/core/modules/macros/displayshortcuts.js b/core/modules/macros/displayshortcuts.js
index b18297238..10f6c7221 100644
--- a/core/modules/macros/displayshortcuts.js
+++ b/core/modules/macros/displayshortcuts.js
@@ -6,10 +6,7 @@ module-type: macro
Macro to display a list of keyboard shortcuts in human readable form. Notably, it resolves named shortcuts like `((bold))` to the underlying keystrokes.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -41,5 +38,3 @@ exports.run = function(shortcuts,prefix,separator,suffix) {
return "";
}
};
-
-})();
diff --git a/core/modules/macros/jsontiddler.js b/core/modules/macros/jsontiddler.js
index 509fd5559..ff5ae3c9b 100644
--- a/core/modules/macros/jsontiddler.js
+++ b/core/modules/macros/jsontiddler.js
@@ -6,10 +6,7 @@ module-type: macro
Macro to output a single tiddler to JSON
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -37,4 +34,3 @@ exports.run = function(title) {
return JSON.stringify(fields,null,$tw.config.preferences.jsonSpaces);
};
-})();
diff --git a/core/modules/macros/jsontiddlers.js b/core/modules/macros/jsontiddlers.js
index eeaf70d3a..25e08f6b9 100644
--- a/core/modules/macros/jsontiddlers.js
+++ b/core/modules/macros/jsontiddlers.js
@@ -6,10 +6,7 @@ module-type: macro
Macro to output tiddlers matching a filter to JSON
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -29,5 +26,3 @@ Run the macro
exports.run = function(filter,spaces) {
return this.wiki.getTiddlersAsJson(filter,$tw.utils.parseInt(spaces));
};
-
-})();
diff --git a/core/modules/macros/makedatauri.js b/core/modules/macros/makedatauri.js
index 0ff862df1..db67495e5 100644
--- a/core/modules/macros/makedatauri.js
+++ b/core/modules/macros/makedatauri.js
@@ -8,10 +8,7 @@ Macro to convert a string of text to a data URI
<>
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -32,5 +29,3 @@ Run the macro
exports.run = function(text,type,_canonical_uri) {
return $tw.utils.makeDataUri(text,type,_canonical_uri);
};
-
-})();
diff --git a/core/modules/macros/now.js b/core/modules/macros/now.js
index d0a15dce2..86513f1b9 100644
--- a/core/modules/macros/now.js
+++ b/core/modules/macros/now.js
@@ -6,10 +6,7 @@ module-type: macro
Macro to return a formatted version of the current time
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -28,5 +25,3 @@ Run the macro
exports.run = function(format) {
return $tw.utils.formatDateString(new Date(),format || "0hh:0mm, DDth MMM YYYY");
};
-
-})();
diff --git a/core/modules/macros/qualify.js b/core/modules/macros/qualify.js
index de9dc6c8e..ff6716dd4 100644
--- a/core/modules/macros/qualify.js
+++ b/core/modules/macros/qualify.js
@@ -6,10 +6,7 @@ module-type: macro
Macro to qualify a state tiddler title according
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -28,5 +25,3 @@ Run the macro
exports.run = function(title) {
return title + "-" + this.getStateQualifier();
};
-
-})();
diff --git a/core/modules/macros/resolvepath.js b/core/modules/macros/resolvepath.js
index d84d87563..68c2e4d04 100644
--- a/core/modules/macros/resolvepath.js
+++ b/core/modules/macros/resolvepath.js
@@ -6,10 +6,7 @@ module-type: macro
Resolves a relative path for an absolute rootpath.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "resolvepath";
@@ -25,5 +22,3 @@ Run the macro
exports.run = function(source, root) {
return $tw.utils.resolvePath(source, root);
};
-
-})();
diff --git a/core/modules/macros/unusedtitle.js b/core/modules/macros/unusedtitle.js
index 8a61c425e..056c713df 100644
--- a/core/modules/macros/unusedtitle.js
+++ b/core/modules/macros/unusedtitle.js
@@ -5,10 +5,7 @@ module-type: macro
Macro to return a new title that is unused in the wiki. It can be given a name as a base.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "unusedtitle";
@@ -31,7 +28,5 @@ exports.run = function(baseName,separator,template,startCount) {
}
// $tw.wiki.generateNewTitle = function(baseTitle,options)
// options.prefix must be a string!
- return this.wiki.generateNewTitle(baseName, {"prefix": separator, "template": template, "startCount": startCount});
+ return this.wiki.generateNewTitle(baseName, {"prefix": separator, "template": template, "startCount": startCount}).trim();
};
-
-})();
diff --git a/core/modules/macros/version.js b/core/modules/macros/version.js
index b0dd0b0d5..0a5315b81 100644
--- a/core/modules/macros/version.js
+++ b/core/modules/macros/version.js
@@ -6,10 +6,7 @@ module-type: macro
Macro to return the TiddlyWiki core version number
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -26,5 +23,3 @@ Run the macro
exports.run = function() {
return $tw.version;
};
-
-})();
diff --git a/core/modules/parsers/audioparser.js b/core/modules/parsers/audioparser.js
index 5eb2ff985..601de058e 100644
--- a/core/modules/parsers/audioparser.js
+++ b/core/modules/parsers/audioparser.js
@@ -6,10 +6,7 @@ module-type: parser
The audio parser parses an audio tiddler into an embeddable HTML element
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var AudioParser = function(type,text,options) {
@@ -36,6 +33,3 @@ exports["audio/ogg"] = AudioParser;
exports["audio/mpeg"] = AudioParser;
exports["audio/mp3"] = AudioParser;
exports["audio/mp4"] = AudioParser;
-
-})();
-
diff --git a/core/modules/parsers/binaryparser.js b/core/modules/parsers/binaryparser.js
index 60e7b5ef0..947d9befa 100644
--- a/core/modules/parsers/binaryparser.js
+++ b/core/modules/parsers/binaryparser.js
@@ -6,10 +6,7 @@ module-type: parser
The binary parser parses a binary tiddler into a warning message and download link
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var BINARY_WARNING_MESSAGE = "$:/core/ui/BinaryWarning";
@@ -69,6 +66,3 @@ var BinaryParser = function(type,text,options) {
};
exports["application/octet-stream"] = BinaryParser;
-
-})();
-
diff --git a/core/modules/parsers/csvparser.js b/core/modules/parsers/csvparser.js
index f40b5f0e5..2d32b3a06 100644
--- a/core/modules/parsers/csvparser.js
+++ b/core/modules/parsers/csvparser.js
@@ -6,10 +6,7 @@ module-type: parser
The CSV text parser processes CSV files into a table wrapped in a scrollable widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var CsvParser = function(type,text,options) {
@@ -58,6 +55,3 @@ var CsvParser = function(type,text,options) {
exports["text/csv"] = CsvParser;
exports["text/tab-delimited-values"] = CsvParser;
-
-})();
-
diff --git a/core/modules/parsers/htmlparser.js b/core/modules/parsers/htmlparser.js
index 24c9f5d3e..fee869868 100644
--- a/core/modules/parsers/htmlparser.js
+++ b/core/modules/parsers/htmlparser.js
@@ -6,10 +6,7 @@ module-type: parser
The HTML parser displays text as raw HTML
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var HtmlParser = function(type,text,options) {
@@ -34,6 +31,3 @@ var HtmlParser = function(type,text,options) {
};
exports["text/html"] = HtmlParser;
-
-})();
-
diff --git a/core/modules/parsers/imageparser.js b/core/modules/parsers/imageparser.js
index a964a4ba8..c7201445f 100644
--- a/core/modules/parsers/imageparser.js
+++ b/core/modules/parsers/imageparser.js
@@ -6,10 +6,7 @@ module-type: parser
The image parser parses an image into an embeddable HTML element
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var ImageParser = function(type,text,options) {
@@ -40,8 +37,6 @@ exports["image/gif"] = ImageParser;
exports["image/webp"] = ImageParser;
exports["image/heic"] = ImageParser;
exports["image/heif"] = ImageParser;
+exports["image/avif"] = ImageParser;
exports["image/x-icon"] = ImageParser;
exports["image/vnd.microsoft.icon"] = ImageParser;
-
-})();
-
diff --git a/core/modules/parsers/parseutils.js b/core/modules/parsers/parseutils.js
index 2a2e36309..30bc39509 100644
--- a/core/modules/parsers/parseutils.js
+++ b/core/modules/parsers/parseutils.js
@@ -22,10 +22,7 @@ Most functions have the following pattern:
The exception is `skipWhiteSpace`, which just returns the position after the whitespace.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -384,5 +381,3 @@ exports.parseAttribute = function(source,pos) {
node.end = pos;
return node;
};
-
-})();
diff --git a/core/modules/parsers/pdfparser.js b/core/modules/parsers/pdfparser.js
index c7830bf69..0551e93fa 100644
--- a/core/modules/parsers/pdfparser.js
+++ b/core/modules/parsers/pdfparser.js
@@ -6,10 +6,7 @@ module-type: parser
The PDF parser embeds a PDF viewer
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var ImageParser = function(type,text,options) {
@@ -30,6 +27,3 @@ var ImageParser = function(type,text,options) {
};
exports["application/pdf"] = ImageParser;
-
-})();
-
diff --git a/core/modules/parsers/textparser.js b/core/modules/parsers/textparser.js
index 17f9bde10..ca97404ac 100644
--- a/core/modules/parsers/textparser.js
+++ b/core/modules/parsers/textparser.js
@@ -6,10 +6,7 @@ module-type: parser
The plain text parser processes blocks of source text into a degenerate parse tree consisting of a single text node
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var TextParser = function(type,text,options) {
@@ -32,5 +29,3 @@ exports["application/javascript"] = TextParser;
exports["application/json"] = TextParser;
exports["text/css"] = TextParser;
exports["application/x-tiddler-dictionary"] = TextParser;
-
-})();
diff --git a/core/modules/parsers/videoparser.js b/core/modules/parsers/videoparser.js
index 1c8a38bb2..e4406e56a 100644
--- a/core/modules/parsers/videoparser.js
+++ b/core/modules/parsers/videoparser.js
@@ -6,10 +6,7 @@ module-type: parser
The video parser parses a video tiddler into an embeddable HTML element
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var VideoParser = function(type,text,options) {
@@ -36,5 +33,3 @@ exports["video/ogg"] = VideoParser;
exports["video/webm"] = VideoParser;
exports["video/mp4"] = VideoParser;
exports["video/quicktime"] = VideoParser;
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/codeblock.js b/core/modules/parsers/wikiparser/rules/codeblock.js
index 6c3480566..bdecd65be 100644
--- a/core/modules/parsers/wikiparser/rules/codeblock.js
+++ b/core/modules/parsers/wikiparser/rules/codeblock.js
@@ -12,10 +12,7 @@ Wiki text rule for code blocks. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "codeblock";
@@ -56,5 +53,3 @@ exports.parse = function() {
}
}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/codeinline.js b/core/modules/parsers/wikiparser/rules/codeinline.js
index 048fc051c..5606ba478 100644
--- a/core/modules/parsers/wikiparser/rules/codeinline.js
+++ b/core/modules/parsers/wikiparser/rules/codeinline.js
@@ -11,10 +11,7 @@ Wiki text inline rule for code runs. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "codeinline";
@@ -54,5 +51,3 @@ exports.parse = function() {
}]
}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/commentblock.js b/core/modules/parsers/wikiparser/rules/commentblock.js
index 1c303f38f..96d3deb3d 100644
--- a/core/modules/parsers/wikiparser/rules/commentblock.js
+++ b/core/modules/parsers/wikiparser/rules/commentblock.js
@@ -18,10 +18,7 @@ xxxx
Note that the syntax for comments is simplified to an opening "" sequence -- HTML itself implements a more complex format (see http://ostermiller.org/findhtmlcomment.html)
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "commentblock";
@@ -52,5 +49,3 @@ exports.parse = function() {
// Don't return any elements
return [];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/commentinline.js b/core/modules/parsers/wikiparser/rules/commentinline.js
index 671bd79d6..e826b95e6 100644
--- a/core/modules/parsers/wikiparser/rules/commentinline.js
+++ b/core/modules/parsers/wikiparser/rules/commentinline.js
@@ -12,10 +12,7 @@ Wiki text inline rule for HTML comments. For example:
Note that the syntax for comments is simplified to an opening "" sequence -- HTML itself implements a more complex format (see http://ostermiller.org/findhtmlcomment.html)
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "commentinline";
@@ -46,5 +43,3 @@ exports.parse = function() {
// Don't return any elements
return [];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/conditional.js b/core/modules/parsers/wikiparser/rules/conditional.js
index c2d6a43b8..3995b90dc 100644
--- a/core/modules/parsers/wikiparser/rules/conditional.js
+++ b/core/modules/parsers/wikiparser/rules/conditional.js
@@ -10,10 +10,6 @@ This is a <%if [{something}] %>Elephant<%elseif [{else}] %>Pelican<%else%>Crocod
```
\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "conditional";
@@ -116,5 +112,3 @@ exports.parseIfClause = function(filterCondition) {
// Return the parse tree node
return [listWidget];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/dash.js b/core/modules/parsers/wikiparser/rules/dash.js
index 45481bf07..02d82baec 100644
--- a/core/modules/parsers/wikiparser/rules/dash.js
+++ b/core/modules/parsers/wikiparser/rules/dash.js
@@ -12,10 +12,7 @@ This is an em-dash: ---
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "dash";
@@ -36,5 +33,3 @@ exports.parse = function() {
entity: dash
}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/emphasis/bold.js b/core/modules/parsers/wikiparser/rules/emphasis/bold.js
index 3799feeb5..70f741759 100644
--- a/core/modules/parsers/wikiparser/rules/emphasis/bold.js
+++ b/core/modules/parsers/wikiparser/rules/emphasis/bold.js
@@ -17,10 +17,7 @@ This wikiparser can be modified using the rules eg:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "bold";
@@ -46,5 +43,3 @@ exports.parse = function() {
children: tree
}];
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/parsers/wikiparser/rules/emphasis/italic.js b/core/modules/parsers/wikiparser/rules/emphasis/italic.js
index 3e0744c4d..995e58123 100644
--- a/core/modules/parsers/wikiparser/rules/emphasis/italic.js
+++ b/core/modules/parsers/wikiparser/rules/emphasis/italic.js
@@ -17,10 +17,7 @@ This wikiparser can be modified using the rules eg:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "italic";
@@ -46,5 +43,3 @@ exports.parse = function() {
children: tree
}];
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js b/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js
index 0fb34fc52..24380ed11 100644
--- a/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js
+++ b/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js
@@ -17,10 +17,7 @@ This wikiparser can be modified using the rules eg:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "strikethrough";
@@ -46,5 +43,3 @@ exports.parse = function() {
children: tree
}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/emphasis/subscript.js b/core/modules/parsers/wikiparser/rules/emphasis/subscript.js
index 12be0fbbc..104ed0294 100644
--- a/core/modules/parsers/wikiparser/rules/emphasis/subscript.js
+++ b/core/modules/parsers/wikiparser/rules/emphasis/subscript.js
@@ -17,10 +17,7 @@ This wikiparser can be modified using the rules eg:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "subscript";
@@ -46,5 +43,3 @@ exports.parse = function() {
children: tree
}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/emphasis/superscript.js b/core/modules/parsers/wikiparser/rules/emphasis/superscript.js
index 5a5330d8c..be7157255 100644
--- a/core/modules/parsers/wikiparser/rules/emphasis/superscript.js
+++ b/core/modules/parsers/wikiparser/rules/emphasis/superscript.js
@@ -17,10 +17,7 @@ This wikiparser can be modified using the rules eg:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "superscript";
@@ -46,5 +43,3 @@ exports.parse = function() {
children: tree
}];
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/parsers/wikiparser/rules/emphasis/underscore.js b/core/modules/parsers/wikiparser/rules/emphasis/underscore.js
index d36bd242d..2c2bf71c3 100644
--- a/core/modules/parsers/wikiparser/rules/emphasis/underscore.js
+++ b/core/modules/parsers/wikiparser/rules/emphasis/underscore.js
@@ -17,10 +17,7 @@ This wikiparser can be modified using the rules eg:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "underscore";
@@ -46,5 +43,3 @@ exports.parse = function() {
children: tree
}];
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/parsers/wikiparser/rules/entity.js b/core/modules/parsers/wikiparser/rules/entity.js
index dc3917daf..df2068b78 100644
--- a/core/modules/parsers/wikiparser/rules/entity.js
+++ b/core/modules/parsers/wikiparser/rules/entity.js
@@ -10,10 +10,7 @@ Wiki text inline rule for HTML entities. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "entity";
@@ -36,5 +33,3 @@ exports.parse = function() {
// Return the entity
return [{type: "entity", entity: this.match[0]}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/extlink.js b/core/modules/parsers/wikiparser/rules/extlink.js
index 5b9f57adf..2678e3873 100644
--- a/core/modules/parsers/wikiparser/rules/extlink.js
+++ b/core/modules/parsers/wikiparser/rules/extlink.js
@@ -14,10 +14,7 @@ A suppressed external link: ~http://www.tiddlyspace.com/
External links can be suppressed by preceding them with `~`.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "extlink";
@@ -52,5 +49,3 @@ exports.parse = function() {
}];
}
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js b/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js
index 73bdff813..2fd96183e 100644
--- a/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js
+++ b/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js
@@ -14,10 +14,7 @@ Wiki text rule for block-level filtered transclusion. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "filteredtranscludeblock";
@@ -70,5 +67,3 @@ exports.parse = function() {
}
return [node];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js b/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js
index c0b19a941..ee82ff517 100644
--- a/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js
+++ b/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js
@@ -14,10 +14,7 @@ Wiki text rule for inline filtered transclusion. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "filteredtranscludeinline";
@@ -69,5 +66,3 @@ exports.parse = function() {
}
return [node];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/fnprocdef.js b/core/modules/parsers/wikiparser/rules/fnprocdef.js
index 85bd14d5c..63ae8130f 100644
--- a/core/modules/parsers/wikiparser/rules/fnprocdef.js
+++ b/core/modules/parsers/wikiparser/rules/fnprocdef.js
@@ -20,10 +20,7 @@ definition text
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "fnprocdef";
@@ -53,7 +50,7 @@ exports.parse = function() {
var reEnd;
if(this.match[5]) {
// If so, it is a multiline definition and the end of the body is marked with \end
- reEnd = new RegExp("((:?^|\\r?\\n)[^\\S\\n\\r]*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[2]) + ")?(?:$|\\r?\\n))","mg");
+ reEnd = new RegExp("((:?^|\\r?\\n)[^\\S\\n\\r]*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[2]) + ")?\\s*?(?:$|\\r?\\n))","mg");
} else {
// Otherwise, the end of the definition is marked by the end of the line
reEnd = /($|\r?\n)/mg;
@@ -92,6 +89,3 @@ exports.parse = function() {
}
return parseTreeNodes;
};
-
-})();
-
\ No newline at end of file
diff --git a/core/modules/parsers/wikiparser/rules/hardlinebreaks.js b/core/modules/parsers/wikiparser/rules/hardlinebreaks.js
index 94f517cd4..da28f7808 100644
--- a/core/modules/parsers/wikiparser/rules/hardlinebreaks.js
+++ b/core/modules/parsers/wikiparser/rules/hardlinebreaks.js
@@ -17,10 +17,7 @@ Not
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "hardlinebreaks";
@@ -56,5 +53,3 @@ exports.parse = function() {
// Return the nodes
return tree;
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/heading.js b/core/modules/parsers/wikiparser/rules/heading.js
index 7a0ecb9db..af2a6ad12 100644
--- a/core/modules/parsers/wikiparser/rules/heading.js
+++ b/core/modules/parsers/wikiparser/rules/heading.js
@@ -6,10 +6,7 @@ module-type: wikirule
Wiki text block rule for headings
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "heading";
@@ -45,4 +42,3 @@ exports.parse = function() {
children: tree
}];
};
-})();
diff --git a/core/modules/parsers/wikiparser/rules/horizrule.js b/core/modules/parsers/wikiparser/rules/horizrule.js
index bacad06ed..2294add6b 100644
--- a/core/modules/parsers/wikiparser/rules/horizrule.js
+++ b/core/modules/parsers/wikiparser/rules/horizrule.js
@@ -10,10 +10,7 @@ Wiki text block rule for rules. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "horizrule";
@@ -30,5 +27,3 @@ exports.parse = function() {
this.parser.pos = this.matchRegExp.lastIndex;
return [{type: "element", tag: "hr"}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/html.js b/core/modules/parsers/wikiparser/rules/html.js
index 61c4ad9e1..c5f0e86c5 100644
--- a/core/modules/parsers/wikiparser/rules/html.js
+++ b/core/modules/parsers/wikiparser/rules/html.js
@@ -17,10 +17,7 @@ This is a widget invocation
}}}
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "html";
@@ -194,5 +191,3 @@ exports.isLegalTag = function(tag) {
return true;
}
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/image.js b/core/modules/parsers/wikiparser/rules/image.js
index 6f58225e0..2bc90b80d 100644
--- a/core/modules/parsers/wikiparser/rules/image.js
+++ b/core/modules/parsers/wikiparser/rules/image.js
@@ -17,10 +17,7 @@ Wiki text inline rule for embedding images. For example:
Generates the `<$image>` widget.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "image";
@@ -129,5 +126,3 @@ exports.parseImage = function(source,pos) {
node.end = pos;
return node;
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/import.js b/core/modules/parsers/wikiparser/rules/import.js
index bb1832255..52332f0e3 100644
--- a/core/modules/parsers/wikiparser/rules/import.js
+++ b/core/modules/parsers/wikiparser/rules/import.js
@@ -10,10 +10,7 @@ Wiki pragma rule for importing variable definitions
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "import";
@@ -50,5 +47,3 @@ exports.parse = function() {
children: []
}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/list.js b/core/modules/parsers/wikiparser/rules/list.js
index d89c201b9..98cc5540f 100644
--- a/core/modules/parsers/wikiparser/rules/list.js
+++ b/core/modules/parsers/wikiparser/rules/list.js
@@ -40,10 +40,7 @@ A CSS class can be applied to a list item as follows:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "list";
@@ -152,5 +149,3 @@ exports.parse = function() {
// Return the root element of the list
return [listStack[0]];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/macrocallblock.js b/core/modules/parsers/wikiparser/rules/macrocallblock.js
index a2c10e04a..3793d563d 100644
--- a/core/modules/parsers/wikiparser/rules/macrocallblock.js
+++ b/core/modules/parsers/wikiparser/rules/macrocallblock.js
@@ -10,10 +10,7 @@ Wiki rule for block macro calls
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "macrocallblock";
@@ -52,5 +49,3 @@ exports.parse = function() {
this.parser.pos = call.end;
return [call];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/macrocallinline.js b/core/modules/parsers/wikiparser/rules/macrocallinline.js
index e9f79f09e..bd6e777bb 100644
--- a/core/modules/parsers/wikiparser/rules/macrocallinline.js
+++ b/core/modules/parsers/wikiparser/rules/macrocallinline.js
@@ -10,10 +10,7 @@ Wiki rule for macro calls
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "macrocallinline";
@@ -45,5 +42,3 @@ exports.parse = function() {
this.parser.pos = call.end;
return [call];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/macrodef.js b/core/modules/parsers/wikiparser/rules/macrodef.js
index 2001f70d5..24f0e1212 100644
--- a/core/modules/parsers/wikiparser/rules/macrodef.js
+++ b/core/modules/parsers/wikiparser/rules/macrodef.js
@@ -12,10 +12,7 @@ definition text, including $param$ markers
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "macrodef";
@@ -58,7 +55,7 @@ exports.parse = function() {
var reEnd;
if(this.match[3]) {
// If so, it is a multiline definition and the end of the body is marked with \end
- reEnd = new RegExp("((?:^|\\r?\\n)[^\\S\\n\\r]*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[1]) + ")?(?:$|\\r?\\n))","mg");
+ reEnd = new RegExp("((?:^|\\r?\\n)[^\\S\\n\\r]*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[1]) + ")?\\s*?(?:$|\\r?\\n))","mg");
} else {
// Otherwise, the end of the definition is marked by the end of the line
reEnd = /($|\r?\n)/mg;
@@ -88,5 +85,3 @@ exports.parse = function() {
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],"value",text);
return parseTreeNodes;
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/parameters.js b/core/modules/parsers/wikiparser/rules/parameters.js
index 60bbd8901..ccd50319c 100644
--- a/core/modules/parsers/wikiparser/rules/parameters.js
+++ b/core/modules/parsers/wikiparser/rules/parameters.js
@@ -11,10 +11,7 @@ definition text
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "parameters";
@@ -56,5 +53,3 @@ exports.parse = function() {
orderedAttributes: orderedAttributes
}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/parsermode.js b/core/modules/parsers/wikiparser/rules/parsermode.js
index 72a6de067..868db3e15 100644
--- a/core/modules/parsers/wikiparser/rules/parsermode.js
+++ b/core/modules/parsers/wikiparser/rules/parsermode.js
@@ -11,10 +11,7 @@ Wiki pragma rule for parser mode specifications
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "parsermode";
@@ -64,5 +61,3 @@ exports.parse = function() {
// No parse tree nodes to return
return [];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/prettyextlink.js b/core/modules/parsers/wikiparser/rules/prettyextlink.js
index 4707fa0d0..2c575c227 100644
--- a/core/modules/parsers/wikiparser/rules/prettyextlink.js
+++ b/core/modules/parsers/wikiparser/rules/prettyextlink.js
@@ -11,10 +11,7 @@ Wiki text inline rule for external links. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "prettyextlink";
@@ -116,5 +113,3 @@ exports.parseLink = function(source,pos) {
node.end = closePos + 2;
return node;
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/prettylink.js b/core/modules/parsers/wikiparser/rules/prettylink.js
index 66c19dc88..91579256d 100644
--- a/core/modules/parsers/wikiparser/rules/prettylink.js
+++ b/core/modules/parsers/wikiparser/rules/prettylink.js
@@ -12,10 +12,7 @@ Wiki text inline rule for pretty links. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "prettylink";
@@ -66,5 +63,3 @@ exports.parse = function() {
}];
}
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/quoteblock.js b/core/modules/parsers/wikiparser/rules/quoteblock.js
index fdd6c860b..be8746de4 100644
--- a/core/modules/parsers/wikiparser/rules/quoteblock.js
+++ b/core/modules/parsers/wikiparser/rules/quoteblock.js
@@ -6,10 +6,7 @@ module-type: wikirule
Wiki text rule for quote blocks.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "quoteblock";
@@ -72,5 +69,3 @@ exports.parse = function() {
children: tree
}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/rules.js b/core/modules/parsers/wikiparser/rules/rules.js
index 1d0f80f29..7b3749308 100644
--- a/core/modules/parsers/wikiparser/rules/rules.js
+++ b/core/modules/parsers/wikiparser/rules/rules.js
@@ -11,10 +11,7 @@ Wiki pragma rule for rules specifications
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "rules";
@@ -60,5 +57,3 @@ exports.parse = function() {
// No parse tree nodes to return
return [];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/styleblock.js b/core/modules/parsers/wikiparser/rules/styleblock.js
index 3fcad5bb4..2abf2fc9e 100644
--- a/core/modules/parsers/wikiparser/rules/styleblock.js
+++ b/core/modules/parsers/wikiparser/rules/styleblock.js
@@ -26,10 +26,7 @@ This is a paragraph
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "styleblock";
@@ -69,5 +66,3 @@ exports.parse = function() {
}
return tree;
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/styleinline.js b/core/modules/parsers/wikiparser/rules/styleinline.js
index 653e48986..3aea0d266 100644
--- a/core/modules/parsers/wikiparser/rules/styleinline.js
+++ b/core/modules/parsers/wikiparser/rules/styleinline.js
@@ -13,10 +13,7 @@ Wiki text inline rule for assigning styles and classes to inline runs. For examp
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "styleinline";
@@ -54,5 +51,3 @@ exports.parse = function() {
}
return [node];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/syslink.js b/core/modules/parsers/wikiparser/rules/syslink.js
index 6bcbee384..a57850265 100644
--- a/core/modules/parsers/wikiparser/rules/syslink.js
+++ b/core/modules/parsers/wikiparser/rules/syslink.js
@@ -6,10 +6,7 @@ module-type: wikirule
Wiki text inline rule for system tiddler links.
Can be suppressed preceding them with `~`.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "syslink";
@@ -49,5 +46,3 @@ exports.parse = function() {
}];
}
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/table.js b/core/modules/parsers/wikiparser/rules/table.js
index fbdbb4f9d..67def255f 100644
--- a/core/modules/parsers/wikiparser/rules/table.js
+++ b/core/modules/parsers/wikiparser/rules/table.js
@@ -6,10 +6,7 @@ module-type: wikirule
Wiki text block rule for tables.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "table";
@@ -187,5 +184,3 @@ exports.parse = function() {
}
return [table];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/transcludeblock.js b/core/modules/parsers/wikiparser/rules/transcludeblock.js
index c033c2440..525113d5d 100644
--- a/core/modules/parsers/wikiparser/rules/transcludeblock.js
+++ b/core/modules/parsers/wikiparser/rules/transcludeblock.js
@@ -11,10 +11,7 @@ Wiki text rule for block-level transclusion. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "transcludeblock";
@@ -85,5 +82,3 @@ exports.parse = function() {
}
}
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/transcludeinline.js b/core/modules/parsers/wikiparser/rules/transcludeinline.js
index 3ce9dc78e..4ae58e617 100644
--- a/core/modules/parsers/wikiparser/rules/transcludeinline.js
+++ b/core/modules/parsers/wikiparser/rules/transcludeinline.js
@@ -11,10 +11,7 @@ Wiki text rule for inline-level transclusion. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "transcludeinline";
@@ -83,5 +80,3 @@ exports.parse = function() {
}
}
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/typedblock.js b/core/modules/parsers/wikiparser/rules/typedblock.js
index 07c88be15..03fdc8e10 100644
--- a/core/modules/parsers/wikiparser/rules/typedblock.js
+++ b/core/modules/parsers/wikiparser/rules/typedblock.js
@@ -22,10 +22,7 @@ $$$
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var widget = require("$:/core/modules/widgets/widget.js");
@@ -82,5 +79,3 @@ exports.parse = function() {
}];
}
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/whitespace.js b/core/modules/parsers/wikiparser/rules/whitespace.js
index 5fd9d4b83..3be34ee88 100644
--- a/core/modules/parsers/wikiparser/rules/whitespace.js
+++ b/core/modules/parsers/wikiparser/rules/whitespace.js
@@ -11,10 +11,7 @@ Wiki pragma rule for whitespace specifications
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "whitespace";
@@ -68,5 +65,3 @@ exports.parse = function() {
// No parse tree nodes to return
return [];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/wikilink.js b/core/modules/parsers/wikiparser/rules/wikilink.js
index 6b195f9ff..d706de8a9 100644
--- a/core/modules/parsers/wikiparser/rules/wikilink.js
+++ b/core/modules/parsers/wikiparser/rules/wikilink.js
@@ -14,10 +14,7 @@ AnotherLink
Precede a camel case word with `~` to prevent it from being recognised as a link.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "wikilink";
@@ -64,5 +61,3 @@ exports.parse = function() {
}]
}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/rules/wikilinkprefix.js b/core/modules/parsers/wikiparser/rules/wikilinkprefix.js
index 60cb3d992..c1c5db1f6 100644
--- a/core/modules/parsers/wikiparser/rules/wikilinkprefix.js
+++ b/core/modules/parsers/wikiparser/rules/wikilinkprefix.js
@@ -10,10 +10,7 @@ Wiki text inline rule for suppressed wiki links. For example:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.name = "wikilinkprefix";
@@ -36,5 +33,3 @@ exports.parse = function() {
// Return the link without unwikilink character as plain text
return [{type: "text", text: linkText.substr(1)}];
};
-
-})();
diff --git a/core/modules/parsers/wikiparser/wikiparser.js b/core/modules/parsers/wikiparser/wikiparser.js
index 854171d19..3d1379fd4 100644
--- a/core/modules/parsers/wikiparser/wikiparser.js
+++ b/core/modules/parsers/wikiparser/wikiparser.js
@@ -19,10 +19,7 @@ Attributes are stored as hashmaps of the following objects:
{type: "macro", macro: } - indirect through a macro invocation
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -495,5 +492,3 @@ WikiParser.prototype.amendRules = function(type,names) {
};
exports["text/vnd.tiddlywiki"] = WikiParser;
-
-})();
diff --git a/core/modules/parsers/wikiparser/wikirulebase.js b/core/modules/parsers/wikiparser/wikirulebase.js
index 8aa960ef7..a9d6c748f 100644
--- a/core/modules/parsers/wikiparser/wikirulebase.js
+++ b/core/modules/parsers/wikiparser/wikirulebase.js
@@ -6,10 +6,7 @@ module-type: global
Base class for wiki parser rules
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -35,5 +32,3 @@ WikiRuleBase.prototype.findNextMatch = function(startPos) {
};
exports.WikiRuleBase = WikiRuleBase;
-
-})();
diff --git a/core/modules/pluginswitcher.js b/core/modules/pluginswitcher.js
index 2915de95a..d89d261d7 100644
--- a/core/modules/pluginswitcher.js
+++ b/core/modules/pluginswitcher.js
@@ -6,10 +6,7 @@ module-type: global
Manages switching plugins for themes and languages.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -75,5 +72,3 @@ PluginSwitcher.prototype.switchPlugins = function() {
};
exports.PluginSwitcher = PluginSwitcher;
-
-})();
diff --git a/core/modules/saver-handler.js b/core/modules/saver-handler.js
index 23056bcc2..7f4e834a0 100644
--- a/core/modules/saver-handler.js
+++ b/core/modules/saver-handler.js
@@ -6,10 +6,7 @@ module-type: global
The saver handler tracks changes to the store and handles saving the entire wiki via saver modules.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -46,8 +43,10 @@ function SaverHandler(options) {
// Filter the changes so that we only count changes to tiddlers that we care about
var filteredChanges = self.filterFn.call(self.wiki,function(iterator) {
$tw.utils.each(changes,function(change,title) {
- var tiddler = self.wiki.getTiddler(title);
- iterator(tiddler,title);
+ if(change.normal) {
+ var tiddler = self.wiki.getTiddler(title);
+ iterator(tiddler,title);
+ }
});
});
// Adjust the number of changes
@@ -183,7 +182,7 @@ SaverHandler.prototype.saveWiki = function(options) {
// Call the highest priority saver that supports this method
for(var t=this.savers.length-1; t>=0; t--) {
var saver = this.savers[t];
- if(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback,{variables: {filename: variables.filename}})) {
+ if(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback,{variables: {filename: variables.filename, type: variables.type}})) {
this.logger.log("Saving wiki with method",method,"through saver",saver.info.name);
return true;
}
@@ -212,5 +211,3 @@ SaverHandler.prototype.updateDirtyStatus = function() {
};
exports.SaverHandler = SaverHandler;
-
-})();
diff --git a/core/modules/savers/andtidwiki.js b/core/modules/savers/andtidwiki.js
index 9ab405e37..5ce4dbe0e 100644
--- a/core/modules/savers/andtidwiki.js
+++ b/core/modules/savers/andtidwiki.js
@@ -6,10 +6,8 @@ module-type: saver
Handles saving changes via the AndTidWiki Android app
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false, netscape: false, Components: false */
+
"use strict";
var AndTidWiki = function(wiki) {
@@ -86,5 +84,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new AndTidWiki(wiki);
};
-
-})();
diff --git a/core/modules/savers/custom.js b/core/modules/savers/custom.js
index 836691204..dc5f91703 100644
--- a/core/modules/savers/custom.js
+++ b/core/modules/savers/custom.js
@@ -9,10 +9,7 @@ on the parent window (of an iframe). If present, the saver must define
and the saver may define
priority: number
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var findSaver = function(window) {
@@ -57,4 +54,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new CustomSaver(wiki);
};
-})();
diff --git a/core/modules/savers/download.js b/core/modules/savers/download.js
index 0a1d565ce..9d046d24a 100644
--- a/core/modules/savers/download.js
+++ b/core/modules/savers/download.js
@@ -6,10 +6,7 @@ module-type: saver
Handles saving changes via HTML5's download APIs
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -22,6 +19,7 @@ DownloadSaver.prototype.save = function(text,method,callback,options) {
options = options || {};
// Get the current filename
var filename = options.variables.filename;
+ var type = options.variables.type;
if(!filename) {
var p = document.location.pathname.lastIndexOf("/");
if(p !== -1) {
@@ -32,13 +30,16 @@ DownloadSaver.prototype.save = function(text,method,callback,options) {
if(!filename) {
filename = "tiddlywiki.html";
}
+ if(!type) {
+ type = "text/html";
+ }
// Set up the link
var link = document.createElement("a");
if(Blob !== undefined) {
- var blob = new Blob([text], {type: "text/html"});
+ var blob = new Blob([text], {type: type});
link.setAttribute("href", URL.createObjectURL(blob));
} else {
- link.setAttribute("href","data:text/html," + encodeURIComponent(text));
+ link.setAttribute("href","data:" + type + "," + encodeURIComponent(text));
}
link.setAttribute("download",filename);
document.body.appendChild(link);
@@ -80,5 +81,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new DownloadSaver(wiki);
};
-
-})();
diff --git a/core/modules/savers/fsosaver.js b/core/modules/savers/fsosaver.js
index 37224e42a..85b56e956 100644
--- a/core/modules/savers/fsosaver.js
+++ b/core/modules/savers/fsosaver.js
@@ -9,10 +9,7 @@ Note: Since TiddlyWiki's markup contains the MOTW, the FileSystemObject normally
However, if the wiki is loaded as an .HTA file (Windows HTML Applications) then the FSO can be used.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -70,5 +67,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new FSOSaver(wiki);
};
-
-})();
diff --git a/core/modules/savers/gitea.js b/core/modules/savers/gitea.js
index 826719ee9..ef23214c1 100644
--- a/core/modules/savers/gitea.js
+++ b/core/modules/savers/gitea.js
@@ -6,10 +6,7 @@ module-type: saver
Saves wiki by pushing a commit to the gitea
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -132,5 +129,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new GiteaSaver(wiki);
};
-
-})();
diff --git a/core/modules/savers/github.js b/core/modules/savers/github.js
index c0a34f2d6..f0dca48fc 100644
--- a/core/modules/savers/github.js
+++ b/core/modules/savers/github.js
@@ -6,10 +6,7 @@ module-type: saver
Saves wiki by pushing a commit to the GitHub v3 REST API
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -115,5 +112,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new GitHubSaver(wiki);
};
-
-})();
diff --git a/core/modules/savers/gitlab.js b/core/modules/savers/gitlab.js
index 243aab8a5..43305b578 100644
--- a/core/modules/savers/gitlab.js
+++ b/core/modules/savers/gitlab.js
@@ -6,10 +6,7 @@ module-type: saver
Saves wiki by pushing a commit to the GitLab REST API
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: true */
"use strict";
/*
@@ -113,5 +110,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new GitLabSaver(wiki);
};
-
-})();
diff --git a/core/modules/savers/manualdownload.js b/core/modules/savers/manualdownload.js
index af9bcd743..bb3c3c142 100644
--- a/core/modules/savers/manualdownload.js
+++ b/core/modules/savers/manualdownload.js
@@ -6,10 +6,7 @@ module-type: saver
Handles saving changes via HTML5's download APIs
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Title of the tiddler containing the download message
@@ -52,5 +49,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new ManualDownloadSaver(wiki);
};
-
-})();
diff --git a/core/modules/savers/msdownload.js b/core/modules/savers/msdownload.js
index 6cb55c334..233fd3571 100644
--- a/core/modules/savers/msdownload.js
+++ b/core/modules/savers/msdownload.js
@@ -6,10 +6,7 @@ module-type: saver
Handles saving changes via window.navigator.msSaveBlob()
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -55,5 +52,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new MsDownloadSaver(wiki);
};
-
-})();
diff --git a/core/modules/savers/put.js b/core/modules/savers/put.js
index 69689e6db..b77cfdfc8 100644
--- a/core/modules/savers/put.js
+++ b/core/modules/savers/put.js
@@ -9,10 +9,7 @@ Works with any server which accepts a PUT request
to the current URL, such as a WebDAV server.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -136,5 +133,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new PutSaver(wiki);
};
-
-})();
diff --git a/core/modules/savers/tiddlyfox.js b/core/modules/savers/tiddlyfox.js
index 81b373d42..2356e287e 100644
--- a/core/modules/savers/tiddlyfox.js
+++ b/core/modules/savers/tiddlyfox.js
@@ -6,10 +6,7 @@ module-type: saver
Handles saving changes via the TiddlyFox file extension
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false, netscape: false, Components: false */
"use strict";
var TiddlyFoxSaver = function(wiki) {
@@ -82,5 +79,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new TiddlyFoxSaver(wiki);
};
-
-})();
diff --git a/core/modules/savers/tiddlyie.js b/core/modules/savers/tiddlyie.js
index d6d49db45..3b380592d 100644
--- a/core/modules/savers/tiddlyie.js
+++ b/core/modules/savers/tiddlyie.js
@@ -6,10 +6,7 @@ module-type: saver
Handles saving changes via Internet Explorer BHO extenion (TiddlyIE)
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -67,5 +64,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new TiddlyIESaver(wiki);
};
-
-})();
diff --git a/core/modules/savers/twedit.js b/core/modules/savers/twedit.js
index ec125bf94..8aae0c54e 100644
--- a/core/modules/savers/twedit.js
+++ b/core/modules/savers/twedit.js
@@ -6,10 +6,7 @@ module-type: saver
Handles saving changes via the TWEdit iOS app
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false, netscape: false, Components: false */
"use strict";
var TWEditSaver = function(wiki) {
@@ -87,5 +84,3 @@ exports.create = function(wiki) {
if($tw.browser) {
window.version = {title: "TiddlyWiki"};
}
-
-})();
diff --git a/core/modules/savers/upload.js b/core/modules/savers/upload.js
index ade545000..7f17d77bd 100644
--- a/core/modules/savers/upload.js
+++ b/core/modules/savers/upload.js
@@ -8,10 +8,7 @@ Handles saving changes via upload to a server.
Designed to be compatible with BidiX's UploadPlugin at http://tiddlywiki.bidix.info/#UploadPlugin
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -107,5 +104,3 @@ Create an instance of this saver
exports.create = function(wiki) {
return new UploadSaver(wiki);
};
-
-})();
diff --git a/core/modules/server/authenticators/basic.js b/core/modules/server/authenticators/basic.js
index cd528c485..e67e701f5 100644
--- a/core/modules/server/authenticators/basic.js
+++ b/core/modules/server/authenticators/basic.js
@@ -6,10 +6,7 @@ module-type: authenticator
Authenticator for WWW basic authentication
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
if($tw.node) {
@@ -90,5 +87,3 @@ BasicAuthenticator.prototype.authenticateRequest = function(request,response,sta
};
exports.AuthenticatorClass = BasicAuthenticator;
-
-})();
diff --git a/core/modules/server/authenticators/header.js b/core/modules/server/authenticators/header.js
index cc1d6bdaf..bbcf9a1d4 100644
--- a/core/modules/server/authenticators/header.js
+++ b/core/modules/server/authenticators/header.js
@@ -6,10 +6,7 @@ module-type: authenticator
Authenticator for trusted header authentication
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
function HeaderAuthenticator(server) {
@@ -46,4 +43,3 @@ HeaderAuthenticator.prototype.authenticateRequest = function(request,response,st
exports.AuthenticatorClass = HeaderAuthenticator;
-})();
diff --git a/core/modules/server/routes/delete-tiddler.js b/core/modules/server/routes/delete-tiddler.js
index 85b552599..33cb40d55 100644
--- a/core/modules/server/routes/delete-tiddler.js
+++ b/core/modules/server/routes/delete-tiddler.js
@@ -6,10 +6,6 @@ module-type: route
DELETE /recipes/default/tiddlers/:title
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.method = "DELETE";
@@ -24,5 +20,3 @@ exports.handler = function(request,response,state) {
});
response.end();
};
-
-}());
diff --git a/core/modules/server/routes/get-favicon.js b/core/modules/server/routes/get-favicon.js
index 39a391127..8b757b2f7 100644
--- a/core/modules/server/routes/get-favicon.js
+++ b/core/modules/server/routes/get-favicon.js
@@ -6,10 +6,6 @@ module-type: route
GET /favicon.ico
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.method = "GET";
@@ -20,5 +16,3 @@ exports.handler = function(request,response,state) {
var buffer = state.wiki.getTiddlerText("$:/favicon.ico","");
state.sendResponse(200,{"Content-Type": "image/x-icon"},buffer,"base64");
};
-
-}());
diff --git a/core/modules/server/routes/get-file.js b/core/modules/server/routes/get-file.js
index 45aa51d34..39681de4c 100644
--- a/core/modules/server/routes/get-file.js
+++ b/core/modules/server/routes/get-file.js
@@ -6,10 +6,6 @@ module-type: route
GET /files/:filepath
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.method = "GET";
@@ -44,5 +40,3 @@ exports.handler = function(request,response,state) {
state.sendResponse(404,{"Content-Type": "text/plain"},"File '" + suppliedFilename + "' not found");
}
};
-
-}());
diff --git a/core/modules/server/routes/get-index.js b/core/modules/server/routes/get-index.js
index f2d01f793..7ba52faf6 100644
--- a/core/modules/server/routes/get-index.js
+++ b/core/modules/server/routes/get-index.js
@@ -6,10 +6,6 @@ module-type: route
GET /
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.method = "GET";
@@ -23,5 +19,3 @@ exports.handler = function(request,response,state) {
};
state.sendResponse(200,responseHeaders,text);
};
-
-}());
diff --git a/core/modules/server/routes/get-login-basic.js b/core/modules/server/routes/get-login-basic.js
index d573a0b5d..bca3bd18d 100644
--- a/core/modules/server/routes/get-login-basic.js
+++ b/core/modules/server/routes/get-login-basic.js
@@ -6,10 +6,6 @@ module-type: route
GET /login-basic -- force a Basic Authentication challenge
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.method = "GET";
@@ -25,12 +21,10 @@ exports.handler = function(request,response,state) {
response.end();
} else {
// Redirect to the root wiki if login worked
- var location = ($tw.syncadaptor && $tw.syncadaptor.host)? $tw.syncadaptor.host: "/";
+ var location = ($tw.syncadaptor && $tw.syncadaptor.host)? $tw.syncadaptor.host: `${state.pathPrefix}/`;
response.writeHead(302,{
Location: location
});
response.end();
}
};
-
-}());
diff --git a/core/modules/server/routes/get-status.js b/core/modules/server/routes/get-status.js
index ac35ee874..d93c64037 100644
--- a/core/modules/server/routes/get-status.js
+++ b/core/modules/server/routes/get-status.js
@@ -6,10 +6,6 @@ module-type: route
GET /status
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.method = "GET";
@@ -29,5 +25,3 @@ exports.handler = function(request,response,state) {
});
state.sendResponse(200,{"Content-Type": "application/json"},text,"utf8");
};
-
-}());
diff --git a/core/modules/server/routes/get-tiddler-html.js b/core/modules/server/routes/get-tiddler-html.js
index ab1570e30..a891ea6e7 100644
--- a/core/modules/server/routes/get-tiddler-html.js
+++ b/core/modules/server/routes/get-tiddler-html.js
@@ -6,10 +6,6 @@ module-type: route
GET /:title
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.method = "GET";
@@ -40,5 +36,3 @@ exports.handler = function(request,response,state) {
response.end();
}
};
-
-}());
diff --git a/core/modules/server/routes/get-tiddler.js b/core/modules/server/routes/get-tiddler.js
index ae6cfeadc..58ecb8a43 100644
--- a/core/modules/server/routes/get-tiddler.js
+++ b/core/modules/server/routes/get-tiddler.js
@@ -6,10 +6,6 @@ module-type: route
GET /recipes/default/tiddlers/:title
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.method = "GET";
@@ -42,5 +38,3 @@ exports.handler = function(request,response,state) {
response.end();
}
};
-
-}());
diff --git a/core/modules/server/routes/get-tiddlers-json.js b/core/modules/server/routes/get-tiddlers-json.js
index 6f3f07f6a..89f91032e 100644
--- a/core/modules/server/routes/get-tiddlers-json.js
+++ b/core/modules/server/routes/get-tiddlers-json.js
@@ -6,10 +6,6 @@ module-type: route
GET /recipes/default/tiddlers.json?filter=
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var DEFAULT_FILTER = "[all[tiddlers]!is[system]sort[title]]";
@@ -46,5 +42,3 @@ exports.handler = function(request,response,state) {
var text = JSON.stringify(tiddlers);
state.sendResponse(200,{"Content-Type": "application/json"},text,"utf8");
};
-
-}());
diff --git a/core/modules/server/routes/put-tiddler.js b/core/modules/server/routes/put-tiddler.js
index ff1bd2737..74327bd50 100644
--- a/core/modules/server/routes/put-tiddler.js
+++ b/core/modules/server/routes/put-tiddler.js
@@ -6,10 +6,6 @@ module-type: route
PUT /recipes/default/tiddlers/:title
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.method = "PUT";
@@ -48,5 +44,3 @@ exports.handler = function(request,response,state) {
});
response.end();
};
-
-}());
diff --git a/core/modules/server/server.js b/core/modules/server/server.js
index d3c98f8fc..2118e9b50 100644
--- a/core/modules/server/server.js
+++ b/core/modules/server/server.js
@@ -6,10 +6,7 @@ module-type: library
Serve tiddlers over http
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
if($tw.node) {
@@ -374,5 +371,3 @@ Server.prototype.listen = function(port,host,prefix) {
};
exports.Server = Server;
-
-})();
diff --git a/core/modules/startup/browser-messaging.js b/core/modules/startup/browser-messaging.js
index 733041e45..27ddb19d5 100644
--- a/core/modules/startup/browser-messaging.js
+++ b/core/modules/startup/browser-messaging.js
@@ -6,10 +6,7 @@ module-type: startup
Browser message handling
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -181,5 +178,3 @@ exports.startup = function() {
}
},false);
};
-
-})();
diff --git a/core/modules/startup/commands.js b/core/modules/startup/commands.js
index bd8b4afb3..3e4e40f45 100644
--- a/core/modules/startup/commands.js
+++ b/core/modules/startup/commands.js
@@ -6,10 +6,7 @@ module-type: startup
Command processing
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -33,5 +30,3 @@ exports.startup = function(callback) {
);
commander.execute();
};
-
-})();
diff --git a/core/modules/startup/favicon.js b/core/modules/startup/favicon.js
index 55e7891e2..d1a7c5677 100644
--- a/core/modules/startup/favicon.js
+++ b/core/modules/startup/favicon.js
@@ -6,10 +6,7 @@ module-type: startup
Favicon handling
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -39,5 +36,3 @@ function setFavicon() {
faviconLink.setAttribute("href",$tw.utils.makeDataUri(tiddler.fields.text,tiddler.fields.type,tiddler.fields._canonical_uri));
}
}
-
-})();
diff --git a/core/modules/startup/info.js b/core/modules/startup/info.js
index ed2305930..a5767ed34 100644
--- a/core/modules/startup/info.js
+++ b/core/modules/startup/info.js
@@ -6,10 +6,7 @@ module-type: startup
Initialise $:/info tiddlers via $:/temp/info-plugin pseudo-plugin
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -54,5 +51,3 @@ exports.startup = function() {
$tw.wiki.registerPluginTiddlers("info",[TITLE_INFO_PLUGIN]);
$tw.wiki.unpackPluginTiddlers();
};
-
-})();
diff --git a/core/modules/startup/load-modules.js b/core/modules/startup/load-modules.js
index 1dc71f7ac..cf0a8232d 100644
--- a/core/modules/startup/load-modules.js
+++ b/core/modules/startup/load-modules.js
@@ -6,10 +6,7 @@ module-type: startup
Load core modules
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -36,5 +33,3 @@ exports.startup = function() {
$tw.wiki.initParsers();
$tw.Commander.initCommands();
};
-
-})();
diff --git a/core/modules/startup/password.js b/core/modules/startup/password.js
index 5e8bd5352..5ea36ee19 100644
--- a/core/modules/startup/password.js
+++ b/core/modules/startup/password.js
@@ -6,10 +6,7 @@ module-type: startup
Password handling
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -49,5 +46,3 @@ exports.startup = function() {
}
});
};
-
-})();
diff --git a/core/modules/startup/plugins.js b/core/modules/startup/plugins.js
index fc8ba9589..3ceda8669 100644
--- a/core/modules/startup/plugins.js
+++ b/core/modules/startup/plugins.js
@@ -6,10 +6,7 @@ module-type: startup
Startup logic concerned with managing plugins
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -75,11 +72,10 @@ exports.startup = function() {
$tw.wiki.unpackPluginTiddlers();
// Queue change events for the changed shadow tiddlers
$tw.utils.each(Object.keys(changedShadowTiddlers),function(title) {
- $tw.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title]);
+ $tw.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title], true);
});
}
}
});
};
-})();
diff --git a/core/modules/startup/render.js b/core/modules/startup/render.js
index 7206a51d0..13cbb0356 100644
--- a/core/modules/startup/render.js
+++ b/core/modules/startup/render.js
@@ -6,10 +6,7 @@ module-type: startup
Title, stylesheet and page rendering
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -120,5 +117,3 @@ exports.startup = function() {
// Run any post-render startup actions
$tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction/PostRender");
};
-
-})();
diff --git a/core/modules/startup/rootwidget.js b/core/modules/startup/rootwidget.js
index d96d569c3..b30e03e7b 100644
--- a/core/modules/startup/rootwidget.js
+++ b/core/modules/startup/rootwidget.js
@@ -6,10 +6,7 @@ module-type: startup
Setup the root widget and the core root widget handlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -77,8 +74,9 @@ exports.startup = function() {
$tw.rootWidget.addEventListener("tm-copy-to-clipboard",function(event) {
$tw.utils.copyToClipboard(event.param,{
successNotification: event.paramObject && event.paramObject.successNotification,
- failureNotification: event.paramObject && event.paramObject.failureNotification
- });
+ failureNotification: event.paramObject && event.paramObject.failureNotification,
+ plainText: event.paramObject && event.paramObject.plainText
+ },event.paramObject && event.paramObject.type);
});
// Install the tm-focus-selector message
$tw.rootWidget.addEventListener("tm-focus-selector",function(event) {
@@ -127,5 +125,3 @@ exports.startup = function() {
});
}
};
-
-})();
diff --git a/core/modules/startup/startup.js b/core/modules/startup/startup.js
index e09f6393f..6f78c71b5 100755
--- a/core/modules/startup/startup.js
+++ b/core/modules/startup/startup.js
@@ -6,10 +6,7 @@ module-type: startup
Miscellaneous startup logic for both the client and server.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -67,14 +64,6 @@ exports.startup = function() {
wiki: $tw.wiki,
document: $tw.browser ? document : $tw.fakeDocument
});
- // Execute any startup actions
- $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction");
- if($tw.browser) {
- $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction/Browser");
- }
- if($tw.node) {
- $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction/Node");
- }
// Kick off the language manager and switcher
$tw.language = new $tw.Language();
$tw.languageSwitcher = new $tw.PluginSwitcher({
@@ -88,8 +77,10 @@ exports.startup = function() {
if($tw.browser) {
var pluginTiddler = $tw.wiki.getTiddler(plugins[0]);
if(pluginTiddler) {
+ document.documentElement.setAttribute("lang",pluginTiddler.getFieldString("name"));
document.documentElement.setAttribute("dir",pluginTiddler.getFieldString("text-direction") || "auto");
} else {
+ document.documentElement.setAttribute("lang","en-GB");
document.documentElement.removeAttribute("dir");
}
}
@@ -115,6 +106,14 @@ exports.startup = function() {
handlerMethod: "handleKeydownEvent"
}]);
}
+ // Execute any startup actions
+ $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction");
+ if($tw.browser) {
+ $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction/Browser");
+ }
+ if($tw.node) {
+ $tw.rootWidget.invokeActionsByTag("$:/tags/StartupAction/Node");
+ }
// Clear outstanding tiddler store change events to avoid an unnecessary refresh cycle at startup
$tw.wiki.clearTiddlerEventQueue();
// Find a working syncadaptor
@@ -146,5 +145,3 @@ exports.startup = function() {
$tw.anim = new $tw.utils.Animator();
}
};
-
-})();
diff --git a/core/modules/startup/story.js b/core/modules/startup/story.js
index c58c759c3..a0c878024 100644
--- a/core/modules/startup/story.js
+++ b/core/modules/startup/story.js
@@ -6,10 +6,7 @@ module-type: startup
Load core modules
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -234,5 +231,3 @@ function updateLocationHash(options) {
}
}
}
-
-})();
diff --git a/core/modules/startup/windows.js b/core/modules/startup/windows.js
index 34f45d7a5..8506a9866 100644
--- a/core/modules/startup/windows.js
+++ b/core/modules/startup/windows.js
@@ -6,10 +6,7 @@ module-type: startup
Setup root widget handlers for the messages concerned with opening external browser windows
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Export name and synchronous status
@@ -110,5 +107,3 @@ exports.startup = function() {
// Close open windows when unloading main window
$tw.addUnloadTask(closeAllWindows);
};
-
-})();
diff --git a/core/modules/story.js b/core/modules/story.js
index 16ff5a74a..4e624bb26 100644
--- a/core/modules/story.js
+++ b/core/modules/story.js
@@ -6,10 +6,7 @@ module-type: global
Lightweight object for managing interactions with the story and history lists.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -133,6 +130,3 @@ Story.prototype.storyNewTiddler = function(targetTitle) {
};
exports.Story = Story;
-
-
-})();
diff --git a/core/modules/storyviews/classic.js b/core/modules/storyviews/classic.js
index a85e458c5..c1f1c0e0f 100644
--- a/core/modules/storyviews/classic.js
+++ b/core/modules/storyviews/classic.js
@@ -6,10 +6,7 @@ module-type: storyview
Views the story as a linear sequence
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var easing = "cubic-bezier(0.645, 0.045, 0.355, 1)"; // From http://easings.net/#easeInOutCubic
@@ -117,5 +114,3 @@ ClassicStoryView.prototype.remove = function(widget) {
};
exports.classic = ClassicStoryView;
-
-})();
diff --git a/core/modules/storyviews/pop.js b/core/modules/storyviews/pop.js
index e2634e3d5..cbf649b18 100644
--- a/core/modules/storyviews/pop.js
+++ b/core/modules/storyviews/pop.js
@@ -6,10 +6,7 @@ module-type: storyview
Animates list insertions and removals
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var PopStoryView = function(listWidget) {
@@ -99,5 +96,3 @@ PopStoryView.prototype.remove = function(widget) {
};
exports.pop = PopStoryView;
-
-})();
diff --git a/core/modules/storyviews/zoomin.js b/core/modules/storyviews/zoomin.js
index d02f705e7..e5c5b88a8 100644
--- a/core/modules/storyviews/zoomin.js
+++ b/core/modules/storyviews/zoomin.js
@@ -6,10 +6,7 @@ module-type: storyview
Zooms between individual tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var easing = "cubic-bezier(0.645, 0.045, 0.355, 1)"; // From http://easings.net/#easeInOutCubic
@@ -226,5 +223,3 @@ ZoominListView.prototype.logTextNodeRoot = function(node) {
};
exports.zoomin = ZoominListView;
-
-})();
diff --git a/core/modules/syncer.js b/core/modules/syncer.js
index f7627e1ac..f565d0b9f 100644
--- a/core/modules/syncer.js
+++ b/core/modules/syncer.js
@@ -6,10 +6,7 @@ module-type: global
The syncer tracks changes to the store and synchronises them to a remote data store represented as a "sync adaptor"
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -703,5 +700,3 @@ SyncFromServerTask.prototype.run = function(callback) {
};
exports.Syncer = Syncer;
-
-})();
diff --git a/core/modules/tiddler.js b/core/modules/tiddler.js
index b0b6e6942..d28f90945 100644
--- a/core/modules/tiddler.js
+++ b/core/modules/tiddler.js
@@ -6,10 +6,7 @@ module-type: tiddlermethod
Extension methods for the $tw.Tiddler object (constructor and methods required at boot time are in boot/boot.js)
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.hasTag = function(tag) {
@@ -40,10 +37,10 @@ exports.getFieldString = function(field,defaultValue) {
};
/*
-Get the value of a field as a list
+Get the value of a field as an array / list
*/
exports.getFieldList = function(field) {
- var value = this.fields[field];
+ var value = this.getFieldString(field,null);
// Check for a missing field
if(value === undefined || value === null) {
return [];
@@ -99,5 +96,3 @@ exports.getFieldDay = function(field) {
this.cache.day[field] = day;
return day;
};
-
-})();
diff --git a/core/modules/upgraders/plugins.js b/core/modules/upgraders/plugins.js
index 83487aabf..8f35d5090 100644
--- a/core/modules/upgraders/plugins.js
+++ b/core/modules/upgraders/plugins.js
@@ -6,10 +6,7 @@ module-type: upgrader
Upgrader module that checks that plugins are newer than any already installed version
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var UPGRADE_LIBRARY_TITLE = "$:/UpgradeLibrary";
@@ -75,5 +72,3 @@ exports.upgrade = function(wiki,titles,tiddlers) {
});
return messages;
};
-
-})();
diff --git a/core/modules/upgraders/system.js b/core/modules/upgraders/system.js
index a653a75b1..ae3f76b3c 100644
--- a/core/modules/upgraders/system.js
+++ b/core/modules/upgraders/system.js
@@ -6,10 +6,7 @@ module-type: upgrader
Upgrader module that suppresses certain system tiddlers that shouldn't be imported
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var DONT_IMPORT_LIST = ["$:/Import", "$:/build"],
@@ -47,5 +44,3 @@ exports.upgrade = function(wiki,titles,tiddlers) {
}
return messages;
};
-
-})();
diff --git a/core/modules/upgraders/themetweaks.js b/core/modules/upgraders/themetweaks.js
index e411b285a..616f9008d 100644
--- a/core/modules/upgraders/themetweaks.js
+++ b/core/modules/upgraders/themetweaks.js
@@ -15,10 +15,7 @@ Now, each tweak is stored in its own separate tiddler.
This upgrader copies any values from the old format to the new. The old data tiddlers are not deleted in case they have been used to store additional indexes.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var MAPPINGS = {
@@ -61,5 +58,3 @@ exports.upgrade = function(wiki,titles,tiddlers) {
});
return messages;
};
-
-})();
diff --git a/core/modules/utils/crypto.js b/core/modules/utils/crypto.js
index 8ad0923a4..dc239fbcc 100644
--- a/core/modules/utils/crypto.js
+++ b/core/modules/utils/crypto.js
@@ -6,10 +6,7 @@ module-type: utils
Utility functions related to crypto.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -90,5 +87,3 @@ exports.decryptStoreAreaInteractive = function(encryptedStoreArea,callback,optio
});
}
};
-
-})();
diff --git a/core/modules/utils/csv.js b/core/modules/utils/csv.js
index 68b647127..177f0c0ac 100644
--- a/core/modules/utils/csv.js
+++ b/core/modules/utils/csv.js
@@ -6,10 +6,7 @@ module-type: utils
A barebones CSV parser
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var QUOTE = '"';
@@ -120,5 +117,3 @@ exports.parseCsvStringWithHeader = function(text,options) {
}
return csv;
}
-
-})();
diff --git a/core/modules/utils/dom/animations/slide.js b/core/modules/utils/dom/animations/slide.js
index face94960..2057c4460 100644
--- a/core/modules/utils/dom/animations/slide.js
+++ b/core/modules/utils/dom/animations/slide.js
@@ -6,10 +6,7 @@ module-type: animation
A simple slide animation that varies the height of the element
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
function slideOpen(domNode,options) {
@@ -111,5 +108,3 @@ exports.slide = {
open: slideOpen,
close: slideClosed
};
-
-})();
diff --git a/core/modules/utils/dom/animator.js b/core/modules/utils/dom/animator.js
index f994d9b58..013900975 100644
--- a/core/modules/utils/dom/animator.js
+++ b/core/modules/utils/dom/animator.js
@@ -6,10 +6,7 @@ module-type: utils
Orchestrates animations and transitions
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
function Animator() {
@@ -39,5 +36,3 @@ Animator.prototype.perform = function(type,domNode,options) {
};
exports.Animator = Animator;
-
-})();
diff --git a/core/modules/utils/dom/browser.js b/core/modules/utils/dom/browser.js
index fcc292bed..7501d4154 100644
--- a/core/modules/utils/dom/browser.js
+++ b/core/modules/utils/dom/browser.js
@@ -6,10 +6,7 @@ module-type: utils
Browser feature detection
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -160,5 +157,3 @@ exports.getFullScreenApis = function() {
return result;
}
};
-
-})();
diff --git a/core/modules/utils/dom/dom.js b/core/modules/utils/dom/dom.js
index 0b71e128c..a5b14ff78 100644
--- a/core/modules/utils/dom/dom.js
+++ b/core/modules/utils/dom/dom.js
@@ -6,10 +6,7 @@ module-type: utils
Various static DOM-related utility functions.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Popup = require("$:/core/modules/utils/dom/popup.js");
@@ -268,9 +265,10 @@ exports.copyStyles = function(srcDomNode,dstDomNode) {
/*
Copy plain text to the clipboard on browsers that support it
*/
-exports.copyToClipboard = function(text,options) {
- options = options || {};
- text = text || "";
+exports.copyToClipboard = function(text,options,type) {
+ var text = text || "";
+ var options = options || {};
+ var type = type || "text/plain";
var textArea = document.createElement("textarea");
textArea.style.position = "fixed";
textArea.style.top = 0;
@@ -283,10 +281,16 @@ exports.copyToClipboard = function(text,options) {
textArea.style.outline = "none";
textArea.style.boxShadow = "none";
textArea.style.background = "transparent";
- textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
textArea.setSelectionRange(0,text.length);
+ textArea.addEventListener("copy",function(event) {
+ event.preventDefault();
+ if (options.plainText) {
+ event.clipboardData.setData("text/plain",options.plainText);
+ }
+ event.clipboardData.setData(type,text);
+ });
var succeeded = false;
try {
succeeded = document.execCommand("copy");
@@ -388,5 +392,3 @@ exports.querySelectorAllSafe = function(selector,baseElement) {
console.log("Invalid selector: ",selector);
}
};
-
-})();
diff --git a/core/modules/utils/dom/dragndrop.js b/core/modules/utils/dom/dragndrop.js
index c7c32cbaf..25a13537c 100644
--- a/core/modules/utils/dom/dragndrop.js
+++ b/core/modules/utils/dom/dragndrop.js
@@ -6,10 +6,7 @@ module-type: utils
Browser data transfer utilities, used with the clipboard and drag and drop
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -275,5 +272,3 @@ exports.dragEventContainsFiles = function(event) {
};
exports.dragEventContainsType = dragEventContainsType;
-
-})();
diff --git a/core/modules/utils/dom/http.js b/core/modules/utils/dom/http.js
index f16f1c512..75b82cd77 100644
--- a/core/modules/utils/dom/http.js
+++ b/core/modules/utils/dom/http.js
@@ -6,10 +6,7 @@ module-type: utils
HTTP support
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -216,11 +213,11 @@ HttpClientRequest.prototype.send = function(callback) {
if(lengthComputable) {
setBinding(self.bindProgress,"" + Math.floor((loaded/total) * 100))
}
- self.wiki.invokeActionString(self.progressActions,undefined,{
+ self.wiki.invokeActionString(self.progressActions,undefined,$tw.utils.extend({},self.variables,{
lengthComputable: lengthComputable ? "yes" : "no",
loaded: loaded,
total: total
- },{parentWidget: $tw.rootWidget});
+ }),{parentWidget: $tw.rootWidget});
}
});
}
@@ -353,5 +350,3 @@ exports.setQueryStringParameter = function(url,paramName,paramValue) {
return url;
}
};
-
-})();
diff --git a/core/modules/utils/dom/keyboard.js b/core/modules/utils/dom/keyboard.js
index 0ba1af5a0..926753a65 100644
--- a/core/modules/utils/dom/keyboard.js
+++ b/core/modules/utils/dom/keyboard.js
@@ -6,10 +6,7 @@ module-type: utils
Keyboard utilities; now deprecated. Instead, use $tw.keyboardManager
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
["parseKeyDescriptor","checkKeyDescriptor"].forEach(function(method) {
@@ -21,5 +18,3 @@ Keyboard utilities; now deprecated. Instead, use $tw.keyboardManager
}
};
});
-
-})();
diff --git a/core/modules/utils/dom/modal.js b/core/modules/utils/dom/modal.js
index 1e620aa9a..cd827c3be 100644
--- a/core/modules/utils/dom/modal.js
+++ b/core/modules/utils/dom/modal.js
@@ -6,10 +6,7 @@ module-type: utils
Modal message mechanism
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var widget = require("$:/core/modules/widgets/widget.js");
@@ -253,5 +250,3 @@ Modal.prototype.adjustPageClass = function() {
};
exports.Modal = Modal;
-
-})();
diff --git a/core/modules/utils/dom/notifier.js b/core/modules/utils/dom/notifier.js
index bf93d451c..8743b83be 100644
--- a/core/modules/utils/dom/notifier.js
+++ b/core/modules/utils/dom/notifier.js
@@ -6,10 +6,7 @@ module-type: utils
Notifier mechanism
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var widget = require("$:/core/modules/widgets/widget.js");
@@ -88,5 +85,3 @@ Notifier.prototype.display = function(title,options) {
};
exports.Notifier = Notifier;
-
-})();
diff --git a/core/modules/utils/dom/popup.js b/core/modules/utils/dom/popup.js
index 017e7da8f..6ed7c4bca 100644
--- a/core/modules/utils/dom/popup.js
+++ b/core/modules/utils/dom/popup.js
@@ -6,10 +6,7 @@ module-type: utils
Module that creates a $tw.utils.Popup object prototype that manages popups in the browser
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -243,5 +240,3 @@ exports.buildCoordinates = function(prefix,position) {
}
exports.Popup = Popup;
-
-})();
diff --git a/core/modules/utils/dom/scroller.js b/core/modules/utils/dom/scroller.js
index 905bb2750..84be12c50 100644
--- a/core/modules/utils/dom/scroller.js
+++ b/core/modules/utils/dom/scroller.js
@@ -6,10 +6,7 @@ module-type: utils
Module that creates a $tw.utils.Scroller object prototype that manages scrolling in the browser
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -135,5 +132,3 @@ PageScroller.prototype.scrollSelectorIntoView = function(baseElement,selector,ca
};
exports.PageScroller = PageScroller;
-
-})();
diff --git a/core/modules/utils/edition-info.js b/core/modules/utils/edition-info.js
index b9d97f962..2c525e3cc 100644
--- a/core/modules/utils/edition-info.js
+++ b/core/modules/utils/edition-info.js
@@ -6,10 +6,7 @@ module-type: utils-node
Information about the available editions
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var fs = require("fs"),
@@ -44,5 +41,3 @@ exports.getEditionInfo = function() {
}
return editionInfo;
};
-
-})();
\ No newline at end of file
diff --git a/core/modules/utils/errors.js b/core/modules/utils/errors.js
index fac4b3fa7..40e0a4f8f 100644
--- a/core/modules/utils/errors.js
+++ b/core/modules/utils/errors.js
@@ -6,8 +6,6 @@ module-type: utils
Custom errors for TiddlyWiki.
\*/
-(function(){
-
function TranscludeRecursionError() {
Error.apply(this,arguments);
this.signatures = Object.create(null);
@@ -19,5 +17,3 @@ TranscludeRecursionError.MAX_WIDGET_TREE_DEPTH = 1000;
TranscludeRecursionError.prototype = Object.create(Error);
exports.TranscludeRecursionError = TranscludeRecursionError;
-
-})();
diff --git a/core/modules/utils/escapecss.js b/core/modules/utils/escapecss.js
index 5935b034a..f2248c445 100644
--- a/core/modules/utils/escapecss.js
+++ b/core/modules/utils/escapecss.js
@@ -6,12 +6,10 @@ module-type: utils
Provides CSS.escape() functionality.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false, window: false */
"use strict";
+// TODO -- resolve this construction
exports.escapeCSS = (function() {
// use browser's native CSS.escape() function if available
if ($tw.browser && window.CSS && window.CSS.escape) {
@@ -100,5 +98,3 @@ exports.escapeCSS = (function() {
return result;
};
})();
-
-})();
diff --git a/core/modules/utils/fakedom.js b/core/modules/utils/fakedom.js
index 66f2314e2..764ac84f8 100755
--- a/core/modules/utils/fakedom.js
+++ b/core/modules/utils/fakedom.js
@@ -6,10 +6,7 @@ module-type: global
A barebones implementation of DOM interfaces needed by the rendering mechanism.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Sequence number used to enable us to track objects for testing
@@ -353,5 +350,3 @@ var document = {
};
exports.fakeDocument = document;
-
-})();
diff --git a/core/modules/utils/filesystem.js b/core/modules/utils/filesystem.js
index 86001c291..aa214586a 100644
--- a/core/modules/utils/filesystem.js
+++ b/core/modules/utils/filesystem.js
@@ -6,10 +6,7 @@ module-type: utils-node
File system utilities
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var fs = require("fs"),
@@ -543,5 +540,3 @@ exports.cleanupTiddlerFiles = function(options,callback) {
return callback(null,bootInfo);
}
};
-
-})();
diff --git a/core/modules/utils/linked-list.js b/core/modules/utils/linked-list.js
index 917069d16..8d7f44676 100644
--- a/core/modules/utils/linked-list.js
+++ b/core/modules/utils/linked-list.js
@@ -7,7 +7,8 @@ This is a doubly-linked indexed list intended for manipulation, particularly
pushTop, which it does with significantly better performance than an array.
\*/
-(function(){
+
+"use strict";
function LinkedList() {
this.clear();
@@ -204,5 +205,3 @@ LLMap.prototype = {
};
exports.LinkedList = LinkedList;
-
-})();
diff --git a/core/modules/utils/logger.js b/core/modules/utils/logger.js
index 1bee04646..da0d66923 100644
--- a/core/modules/utils/logger.js
+++ b/core/modules/utils/logger.js
@@ -6,10 +6,7 @@ module-type: utils
A basic logging implementation
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var ALERT_TAG = "$:/tags/Alert";
@@ -134,5 +131,3 @@ Logger.prototype.clearAlerts = function() {
};
exports.Logger = Logger;
-
-})();
diff --git a/core/modules/utils/parsetree.js b/core/modules/utils/parsetree.js
index a74b8f3f8..410f92181 100644
--- a/core/modules/utils/parsetree.js
+++ b/core/modules/utils/parsetree.js
@@ -6,10 +6,7 @@ module-type: utils
Parse tree utility functions.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -122,5 +119,3 @@ exports.getParseTreeText = function getParseTreeText(tree) {
}
return output.join("");
};
-
-})();
diff --git a/core/modules/utils/performance.js b/core/modules/utils/performance.js
index 8a86d33c7..f8311d977 100644
--- a/core/modules/utils/performance.js
+++ b/core/modules/utils/performance.js
@@ -6,10 +6,7 @@ module-type: global
Performance measurement.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
function Performance(enabled) {
@@ -87,5 +84,3 @@ Performance.prototype.measure = function(name,fn) {
};
exports.Performance = Performance;
-
-})();
diff --git a/core/modules/utils/pluginmaker.js b/core/modules/utils/pluginmaker.js
index e7426d62b..f64bbec85 100644
--- a/core/modules/utils/pluginmaker.js
+++ b/core/modules/utils/pluginmaker.js
@@ -6,10 +6,7 @@ module-type: utils
A quick and dirty way to pack up plugins within the browser.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -75,5 +72,3 @@ exports.repackPlugin = function(title,additionalTiddlers,excludeTiddlers) {
// Return a heartwarming confirmation
return "Plugin " + title + " successfully saved";
};
-
-})();
diff --git a/core/modules/utils/repository.js b/core/modules/utils/repository.js
index 3aeb4d25a..08d8828d9 100644
--- a/core/modules/utils/repository.js
+++ b/core/modules/utils/repository.js
@@ -6,10 +6,6 @@ module-type: utils
Utilities for working with the TiddlyWiki repository file structure
\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -48,5 +44,3 @@ exports.getAllPlugins = function(options) {
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.languagesPath,options.ignoreEnvironmentVariables ? undefined : $tw.config.languagesEnvVar),collectPlugins);
return tiddlers;
};
-
-})();
diff --git a/core/modules/utils/transliterate.js b/core/modules/utils/transliterate.js
index ce1cbeddb..37c5502bf 100644
--- a/core/modules/utils/transliterate.js
+++ b/core/modules/utils/transliterate.js
@@ -6,10 +6,7 @@ module-type: utils
Transliteration static utility functions.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -928,5 +925,3 @@ exports.transliterateToSafeASCII = function(str) {
return exports.transliterationPairs[ch] || ""
});
};
-
-})();
diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js
index 234de0c75..a228f91d4 100644
--- a/core/modules/utils/utils.js
+++ b/core/modules/utils/utils.js
@@ -6,10 +6,7 @@ module-type: utils
Various static utility functions.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var base64utf8 = require("$:/core/modules/utils/base64-utf8/base64-utf8.module.js");
@@ -1038,5 +1035,3 @@ exports.makeCompareFunction = function(type,options) {
};
return (types[type] || types[options.defaultType] || types.number);
};
-
-})();
diff --git a/core/modules/widgets/action-confirm.js b/core/modules/widgets/action-confirm.js
index 68d8c447e..c2ca39b64 100644
--- a/core/modules/widgets/action-confirm.js
+++ b/core/modules/widgets/action-confirm.js
@@ -5,10 +5,7 @@ type: application/javascript
module-type: widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -74,5 +71,3 @@ ConfirmWidget.prototype.allowActionPropagation = function() {
};
exports["action-confirm"] = ConfirmWidget;
-
-})();
diff --git a/core/modules/widgets/action-createtiddler.js b/core/modules/widgets/action-createtiddler.js
index b49eaad20..d010e6465 100644
--- a/core/modules/widgets/action-createtiddler.js
+++ b/core/modules/widgets/action-createtiddler.js
@@ -6,10 +6,7 @@ module-type: widget
Action widget to create a new tiddler with a unique name and specified fields.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw:false, require:false, exports:false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -109,5 +106,3 @@ CreateTiddlerWidget.prototype.invokeAction = function(triggeringWidget,event) {
};
exports["action-createtiddler"] = CreateTiddlerWidget;
-
-})();
diff --git a/core/modules/widgets/action-deletefield.js b/core/modules/widgets/action-deletefield.js
index 00f06562d..fd55e2270 100644
--- a/core/modules/widgets/action-deletefield.js
+++ b/core/modules/widgets/action-deletefield.js
@@ -6,10 +6,7 @@ module-type: widget
Action widget to delete fields of a tiddler.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -85,5 +82,3 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
};
exports["action-deletefield"] = DeleteFieldWidget;
-
-})();
diff --git a/core/modules/widgets/action-deletetiddler.js b/core/modules/widgets/action-deletetiddler.js
index 816f9f55e..fa80620b7 100644
--- a/core/modules/widgets/action-deletetiddler.js
+++ b/core/modules/widgets/action-deletetiddler.js
@@ -6,10 +6,7 @@ module-type: widget
Action widget to delete a tiddler.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -69,5 +66,3 @@ DeleteTiddlerWidget.prototype.invokeAction = function(triggeringWidget,event) {
};
exports["action-deletetiddler"] = DeleteTiddlerWidget;
-
-})();
diff --git a/core/modules/widgets/action-listops.js b/core/modules/widgets/action-listops.js
index b3d93a657..29cf9f8de 100644
--- a/core/modules/widgets/action-listops.js
+++ b/core/modules/widgets/action-listops.js
@@ -6,10 +6,6 @@ module-type: widget
Action widget to apply list operations to any tiddler field (defaults to the 'list' field of the current tiddler)
\*/
-(function() {
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var ActionListopsWidget = function(parseTreeNode, options) {
@@ -87,5 +83,3 @@ ActionListopsWidget.prototype.invokeAction = function(triggeringWidget,
};
exports["action-listops"] = ActionListopsWidget;
-
-})();
diff --git a/core/modules/widgets/action-log.js b/core/modules/widgets/action-log.js
index 7b1d1e904..3f8caf047 100644
--- a/core/modules/widgets/action-log.js
+++ b/core/modules/widgets/action-log.js
@@ -6,10 +6,7 @@ module-type: widget
Action widget to log debug messages
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -94,5 +91,3 @@ LogWidget.prototype.log = function() {
}
exports["action-log"] = LogWidget;
-
-})();
diff --git a/core/modules/widgets/action-navigate.js b/core/modules/widgets/action-navigate.js
index 2df6a011f..67c7713db 100644
--- a/core/modules/widgets/action-navigate.js
+++ b/core/modules/widgets/action-navigate.js
@@ -6,10 +6,7 @@ module-type: widget
Action widget to navigate to a tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -87,5 +84,3 @@ NavigateWidget.prototype.invokeAction = function(triggeringWidget,event) {
};
exports["action-navigate"] = NavigateWidget;
-
-})();
diff --git a/core/modules/widgets/action-popup.js b/core/modules/widgets/action-popup.js
index a3ce20165..b44b3a524 100644
--- a/core/modules/widgets/action-popup.js
+++ b/core/modules/widgets/action-popup.js
@@ -6,10 +6,7 @@ module-type: widget
Action widget to trigger a popup.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -81,5 +78,3 @@ ActionPopupWidget.prototype.invokeAction = function(triggeringWidget,event) {
};
exports["action-popup"] = ActionPopupWidget;
-
-})();
diff --git a/core/modules/widgets/action-sendmessage.js b/core/modules/widgets/action-sendmessage.js
index d1e800c91..7b9e6453f 100644
--- a/core/modules/widgets/action-sendmessage.js
+++ b/core/modules/widgets/action-sendmessage.js
@@ -6,10 +6,7 @@ module-type: widget
Action widget to send a message
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -95,5 +92,3 @@ SendMessageWidget.prototype.invokeAction = function(triggeringWidget,event) {
};
exports["action-sendmessage"] = SendMessageWidget;
-
-})();
diff --git a/core/modules/widgets/action-setfield.js b/core/modules/widgets/action-setfield.js
index f853484cd..2d2c6ce47 100644
--- a/core/modules/widgets/action-setfield.js
+++ b/core/modules/widgets/action-setfield.js
@@ -6,10 +6,7 @@ module-type: widget
Action widget to set a single field or index on a tiddler.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -71,5 +68,3 @@ SetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
};
exports["action-setfield"] = SetFieldWidget;
-
-})();
diff --git a/core/modules/widgets/action-setmultiplefields.js b/core/modules/widgets/action-setmultiplefields.js
index 174c72889..1e2326394 100644
--- a/core/modules/widgets/action-setmultiplefields.js
+++ b/core/modules/widgets/action-setmultiplefields.js
@@ -6,10 +6,7 @@ module-type: widget
Action widget to set multiple fields or indexes on a tiddler
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -81,6 +78,3 @@ SetMultipleFieldsWidget.prototype.invokeAction = function(triggeringWidget,event
};
exports["action-setmultiplefields"] = SetMultipleFieldsWidget;
-
-})();
-
\ No newline at end of file
diff --git a/core/modules/widgets/browse.js b/core/modules/widgets/browse.js
index 8130825b0..b0173f6e2 100644
--- a/core/modules/widgets/browse.js
+++ b/core/modules/widgets/browse.js
@@ -6,10 +6,7 @@ module-type: widget
Browse widget for browsing for files to import
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -42,6 +39,9 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
if(this.tooltip) {
domNode.setAttribute("title",this.tooltip);
}
+ if(this.tabIndex) {
+ domNode.setAttribute("tabindex", this.tabIndex);
+ }
// Nw.js supports "nwsaveas" to force a "save as" dialogue that allows a new or existing file to be selected
if(this.nwsaveas) {
domNode.setAttribute("nwsaveas",this.nwsaveas);
@@ -56,6 +56,9 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
if(this.nwdirectory) {
domNode.setAttribute("nwdirectory",this.nwdirectory);
}
+ if(this.isDisabled === "yes") {
+ domNode.setAttribute("disabled", true);
+ }
// Add a click event handler
domNode.addEventListener("change",function (event) {
if(self.message) {
@@ -94,6 +97,8 @@ BrowseWidget.prototype.execute = function() {
this.accept = this.getAttribute("accept");
this.webkitdirectory = this.getAttribute("webkitdirectory");
this.nwdirectory = this.getAttribute("nwdirectory");
+ this.tabIndex = this.getAttribute("tabindex");
+ this.isDisabled = this.getAttribute("disabled", "no");
};
/*
@@ -109,5 +114,3 @@ BrowseWidget.prototype.refresh = function(changedTiddlers) {
};
exports.browse = BrowseWidget;
-
-})();
diff --git a/core/modules/widgets/button.js b/core/modules/widgets/button.js
index aef0fe630..68f2fcd11 100644
--- a/core/modules/widgets/button.js
+++ b/core/modules/widgets/button.js
@@ -6,10 +6,7 @@ module-type: widget
Button widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -279,5 +276,3 @@ ButtonWidget.prototype.refresh = function(changedTiddlers) {
};
exports.button = ButtonWidget;
-
-})();
diff --git a/core/modules/widgets/checkbox.js b/core/modules/widgets/checkbox.js
index e07513b0a..7fe62fb42 100644
--- a/core/modules/widgets/checkbox.js
+++ b/core/modules/widgets/checkbox.js
@@ -6,10 +6,7 @@ module-type: widget
Checkbox widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -47,6 +44,9 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) {
if(isChecked === undefined && this.checkboxIndeterminate === "yes") {
this.inputDomNode.indeterminate = true;
}
+ if(this.tabIndex) {
+ this.inputDomNode.setAttribute("tabindex", this.tabIndex);
+ }
if(this.isDisabled === "yes") {
this.inputDomNode.setAttribute("disabled",true);
}
@@ -154,7 +154,7 @@ CheckboxWidget.prototype.getValue = function() {
if(this.checkboxTag) {
return false;
}
- if(this.checkboxField) {
+ if(this.checkboxField || this.checkboxIndex) {
if(this.checkboxDefault === this.checkboxChecked) {
return true;
}
@@ -305,6 +305,7 @@ CheckboxWidget.prototype.execute = function() {
this.checkboxClass = this.getAttribute("class","");
this.checkboxInvertTag = this.getAttribute("invertTag","");
this.isDisabled = this.getAttribute("disabled","no");
+ this.tabIndex = this.getAttribute();
// Make the child widgets
this.makeChildWidgets();
};
@@ -314,7 +315,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
CheckboxWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
- if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.listField || changedAttributes.listIndex || changedAttributes.filter || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes.indeterminate || changedAttributes["class"] || changedAttributes.disabled) {
+ if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.listField || changedAttributes.listIndex || changedAttributes.filter || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes.indeterminate || changedAttributes["class"] || changedAttributes.disabled || changedAttributes.tabindex) {
this.refreshSelf();
return true;
} else {
@@ -340,6 +341,3 @@ CheckboxWidget.prototype.refresh = function(changedTiddlers) {
};
exports.checkbox = CheckboxWidget;
-
-})();
-
\ No newline at end of file
diff --git a/core/modules/widgets/codeblock.js b/core/modules/widgets/codeblock.js
index aa7910cf8..0c709c8e2 100644
--- a/core/modules/widgets/codeblock.js
+++ b/core/modules/widgets/codeblock.js
@@ -6,10 +6,7 @@ module-type: widget
Code block node widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -62,5 +59,3 @@ CodeBlockWidget.prototype.refresh = function(changedTiddlers) {
};
exports.codeblock = CodeBlockWidget;
-
-})();
diff --git a/core/modules/widgets/count.js b/core/modules/widgets/count.js
index b7ee45452..57acc6fe2 100644
--- a/core/modules/widgets/count.js
+++ b/core/modules/widgets/count.js
@@ -6,10 +6,7 @@ module-type: widget
Count widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -68,5 +65,3 @@ CountWidget.prototype.refresh = function(changedTiddlers) {
};
exports.count = CountWidget;
-
-})();
diff --git a/core/modules/widgets/data.js b/core/modules/widgets/data.js
index 5d76f5abd..50eafc63f 100644
--- a/core/modules/widgets/data.js
+++ b/core/modules/widgets/data.js
@@ -6,10 +6,6 @@ module-type: widget
Widget to dynamically represent one or more tiddlers
\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -190,5 +186,3 @@ function hasPayloadChanged(a,b) {
}
exports.data = DataWidget;
-
-})();
diff --git a/core/modules/widgets/diff-text.js b/core/modules/widgets/diff-text.js
index 47a47e259..32cc4f1d8 100644
--- a/core/modules/widgets/diff-text.js
+++ b/core/modules/widgets/diff-text.js
@@ -6,10 +6,7 @@ module-type: widget
Widget to display a diff between two texts
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget,
@@ -144,5 +141,3 @@ DiffTextWidget.prototype.refresh = function(changedTiddlers) {
};
exports["diff-text"] = DiffTextWidget;
-
-})();
diff --git a/core/modules/widgets/draggable.js b/core/modules/widgets/draggable.js
index 97e795ae4..0bb2fc169 100644
--- a/core/modules/widgets/draggable.js
+++ b/core/modules/widgets/draggable.js
@@ -6,10 +6,7 @@ module-type: widget
Draggable widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -131,5 +128,3 @@ DraggableWidget.prototype.refresh = function(changedTiddlers) {
};
exports.draggable = DraggableWidget;
-
-})();
diff --git a/core/modules/widgets/droppable.js b/core/modules/widgets/droppable.js
index ba54d8860..fe528d08f 100644
--- a/core/modules/widgets/droppable.js
+++ b/core/modules/widgets/droppable.js
@@ -6,10 +6,7 @@ module-type: widget
Droppable widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -206,5 +203,3 @@ DroppableWidget.prototype.refresh = function(changedTiddlers) {
};
exports.droppable = DroppableWidget;
-
-})();
\ No newline at end of file
diff --git a/core/modules/widgets/dropzone.js b/core/modules/widgets/dropzone.js
index 043b2557f..7d7d8b815 100644
--- a/core/modules/widgets/dropzone.js
+++ b/core/modules/widgets/dropzone.js
@@ -6,10 +6,7 @@ module-type: widget
Dropzone widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var IMPORT_TITLE = "$:/Import";
@@ -328,5 +325,3 @@ DropZoneWidget.prototype.refresh = function(changedTiddlers) {
};
exports.dropzone = DropZoneWidget;
-
-})();
diff --git a/core/modules/widgets/edit-binary.js b/core/modules/widgets/edit-binary.js
index a4a18f63d..bb9581df7 100644
--- a/core/modules/widgets/edit-binary.js
+++ b/core/modules/widgets/edit-binary.js
@@ -6,10 +6,7 @@ module-type: widget
Edit-binary widget; placeholder for editing binary tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var BINARY_WARNING_MESSAGE = "$:/core/ui/BinaryWarning";
@@ -103,5 +100,3 @@ EditBinaryWidget.prototype.refresh = function(changedTiddlers) {
};
exports["edit-binary"] = EditBinaryWidget;
-
-})();
diff --git a/core/modules/widgets/edit-bitmap.js b/core/modules/widgets/edit-bitmap.js
index 5065127d8..3065384b3 100644
--- a/core/modules/widgets/edit-bitmap.js
+++ b/core/modules/widgets/edit-bitmap.js
@@ -6,10 +6,7 @@ module-type: widget
Edit-bitmap widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
// Default image sizes
@@ -339,5 +336,3 @@ EditBitmapWidget.prototype.saveChanges = function() {
};
exports["edit-bitmap"] = EditBitmapWidget;
-
-})();
diff --git a/core/modules/widgets/edit-shortcut.js b/core/modules/widgets/edit-shortcut.js
index 31d81b6b8..9a45b6ec0 100644
--- a/core/modules/widgets/edit-shortcut.js
+++ b/core/modules/widgets/edit-shortcut.js
@@ -6,10 +6,7 @@ module-type: widget
Widget to display an editable keyboard shortcut
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -48,6 +45,9 @@ EditShortcutWidget.prototype.render = function(parent,nextSibling) {
if(this.shortcutAriaLabel) {
this.inputNode.setAttribute("aria-label",this.shortcutAriaLabel);
}
+ if(this.isDisabled === "yes") {
+ this.inputNode.setAttribute("disabled", true);
+ }
// Assign the current shortcut
this.updateInputNode();
// Add event handlers
@@ -77,6 +77,7 @@ EditShortcutWidget.prototype.execute = function() {
this.shortcutTooltip = this.getAttribute("tooltip");
this.shortcutAriaLabel = this.getAttribute("aria-label");
this.shortcutFocus = this.getAttribute("focus");
+ this.isDisabled = this.getAttribute("disabled", "no");
};
/*
@@ -138,7 +139,7 @@ Selectively refreshes the widget if needed. Returns true if the widget needed re
*/
EditShortcutWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
- if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.placeholder || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.style || changedAttributes.tooltip || changedAttributes["aria-label"] || changedAttributes.focus) {
+ if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.placeholder || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.style || changedAttributes.tooltip || changedAttributes["aria-label"] || changedAttributes.focus || changedAttributes.disabled) {
this.refreshSelf();
return true;
} else if(changedTiddlers[this.shortcutTiddler]) {
@@ -150,5 +151,3 @@ EditShortcutWidget.prototype.refresh = function(changedTiddlers) {
};
exports["edit-shortcut"] = EditShortcutWidget;
-
-})();
diff --git a/core/modules/widgets/edit-text.js b/core/modules/widgets/edit-text.js
index bc7b77490..28dc5f79c 100644
--- a/core/modules/widgets/edit-text.js
+++ b/core/modules/widgets/edit-text.js
@@ -6,10 +6,7 @@ module-type: widget
Edit-text widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var editTextWidgetFactory = require("$:/core/modules/editor/factory.js").editTextWidgetFactory,
@@ -17,5 +14,3 @@ var editTextWidgetFactory = require("$:/core/modules/editor/factory.js").editTex
SimpleEngine = require("$:/core/modules/editor/engines/simple.js").SimpleEngine;
exports["edit-text"] = editTextWidgetFactory(FramedEngine,SimpleEngine);
-
-})();
diff --git a/core/modules/widgets/edit.js b/core/modules/widgets/edit.js
index eb7758e90..ed2ad0b35 100644
--- a/core/modules/widgets/edit.js
+++ b/core/modules/widgets/edit.js
@@ -6,10 +6,7 @@ module-type: widget
Edit widget is a meta-widget chooses the appropriate actual editting widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -43,15 +40,6 @@ EditWidget.prototype.execute = function() {
// Get our parameters
this.editTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
this.editField = this.getAttribute("field","text");
- this.editIndex = this.getAttribute("index");
- this.editClass = this.getAttribute("class");
- this.editPlaceholder = this.getAttribute("placeholder");
- this.editTabIndex = this.getAttribute("tabindex");
- this.editFocus = this.getAttribute("focus","");
- this.editCancelPopups = this.getAttribute("cancelPopups","");
- this.editInputActions = this.getAttribute("inputActions");
- this.editRefreshTitle = this.getAttribute("refreshTitle");
- this.editAutoComplete = this.getAttribute("autocomplete");
// Choose the appropriate edit widget
this.editorType = this.getEditorType();
// Make the child widgets
@@ -89,8 +77,8 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
EditWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
- // Refresh if an attribute has changed, or the type associated with the target tiddler has changed
- if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tabindex || changedAttributes.cancelPopups || changedAttributes.inputActions || changedAttributes.refreshTitle || changedAttributes.autocomplete || (this.getEditorType() !== this.editorType)) {
+ // Refresh if the editor type has changed
+ if(changedAttributes.tiddler || changedAttributes.field || (this.getEditorType() !== this.editorType)) {
this.refreshSelf();
return true;
} else {
@@ -99,5 +87,3 @@ EditWidget.prototype.refresh = function(changedTiddlers) {
};
exports.edit = EditWidget;
-
-})();
diff --git a/core/modules/widgets/element.js b/core/modules/widgets/element.js
index 716886e5b..34fd3b9ff 100755
--- a/core/modules/widgets/element.js
+++ b/core/modules/widgets/element.js
@@ -6,10 +6,7 @@ module-type: widget
Element widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -101,5 +98,3 @@ ElementWidget.prototype.refresh = function(changedTiddlers) {
};
exports.element = ElementWidget;
-
-})();
diff --git a/core/modules/widgets/encrypt.js b/core/modules/widgets/encrypt.js
index 28dfdaf78..edfbe4429 100644
--- a/core/modules/widgets/encrypt.js
+++ b/core/modules/widgets/encrypt.js
@@ -6,10 +6,7 @@ module-type: widget
Encrypt widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -65,5 +62,3 @@ EncryptWidget.prototype.refresh = function(changedTiddlers) {
};
exports.encrypt = EncryptWidget;
-
-})();
diff --git a/core/modules/widgets/entity.js b/core/modules/widgets/entity.js
index 6f1a66fed..a88f32c3d 100755
--- a/core/modules/widgets/entity.js
+++ b/core/modules/widgets/entity.js
@@ -6,10 +6,7 @@ module-type: widget
HTML entity widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -56,5 +53,3 @@ EntityWidget.prototype.refresh = function(changedTiddlers) {
};
exports.entity = EntityWidget;
-
-})();
diff --git a/core/modules/widgets/error.js b/core/modules/widgets/error.js
index 6a4a607f1..efbb2cbfb 100644
--- a/core/modules/widgets/error.js
+++ b/core/modules/widgets/error.js
@@ -6,10 +6,7 @@ module-type: widget
Error widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -59,5 +56,3 @@ ErrorWidget.prototype.refresh = function(changedTiddlers) {
};
exports.error = ErrorWidget;
-
-})();
diff --git a/core/modules/widgets/eventcatcher.js b/core/modules/widgets/eventcatcher.js
index dad9503c6..70dc99202 100644
--- a/core/modules/widgets/eventcatcher.js
+++ b/core/modules/widgets/eventcatcher.js
@@ -6,10 +6,7 @@ module-type: widget
Event handler widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -155,5 +152,3 @@ EventWidget.prototype.refresh = function(changedTiddlers) {
};
exports.eventcatcher = EventWidget;
-
-})();
diff --git a/core/modules/widgets/fieldmangler.js b/core/modules/widgets/fieldmangler.js
index 5a7e43659..811318e99 100644
--- a/core/modules/widgets/fieldmangler.js
+++ b/core/modules/widgets/fieldmangler.js
@@ -6,10 +6,7 @@ module-type: widget
Field mangler widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -130,5 +127,3 @@ FieldManglerWidget.prototype.handleAddTagEvent = function(event) {
};
exports.fieldmangler = FieldManglerWidget;
-
-})();
diff --git a/core/modules/widgets/fields.js b/core/modules/widgets/fields.js
index 0e32443ad..db558e3b6 100755
--- a/core/modules/widgets/fields.js
+++ b/core/modules/widgets/fields.js
@@ -6,10 +6,7 @@ module-type: widget
Fields widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -110,5 +107,3 @@ FieldsWidget.prototype.refresh = function(changedTiddlers) {
};
exports.fields = FieldsWidget;
-
-})();
diff --git a/core/modules/widgets/fill.js b/core/modules/widgets/fill.js
index de88c95af..3a93a2b02 100644
--- a/core/modules/widgets/fill.js
+++ b/core/modules/widgets/fill.js
@@ -6,10 +6,7 @@ module-type: widget
Sub-widget used by the transclude widget for specifying values for slots within transcluded content. It doesn't do anything by itself because the transclude widget only ever deals with the parse tree nodes, and doesn't instantiate the widget itself
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -24,7 +21,8 @@ Inherit from the base widget class
*/
FillWidget.prototype = new Widget();
-exports.fill = FillWidget;
+FillWidget.prototype.execute = function() {
+ // Do nothing. Make no child widgets. $Fill widgets should be invisible when naturally encountered. Instead, their parseTreeNodes are made available to $slot widgets that want it.
+};
-})();
-
\ No newline at end of file
+exports.fill = FillWidget;
diff --git a/core/modules/widgets/genesis.js b/core/modules/widgets/genesis.js
index 299be1e48..3084ad285 100644
--- a/core/modules/widgets/genesis.js
+++ b/core/modules/widgets/genesis.js
@@ -6,10 +6,7 @@ module-type: widget
Genesis widget for dynamically creating widgets
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -23,15 +20,21 @@ Inherit from the base widget class
*/
GenesisWidget.prototype = new Widget();
+GenesisWidget.prototype.computeAttributes = function(options) {
+ options = options || Object.create(null);
+ options.filterFn = function(name) {
+ // Only compute our own attributes which start with a single dollar
+ return name.charAt(0) === "$" && name.charAt(1) !== "$";
+ }
+ return Widget.prototype.computeAttributes.call(this,options);
+};
+
/*
Render this widget into the DOM
*/
GenesisWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
- this.computeAttributes({filterFn: function(name) {
- // Only compute our own attributes which start with a single dollar
- return name.charAt(0) === "$" && name.charAt(1) !== "$";
- }});
+ this.computeAttributes();
this.execute();
this.renderChildren(parent,nextSibling);
};
@@ -111,5 +114,3 @@ GenesisWidget.prototype.refresh = function(changedTiddlers) {
};
exports.genesis = GenesisWidget;
-
-})();
diff --git a/core/modules/widgets/image.js b/core/modules/widgets/image.js
index 52496fd74..a8fddc789 100644
--- a/core/modules/widgets/image.js
+++ b/core/modules/widgets/image.js
@@ -22,10 +22,7 @@ Tiddlers that contain wikitext could be rendered to a DIV of the usual size of a
The width and height attributes are interpreted as a number of pixels, and do not need to include the "px" suffix.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -162,5 +159,3 @@ ImageWidget.prototype.refresh = function(changedTiddlers) {
};
exports.image = ImageWidget;
-
-})();
diff --git a/core/modules/widgets/importvariables.js b/core/modules/widgets/importvariables.js
index 3e1ac3fc6..befee4a90 100644
--- a/core/modules/widgets/importvariables.js
+++ b/core/modules/widgets/importvariables.js
@@ -6,10 +6,7 @@ module-type: widget
Import variable definitions from other tiddlers
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -132,5 +129,3 @@ ImportVariablesWidget.prototype.refresh = function(changedTiddlers) {
};
exports.importvariables = ImportVariablesWidget;
-
-})();
diff --git a/core/modules/widgets/jsontiddler.js b/core/modules/widgets/jsontiddler.js
index 44a9e50e3..8d16ae862 100644
--- a/core/modules/widgets/jsontiddler.js
+++ b/core/modules/widgets/jsontiddler.js
@@ -6,10 +6,7 @@ module-type: widget
Render a tiddler as JSON text
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -87,5 +84,3 @@ JSONTiddlerWidget.prototype.getTiddlerFields = function() {
};
exports.jsontiddler = JSONTiddlerWidget;
-
-})();
\ No newline at end of file
diff --git a/core/modules/widgets/keyboard.js b/core/modules/widgets/keyboard.js
index 9515f5a3b..f4f6c2906 100644
--- a/core/modules/widgets/keyboard.js
+++ b/core/modules/widgets/keyboard.js
@@ -6,10 +6,7 @@ module-type: widget
Keyboard shortcut widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -135,5 +132,3 @@ KeyboardWidget.prototype.refresh = function(changedTiddlers) {
};
exports.keyboard = KeyboardWidget;
-
-})();
diff --git a/core/modules/widgets/let.js b/core/modules/widgets/let.js
index 2b2886530..3cc09ad94 100644
--- a/core/modules/widgets/let.js
+++ b/core/modules/widgets/let.js
@@ -14,10 +14,7 @@ the later variables to depend upon the earlier ones.
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -92,5 +89,3 @@ LetWidget.prototype.refresh = function(changedTiddlers) {
};
exports["let"] = LetWidget;
-
-})();
diff --git a/core/modules/widgets/link.js b/core/modules/widgets/link.js
index f02a7cae2..c8b54818d 100755
--- a/core/modules/widgets/link.js
+++ b/core/modules/widgets/link.js
@@ -6,10 +6,7 @@ module-type: widget
Link widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -225,6 +222,3 @@ LinkWidget.prototype.refresh = function(changedTiddlers) {
};
exports.link = LinkWidget;
-
-})();
-
\ No newline at end of file
diff --git a/core/modules/widgets/linkcatcher.js b/core/modules/widgets/linkcatcher.js
index 4f4a66b17..d95b523ad 100644
--- a/core/modules/widgets/linkcatcher.js
+++ b/core/modules/widgets/linkcatcher.js
@@ -6,10 +6,7 @@ module-type: widget
Linkcatcher widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -100,5 +97,3 @@ LinkCatcherWidget.prototype.handleNavigateEvent = function(event) {
};
exports.linkcatcher = LinkCatcherWidget;
-
-})();
diff --git a/core/modules/widgets/list.js b/core/modules/widgets/list.js
index d4ad41995..f86d2d571 100755
--- a/core/modules/widgets/list.js
+++ b/core/modules/widgets/list.js
@@ -6,10 +6,7 @@ module-type: widget
List and list item widgets
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -523,4 +520,35 @@ ListJoinWidget.prototype.refresh = function() { return false; }
exports["list-join"] = ListJoinWidget;
-})();
+/*
+Make <$list-template> and <$list-empty> widgets that do nothing
+*/
+var ListTemplateWidget = function(parseTreeNode,options) {
+ // Main initialisation inherited from widget.js
+ this.initialise(parseTreeNode,options);
+};
+ListTemplateWidget.prototype = new Widget();
+ListTemplateWidget.prototype.render = function() {}
+ListTemplateWidget.prototype.refresh = function() { return false; }
+
+exports["list-template"] = ListTemplateWidget;
+
+var ListEmptyWidget = function(parseTreeNode,options) {
+ // Main initialisation inherited from widget.js
+ this.initialise(parseTreeNode,options);
+};
+ListEmptyWidget.prototype = new Widget();
+ListEmptyWidget.prototype.render = function() {}
+ListEmptyWidget.prototype.refresh = function() { return false; }
+
+exports["list-empty"] = ListEmptyWidget;
+
+var ListJoinWidget = function(parseTreeNode,options) {
+ // Main initialisation inherited from widget.js
+ this.initialise(parseTreeNode,options);
+};
+ListJoinWidget.prototype = new Widget();
+ListJoinWidget.prototype.render = function() {}
+ListJoinWidget.prototype.refresh = function() { return false; }
+
+exports["list-join"] = ListJoinWidget;
diff --git a/core/modules/widgets/log.js b/core/modules/widgets/log.js
index 9d6e95159..332c79fc2 100644
--- a/core/modules/widgets/log.js
+++ b/core/modules/widgets/log.js
@@ -6,10 +6,7 @@ module-type: widget-subclass
Widget to log debug messages
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
exports.baseClass = "action-log";
@@ -26,5 +23,3 @@ exports.prototype.render = function(event) {
Object.getPrototypeOf(Object.getPrototypeOf(this)).render.call(this,event);
Object.getPrototypeOf(Object.getPrototypeOf(this)).log.call(this);
}
-
-})();
\ No newline at end of file
diff --git a/core/modules/widgets/macrocall.js b/core/modules/widgets/macrocall.js
index 2c4adc355..75a927a62 100644
--- a/core/modules/widgets/macrocall.js
+++ b/core/modules/widgets/macrocall.js
@@ -6,10 +6,7 @@ module-type: widget
Macrocall widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -87,5 +84,3 @@ MacroCallWidget.prototype.refresh = function(changedTiddlers) {
};
exports.macrocall = MacroCallWidget;
-
-})();
diff --git a/core/modules/widgets/messagecatcher.js b/core/modules/widgets/messagecatcher.js
index 1457cd11f..44cb60f41 100644
--- a/core/modules/widgets/messagecatcher.js
+++ b/core/modules/widgets/messagecatcher.js
@@ -6,10 +6,7 @@ module-type: widget
Message catcher widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -106,5 +103,3 @@ MessageCatcherWidget.prototype.refresh = function(changedTiddlers) {
};
exports.messagecatcher = MessageCatcherWidget;
-
-})();
diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js
index e9bec7682..793bc8416 100755
--- a/core/modules/widgets/navigator.js
+++ b/core/modules/widgets/navigator.js
@@ -6,10 +6,7 @@ module-type: widget
Navigator widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var IMPORT_TITLE = "$:/Import";
@@ -277,6 +274,8 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
}
// Get the current value of the tiddler we're editing
var tiddler = this.wiki.getTiddler(targetTitle);
+ var defaultType = this.wiki.getTiddlerText("$:/config/DefaultMissingType", "").trim();
+ var defaultFields = { type: defaultType };
// Save the initial value of the draft tiddler
draftTitle = this.generateDraftTitle(targetTitle);
var draftTiddler = new $tw.Tiddler({
@@ -288,7 +287,8 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
"draft.title": targetTitle,
"draft.of": targetTitle
},
- this.wiki.getModificationFields()
+ this.wiki.getModificationFields(),
+ tiddler === null || tiddler === undefined ? defaultFields : {}
);
this.wiki.addTiddler(draftTiddler);
return draftTiddler;
@@ -636,5 +636,3 @@ NavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) {
};
exports.navigator = NavigatorWidget;
-
-})();
diff --git a/core/modules/widgets/parameters.js b/core/modules/widgets/parameters.js
index fdd2cb963..638db8054 100644
--- a/core/modules/widgets/parameters.js
+++ b/core/modules/widgets/parameters.js
@@ -6,10 +6,7 @@ module-type: widget
Widget for definition of transclusion parameters
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget,
@@ -104,5 +101,3 @@ ParametersWidget.prototype.refresh = function(changedTiddlers) {
};
exports.parameters = ParametersWidget;
-
-})();
diff --git a/core/modules/widgets/password.js b/core/modules/widgets/password.js
index 1d2e4ca69..59b084940 100644
--- a/core/modules/widgets/password.js
+++ b/core/modules/widgets/password.js
@@ -6,10 +6,7 @@ module-type: widget
Password widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -78,5 +75,3 @@ PasswordWidget.prototype.refresh = function(changedTiddlers) {
};
exports.password = PasswordWidget;
-
-})();
diff --git a/core/modules/widgets/qualify.js b/core/modules/widgets/qualify.js
index 07a5c8b4e..438d88d65 100644
--- a/core/modules/widgets/qualify.js
+++ b/core/modules/widgets/qualify.js
@@ -6,10 +6,7 @@ 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;
@@ -62,5 +59,3 @@ QualifyWidget.prototype.refresh = function(changedTiddlers) {
};
exports.qualify = QualifyWidget;
-
-})();
diff --git a/core/modules/widgets/radio.js b/core/modules/widgets/radio.js
index aa7a32cf1..4587df65f 100644
--- a/core/modules/widgets/radio.js
+++ b/core/modules/widgets/radio.js
@@ -6,10 +6,7 @@ module-type: widget
Set a field or index at a given tiddler via radio buttons
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -47,6 +44,9 @@ RadioWidget.prototype.render = function(parent,nextSibling) {
if(isChecked) {
this.inputDomNode.checked = true;
}
+ if(this.tabIndex) {
+ this.inputDomNode.setAttribute("tabindex", this.tabIndex);
+ }
if(this.isDisabled === "yes") {
this.inputDomNode.setAttribute("disabled",true);
}
@@ -111,6 +111,7 @@ RadioWidget.prototype.execute = function() {
this.radioClass = this.getAttribute("class","");
this.radioDefault = this.getAttribute("default");
this.isDisabled = this.getAttribute("disabled","no");
+ this.tabIndex = this.getAttribute("tabindex");
this.radioActions = this.getAttribute("actions","");
// Make the child widgets
this.makeChildWidgets();
@@ -134,5 +135,3 @@ RadioWidget.prototype.refresh = function(changedTiddlers) {
};
exports.radio = RadioWidget;
-
-})();
diff --git a/core/modules/widgets/range.js b/core/modules/widgets/range.js
index db2699cc4..8d039b1f1 100644
--- a/core/modules/widgets/range.js
+++ b/core/modules/widgets/range.js
@@ -6,10 +6,7 @@ module-type: widget
Range widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -46,6 +43,9 @@ RangeWidget.prototype.render = function(parent,nextSibling) {
if(this.increment){
this.inputDomNode.setAttribute("step", this.increment);
}
+ if(this.tabIndex) {
+ this.inputDomNode.setAttribute("tabindex", this.tabIndex);
+ }
if(this.isDisabled === "yes") {
this.inputDomNode.setAttribute("disabled",true);
}
@@ -164,6 +164,7 @@ RangeWidget.prototype.execute = function() {
this.defaultValue = this.getAttribute("default","");
this.elementClass = this.getAttribute("class","");
this.isDisabled = this.getAttribute("disabled","no");
+ this.tabIndex = this.getAttribute("tabindex");
// Actions since 5.1.23
// Next 2 only fire once!
this.actionsMouseDown = this.getAttribute("actionsStart","");
@@ -196,5 +197,3 @@ RangeWidget.prototype.refresh = function(changedTiddlers) {
};
exports.range = RangeWidget;
-
-})();
diff --git a/core/modules/widgets/raw.js b/core/modules/widgets/raw.js
index 6d0ac41de..3de52a892 100644
--- a/core/modules/widgets/raw.js
+++ b/core/modules/widgets/raw.js
@@ -6,10 +6,7 @@ module-type: widget
Raw widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -49,5 +46,3 @@ RawWidget.prototype.refresh = function(changedTiddlers) {
};
exports.raw = RawWidget;
-
-})();
diff --git a/core/modules/widgets/reveal.js b/core/modules/widgets/reveal.js
index 3e3510f75..f57f1cf42 100755
--- a/core/modules/widgets/reveal.js
+++ b/core/modules/widgets/reveal.js
@@ -6,10 +6,7 @@ module-type: widget
Reveal widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -275,5 +272,3 @@ RevealWidget.prototype.updateState = function() {
};
exports.reveal = RevealWidget;
-
-})();
diff --git a/core/modules/widgets/scrollable.js b/core/modules/widgets/scrollable.js
index 227c455c3..f34d462e7 100644
--- a/core/modules/widgets/scrollable.js
+++ b/core/modules/widgets/scrollable.js
@@ -6,10 +6,7 @@ module-type: widget
Scrollable widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var DEBOUNCE_INTERVAL = 100; // Delay after last scroll event before updating the bound tiddler
@@ -262,5 +259,3 @@ ScrollableWidget.prototype.refresh = function(changedTiddlers) {
};
exports.scrollable = ScrollableWidget;
-
-})();
diff --git a/core/modules/widgets/select.js b/core/modules/widgets/select.js
index 2940e3be0..8bc23542c 100644
--- a/core/modules/widgets/select.js
+++ b/core/modules/widgets/select.js
@@ -16,10 +16,7 @@ Select widget:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -53,6 +50,9 @@ SelectWidget.prototype.render = function(parent,nextSibling) {
if(this.selectMultiple) {
domNode.setAttribute("multiple","multiple");
}
+ if(this.isDisabled === "yes") {
+ domNode.setAttribute("disabled", true);
+ }
if(this.selectSize) {
domNode.setAttribute("size",this.selectSize);
}
@@ -172,6 +172,7 @@ SelectWidget.prototype.execute = function() {
this.selectTabindex = this.getAttribute("tabindex");
this.selectTooltip = this.getAttribute("tooltip");
this.selectFocus = this.getAttribute("focus");
+ this.isDisabled = this.getAttribute("disabled","no");
// Make the child widgets
this.makeChildWidgets();
};
@@ -182,7 +183,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
SelectWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
// If we're using a different tiddler/field/index then completely refresh ourselves
- if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tooltip || changedAttributes.tabindex) {
+ if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tooltip || changedAttributes.tabindex || changedAttributes.disabled) {
this.refreshSelf();
return true;
} else {
@@ -205,5 +206,3 @@ SelectWidget.prototype.refresh = function(changedTiddlers) {
};
exports.select = SelectWidget;
-
-})();
diff --git a/core/modules/widgets/setmultiplevariables.js b/core/modules/widgets/setmultiplevariables.js
index 41951953e..c2c3f65de 100644
--- a/core/modules/widgets/setmultiplevariables.js
+++ b/core/modules/widgets/setmultiplevariables.js
@@ -6,10 +6,7 @@ module-type: widget
Widget to set multiple variables at once from a list of names and a list of values
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -76,6 +73,3 @@ SetMultipleVariablesWidget.prototype.refresh = function(changedTiddlers) {
};
exports["setmultiplevariables"] = SetMultipleVariablesWidget;
-
-})();
-
\ No newline at end of file
diff --git a/core/modules/widgets/setvariable.js b/core/modules/widgets/setvariable.js
index f8e98f390..688268a8d 100755
--- a/core/modules/widgets/setvariable.js
+++ b/core/modules/widgets/setvariable.js
@@ -6,10 +6,7 @@ module-type: widget
Set variable widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -122,5 +119,3 @@ SetWidget.prototype.refresh = function(changedTiddlers) {
exports.setvariable = SetWidget;
exports.set = SetWidget;
-
-})();
diff --git a/core/modules/widgets/slot.js b/core/modules/widgets/slot.js
index eeaaedefe..37c671c90 100644
--- a/core/modules/widgets/slot.js
+++ b/core/modules/widgets/slot.js
@@ -6,10 +6,7 @@ module-type: widget
Widget for definition of slots within transcluded content. The values provided by the translusion are passed to the slot.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget,
@@ -78,5 +75,3 @@ SlotWidget.prototype.refresh = function(changedTiddlers) {
};
exports.slot = SlotWidget;
-
-})();
diff --git a/core/modules/widgets/testcase.js b/core/modules/widgets/testcase.js
index 0fd55531c..ccdce7ac5 100644
--- a/core/modules/widgets/testcase.js
+++ b/core/modules/widgets/testcase.js
@@ -6,10 +6,6 @@ module-type: widget
Widget to display a test case
\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -33,6 +29,7 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) {
this.execute();
// Create container DOM node
var domNode = this.document.createElement("div");
+ domNode.setAttribute("class", "tc-test-case " + this.testcaseClass);
this.domNodes.push(domNode);
parent.insertBefore(domNode,nextSibling);
// Render the children into a hidden DOM node
@@ -145,6 +142,7 @@ TestCaseWidget.prototype.execute = function() {
this.testcaseTestActions = this.getAttribute("testActions");
this.testcaseTestExpectedResult = this.getAttribute("testExpectedResult");
this.testcaseHideIfPass = this.getAttribute("testHideIfPass");
+ this.testcaseClass = this.getAttribute("class","");
};
/*
@@ -161,5 +159,3 @@ TestCaseWidget.prototype.refresh = function(changedTiddlers) {
};
exports["testcase"] = TestCaseWidget;
-
-})();
diff --git a/core/modules/widgets/text.js b/core/modules/widgets/text.js
index 14f729114..a349b5550 100755
--- a/core/modules/widgets/text.js
+++ b/core/modules/widgets/text.js
@@ -6,10 +6,7 @@ module-type: widget
Text node widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -58,5 +55,3 @@ TextNodeWidget.prototype.refresh = function(changedTiddlers) {
};
exports.text = TextNodeWidget;
-
-})();
diff --git a/core/modules/widgets/tiddler.js b/core/modules/widgets/tiddler.js
index 0b70ff875..6c08aac4e 100755
--- a/core/modules/widgets/tiddler.js
+++ b/core/modules/widgets/tiddler.js
@@ -6,10 +6,7 @@ module-type: widget
Tiddler widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -97,5 +94,3 @@ TiddlerWidget.prototype.refresh = function(changedTiddlers) {
};
exports.tiddler = TiddlerWidget;
-
-})();
diff --git a/core/modules/widgets/transclude.js b/core/modules/widgets/transclude.js
index 35b4941bd..9bec28b07 100755
--- a/core/modules/widgets/transclude.js
+++ b/core/modules/widgets/transclude.js
@@ -6,10 +6,7 @@ module-type: widget
Transclude widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -101,6 +98,7 @@ TranscludeWidget.prototype.execute = function() {
}
this.sourceText = target.text;
this.parserType = target.type;
+ this._canonical_uri = target._canonical_uri;
// Set the legacy transclusion context variables only if we're not transcluding a variable
if(!this.transcludeVariable) {
var recursionMarker = this.makeRecursionMarker();
@@ -228,7 +226,8 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
});
return {
text: parserInfo.text,
- type: parserInfo.type
+ type: parserInfo.type,
+ _canonical_uri: parserInfo._canonical_uri
};
}
};
@@ -455,8 +454,11 @@ TranscludeWidget.prototype.makeRecursionMarker = function() {
TranscludeWidget.prototype.parserNeedsRefresh = function() {
// Doesn't need to consider transcluded variables because a parent variable can't change once a widget has been created
- var parserInfo = this.wiki.getTextReferenceParserInfo(this.transcludeTitle,this.transcludeField,this.transcludeIndex,{subTiddler:this.transcludeSubTiddler});
- return (this.sourceText === undefined || parserInfo.sourceText !== this.sourceText || parserInfo.parserType !== this.parserType)
+ var parserInfo = this.wiki.getTextReferenceParserInfo(this.transcludeTitle,this.transcludeField,this.transcludeIndex,{
+ subTiddler: this.transcludeSubTiddler,
+ defaultType: this.transcludeType
+ });
+ return (this.sourceText === undefined || parserInfo.sourceText !== this.sourceText || parserInfo.parserType !== this.parserType || parserInfo._canonical_uri !== this._canonical_uri);
};
TranscludeWidget.prototype.functionNeedsRefresh = function() {
@@ -480,5 +482,3 @@ TranscludeWidget.prototype.refresh = function(changedTiddlers) {
};
exports.transclude = TranscludeWidget;
-
-})();
diff --git a/core/modules/widgets/vars.js b/core/modules/widgets/vars.js
index 42c2b273d..97edab041 100644
--- a/core/modules/widgets/vars.js
+++ b/core/modules/widgets/vars.js
@@ -13,10 +13,7 @@ This widget allows multiple variables to be set in one go:
```
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -69,5 +66,3 @@ VarsWidget.prototype.refresh = function(changedTiddlers) {
};
exports["vars"] = VarsWidget;
-
-})();
diff --git a/core/modules/widgets/view.js b/core/modules/widgets/view.js
index 070836bff..e7c808645 100755
--- a/core/modules/widgets/view.js
+++ b/core/modules/widgets/view.js
@@ -6,10 +6,7 @@ module-type: widget
View widget
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -224,5 +221,3 @@ ViewWidget.prototype.refresh = function(changedTiddlers) {
};
exports.view = ViewWidget;
-
-})();
diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js
index 14e90ba2d..b89df34b7 100755
--- a/core/modules/widgets/widget.js
+++ b/core/modules/widgets/widget.js
@@ -6,10 +6,7 @@ module-type: widget
Widget base class
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -628,31 +625,53 @@ Widget.prototype.addEventListeners = function(listeners) {
};
/*
-Add an event listener
+Add an event listener.
+
+Listener could return a boolean indicating whether to further propagation or not, default to `false`.
*/
Widget.prototype.addEventListener = function(type,handler) {
- var self = this;
- if(typeof handler === "string") { // The handler is a method name on this widget
- this.eventListeners[type] = function(event) {
- return self[handler].call(self,event);
- };
- } else { // The handler is a function
- this.eventListeners[type] = function(event) {
- return handler.call(self,event);
- };
+ this.eventListeners[type] = this.eventListeners[type] || [];
+ if(this.eventListeners[type].indexOf(handler) === -1) {
+ this.eventListeners[type].push(handler);
}
};
/*
-Dispatch an event to a widget. If the widget doesn't handle the event then it is also dispatched to the parent widget
+Remove an event listener
+*/
+Widget.prototype.removeEventListener = function(type,handler) {
+ if(!this.eventListeners[type]) return;
+ var index = this.eventListeners[type].indexOf(handler);
+ if(index !== -1) {
+ this.eventListeners[type].splice(index,1);
+ }
+};
+
+/*
+Dispatch an event to a widget.
+
+If the widget doesn't handle the event then it is also dispatched to the parent widget
*/
Widget.prototype.dispatchEvent = function(event) {
event.widget = event.widget || this;
- // Dispatch the event if this widget handles it
- var listener = this.eventListeners[event.type];
- if(listener) {
- // Don't propagate the event if the listener returned false
- if(!listener(event)) {
+ var listeners = this.eventListeners[event.type];
+ if(listeners) {
+ var self = this;
+ var shouldPropagate = true;
+ $tw.utils.each(listeners,function(handler) {
+ var propagate;
+ if(typeof handler === "string") {
+ // If handler is a string, call it as a method on the widget
+ propagate = self[handler].call(self,event);
+ } else {
+ // Otherwise call the function handler directly
+ propagate = handler.call(self,event);
+ }
+ if(propagate === false) {
+ shouldPropagate = false;
+ }
+ });
+ if(!shouldPropagate) {
return false;
}
}
@@ -846,5 +865,3 @@ Widget.evaluateVariable = function(widget,name,options) {
};
exports.widget = Widget;
-
-})();
diff --git a/core/modules/widgets/wikify.js b/core/modules/widgets/wikify.js
index 987c3ab8a..bdb154b1b 100644
--- a/core/modules/widgets/wikify.js
+++ b/core/modules/widgets/wikify.js
@@ -6,10 +6,7 @@ module-type: widget
Widget to wikify text into a variable
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
@@ -86,5 +83,3 @@ WikifyWidget.prototype.refresh = function(changedTiddlers) {
};
exports.wikify = WikifyWidget;
-
-})();
diff --git a/core/modules/wiki-bulkops.js b/core/modules/wiki-bulkops.js
index d730b3c2e..ca7ca4a97 100644
--- a/core/modules/wiki-bulkops.js
+++ b/core/modules/wiki-bulkops.js
@@ -6,10 +6,7 @@ module-type: wikimethod
Bulk tiddler operations such as rename.
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
/*
@@ -84,5 +81,3 @@ function relinkTiddler(fromTitle,toTitle,options) {
exports.renameTiddler = renameTiddler;
exports.relinkTiddler = relinkTiddler;
-
-})();
diff --git a/core/modules/wiki.js b/core/modules/wiki.js
index 29a839c7a..878b34eb2 100755
--- a/core/modules/wiki.js
+++ b/core/modules/wiki.js
@@ -16,10 +16,7 @@ Adds the following properties to the wiki object:
* `globalCache` is a hashmap by cache name of cache objects that are cleared whenever any tiddler change occurs
\*/
-(function(){
-/*jslint node: true, browser: true */
-/*global $tw: false */
"use strict";
var widget = require("$:/core/modules/widgets/widget.js");
@@ -141,12 +138,15 @@ This method should be called after the changes it describes have been made to th
title: Title of tiddler
isDeleted: defaults to false (meaning the tiddler has been created or modified),
true if the tiddler has been deleted
+ isShadow: defaults to false (meaning the change applies to the normal tiddler),
+ true if the tiddler being changed is a shadow tiddler
*/
-exports.enqueueTiddlerEvent = function(title,isDeleted) {
+exports.enqueueTiddlerEvent = function(title,isDeleted,isShadow) {
// Record the touch in the list of changed tiddlers
this.changedTiddlers = this.changedTiddlers || Object.create(null);
this.changedTiddlers[title] = this.changedTiddlers[title] || Object.create(null);
this.changedTiddlers[title][isDeleted ? "deleted" : "modified"] = true;
+ this.changedTiddlers[title][isShadow ? "shadow" : "normal"] = true;
// Increment the change count
this.changeCount = this.changeCount || Object.create(null);
if($tw.utils.hop(this.changeCount,title)) {
@@ -1132,6 +1132,7 @@ exports.getTextReferenceParserInfo = function(title,field,index,options) {
if(tiddler.fields.type) {
parserInfo.parserType = tiddler.fields.type;
}
+ parserInfo._canonical_uri = tiddler.fields._canonical_uri;
}
} else if(field) {
if(field === "title") {
@@ -1787,5 +1788,3 @@ exports.slugify = function(title,options) {
}
return slug;
};
-
-})();
diff --git a/core/palettes/FlexokiDark.tid b/core/palettes/FlexokiDark.tid
index b8bb4570c..05e53edf5 100644
--- a/core/palettes/FlexokiDark.tid
+++ b/core/palettes/FlexokiDark.tid
@@ -65,11 +65,11 @@ flexoki-bl-2: <>
flexoki-pu-2: <>
flexoki-ma-2: <>
-alert-background: <>
-alert-border: <>
+alert-background: <>
+alert-border: <>
alert-highlight: <>
alert-muted-foreground: <>
-background: #1C1B1A
+background: #100F0F
blockquote-bar: <>
button-background: <>
button-foreground: <>
@@ -78,13 +78,13 @@ code-background: <>
code-border: <>
code-foreground: <>
diff-delete-background: <>
-diff-delete-foreground: <>
+diff-delete-foreground: <>
diff-equal-background:
diff-equal-foreground: inherit
diff-insert-background: <>
-diff-insert-foreground: <>
+diff-insert-foreground: <>
diff-invisible-background: <>
-diff-invisible-foreground: <>
+diff-invisible-foreground: <>
dirty-indicator: <>
download-background: <>
download-foreground: <>
@@ -102,9 +102,9 @@ external-link-foreground-hover: inherit
external-link-foreground-visited: <>
external-link-foreground: <>
footnote-target-background: <>
-foreground: #B7B5AC
-highlight-background: #ffff00
-highlight-foreground: #000000
+foreground: #CECDC3
+highlight-background: <>
+highlight-foreground: inherit
menubar-background: <>
menubar-foreground: <>
message-background: <>
@@ -118,14 +118,14 @@ modal-footer-border: <>
modal-header-border: <>
muted-foreground: <>
network-activity-foreground: <>
-notification-background: <>
-notification-border: <>
+notification-background: <>
+notification-border: <>
page-background: <>
-pre-background: <>
+pre-background: <>
pre-border: <>
primary: <>
-selection-background: #2b7b73
-selection-foreground: <>
+selection-background: <>
+selection-foreground: <>
select-tag-background: <>
select-tag-foreground: <>
sidebar-button-foreground: <>
@@ -135,11 +135,11 @@ sidebar-foreground-shadow: transparent
sidebar-foreground: <>
sidebar-muted-foreground-hover: <>
sidebar-muted-foreground: <>
-sidebar-tab-background-selected: <>
+sidebar-tab-background-selected: <>
sidebar-tab-background: <>
sidebar-tab-border-selected: <>
sidebar-tab-border: <>
-sidebar-tab-divider: #e4e4e4
+sidebar-tab-divider: <>
sidebar-tab-foreground-selected:
sidebar-tab-foreground: <>
sidebar-tiddler-link-foreground-hover: <>
@@ -157,7 +157,7 @@ tab-border: <>
tab-divider: <>
tab-foreground-selected: <>
tab-foreground: <>
-table-border: <>
+table-border: <>
table-footer-background: <>
table-header-background: <>
tag-background: #D0A215
@@ -169,7 +169,7 @@ tiddler-background: <>
tiddler-border: <>
tiddler-controls-foreground-hover: <>
tiddler-controls-foreground-selected: <>
-tiddler-controls-foreground: <>
+tiddler-controls-foreground: <>
tiddler-editor-background: <>
tiddler-editor-border-image: #ffffff
tiddler-editor-border: <>
@@ -188,25 +188,25 @@ toolbar-save-button:
toolbar-info-button:
toolbar-edit-button:
toolbar-close-button:
-toolbar-delete-button:
+toolbar-delete-button: <>
toolbar-cancel-button:
toolbar-done-button:
-untagged-background: #999999
+untagged-background: <>
very-muted-foreground: <>
-wikilist-background: #e5e5e5
-wikilist-item: #fff
-wikilist-info: #000
-wikilist-title: #666
+wikilist-background: <>
+wikilist-item: <>
+wikilist-info: <>
+wikilist-title: <>
wikilist-title-svg: <>
-wikilist-url: #aaa
-wikilist-button-open: #4fb82b
-wikilist-button-open-hover: green
-wikilist-button-reveal: #5778d8
-wikilist-button-reveal-hover: blue
-wikilist-button-remove: #d85778
-wikilist-button-remove-hover: red
-wikilist-toolbar-background: #d3d3d3
-wikilist-toolbar-foreground: #888
-wikilist-droplink-dragover: rgba(255,192,192,0.5)
-wikilist-button-background: #acacac
-wikilist-button-foreground: #000
\ No newline at end of file
+wikilist-url: <>
+wikilist-button-open: <>
+wikilist-button-open-hover: <>
+wikilist-button-reveal: <>
+wikilist-button-reveal-hover: <>
+wikilist-button-remove: <>
+wikilist-button-remove-hover: <>
+wikilist-toolbar-background: <>
+wikilist-toolbar-foreground: <>
+wikilist-droplink-dragover: <>
+wikilist-button-background: <>
+wikilist-button-foreground: <>
\ No newline at end of file
diff --git a/core/palettes/FlexokiLight.tid b/core/palettes/FlexokiLight.tid
index ba6862f66..c3c4d2f25 100644
--- a/core/palettes/FlexokiLight.tid
+++ b/core/palettes/FlexokiLight.tid
@@ -94,8 +94,8 @@ dragger-background: <>
dragger-foreground: <>
dropdown-background: <>
dropdown-border: <>
-dropdown-tab-background-selected: #fff
-dropdown-tab-background: #ececec
+dropdown-tab-background-selected: <>
+dropdown-tab-background: <>
dropzone-background: <>
external-link-background-hover: inherit
external-link-background-visited: inherit
@@ -105,8 +105,8 @@ external-link-foreground-visited: <>
external-link-foreground: <>
footnote-target-background: <>
foreground: #100F0F
-highlight-background: #ffff00
-highlight-foreground: #000000
+highlight-background: <>
+highlight-foreground: inherit
menubar-background: <>
menubar-foreground: <>
message-background: <>
@@ -114,26 +114,26 @@ message-border: <>
message-foreground: <>
modal-backdrop: <>
modal-background: <>
-modal-border: #999999
-modal-footer-background: #f5f5f5
-modal-footer-border: #dddddd
-modal-header-border: #eeeeee
+modal-border: <>
+modal-footer-background: <>
+modal-footer-border: <>
+modal-header-border: <>
muted-foreground: <>
network-activity-foreground: <>
notification-background: <>
notification-border: <>
page-background: <>
-pre-background: <>
+pre-background: <>
pre-border: <>
-primary: <>
-selection-background:
-selection-foreground:
+primary: <>
+selection-background: <>
+selection-foreground: <>
select-tag-background: <>
select-tag-foreground: <>
sidebar-button-foreground: <>
sidebar-controls-foreground-hover: <>
sidebar-controls-foreground: <>
-sidebar-foreground-shadow: rgba(255,255,255, 0.8)
+sidebar-foreground-shadow: transparent
sidebar-foreground: <>
sidebar-muted-foreground-hover: <>
sidebar-muted-foreground: <>
@@ -182,7 +182,7 @@ tiddler-info-border: <>
tiddler-info-tab-background: <>
tiddler-link-background: <>
tiddler-link-foreground: <>
-tiddler-subtitle-foreground: <>
+tiddler-subtitle-foreground: <>
tiddler-title-foreground: <>
toolbar-new-button:
toolbar-options-button:
@@ -190,25 +190,25 @@ toolbar-save-button:
toolbar-info-button:
toolbar-edit-button:
toolbar-close-button:
-toolbar-delete-button:
+toolbar-delete-button: <>
toolbar-cancel-button:
toolbar-done-button:
-untagged-background: #999999
-very-muted-foreground: #888888
+untagged-background: <>
+very-muted-foreground: <>
wikilist-background: <>
-wikilist-item: #fff
-wikilist-info: #000
-wikilist-title: #666
+wikilist-item: <>
+wikilist-info: <>
+wikilist-title: <>
wikilist-title-svg: <>
-wikilist-url: #aaa
-wikilist-button-open: #4fb82b
-wikilist-button-open-hover: green
-wikilist-button-reveal: #5778d8
-wikilist-button-reveal-hover: blue
-wikilist-button-remove: #d85778
-wikilist-button-remove-hover: red
-wikilist-toolbar-background: #d3d3d3
-wikilist-toolbar-foreground: #888
-wikilist-droplink-dragover: rgba(255,192,192,0.5)
-wikilist-button-background: #acacac
-wikilist-button-foreground: #000
+wikilist-url: <>
+wikilist-button-open: <>
+wikilist-button-open-hover: <>
+wikilist-button-reveal: <>
+wikilist-button-reveal-hover: <>
+wikilist-button-remove: <>
+wikilist-button-remove-hover: <>
+wikilist-toolbar-background: <>
+wikilist-toolbar-foreground: <>
+wikilist-droplink-dragover: <>
+wikilist-button-background: <>
+wikilist-button-foreground: <>
diff --git a/core/palettes/GruvBoxDark.tid b/core/palettes/GruvBoxDark.tid
index e839fd7b4..16ac22d65 100644
--- a/core/palettes/GruvBoxDark.tid
+++ b/core/palettes/GruvBoxDark.tid
@@ -21,9 +21,9 @@ diff-delete-foreground: <>
diff-equal-background:
diff-equal-foreground: <>
diff-insert-background: #b8bb26
-diff-insert-foreground: <>
-diff-invisible-background:
-diff-invisible-foreground: <>
+diff-insert-foreground: <>
+diff-invisible-background: #ffff97
+diff-invisible-foreground: #444347
dirty-indicator: #fb4934
download-background: #b8bb26
download-foreground: <>
diff --git a/core/palettes/Nord.tid b/core/palettes/Nord.tid
index 5f18dce3f..87e918927 100644
--- a/core/palettes/Nord.tid
+++ b/core/palettes/Nord.tid
@@ -21,8 +21,8 @@ diff-delete-foreground: <>
diff-equal-background:
diff-equal-foreground: <>
diff-insert-background: #A3BE8C
-diff-insert-foreground: <>
-diff-invisible-background:
+diff-insert-foreground: <>
+diff-invisible-background: #f9f3b5
diff-invisible-foreground: <>
dirty-indicator: #BF616A
download-background: #A3BE8C
diff --git a/core/palettes/SolarFlare.tid b/core/palettes/SolarFlare.tid
index 9f394f10c..ff6ddcf1d 100644
--- a/core/palettes/SolarFlare.tid
+++ b/core/palettes/SolarFlare.tid
@@ -125,6 +125,14 @@ foreground: #657b83
tiddler-link-foreground: <>
alert-border: #b99e2f
+diff-delete-background: <>
+diff-delete-foreground: <>
+diff-equal-background: inherit
+diff-equal-foreground: inherit
+diff-insert-background: <>
+diff-insert-foreground: <>
+diff-invisible-background: <>
+diff-invisible-foreground: <>
dirty-indicator: #ff0000
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover: inherit
diff --git a/core/palettes/SolarizedDark.tid b/core/palettes/SolarizedDark.tid
index 326f6a4fb..9338998e9 100644
--- a/core/palettes/SolarizedDark.tid
+++ b/core/palettes/SolarizedDark.tid
@@ -18,6 +18,14 @@ button-foreground: #93a1a1
code-background: #073642
code-border: #586e75
code-foreground: #93a1a1
+diff-delete-background: #dc322f
+diff-delete-foreground: #eee8d5
+diff-equal-background: inherit
+diff-equal-foreground: inherit
+diff-insert-background: #859900
+diff-insert-foreground: #073642
+diff-invisible-background: #b58900
+diff-invisible-foreground: #eee8d5
dirty-indicator: #dc322f
download-background: #859900
download-foreground: #073642
diff --git a/core/palettes/SolarizedLight.tid b/core/palettes/SolarizedLight.tid
index 28ce1c7c2..c01ff8821 100644
--- a/core/palettes/SolarizedLight.tid
+++ b/core/palettes/SolarizedLight.tid
@@ -18,6 +18,14 @@ button-foreground: #586e75
code-background: #eee8d5
code-border: #93a1a1
code-foreground: #586e75
+diff-delete-background: #dc322f
+diff-delete-foreground: #eee8d5
+diff-equal-background: inherit
+diff-equal-foreground: inherit
+diff-insert-background: #859900
+diff-insert-foreground: #eee8d5
+diff-invisible-background: #b58900
+diff-invisible-foreground: #eee8d5
dirty-indicator: #dc322f
download-background: #859900
download-foreground: #eee8d5
diff --git a/core/palettes/Twilight.tid b/core/palettes/Twilight.tid
index 1cd8efab1..d6b54673a 100644
--- a/core/palettes/Twilight.tid
+++ b/core/palettes/Twilight.tid
@@ -19,13 +19,13 @@ code-background: rgba(0,0,0,0.03)
code-border: rgba(0,0,0,0.08)
code-foreground: rgb(255, 94, 94)
diff-delete-background: #ffc9c9
-diff-delete-foreground: <>
+diff-delete-foreground: <>
diff-equal-background:
diff-equal-foreground: <>
diff-insert-background: #aaefad
-diff-insert-foreground: <>
-diff-invisible-background:
-diff-invisible-foreground: <>
+diff-insert-foreground: <>
+diff-invisible-background: #fdfcbd
+diff-invisible-foreground: <>
dirty-indicator: rgb(255, 94, 94)
download-background: #19a974
download-foreground: rgb(38, 38, 38)
diff --git a/core/templates/exporters/CsvFile.tid b/core/templates/exporters/CsvFile.tid
index 23d3bbd73..724827d89 100644
--- a/core/templates/exporters/CsvFile.tid
+++ b/core/templates/exporters/CsvFile.tid
@@ -2,5 +2,6 @@ title: $:/core/templates/exporters/CsvFile
tags: $:/tags/Exporter
description: {{$:/language/Exporters/CsvFile}}
extension: .csv
+file-type: text/csv
<$macrocall $name="csvtiddlers" filter=<> format="quoted-comma-sep" $output="text/raw"/>
diff --git a/core/templates/exporters/JsonFile.tid b/core/templates/exporters/JsonFile.tid
index 9008906cc..2ae5495c1 100644
--- a/core/templates/exporters/JsonFile.tid
+++ b/core/templates/exporters/JsonFile.tid
@@ -2,5 +2,6 @@ title: $:/core/templates/exporters/JsonFile
tags: $:/tags/Exporter
description: {{$:/language/Exporters/JsonFile}}
extension: .json
+file-type: application/json
<$macrocall $name="jsontiddlers" filter=<> $output="text/raw"/>
diff --git a/core/templates/exporters/TidFile.tid b/core/templates/exporters/TidFile.tid
index 7b0bb2d78..94f9744a8 100644
--- a/core/templates/exporters/TidFile.tid
+++ b/core/templates/exporters/TidFile.tid
@@ -2,6 +2,7 @@ title: $:/core/templates/exporters/TidFile
tags: $:/tags/Exporter
description: {{$:/language/Exporters/TidFile}}
extension: .tid
+file-type: text/vnd.tiddlywiki
condition: [compare:lte[1]]
\define renderContent()
diff --git a/core/ui/AdvancedSearch/Standard.tid b/core/ui/AdvancedSearch/Standard.tid
index c85c8b9f2..ae80ced35 100644
--- a/core/ui/AdvancedSearch/Standard.tid
+++ b/core/ui/AdvancedSearch/Standard.tid
@@ -37,7 +37,7 @@ caption: {{$:/language/Search/Standard/Caption}}
inputCancelActions=<>
inputAcceptActions=<>
inputAcceptVariantActions=<>
- configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}]"
+ configTiddlerFilter="[[$:/state/advancedsearch/standard/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}]"
filterMinLength={{$:/config/Search/MinLength}}/>
$keyboard>
$keyboard>
diff --git a/core/ui/EditorToolbar/link-dropdown.tid b/core/ui/EditorToolbar/link-dropdown.tid
index 2b75a32ce..68e41a17b 100644
--- a/core/ui/EditorToolbar/link-dropdown.tid
+++ b/core/ui/EditorToolbar/link-dropdown.tid
@@ -8,13 +8,8 @@ title: $:/core/ui/EditorToolbar/link-dropdown
<$action-deletetiddler $filter="[] [] [] [] []"/>
\end
-\procedure prefix.bracket() [
-\procedure suffix.bracket() ]
-
-\function tf.get-focus-selector() [[data-tiddler-title=]addprefix[$(prefix.bracket)$]substitute[]addsuffixaddsuffix[$(suffix.bracket)$]substitute[]] .tc-create-wikitext-link input :and[join[ ]]
-
\procedure cancel-search-actions-inner()
-<$set name="userInput" value={{{ [get[text]] }}}><$list filter="[get[text]!match]" emptyMessage="<$action-deletetiddler $filter='[] [] [] []'/>"><$action-setfield $tiddler=<> text=<>/><$action-setfield $tiddler=<> text="yes"/>$list>$set>
+<$let userInput={{{ [get[text]] }}}><$list filter="[get[text]!match]" emptyMessage="<$action-deletetiddler $filter='[] [] [] []'/>"><$action-setfield $tiddler=<> text=<>/><$action-setfield $tiddler=<> text="yes"/>$list>$let>
\end
\procedure cancel-search-actions() <$list filter="[!has[text]] :and[!has[text]]" emptyMessage="<>"><$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/>$list>
@@ -34,9 +29,9 @@ title: $:/core/ui/EditorToolbar/link-dropdown
\whitespace trim
''<>''
-<$vars searchTiddler={{{ [addsuffix[/search]] }}} linkTiddler={{{ [addsuffix[/link]] }}} linktext="" searchListState=<> refreshTitle=<> storeTitle=<>>
+<$let searchTiddler=`$(config-title)$/search` linkTiddler=`$(config-title)$/link` linktext="" searchListState=<> refreshTitle=<> storeTitle=<>>
-<$vars linkTiddler=<>>
+<$let linkTiddler=<>>
<$keyboard key="((input-tab-right))" actions=<>>
<$keyboard key="((input-tab-left))" actions=<> class="tc-create-wikitext-link">
<$transclude $variable="keyboard-driven-input" tiddler=<> storeTitle=<>
@@ -51,28 +46,28 @@ title: $:/core/ui/EditorToolbar/link-dropdown
<>
<$button class="tc-btn-invisible tc-btn-mini" style="width: auto; display: inline-block; background-colour: inherit;">
-<><$set name="cssEscapedTitle" value={{{ [escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<