1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-03-27 22:06:55 +00:00

Merge branch 'master' into colour-improvements

This commit is contained in:
Jeremy Ruston 2025-03-21 17:24:19 +00:00
commit e86eb28890
517 changed files with 673 additions and 2525 deletions

317
.eslintrc.json Normal file
View File

@ -0,0 +1,317 @@
{
"env": {
"browser": true,
"commonjs": true,
"node": true
},
"extends": [
"eslint:recommended"
],
"globals": {
"$tw": "writable"
},
"parserOptions": {
"ecmaVersion": 5
},
"plugins": [],
"rules": {
"array-bracket-newline": "off",
"array-bracket-spacing": "off",
"array-callback-return": "off",
"array-element-newline": "off",
"arrow-body-style": "error",
"arrow-parens": [
"error",
"as-needed"
],
"arrow-spacing": [
"error",
{
"after": true,
"before": true
}
],
"block-scoped-var": "off",
"block-spacing": "off",
"brace-style": "off",
"callback-return": "off",
"camelcase": "off",
"capitalized-comments": "off",
"class-methods-use-this": "error",
"comma-dangle": "off",
"comma-spacing": "off",
"comma-style": "off",
"complexity": "off",
"computed-property-spacing": "off",
"consistent-return": "off",
"consistent-this": "off",
"curly": "off",
"default-case": "off",
"default-case-last": "error",
"default-param-last": "error",
"dot-location": "off",
"dot-notation": "off",
"eol-last": "off",
"eqeqeq": "off",
"func-call-spacing": "off",
"func-name-matching": "off",
"func-names": "off",
"func-style": "off",
"function-call-argument-newline": "off",
"function-paren-newline": "off",
"generator-star-spacing": "error",
"global-require": "off",
"grouped-accessor-pairs": "error",
"guard-for-in": "off",
"handle-callback-err": "off",
"id-blacklist": "error",
"id-denylist": "error",
"id-length": "off",
"id-match": "error",
"implicit-arrow-linebreak": "error",
"indent": "off",
"indent-legacy": "off",
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "off",
"keyword-spacing": [
"error",
{
"before": true,
"after": false,
"overrides": {
"case": {
"after": true
},
"do": {
"after": true
},
"else": {
"after": true
},
"return": {
"after": true
},
"throw": {
"after": true
},
"try": {
"after": true
},
"catch": {
"after": true
}
}
}
],
"line-comment-position": "off",
"linebreak-style": "off",
"lines-around-comment": "off",
"lines-around-directive": "off",
"lines-between-class-members": "error",
"max-classes-per-file": "error",
"max-depth": "off",
"max-len": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"multiline-comment-style": "off",
"multiline-ternary": "off",
"new-parens": "off",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"no-alert": "off",
"no-array-constructor": "off",
"no-await-in-loop": "error",
"no-bitwise": "off",
"no-buffer-constructor": "off",
"no-caller": "error",
"no-catch-shadow": "off",
"no-confusing-arrow": "error",
"no-console": "off",
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"no-constructor-return": "error",
"no-continue": "off",
"no-div-regex": "off",
"no-duplicate-imports": "error",
"no-else-return": "off",
"no-empty-function": "off",
"no-eq-null": "off",
"no-eval": "off",
"no-extend-native": "off",
"no-extra-bind": "off",
"no-extra-label": "off",
"no-extra-parens": "off",
"no-floating-decimal": "off",
"no-implicit-coercion": [
"error",
{
"boolean": false,
"number": false,
"string": false
}
],
"no-implicit-globals": "off",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-invalid-this": "off",
"no-iterator": "error",
"no-label-var": "off",
"no-labels": "off",
"no-lone-blocks": "off",
"no-lonely-if": "off",
"no-loop-func": "off",
"no-loss-of-precision": "error",
"no-magic-numbers": "off",
"no-mixed-operators": "off",
"no-mixed-requires": "off",
"no-multi-assign": "off",
"no-multi-spaces": "off",
"no-multi-str": "error",
"no-multiple-empty-lines": ["warn", { "max": 4, "maxEOF": 0 }],
"no-native-reassign": "off",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "off",
"no-new": "off",
"no-new-func": "off",
"no-new-object": "off",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "error",
"no-plusplus": "off",
"no-process-env": "off",
"no-process-exit": "off",
"no-promise-executor-return": "error",
"no-proto": "off",
"no-restricted-exports": "error",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": "off",
"no-return-await": "error",
"no-script-url": "off",
"no-self-compare": "off",
"no-sequences": "off",
"no-shadow": "off",
"no-spaced-func": "off",
"no-sync": "off",
"no-tabs": "off",
"no-template-curly-in-string": "error",
"no-ternary": "off",
"no-throw-literal": "off",
"no-trailing-spaces": "error",
"no-undef-init": "off",
"no-undefined": "off",
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "off",
"no-unneeded-ternary": "off",
"no-unreachable-loop": "error",
"no-unused-expressions": "off",
"no-use-before-define": "off",
"no-useless-backreference": "error",
"no-useless-call": "off",
"no-useless-computed-key": "error",
"no-useless-concat": "off",
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "off",
"no-var": "off",
"no-void": "off",
"no-warning-comments": "off",
"no-whitespace-before-property": "error",
"nonblock-statement-body-position": [
"error",
"any"
],
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-property-newline": "off",
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "off",
"operator-assignment": "off",
"operator-linebreak": "off",
"padded-blocks": "off",
"padding-line-between-statements": "error",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-destructuring": "off",
"prefer-exponentiation-operator": "off",
"prefer-named-capture-group": "off",
"prefer-numeric-literals": "error",
"prefer-object-spread": "off",
"prefer-promise-reject-errors": "error",
"prefer-reflect": "off",
"prefer-regex-literals": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "off",
"require-atomic-updates": "error",
"require-await": "error",
"require-jsdoc": "off",
"require-unicode-regexp": "off",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": "off",
"semi-style": "off",
"sort-imports": "error",
"sort-keys": "off",
"sort-vars": "off",
"space-before-blocks": "off",
"space-before-function-paren": "off",
"space-in-parens": "off",
"space-infix-ops": "off",
"space-unary-ops": "off",
"spaced-comment": "off",
"strict": "off",
"switch-colon-spacing": "off",
"symbol-description": "error",
"template-curly-spacing": "error",
"template-tag-spacing": "error",
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "off",
"valid-typeof": [
"error",
{
"requireStringLiterals": false
}
],
"vars-on-top": "off",
"wrap-iife": "off",
"wrap-regex": "off",
"yield-star-spacing": "error",
"yoda": "off",
"no-useless-escape": "off",
"no-unused-vars": "off",
"no-empty": "off",
"no-extra-semi": "off",
"no-redeclare": "off",
"no-control-regex": "off",
"no-mixed-spaces-and-tabs": "off",
"no-extra-boolean-cast": "off",
"no-prototype-builtins": "off",
"no-undef": "off",
"no-unreachable": "off",
"no-self-assign": "off"
}
}

View File

@ -1902,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") {

View File

@ -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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,10 +15,7 @@ The following options are supported:
Supports backward compatibility with --savewikifolder <wikifolderpath> [<filter>] [ [<name>=<value>] ]*
\*/
(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;
})();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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(",");
})();

View File

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

View File

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

View File

@ -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";
@ -180,5 +177,3 @@ SimpleEngine.prototype.executeTextOperation = function(operation) {
};
exports.SimpleEngine = SimpleEngine;
})();

View File

@ -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
@ -384,5 +381,3 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
}
exports.editTextWidgetFactory = editTextWidgetFactory;
})();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 [];
}
};
})();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,9 +7,6 @@ Filter operator for returning all the backtranscludes from a tiddler
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*

View File

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

View File

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

View File

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

View File

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

View File

@ -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 + ""];
};
})();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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