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); }; -})(); ```