diff --git a/boot/boot.js b/boot/boot.js index e3538a2fe..1cdc21a4b 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -2000,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('/'); @@ -2021,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) { diff --git a/core/modules/filters/backtranscludes.js b/core/modules/filters/backtranscludes.js index 2451ab941..07ef9b254 100644 --- a/core/modules/filters/backtranscludes.js +++ b/core/modules/filters/backtranscludes.js @@ -6,7 +6,6 @@ module-type: filteroperator Filter operator for returning all the backtranscludes from a tiddler \*/ -(function(){ "use strict"; /* @@ -19,5 +18,3 @@ exports.backtranscludes = function(source,operator,options) { }); return results.makeTiddlerIterator(options.wiki); }; - -})(); diff --git a/core/modules/filters/transcludes.js b/core/modules/filters/transcludes.js index 0245dcaa4..5032e4255 100644 --- a/core/modules/filters/transcludes.js +++ b/core/modules/filters/transcludes.js @@ -6,7 +6,6 @@ module-type: filteroperator Filter operator for returning all the transcludes from a tiddler \*/ -(function(){ "use strict"; /* @@ -19,5 +18,3 @@ exports.transcludes = function(source,operator,options) { }); return results.makeTiddlerIterator(options.wiki); }; - -})(); diff --git a/core/modules/parsers/wikiparser/rules/conditional.js b/core/modules/parsers/wikiparser/rules/conditional.js index 4dccf75fb..3995b90dc 100644 --- a/core/modules/parsers/wikiparser/rules/conditional.js +++ b/core/modules/parsers/wikiparser/rules/conditional.js @@ -10,7 +10,6 @@ This is a <%if [{something}] %>Elephant<%elseif [{else}] %>Pelican<%else%>Crocod ``` \*/ -(function(){ "use strict"; exports.name = "conditional"; @@ -113,5 +112,3 @@ exports.parseIfClause = function(filterCondition) { // Return the parse tree node return [listWidget]; }; - -})(); 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/repository.js b/core/modules/utils/repository.js index 359f558b8..08d8828d9 100644 --- a/core/modules/utils/repository.js +++ b/core/modules/utils/repository.js @@ -6,7 +6,6 @@ module-type: utils Utilities for working with the TiddlyWiki repository file structure \*/ -(function(){ "use strict"; /* @@ -45,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/widgets/data.js b/core/modules/widgets/data.js index d51e2ba8b..50eafc63f 100644 --- a/core/modules/widgets/data.js +++ b/core/modules/widgets/data.js @@ -6,7 +6,6 @@ module-type: widget Widget to dynamically represent one or more tiddlers \*/ -(function(){ "use strict"; var Widget = require("$:/core/modules/widgets/widget.js").widget; @@ -187,5 +186,3 @@ function hasPayloadChanged(a,b) { } exports.data = DataWidget; - -})(); diff --git a/core/modules/widgets/testcase.js b/core/modules/widgets/testcase.js index cc7141867..ccdce7ac5 100644 --- a/core/modules/widgets/testcase.js +++ b/core/modules/widgets/testcase.js @@ -6,7 +6,6 @@ module-type: widget Widget to display a test case \*/ -(function(){ "use strict"; var Widget = require("$:/core/modules/widgets/widget.js").widget; @@ -160,5 +159,3 @@ TestCaseWidget.prototype.refresh = function(changedTiddlers) { }; exports["testcase"] = TestCaseWidget; - -})(); diff --git a/editions/dev/tiddlers/new/Filter Operators.tid b/editions/dev/tiddlers/new/Filter Operators.tid index c7c2e7456..4a1d173e3 100644 --- a/editions/dev/tiddlers/new/Filter Operators.tid +++ b/editions/dev/tiddlers/new/Filter Operators.tid @@ -34,13 +34,11 @@ Suppose we want to make a filter operator that returns every other tiddler from We make a new tiddler, set its `type` and `module-type` appropriately, and begin writing the code: ``` -(function(){ "use strict"; exports.everyother = function(source, operator, options) { // TODO } -})(); ``` For the example filter syntax, our function will be called with @@ -54,7 +52,6 @@ As is usually the case, we don't care about `operator.operator` here (since that We could implement the operator by iterating over the input tiddlers and explicitly building a result array of titles: ``` -(function(){ "use strict"; exports.everyother = function(source, operator, options) { @@ -66,7 +63,6 @@ exports.everyother = function(source, operator, options) { }); return result; } -})(); ``` That is, we supply a callback to `source` that negates `include` each time through (in order to grab every other result) and pushes the `title` of every other tiddler onto the result. @@ -74,7 +70,6 @@ That is, we supply a callback to `source` that negates `include` each time throu Alternatively, we can return our own iterator, by returning a function that accepts a similar callback and only calls it on every other tiddler: ``` -(function(){ "use strict"; exports.everyother = function(source, operator, options) { @@ -86,7 +81,6 @@ exports.everyother = function(source, operator, options) { }); }; } -})(); ``` Either way, we could interpret the `!` flag on the filter, if present, to mean that we want the //other// half of the tiddlers, by using it to set the initial value of `include`: `var include = operator.prefix !== "!";` diff --git a/editions/dev/tiddlers/new/Hook_ th-before-importing.tid b/editions/dev/tiddlers/new/Hook_ th-before-importing.tid index 19157566f..483fb5388 100644 --- a/editions/dev/tiddlers/new/Hook_ th-before-importing.tid +++ b/editions/dev/tiddlers/new/Hook_ th-before-importing.tid @@ -40,10 +40,7 @@ module-type: startup YOUR DISCRCRIPTION COMES HERE! \*/ -(function(){ -/*jslint node: true, browser: true */ -/*global $tw: false, exports: true */ "use strict"; // Export name and synchronous status @@ -63,6 +60,4 @@ exports.startup = function() { }); }; -})(); - ``` \ No newline at end of file diff --git a/editions/dev/tiddlers/new/ParserSubclassingMechanism.tid b/editions/dev/tiddlers/new/ParserSubclassingMechanism.tid index c4aab295e..8f36638ca 100644 --- a/editions/dev/tiddlers/new/ParserSubclassingMechanism.tid +++ b/editions/dev/tiddlers/new/ParserSubclassingMechanism.tid @@ -11,10 +11,7 @@ The wikitext parser subclassing mechanism makes it possible for custom parsers t Here is an example of a subclass of the checkbox widget that adds logging to the event handler: ```js -(function(){ -/*jslint node: true, browser: true */ -/*global $tw: false */ "use strict"; var WikiParser = require("$:/core/modules/parsers/wikiparser/wikiparser.js")["text/vnd.tiddlywiki"], @@ -38,5 +35,4 @@ var MyCustomWikiParser = function(type,text,options) { exports["text/vnd.my-custom-type"] = MyCustomWikiParser; -})(); ``` diff --git a/editions/dev/tiddlers/new/WidgetSubclassingMechanism.tid b/editions/dev/tiddlers/new/WidgetSubclassingMechanism.tid index 3f39d4e3a..484952131 100644 --- a/editions/dev/tiddlers/new/WidgetSubclassingMechanism.tid +++ b/editions/dev/tiddlers/new/WidgetSubclassingMechanism.tid @@ -26,10 +26,7 @@ module-type: widget-subclass Widget base class \*/ -(function(){ -/*jslint node: true, browser: true */ -/*global $tw: false */ "use strict"; exports.baseClass = "checkbox"; // Extend the <$checkbox> widget @@ -50,5 +47,4 @@ exports.prototype.handleChangeEvent = function(event) { console.log("Checkbox status:",this.inputDomNode.checked); }; -})(); ``` diff --git a/editions/test/tiddlers/tests/test-action-deletefield.js b/editions/test/tiddlers/tests/test-action-deletefield.js index 876f44d8e..f87eeda01 100644 --- a/editions/test/tiddlers/tests/test-action-deletefield.js +++ b/editions/test/tiddlers/tests/test-action-deletefield.js @@ -6,12 +6,6 @@ tags: [[$:/tags/test-spec]] Tests <$action-deletefield />. \*/ -(function(){ - -/* jslint node: true, browser: true */ -/* eslint-env node, browser, jasmine */ -/* eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/ -/* global $tw, require */ "use strict"; describe("<$action-deletefield /> tests", function() { @@ -172,5 +166,3 @@ it("should correctly delete fields", function() { }); }); - -})(); diff --git a/editions/test/tiddlers/tests/test-fakedom.js b/editions/test/tiddlers/tests/test-fakedom.js index faec01af6..8cfe3f9c2 100644 --- a/editions/test/tiddlers/tests/test-fakedom.js +++ b/editions/test/tiddlers/tests/test-fakedom.js @@ -6,7 +6,6 @@ tags: [[$:/tags/test-spec]] Tests the fakedom that Tiddlywiki occasionally uses. \*/ -(function(){ "use strict"; describe("fakedom tests", function() { @@ -20,5 +19,3 @@ describe("fakedom tests", function() { expect($tw.fakeDocument.createTextNode("text").TEXT_NODE).toBe(3); }); }); - -})(); diff --git a/editions/test/tiddlers/tests/test-plugins.js b/editions/test/tiddlers/tests/test-plugins.js index fadf92a10..86cd4c6f0 100644 --- a/editions/test/tiddlers/tests/test-plugins.js +++ b/editions/test/tiddlers/tests/test-plugins.js @@ -6,7 +6,6 @@ tags: [[$:/tags/test-spec]] Tests for integrity of the core plugins, languages, themes and editions \*/ -(function(){ "use strict"; if($tw.node) { @@ -47,6 +46,3 @@ if($tw.node) { }); }); } - - -})(); diff --git a/editions/test/tiddlers/tests/test-widget-event.js b/editions/test/tiddlers/tests/test-widget-event.js index b70f5424c..9aeb9a838 100644 --- a/editions/test/tiddlers/tests/test-widget-event.js +++ b/editions/test/tiddlers/tests/test-widget-event.js @@ -3,10 +3,7 @@ title: test-widget-event.js type: application/javascript tags: [[$:/tags/test-spec]] \*/ -(function(){ -/*jslint node: true, browser: true */ -/*global $tw: false */ "use strict"; describe("Widget Event Listeners", function() { @@ -220,5 +217,3 @@ describe("Widget Event Listeners", function() { }); }); - -})(); diff --git a/editions/test/tiddlers/tests/test-widget-getVariableInfo.js b/editions/test/tiddlers/tests/test-widget-getVariableInfo.js index 4ce21a956..ae0f4ce20 100644 --- a/editions/test/tiddlers/tests/test-widget-getVariableInfo.js +++ b/editions/test/tiddlers/tests/test-widget-getVariableInfo.js @@ -6,7 +6,6 @@ tags: [[$:/tags/test-spec]] Tests the wikitext rendering pipeline end-to-end. We also need tests that individually test parsers, rendertreenodes etc., but this gets us started. \*/ -(function(){ "use strict"; describe("Widget module", function() { @@ -89,4 +88,3 @@ describe("Widget module", function() { }); -})(); diff --git a/plugins/tiddlywiki/confetti/confetti-manager.js b/plugins/tiddlywiki/confetti/confetti-manager.js index 66ccb427e..5ffb48fe0 100644 --- a/plugins/tiddlywiki/confetti/confetti-manager.js +++ b/plugins/tiddlywiki/confetti/confetti-manager.js @@ -6,7 +6,6 @@ module-type: global Confetti manager \*/ -(function(){ "use strict"; var confetti = require("$:/plugins/tiddlywiki/confetti/confetti.js"); @@ -49,5 +48,3 @@ ConfettiManager.prototype.reset = function () { }; exports.ConfettiManager = ConfettiManager; - -})(); diff --git a/plugins/tiddlywiki/confetti/confetti-widget.js b/plugins/tiddlywiki/confetti/confetti-widget.js index c3bbc25e3..f26dc3e05 100644 --- a/plugins/tiddlywiki/confetti/confetti-widget.js +++ b/plugins/tiddlywiki/confetti/confetti-widget.js @@ -6,7 +6,6 @@ module-type: widget Confetti widget \*/ -(function(){ "use strict"; var Widget = require("$:/core/modules/widgets/widget.js").widget; @@ -60,5 +59,3 @@ ConfettiWidget.prototype.refresh = function(changedTiddlers) { }; exports.confetti = ConfettiWidget; - -})(); diff --git a/plugins/tiddlywiki/confetti/startup.js b/plugins/tiddlywiki/confetti/startup.js index fafbecee7..1ece709eb 100644 --- a/plugins/tiddlywiki/confetti/startup.js +++ b/plugins/tiddlywiki/confetti/startup.js @@ -6,7 +6,6 @@ module-type: startup Setup the root widget event handlers \*/ -(function(){ "use strict"; // Export name and synchronous status @@ -56,5 +55,3 @@ exports.startup = function() { $tw.confettiManager.reset(); }); }; - -})(); diff --git a/plugins/tiddlywiki/dynannotate/modules/element-spotlight.js b/plugins/tiddlywiki/dynannotate/modules/element-spotlight.js index 9a7ab71ad..fea230d55 100644 --- a/plugins/tiddlywiki/dynannotate/modules/element-spotlight.js +++ b/plugins/tiddlywiki/dynannotate/modules/element-spotlight.js @@ -6,7 +6,6 @@ module-type: library Manages the element spotlight effect \*/ -(function(){ "use strict"; function ElementSpotlight() { @@ -129,5 +128,3 @@ ElementSpotlight.prototype.shineSpotlight = function(selectors) { }; exports.ElementSpotlight = ElementSpotlight; - -})(); diff --git a/plugins/tiddlywiki/dynannotate/modules/startup.js b/plugins/tiddlywiki/dynannotate/modules/startup.js index cdcbd4bfb..b95d5ef01 100644 --- a/plugins/tiddlywiki/dynannotate/modules/startup.js +++ b/plugins/tiddlywiki/dynannotate/modules/startup.js @@ -1,5 +1,3 @@ -const { ElementSpotlight } = require("./element-spotlight"); - /*\ title: $:/plugins/tiddlywiki/dynannotate/startup.js type: application/javascript @@ -8,8 +6,6 @@ module-type: startup Startup the dyannotate background daemon to track the selection \*/ -(function(){ - "use strict"; // Export name and synchronous status @@ -56,5 +52,3 @@ exports.startup = function() { $tw.dynannotate.elementSpotlight.shineSpotlight(selectors); }); }; - -})(); diff --git a/plugins/tiddlywiki/innerwiki/anchor.js b/plugins/tiddlywiki/innerwiki/anchor.js index 584370256..6b37cc97d 100644 --- a/plugins/tiddlywiki/innerwiki/anchor.js +++ b/plugins/tiddlywiki/innerwiki/anchor.js @@ -6,9 +6,6 @@ module-type: widget Anchor widget to represent an innerwiki graphical anchor. Clone of the data widget \*/ -(function(){ "use strict"; exports.anchor = require("$:/core/modules/widgets/data.js").data; - -})(); diff --git a/plugins/tiddlywiki/qrcode/barcodereader.js b/plugins/tiddlywiki/qrcode/barcodereader.js index f44ec4c0e..ceba2b36b 100644 --- a/plugins/tiddlywiki/qrcode/barcodereader.js +++ b/plugins/tiddlywiki/qrcode/barcodereader.js @@ -6,7 +6,6 @@ module-type: widget barcodereader widget for reading barcodes \*/ -(function(){ "use strict"; var Widget = require("$:/core/modules/widgets/widget.js").widget; @@ -83,5 +82,3 @@ BarCodeReaderWidget.prototype.refresh = function(changedTiddlers) { }; exports.barcodereader = BarCodeReaderWidget; - -})();