From 279f2d7bd3edbb67b97410f8f1487510fd06e332 Mon Sep 17 00:00:00 2001 From: pmario Date: Sun, 16 Mar 2025 17:09:22 +0100 Subject: [PATCH] fix whitespace --- core/modules/editor/operations/text/excise.js | 2 -- core/modules/editor/operations/text/wrap-lines.js | 2 +- core/modules/filters/format/timestamp.js | 2 +- core/modules/filters/removesuffix.js | 2 +- core/modules/filters/suffix.js | 2 +- core/modules/widgets/button.js | 2 +- editions/test/tiddlers/tests/test-backtranscludes.js | 4 +--- editions/test/tiddlers/tests/test-tags-operator.js | 4 +++- plugins/tiddlywiki/aws/modules/command.js | 4 +++- plugins/tiddlywiki/aws/modules/encodings.js | 4 +++- plugins/tiddlywiki/aws/modules/init.js | 4 +++- plugins/tiddlywiki/aws/modules/utils.js | 4 +++- 12 files changed, 21 insertions(+), 15 deletions(-) diff --git a/core/modules/editor/operations/text/excise.js b/core/modules/editor/operations/text/excise.js index 91a516e0c..c0920cf09 100644 --- a/core/modules/editor/operations/text/excise.js +++ b/core/modules/editor/operations/text/excise.js @@ -7,8 +7,6 @@ Text editor operation to excise the selection to a new tiddler \*/ - - "use strict"; function isMarkdown(mediaType) { diff --git a/core/modules/editor/operations/text/wrap-lines.js b/core/modules/editor/operations/text/wrap-lines.js index c7edd2be4..9e85d50ca 100644 --- a/core/modules/editor/operations/text/wrap-lines.js +++ b/core/modules/editor/operations/text/wrap-lines.js @@ -19,7 +19,7 @@ exports["wrap-lines"] = function(event,operation) { operation.cutStart = operation.selStart - (prefix.length + 1); operation.cutEnd = operation.selEnd + suffix.length + 1; // Also cut the following newline (if there is any) - if(operation.text[operation.cutEnd] === "\n") { + if (operation.text[operation.cutEnd] === "\n") { operation.cutEnd++; } // Replace with selection diff --git a/core/modules/filters/format/timestamp.js b/core/modules/filters/format/timestamp.js index 6835b3f85..9be351c33 100644 --- a/core/modules/filters/format/timestamp.js +++ b/core/modules/filters/format/timestamp.js @@ -12,7 +12,7 @@ Export our filter function exports.timestamp = function(source,operand,options) { var results = []; source(function(tiddler,title) { - if(title.match(/^-?\d+$/)) { + if (title.match(/^-?\d+$/)) { var value = new Date(Number(title)); results.push($tw.utils.formatDateString(value,operand || "[UTC]YYYY0MM0DD0hh0mm0ss0XXX")); } diff --git a/core/modules/filters/removesuffix.js b/core/modules/filters/removesuffix.js index 1b3a7f7c7..98f4f9ba5 100644 --- a/core/modules/filters/removesuffix.js +++ b/core/modules/filters/removesuffix.js @@ -15,7 +15,7 @@ Export our filter function exports.removesuffix = function(source,operator,options) { var results = [], suffixes = (operator.suffixes || [])[0] || []; - if(!operator.operand) { + if (!operator.operand) { source(function(tiddler,title) { results.push(title); }); diff --git a/core/modules/filters/suffix.js b/core/modules/filters/suffix.js index 74e7ecd14..e31d40568 100644 --- a/core/modules/filters/suffix.js +++ b/core/modules/filters/suffix.js @@ -15,7 +15,7 @@ Export our filter function exports.suffix = function(source,operator,options) { var results = [], suffixes = (operator.suffixes || [])[0] || []; - if(!operator.operand) { + if (!operator.operand) { source(function(tiddler,title) { results.push(title); }); diff --git a/core/modules/widgets/button.js b/core/modules/widgets/button.js index 423e06202..68f2fcd11 100644 --- a/core/modules/widgets/button.js +++ b/core/modules/widgets/button.js @@ -71,7 +71,7 @@ ButtonWidget.prototype.render = function(parent,nextSibling) { if(this["aria-label"]) { domNode.setAttribute("aria-label",this["aria-label"]); } - if(this.role) { + if (this.role) { domNode.setAttribute("role", this.role); } if(this.popup || this.popupTitle) { diff --git a/editions/test/tiddlers/tests/test-backtranscludes.js b/editions/test/tiddlers/tests/test-backtranscludes.js index c66646c2d..52f08d970 100644 --- a/editions/test/tiddlers/tests/test-backtranscludes.js +++ b/editions/test/tiddlers/tests/test-backtranscludes.js @@ -6,7 +6,7 @@ tags: $:/tags/test-spec Tests the backtranscludes mechanism. \*/ -(function(){"use strict"; +"use strict"; describe('Backtranscludes and transclude filter tests', function() { describe('a tiddler with no transcludes to it', function() { @@ -250,5 +250,3 @@ describe('Backtranscludes and transclude filter tests', function() { }); }); }); - -})(); diff --git a/editions/test/tiddlers/tests/test-tags-operator.js b/editions/test/tiddlers/tests/test-tags-operator.js index 4e7c726ad..4fa0b5963 100644 --- a/editions/test/tiddlers/tests/test-tags-operator.js +++ b/editions/test/tiddlers/tests/test-tags-operator.js @@ -5,7 +5,9 @@ tags: [[$:/tags/test-spec]] Tests the tagging mechanism. -\*/"use strict"; +\*/ + +"use strict"; describe("Tags Operator tests", function() { diff --git a/plugins/tiddlywiki/aws/modules/command.js b/plugins/tiddlywiki/aws/modules/command.js index 5a2c1628b..50ef266cd 100644 --- a/plugins/tiddlywiki/aws/modules/command.js +++ b/plugins/tiddlywiki/aws/modules/command.js @@ -5,7 +5,9 @@ module-type: command --aws command -\*/"use strict"; +\*/ + +"use strict"; var async, awsUtils; diff --git a/plugins/tiddlywiki/aws/modules/encodings.js b/plugins/tiddlywiki/aws/modules/encodings.js index 73d9d276e..959418567 100644 --- a/plugins/tiddlywiki/aws/modules/encodings.js +++ b/plugins/tiddlywiki/aws/modules/encodings.js @@ -5,7 +5,9 @@ module-type: filteroperator Filter operator for applying encodeuricomponent() to each item, with the addition of converting single quotes to %27, as required by AWS -\*/"use strict"; +\*/ + +"use strict"; /* Export our filter functions diff --git a/plugins/tiddlywiki/aws/modules/init.js b/plugins/tiddlywiki/aws/modules/init.js index aefbdbf18..325543f55 100644 --- a/plugins/tiddlywiki/aws/modules/init.js +++ b/plugins/tiddlywiki/aws/modules/init.js @@ -5,7 +5,9 @@ module-type: startup AWS initialisation -\*/"use strict"; +\*/ + +"use strict"; // Export name and synchronous status exports.name = "aws-init"; diff --git a/plugins/tiddlywiki/aws/modules/utils.js b/plugins/tiddlywiki/aws/modules/utils.js index fce0931db..b663e179e 100644 --- a/plugins/tiddlywiki/aws/modules/utils.js +++ b/plugins/tiddlywiki/aws/modules/utils.js @@ -5,7 +5,9 @@ module-type: library AWS utility functions -\*/"use strict"; +\*/ + +"use strict"; /* Get a file from an S3 bucket