mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-17 15:24:50 +00:00
Merge branch 'saner-filters'
This commit is contained in:
commit
426281539a
71
boot/boot.js
71
boot/boot.js
@ -32,8 +32,8 @@ if(!$tw) {
|
|||||||
$tw = require("./bootprefix.js").bootprefix();
|
$tw = require("./bootprefix.js").bootprefix();
|
||||||
}
|
}
|
||||||
|
|
||||||
$tw.utils = $tw.utils || {};
|
$tw.utils = $tw.utils || Object.create(null);
|
||||||
$tw.boot = $tw.boot || {};
|
$tw.boot = $tw.boot || Object.create(null);
|
||||||
|
|
||||||
/////////////////////////// Standard node.js libraries
|
/////////////////////////// Standard node.js libraries
|
||||||
|
|
||||||
@ -73,13 +73,11 @@ Iterate through all the own properties of an object or array. Callback is invoke
|
|||||||
$tw.utils.each = function(object,callback) {
|
$tw.utils.each = function(object,callback) {
|
||||||
var f;
|
var f;
|
||||||
if(object) {
|
if(object) {
|
||||||
if($tw.utils.isArray(object)) {
|
if(Object.prototype.toString.call(object) == "[object Array]") {
|
||||||
for(f=0; f<object.length; f++) {
|
object.forEach(callback);
|
||||||
callback(object[f],f,object);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
for(f in object) {
|
for(f in object) {
|
||||||
if($tw.utils.hop(object,f)) {
|
if(Object.prototype.hasOwnProperty.call(object,f)) {
|
||||||
callback(object[f],f,object);
|
callback(object[f],f,object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -282,7 +280,7 @@ $tw.utils.parseStringArray = function(value) {
|
|||||||
|
|
||||||
// Parse a block of name:value fields. The `fields` object is used as the basis for the return value
|
// Parse a block of name:value fields. The `fields` object is used as the basis for the return value
|
||||||
$tw.utils.parseFields = function(text,fields) {
|
$tw.utils.parseFields = function(text,fields) {
|
||||||
fields = fields || {};
|
fields = fields || Object.create(null);
|
||||||
text.split(/\r?\n/mg).forEach(function(line) {
|
text.split(/\r?\n/mg).forEach(function(line) {
|
||||||
if(line.charAt(0) !== "#") {
|
if(line.charAt(0) !== "#") {
|
||||||
var p = line.indexOf(":");
|
var p = line.indexOf(":");
|
||||||
@ -387,7 +385,7 @@ $tw.utils.registerFileType = function(type,encoding,extension,flags) {
|
|||||||
Run code globally with specified context variables in scope
|
Run code globally with specified context variables in scope
|
||||||
*/
|
*/
|
||||||
$tw.utils.evalGlobal = function(code,context,filename) {
|
$tw.utils.evalGlobal = function(code,context,filename) {
|
||||||
var contextCopy = $tw.utils.extend({},context);
|
var contextCopy = $tw.utils.extend(Object.create(null),context);
|
||||||
// Get the context variables as a pair of arrays of names and values
|
// Get the context variables as a pair of arrays of names and values
|
||||||
var contextNames = [], contextValues = [];
|
var contextNames = [], contextValues = [];
|
||||||
$tw.utils.each(contextCopy,function(value,name) {
|
$tw.utils.each(contextCopy,function(value,name) {
|
||||||
@ -399,7 +397,7 @@ $tw.utils.evalGlobal = function(code,context,filename) {
|
|||||||
// Compile the code into a function
|
// Compile the code into a function
|
||||||
var fn;
|
var fn;
|
||||||
if($tw.browser) {
|
if($tw.browser) {
|
||||||
fn = window["eval"](code);
|
fn = window["eval"](code + "\n\n//# sourceURL=" + filename);
|
||||||
} else {
|
} else {
|
||||||
fn = vm.runInThisContext(code,filename);
|
fn = vm.runInThisContext(code,filename);
|
||||||
}
|
}
|
||||||
@ -411,7 +409,7 @@ $tw.utils.evalGlobal = function(code,context,filename) {
|
|||||||
Run code in a sandbox with only the specified context variables in scope
|
Run code in a sandbox with only the specified context variables in scope
|
||||||
*/
|
*/
|
||||||
$tw.utils.evalSandboxed = $tw.browser ? $tw.utils.evalGlobal : function(code,context,filename) {
|
$tw.utils.evalSandboxed = $tw.browser ? $tw.utils.evalGlobal : function(code,context,filename) {
|
||||||
var sandbox = $tw.utils.extend({},context);
|
var sandbox = $tw.utils.extend(Object.create(null),context);
|
||||||
vm.runInNewContext(code,sandbox,filename);
|
vm.runInNewContext(code,sandbox,filename);
|
||||||
return sandbox.exports;
|
return sandbox.exports;
|
||||||
};
|
};
|
||||||
@ -684,7 +682,7 @@ Get all the modules of a particular type in a hashmap by their `name` field
|
|||||||
*/
|
*/
|
||||||
$tw.modules.getModulesByTypeAsHashmap = function(moduleType,nameField) {
|
$tw.modules.getModulesByTypeAsHashmap = function(moduleType,nameField) {
|
||||||
nameField = nameField || "name";
|
nameField = nameField || "name";
|
||||||
var results = {};
|
var results = Object.create(null);
|
||||||
$tw.modules.forEachModuleOfType(moduleType,function(title,module) {
|
$tw.modules.forEachModuleOfType(moduleType,function(title,module) {
|
||||||
results[module[nameField]] = module;
|
results[module[nameField]] = module;
|
||||||
});
|
});
|
||||||
@ -696,7 +694,7 @@ Apply the exports of the modules of a particular type to a target object
|
|||||||
*/
|
*/
|
||||||
$tw.modules.applyMethods = function(moduleType,targetObject) {
|
$tw.modules.applyMethods = function(moduleType,targetObject) {
|
||||||
if(!targetObject) {
|
if(!targetObject) {
|
||||||
targetObject = {};
|
targetObject = Object.create(null);
|
||||||
}
|
}
|
||||||
$tw.modules.forEachModuleOfType(moduleType,function(title,module) {
|
$tw.modules.forEachModuleOfType(moduleType,function(title,module) {
|
||||||
$tw.utils.each(module,function(element,title,object) {
|
$tw.utils.each(module,function(element,title,object) {
|
||||||
@ -710,7 +708,7 @@ $tw.modules.applyMethods = function(moduleType,targetObject) {
|
|||||||
Return an array of classes created from the modules of a specified type. Each module should export the properties to be added to those of the optional base class
|
Return an array of classes created from the modules of a specified type. Each module should export the properties to be added to those of the optional base class
|
||||||
*/
|
*/
|
||||||
$tw.modules.createClassesFromModules = function(moduleType,subType,baseClass) {
|
$tw.modules.createClassesFromModules = function(moduleType,subType,baseClass) {
|
||||||
var classes = {};
|
var classes = Object.create(null);
|
||||||
$tw.modules.forEachModuleOfType(moduleType,function(title,moduleExports) {
|
$tw.modules.forEachModuleOfType(moduleType,function(title,moduleExports) {
|
||||||
if(!subType || moduleExports.types[subType]) {
|
if(!subType || moduleExports.types[subType]) {
|
||||||
var newClass = function() {};
|
var newClass = function() {};
|
||||||
@ -732,7 +730,7 @@ Construct a tiddler object from a hashmap of tiddler fields. If multiple hasmaps
|
|||||||
taking precedence to the right
|
taking precedence to the right
|
||||||
*/
|
*/
|
||||||
$tw.Tiddler = function(/* [fields,] fields */) {
|
$tw.Tiddler = function(/* [fields,] fields */) {
|
||||||
this.fields = {};
|
this.fields = Object.create(null);
|
||||||
for(var c=0; c<arguments.length; c++) {
|
for(var c=0; c<arguments.length; c++) {
|
||||||
var arg = arguments[c],
|
var arg = arguments[c],
|
||||||
src = (arg instanceof $tw.Tiddler) ? arg.fields : arg;
|
src = (arg instanceof $tw.Tiddler) ? arg.fields : arg;
|
||||||
@ -805,10 +803,10 @@ shadowTiddlers: Array of shadow tiddlers to be added
|
|||||||
$tw.Wiki = function(options) {
|
$tw.Wiki = function(options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
var self = this,
|
var self = this,
|
||||||
tiddlers = {}, // Hashmap of tiddlers
|
tiddlers = Object.create(null), // Hashmap of tiddlers
|
||||||
pluginTiddlers = [], // Array of tiddlers containing registered plugins, ordered by priority
|
pluginTiddlers = [], // Array of tiddlers containing registered plugins, ordered by priority
|
||||||
pluginInfo = {}, // Hashmap of parsed plugin content
|
pluginInfo = Object.create(null), // Hashmap of parsed plugin content
|
||||||
shadowTiddlers = options.shadowTiddlers || {}; // Hashmap by title of {source:, tiddler:}
|
shadowTiddlers = options.shadowTiddlers || Object.create(null); // Hashmap by title of {source:, tiddler:}
|
||||||
|
|
||||||
// Add a tiddler to the store
|
// Add a tiddler to the store
|
||||||
this.addTiddler = function(tiddler) {
|
this.addTiddler = function(tiddler) {
|
||||||
@ -840,20 +838,16 @@ $tw.Wiki = function(options) {
|
|||||||
var t = tiddlers[title];
|
var t = tiddlers[title];
|
||||||
if(t instanceof $tw.Tiddler) {
|
if(t instanceof $tw.Tiddler) {
|
||||||
return t;
|
return t;
|
||||||
} else if(title !== undefined && $tw.utils.hop(shadowTiddlers,title)) {
|
} else if(title !== undefined && Object.prototype.hasOwnProperty.call(shadowTiddlers,title)) {
|
||||||
return shadowTiddlers[title].tiddler;
|
return shadowTiddlers[title].tiddler;
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get a hashmap of all tiddler titles
|
// Get an array of all tiddler titles
|
||||||
this.getAllTitles = function() {
|
this.allTitles = function() {
|
||||||
var results = {};
|
return Object.keys(tiddlers);
|
||||||
for(var title in tiddlers) {
|
|
||||||
results[title] = true;
|
|
||||||
}
|
|
||||||
return results;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Iterate through all tiddler titles
|
// Iterate through all tiddler titles
|
||||||
@ -863,6 +857,11 @@ $tw.Wiki = function(options) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Get an array of all shadow tiddler titles
|
||||||
|
this.allShadowTitles = function() {
|
||||||
|
return Object.keys(shadowTiddlers);
|
||||||
|
};
|
||||||
|
|
||||||
// Iterate through all shadow tiddler titles
|
// Iterate through all shadow tiddler titles
|
||||||
this.eachShadow = function(callback) {
|
this.eachShadow = function(callback) {
|
||||||
for(var title in shadowTiddlers) {
|
for(var title in shadowTiddlers) {
|
||||||
@ -961,7 +960,7 @@ $tw.Wiki = function(options) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Now go through the plugins in ascending order and assign the shadows
|
// Now go through the plugins in ascending order and assign the shadows
|
||||||
shadowTiddlers = {};
|
shadowTiddlers = Object.create(null);
|
||||||
$tw.utils.each(pluginTiddlers,function(tiddler) {
|
$tw.utils.each(pluginTiddlers,function(tiddler) {
|
||||||
// Extract the constituent tiddlers
|
// Extract the constituent tiddlers
|
||||||
if($tw.utils.hop(pluginInfo,tiddler.fields.title)) {
|
if($tw.utils.hop(pluginInfo,tiddler.fields.title)) {
|
||||||
@ -1034,9 +1033,9 @@ $tw.Wiki.prototype.defineShadowModules = function() {
|
|||||||
Extracts tiddlers from a typed block of text, specifying default field values
|
Extracts tiddlers from a typed block of text, specifying default field values
|
||||||
*/
|
*/
|
||||||
$tw.Wiki.prototype.deserializeTiddlers = function(type,text,srcFields) {
|
$tw.Wiki.prototype.deserializeTiddlers = function(type,text,srcFields) {
|
||||||
srcFields = srcFields || {};
|
srcFields = srcFields || Object.create(null);
|
||||||
var deserializer = $tw.Wiki.tiddlerDeserializerModules[type],
|
var deserializer = $tw.Wiki.tiddlerDeserializerModules[type],
|
||||||
fields = {};
|
fields = Object.create(null);
|
||||||
if(!deserializer && $tw.config.fileExtensionInfo[type]) {
|
if(!deserializer && $tw.config.fileExtensionInfo[type]) {
|
||||||
// If we didn't find the serializer, try converting it from an extension to a content type
|
// If we didn't find the serializer, try converting it from an extension to a content type
|
||||||
type = $tw.config.fileExtensionInfo[type].type;
|
type = $tw.config.fileExtensionInfo[type].type;
|
||||||
@ -1099,7 +1098,7 @@ $tw.modules.define("$:/boot/tiddlerdeserializer/tids","tiddlerdeserializer",{
|
|||||||
if(line.charAt(0) !== "#") {
|
if(line.charAt(0) !== "#") {
|
||||||
var colonPos= line.indexOf(": ");
|
var colonPos= line.indexOf(": ");
|
||||||
if(colonPos !== -1) {
|
if(colonPos !== -1) {
|
||||||
var tiddler = $tw.utils.extend({},fields);
|
var tiddler = $tw.utils.extend(Object.create(null),fields);
|
||||||
tiddler.title = (tiddler.title || "") + line.substr(0,colonPos);
|
tiddler.title = (tiddler.title || "") + line.substr(0,colonPos);
|
||||||
if(titles.indexOf(tiddler.title) !== -1) {
|
if(titles.indexOf(tiddler.title) !== -1) {
|
||||||
console.log("Warning: .multids file contains multiple definitions for " + tiddler.title);
|
console.log("Warning: .multids file contains multiple definitions for " + tiddler.title);
|
||||||
@ -1370,7 +1369,7 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Save the plugin tiddlers into the plugin info
|
// Save the plugin tiddlers into the plugin info
|
||||||
pluginInfo.tiddlers = pluginInfo.tiddlers || {};
|
pluginInfo.tiddlers = pluginInfo.tiddlers || Object.create(null);
|
||||||
for(t=0; t<pluginTiddlers.length; t++) {
|
for(t=0; t<pluginTiddlers.length; t++) {
|
||||||
if(pluginTiddlers[t].title) {
|
if(pluginTiddlers[t].title) {
|
||||||
pluginInfo.tiddlers[pluginTiddlers[t].title] = pluginTiddlers[t];
|
pluginInfo.tiddlers[pluginTiddlers[t].title] = pluginTiddlers[t];
|
||||||
@ -1547,7 +1546,7 @@ $tw.boot.startup = function(options) {
|
|||||||
// Initialise some more $tw properties
|
// Initialise some more $tw properties
|
||||||
$tw.utils.deepDefaults($tw,{
|
$tw.utils.deepDefaults($tw,{
|
||||||
modules: { // Information about each module
|
modules: { // Information about each module
|
||||||
titles: {}, // hashmap by module title of {fn:, exports:, moduleType:}
|
titles: Object.create(null), // hashmap by module title of {fn:, exports:, moduleType:}
|
||||||
types: {} // hashmap by module type of hashmap of exports
|
types: {} // hashmap by module type of hashmap of exports
|
||||||
},
|
},
|
||||||
config: { // Configuration overridables
|
config: { // Configuration overridables
|
||||||
@ -1561,13 +1560,13 @@ $tw.boot.startup = function(options) {
|
|||||||
wikiLanguagesSubDir: "./languages",
|
wikiLanguagesSubDir: "./languages",
|
||||||
wikiTiddlersSubDir: "./tiddlers",
|
wikiTiddlersSubDir: "./tiddlers",
|
||||||
jsModuleHeaderRegExpString: "^\\/\\*\\\\(?:\\r?\\n)((?:^[^\\r\\n]*(?:\\r?\\n))+?)(^\\\\\\*\\/$(?:\\r?\\n)?)",
|
jsModuleHeaderRegExpString: "^\\/\\*\\\\(?:\\r?\\n)((?:^[^\\r\\n]*(?:\\r?\\n))+?)(^\\\\\\*\\/$(?:\\r?\\n)?)",
|
||||||
fileExtensionInfo: {}, // Map file extension to {type:}
|
fileExtensionInfo: Object.create(null), // Map file extension to {type:}
|
||||||
contentTypeInfo: {} // Map type to {encoding:,extension:}
|
contentTypeInfo: Object.create(null) // Map type to {encoding:,extension:}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(!options.readBrowserTiddlers) {
|
if(!options.readBrowserTiddlers) {
|
||||||
// For writable tiddler files, a hashmap of title to {filepath:,type:,hasMetaFile:}
|
// For writable tiddler files, a hashmap of title to {filepath:,type:,hasMetaFile:}
|
||||||
$tw.boot.files = {};
|
$tw.boot.files = Object.create(null);
|
||||||
// System paths and filenames
|
// System paths and filenames
|
||||||
$tw.boot.bootPath = path.dirname(module.filename);
|
$tw.boot.bootPath = path.dirname(module.filename);
|
||||||
$tw.boot.corePath = path.resolve($tw.boot.bootPath,"../core");
|
$tw.boot.corePath = path.resolve($tw.boot.bootPath,"../core");
|
||||||
@ -1614,7 +1613,7 @@ $tw.boot.startup = function(options) {
|
|||||||
// Install built in tiddler fields modules
|
// Install built in tiddler fields modules
|
||||||
$tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap("tiddlerfield");
|
$tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap("tiddlerfield");
|
||||||
// Install the tiddler deserializer modules
|
// Install the tiddler deserializer modules
|
||||||
$tw.Wiki.tiddlerDeserializerModules = {};
|
$tw.Wiki.tiddlerDeserializerModules = Object.create(null);
|
||||||
$tw.modules.applyMethods("tiddlerdeserializer",$tw.Wiki.tiddlerDeserializerModules);
|
$tw.modules.applyMethods("tiddlerdeserializer",$tw.Wiki.tiddlerDeserializerModules);
|
||||||
// Load tiddlers
|
// Load tiddlers
|
||||||
if(options.readBrowserTiddlers) {
|
if(options.readBrowserTiddlers) {
|
||||||
|
@ -3,7 +3,7 @@ title: $:/core/modules/filters.js
|
|||||||
type: application/javascript
|
type: application/javascript
|
||||||
module-type: wikimethod
|
module-type: wikimethod
|
||||||
|
|
||||||
Adds tiddler filtering to the $tw.Wiki object.
|
Adds tiddler filtering methods to the $tw.Wiki object.
|
||||||
|
|
||||||
\*/
|
\*/
|
||||||
(function(){
|
(function(){
|
||||||
@ -149,11 +149,16 @@ exports.getFilterOperators = function() {
|
|||||||
return this.filterOperators;
|
return this.filterOperators;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.filterTiddlers = function(filterString,currTiddlerTitle,tiddlerList) {
|
exports.filterTiddlers = function(filterString,currTiddlerTitle,source) {
|
||||||
var fn = this.compileFilter(filterString);
|
var fn = this.compileFilter(filterString);
|
||||||
return fn.call(this,tiddlerList,currTiddlerTitle);
|
return fn.call(this,source,currTiddlerTitle);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Compile a filter into a function with the signature fn(source,currTiddlerTitle) where:
|
||||||
|
source: an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)
|
||||||
|
currTiddlerTitle: the optional name of the current tiddler
|
||||||
|
*/
|
||||||
exports.compileFilter = function(filterString) {
|
exports.compileFilter = function(filterString) {
|
||||||
var filterParseTree;
|
var filterParseTree;
|
||||||
try {
|
try {
|
||||||
@ -175,10 +180,15 @@ exports.compileFilter = function(filterString) {
|
|||||||
var accumulator = source,
|
var accumulator = source,
|
||||||
results = [];
|
results = [];
|
||||||
$tw.utils.each(operation.operators,function(operator) {
|
$tw.utils.each(operation.operators,function(operator) {
|
||||||
var operatorFunction = filterOperators[operator.operator] || filterOperators.field || function(source,operator,operations) {
|
var operand = operator.operand,
|
||||||
return ["Filter Error: unknown operator '" + operator.operator + "'"];
|
operatorFunction;
|
||||||
},
|
if(!operator.operator) {
|
||||||
operand = operator.operand;
|
operatorFunction = filterOperators.title;
|
||||||
|
} else if(!filterOperators[operator.operator]) {
|
||||||
|
operatorFunction = filterOperators.field;
|
||||||
|
} else {
|
||||||
|
operatorFunction = filterOperators[operator.operator];
|
||||||
|
}
|
||||||
if(operator.indirect) {
|
if(operator.indirect) {
|
||||||
operand = self.getTextReference(operator.operand,"",currTiddlerTitle);
|
operand = self.getTextReference(operator.operand,"",currTiddlerTitle);
|
||||||
}
|
}
|
||||||
@ -192,7 +202,7 @@ exports.compileFilter = function(filterString) {
|
|||||||
wiki: self,
|
wiki: self,
|
||||||
currTiddlerTitle: currTiddlerTitle
|
currTiddlerTitle: currTiddlerTitle
|
||||||
});
|
});
|
||||||
accumulator = results;
|
accumulator = self.makeTiddlerIterator(results);
|
||||||
});
|
});
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
@ -210,16 +220,20 @@ exports.compileFilter = function(filterString) {
|
|||||||
case "+": // This operation is applied to the main results so far
|
case "+": // This operation is applied to the main results so far
|
||||||
return function(results,source,currTiddlerTitle) {
|
return function(results,source,currTiddlerTitle) {
|
||||||
// This replaces all the elements of the array, but keeps the actual array so that references to it are preserved
|
// This replaces all the elements of the array, but keeps the actual array so that references to it are preserved
|
||||||
source = results.slice(0);
|
source = self.makeTiddlerIterator(results);
|
||||||
results.splice(0,results.length);
|
results.splice(0,results.length);
|
||||||
$tw.utils.pushTop(results,operationSubFunction(source,currTiddlerTitle));
|
$tw.utils.pushTop(results,operationSubFunction(source,currTiddlerTitle));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})());
|
})());
|
||||||
});
|
});
|
||||||
// Return a function that applies the operations to a source array/hashmap of tiddler titles
|
// Return a function that applies the operations to a source iterator of tiddler titles
|
||||||
return $tw.perf.measure("filter",function filterFunction(source,currTiddlerTitle) {
|
return $tw.perf.measure("filter",function filterFunction(source,currTiddlerTitle) {
|
||||||
source = source || self.getAllTitles();
|
if(!source) {
|
||||||
|
source = self.each;
|
||||||
|
} else if(typeof source === "object") { // Array or hashmap
|
||||||
|
source = self.makeTiddlerIterator(source);
|
||||||
|
}
|
||||||
var results = [];
|
var results = [];
|
||||||
$tw.utils.each(operationFunctions,function(operationFunction) {
|
$tw.utils.each(operationFunctions,function(operationFunction) {
|
||||||
operationFunction(results,source,currTiddlerTitle);
|
operationFunction(results,source,currTiddlerTitle);
|
||||||
|
45
core/modules/filters/all.js
Normal file
45
core/modules/filters/all.js
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/filters/all.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: filteroperator
|
||||||
|
|
||||||
|
Filter operator for selecting tiddlers
|
||||||
|
|
||||||
|
[all[tiddlers+shadows]]
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var allFilterOperators;
|
||||||
|
|
||||||
|
function getAllFilterOperators() {
|
||||||
|
if(!allFilterOperators) {
|
||||||
|
allFilterOperators = {};
|
||||||
|
$tw.modules.applyMethods("allfilteroperator",allFilterOperators);
|
||||||
|
}
|
||||||
|
return allFilterOperators;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Export our filter function
|
||||||
|
*/
|
||||||
|
exports.all = function(source,operator,options) {
|
||||||
|
// Get our suboperators
|
||||||
|
var allFilterOperators = getAllFilterOperators();
|
||||||
|
// Cycle through the suboperators accumulating their results
|
||||||
|
var results = [],
|
||||||
|
subops = operator.operand.split("+");
|
||||||
|
for(var t=0; t<subops.length; t++) {
|
||||||
|
var subop = allFilterOperators[subops[t]];
|
||||||
|
if(subop) {
|
||||||
|
$tw.utils.pushTop(results,subop(source,operator.prefix,options));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return results;
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
26
core/modules/filters/all/current.js
Normal file
26
core/modules/filters/all/current.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/filters/all/current.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: allfilteroperator
|
||||||
|
|
||||||
|
Filter function for [all[current]]
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Export our filter function
|
||||||
|
*/
|
||||||
|
exports.current = function(source,prefix,options) {
|
||||||
|
if(options.currTiddlerTitle) {
|
||||||
|
return [options.currTiddlerTitle];
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
22
core/modules/filters/all/missing.js
Normal file
22
core/modules/filters/all/missing.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/filters/all/missing.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: allfilteroperator
|
||||||
|
|
||||||
|
Filter function for [all[missing]]
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Export our filter function
|
||||||
|
*/
|
||||||
|
exports.missing = function(source,prefix,options) {
|
||||||
|
return options.wiki.getMissingTitles();
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
22
core/modules/filters/all/orphans.js
Normal file
22
core/modules/filters/all/orphans.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/filters/all/orphans.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: allfilteroperator
|
||||||
|
|
||||||
|
Filter function for [all[orphans]]
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Export our filter function
|
||||||
|
*/
|
||||||
|
exports.orphans = function(source,prefix,options) {
|
||||||
|
return options.wiki.getOrphanTitles();
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
22
core/modules/filters/all/shadows.js
Normal file
22
core/modules/filters/all/shadows.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/filters/all/shadows.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: allfilteroperator
|
||||||
|
|
||||||
|
Filter function for [all[shadows]]
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Export our filter function
|
||||||
|
*/
|
||||||
|
exports.shadows = function(source,prefix,options) {
|
||||||
|
return options.wiki.allShadowTitles();
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
22
core/modules/filters/all/tiddlers.js
Normal file
22
core/modules/filters/all/tiddlers.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/filters/all/tiddlers.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: allfilteroperator
|
||||||
|
|
||||||
|
Filter function for [all[tiddlers]]
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Export our filter function
|
||||||
|
*/
|
||||||
|
exports.tiddlers = function(source,prefix,options) {
|
||||||
|
return options.wiki.allTitles();
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
@ -17,20 +17,9 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.backlinks = function(source,operator,options) {
|
exports.backlinks = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
source(function(tiddler,title) {
|
||||||
function checkTiddler(title) {
|
|
||||||
$tw.utils.pushTop(results,options.wiki.getTiddlerBacklinks(title));
|
$tw.utils.pushTop(results,options.wiki.getTiddlerBacklinks(title));
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -16,18 +16,9 @@ Filter operator that selects one tiddler for each unique value of the specified
|
|||||||
Export our filter function
|
Export our filter function
|
||||||
*/
|
*/
|
||||||
exports.each = function(source,operator,options) {
|
exports.each = function(source,operator,options) {
|
||||||
// Convert the source to an array if necessary
|
var results = [],
|
||||||
if(!$tw.utils.isArray(source)) {
|
values = {};
|
||||||
var copy = [];
|
source(function(tiddler,title) {
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
copy.push(title);
|
|
||||||
});
|
|
||||||
source = copy;
|
|
||||||
}
|
|
||||||
// Collect up the first tiddler with each unique value of the specified field
|
|
||||||
var results = [],values = {};
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
var tiddler = options.wiki.getTiddler(title);
|
|
||||||
if(tiddler) {
|
if(tiddler) {
|
||||||
var value = tiddler.getFieldString(operator.operand);
|
var value = tiddler.getFieldString(operator.operand);
|
||||||
if(!$tw.utils.hop(values,value)) {
|
if(!$tw.utils.hop(values,value)) {
|
||||||
|
@ -16,23 +16,14 @@ Filter operator that selects one tiddler for each unique day covered by the spec
|
|||||||
Export our filter function
|
Export our filter function
|
||||||
*/
|
*/
|
||||||
exports.eachday = function(source,operator,options) {
|
exports.eachday = function(source,operator,options) {
|
||||||
|
var results = [],
|
||||||
|
values = [];
|
||||||
// Function to convert a date/time to a date integer
|
// Function to convert a date/time to a date integer
|
||||||
var toDate = function(value) {
|
var toDate = function(value) {
|
||||||
value = (new Date(value)).setHours(0,0,0,0);
|
value = (new Date(value)).setHours(0,0,0,0);
|
||||||
return value+0;
|
return value+0;
|
||||||
};
|
};
|
||||||
// Convert the source to an array if necessary
|
source(function(tiddler,title) {
|
||||||
if(!$tw.utils.isArray(source)) {
|
|
||||||
var copy = [];
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
copy.push(title);
|
|
||||||
});
|
|
||||||
source = copy;
|
|
||||||
}
|
|
||||||
// Collect up the first tiddler with each unique day value of the specified field
|
|
||||||
var results = [],values = [];
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
var tiddler = options.wiki.getTiddler(title);
|
|
||||||
if(tiddler && tiddler.fields[operator.operand]) {
|
if(tiddler && tiddler.fields[operator.operand]) {
|
||||||
var value = toDate(tiddler.fields[operator.operand]);
|
var value = toDate(tiddler.fields[operator.operand]);
|
||||||
if(values.indexOf(value) === -1) {
|
if(values.indexOf(value) === -1) {
|
||||||
|
@ -17,36 +17,47 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.field = function(source,operator,options) {
|
exports.field = function(source,operator,options) {
|
||||||
var results = [],
|
var results = [],
|
||||||
fieldname = (operator.suffix || operator.operator).toLowerCase(),
|
fieldname = (operator.suffix || operator.operator || "title").toLowerCase();
|
||||||
isTitle = fieldname === "title";
|
if(operator.prefix === "!") {
|
||||||
// Function to check an individual title
|
if(operator.regexp) {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
var tiddler = options.wiki.getTiddler(title),
|
if(tiddler) {
|
||||||
text = tiddler ? tiddler.getFieldString(fieldname) : (isTitle ? title : null),
|
var text = tiddler.getFieldString(fieldname);
|
||||||
match;
|
if(text !== null && !operator.regexp.exec(text)) {
|
||||||
if(text !== null) {
|
results.push(title);
|
||||||
if(operator.regexp) {
|
}
|
||||||
match = !!operator.regexp.exec(text);
|
}
|
||||||
} else {
|
});
|
||||||
match = text === operator.operand;
|
} else {
|
||||||
}
|
source(function(tiddler,title) {
|
||||||
if(operator.prefix === "!") {
|
if(tiddler) {
|
||||||
match = !match;
|
var text = tiddler.getFieldString(fieldname);
|
||||||
}
|
if(text !== null && text !== operator.operand) {
|
||||||
if(match) {
|
results.push(title);
|
||||||
results.push(title);
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(source,function(element,title) {
|
if(operator.regexp) {
|
||||||
checkTiddler(title);
|
source(function(tiddler,title) {
|
||||||
});
|
if(tiddler) {
|
||||||
|
var text = tiddler.getFieldString(fieldname);
|
||||||
|
if(text !== null && !!operator.regexp.exec(text)) {
|
||||||
|
results.push(title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
source(function(tiddler,title) {
|
||||||
|
if(tiddler) {
|
||||||
|
var text = tiddler.getFieldString(fieldname);
|
||||||
|
if(text !== null && text === operator.operand) {
|
||||||
|
results.push(title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -16,28 +16,14 @@ Filter operator for returning the names of the fields on the selected tiddlers
|
|||||||
Export our filter function
|
Export our filter function
|
||||||
*/
|
*/
|
||||||
exports.fields = function(source,operator,options) {
|
exports.fields = function(source,operator,options) {
|
||||||
var self = this,
|
var results = [];
|
||||||
results = [];
|
source(function(tiddler,title) {
|
||||||
// Function to check an individual title
|
|
||||||
function checkTiddler(title) {
|
|
||||||
// Return the fields on the specified tiddler
|
|
||||||
var tiddler = options.wiki.getTiddler(title);
|
|
||||||
if(tiddler) {
|
if(tiddler) {
|
||||||
for(var fieldName in tiddler.fields) {
|
for(var fieldName in tiddler.fields) {
|
||||||
$tw.utils.pushTop(results,fieldName);
|
$tw.utils.pushTop(results,fieldName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,27 +17,17 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.has = function(source,operator,options) {
|
exports.has = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
if(operator.prefix === "!") {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
var tiddler = options.wiki.getTiddler(title);
|
if(tiddler && (!$tw.utils.hop(tiddler.fields,operator.operand) || tiddler.fields[operator.operand] === "")) {
|
||||||
if(tiddler) {
|
|
||||||
var match = $tw.utils.hop(tiddler.fields,operator.operand) && tiddler.fields[operator.operand] !== "";
|
|
||||||
if(operator.prefix === "!") {
|
|
||||||
match = !match;
|
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
results.push(title);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(source,function(element,title) {
|
source(function(tiddler,title) {
|
||||||
checkTiddler(title);
|
if(tiddler && $tw.utils.hop(tiddler.fields,operator.operand) && tiddler.fields[operator.operand] !== "") {
|
||||||
|
results.push(title);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -16,26 +16,13 @@ Filter operator for returning the indexes of a data tiddler
|
|||||||
Export our filter function
|
Export our filter function
|
||||||
*/
|
*/
|
||||||
exports.indexes = function(source,operator,options) {
|
exports.indexes = function(source,operator,options) {
|
||||||
var self = this,
|
var results = [];
|
||||||
results = [];
|
source(function(tiddler,title) {
|
||||||
// Function to check an individual title
|
var data = options.wiki.getTiddlerData(title);
|
||||||
function checkTiddler(title) {
|
|
||||||
// Return the fields on the specified tiddler
|
|
||||||
var data = options.wiki.getTiddlerData(title,{});
|
|
||||||
if(data) {
|
if(data) {
|
||||||
$tw.utils.pushTop(results,Object.keys(data));
|
$tw.utils.pushTop(results,Object.keys(data));
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
results.sort();
|
results.sort();
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -17,31 +17,18 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.current = function(source,prefix,options) {
|
exports.current = function(source,prefix,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check a tiddler
|
if(prefix === "!") {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
if(title !== options.currTiddlerTitle) {
|
if(title !== options.currTiddlerTitle) {
|
||||||
results.push(title);
|
results.push(title);
|
||||||
}
|
|
||||||
};
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
if(prefix === "!") {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if(source.indexOf(options.currTiddlerTitle) !== -1) {
|
|
||||||
results.push(options.currTiddlerTitle);
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
} else {
|
} else {
|
||||||
if(prefix === "!") {
|
source(function(tiddler,title) {
|
||||||
$tw.utils.each(source,function(element,title) {
|
if(title === options.currTiddlerTitle) {
|
||||||
checkTiddler(title);
|
results.push(title);
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
results.push(options.currTiddlerTitle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -17,24 +17,17 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.image = function(source,prefix,options) {
|
exports.image = function(source,prefix,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check a tiddler
|
if(prefix === "!") {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
var match = options.wiki.isImageTiddler(title);
|
if(!options.wiki.isImageTiddler(title)) {
|
||||||
if(prefix === "!") {
|
results.push(title);
|
||||||
match = !match;
|
}
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(source,function(element,title) {
|
source(function(tiddler,title) {
|
||||||
checkTiddler(title);
|
if(options.wiki.isImageTiddler(title)) {
|
||||||
|
results.push(title);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -16,31 +16,19 @@ Filter function for [is[missing]]
|
|||||||
Export our filter function
|
Export our filter function
|
||||||
*/
|
*/
|
||||||
exports.missing = function(source,prefix,options) {
|
exports.missing = function(source,prefix,options) {
|
||||||
var results = [],
|
var results = [];
|
||||||
missingTitles;
|
if(prefix === "!") {
|
||||||
// Iterate through the source tiddlers
|
source(function(tiddler,title) {
|
||||||
if($tw.utils.isArray(source)) {
|
if(options.wiki.tiddlerExists(title)) {
|
||||||
missingTitles = options.wiki.getMissingTitles();
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
var match = missingTitles.indexOf(title) !== -1;
|
|
||||||
if(prefix === "!") {
|
|
||||||
match = !match;
|
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
results.push(title);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if(prefix !== "!") {
|
source(function(tiddler,title) {
|
||||||
missingTitles = options.wiki.getMissingTitles();
|
if(!options.wiki.tiddlerExists(title)) {
|
||||||
$tw.utils.each(missingTitles,function(title) {
|
|
||||||
results.push(title);
|
results.push(title);
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
results.push(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -18,24 +18,15 @@ Export our filter function
|
|||||||
exports.orphan = function(source,prefix,options) {
|
exports.orphan = function(source,prefix,options) {
|
||||||
var results = [],
|
var results = [],
|
||||||
orphanTitles = options.wiki.getOrphanTitles();
|
orphanTitles = options.wiki.getOrphanTitles();
|
||||||
// Iterate through the source tiddlers
|
if(prefix === "!") {
|
||||||
if($tw.utils.isArray(source)) {
|
source(function(tiddler,title) {
|
||||||
$tw.utils.each(source,function(title) {
|
if(orphanTitles.indexOf(title) === -1) {
|
||||||
var match = orphanTitles.indexOf(title) !== -1;
|
|
||||||
if(prefix === "!") {
|
|
||||||
match = !match;
|
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
results.push(title);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(source,function(element,title) {
|
source(function(tiddler,title) {
|
||||||
var match = orphanTitles.indexOf(title) !== -1;
|
if(orphanTitles.indexOf(title) !== -1) {
|
||||||
if(prefix === "!") {
|
|
||||||
match = !match;
|
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
results.push(title);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -17,31 +17,18 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.shadow = function(source,prefix,options) {
|
exports.shadow = function(source,prefix,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check a tiddler
|
if(prefix === "!") {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
var match = options.wiki.isShadowTiddler(title);
|
if(!options.wiki.isShadowTiddler(title)) {
|
||||||
if(prefix === "!") {
|
results.push(title);
|
||||||
match = !match;
|
}
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if(prefix !== "!") {
|
source(function(tiddler,title) {
|
||||||
options.wiki.eachShadow(function(tiddler,title) {
|
if(options.wiki.isShadowTiddler(title)) {
|
||||||
results.push(title);
|
results.push(title);
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -17,24 +17,17 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.system = function(source,prefix,options) {
|
exports.system = function(source,prefix,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check a tiddler
|
if(prefix === "!") {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
var match = options.wiki.isSystemTiddler(title);
|
if(!options.wiki.isSystemTiddler(title)) {
|
||||||
if(prefix === "!") {
|
results.push(title);
|
||||||
match = !match;
|
}
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(source,function(element,title) {
|
source(function(tiddler,title) {
|
||||||
checkTiddler(title);
|
if(options.wiki.isSystemTiddler(title)) {
|
||||||
|
results.push(title);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -17,24 +17,17 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.tiddler = function(source,prefix,options) {
|
exports.tiddler = function(source,prefix,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check a tiddler
|
if(prefix === "!") {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
var match = options.wiki.tiddlerExists(title);
|
if(!options.wiki.tiddlerExists(title)) {
|
||||||
if(prefix === "!") {
|
results.push(title);
|
||||||
match = !match;
|
}
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(source,function(element,title) {
|
source(function(tiddler,title) {
|
||||||
checkTiddler(title);
|
if(options.wiki.tiddlerExists(title)) {
|
||||||
|
results.push(title);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -17,20 +17,16 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.limit = function(source,operator,options) {
|
exports.limit = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Convert to an array if necessary
|
// Convert to an array
|
||||||
if(!$tw.utils.isArray(source)) {
|
source(function(tiddler,title) {
|
||||||
var copy = [];
|
results.push(title);
|
||||||
$tw.utils.each(source,function(element,title) {
|
});
|
||||||
copy.push(title);
|
|
||||||
});
|
|
||||||
source = copy;
|
|
||||||
}
|
|
||||||
// Slice the array if necessary
|
// Slice the array if necessary
|
||||||
var limit = Math.min(source.length,parseInt(operator.operand,10));
|
var limit = Math.min(results.length,parseInt(operator.operand,10));
|
||||||
if(operator.prefix === "!") {
|
if(operator.prefix === "!") {
|
||||||
results = source.slice(source.length - limit);
|
results = results.slice(-limit);
|
||||||
} else {
|
} else {
|
||||||
results = source.slice(0,limit);
|
results = results.slice(0,limit);
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -17,20 +17,9 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.links = function(source,operator,options) {
|
exports.links = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
source(function(tiddler,title) {
|
||||||
function checkTiddler(title) {
|
|
||||||
$tw.utils.pushTop(results,options.wiki.getTiddlerLinks(title));
|
$tw.utils.pushTop(results,options.wiki.getTiddlerLinks(title));
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,28 +19,14 @@ exports.list = function(source,operator,options) {
|
|||||||
var results = [],
|
var results = [],
|
||||||
tr = $tw.utils.parseTextReference(operator.operand),
|
tr = $tw.utils.parseTextReference(operator.operand),
|
||||||
list = options.wiki.getTiddlerList(tr.title || options.currTiddlerTitle,tr.field,tr.index);
|
list = options.wiki.getTiddlerList(tr.title || options.currTiddlerTitle,tr.field,tr.index);
|
||||||
function checkTiddler(title) {
|
if(operator.prefix === "!") {
|
||||||
var match = list.indexOf(title) !== -1;
|
source(function(tiddler,title) {
|
||||||
if(operator.prefix === "!") {
|
if(list.indexOf(title) === -1) {
|
||||||
match = !match;
|
results.push(title);
|
||||||
}
|
}
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if(operator.prefix !== "!") {
|
results = list;
|
||||||
results = list;
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -17,20 +17,9 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.listed = function(source,operator,options) {
|
exports.listed = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
source(function(tiddler,title) {
|
||||||
function checkTiddler(title) {
|
|
||||||
$tw.utils.pushTop(results,options.wiki.findListingsOfTiddler(title));
|
$tw.utils.pushTop(results,options.wiki.findListingsOfTiddler(title));
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,10 +17,7 @@ Reverse list
|
|||||||
*/
|
*/
|
||||||
exports.reverse = function(source,operator,options) {
|
exports.reverse = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
if(!$tw.utils.isArray(source)) {
|
source(function(tiddler,title) {
|
||||||
source = Object.keys(source).sort();
|
|
||||||
}
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
results.unshift(title);
|
results.unshift(title);
|
||||||
});
|
});
|
||||||
return results;
|
return results;
|
||||||
@ -30,33 +27,36 @@ exports.reverse = function(source,operator,options) {
|
|||||||
First entry/entries in list
|
First entry/entries in list
|
||||||
*/
|
*/
|
||||||
exports.first = function(source,operator,options) {
|
exports.first = function(source,operator,options) {
|
||||||
var count = parseInt(operator.operand) || 1;
|
var count = parseInt(operator.operand) || 1,
|
||||||
if(!$tw.utils.isArray(source)) {
|
results = [];
|
||||||
source = Object.keys(source).sort();
|
source(function(tiddler,title) {
|
||||||
}
|
results.push(title);
|
||||||
return source.slice(0,Math.min(count,source.length));
|
});
|
||||||
|
return results.slice(0,count);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Last entry/entries in list
|
Last entry/entries in list
|
||||||
*/
|
*/
|
||||||
exports.last = function(source,operator,options) {
|
exports.last = function(source,operator,options) {
|
||||||
var count = parseInt(operator.operand) || 1;
|
var count = parseInt(operator.operand) || 1,
|
||||||
if(!$tw.utils.isArray(source)) {
|
results = [];
|
||||||
source = Object.keys(source).sort();
|
source(function(tiddler,title) {
|
||||||
}
|
results.push(title);
|
||||||
return source.slice(-count);
|
});
|
||||||
|
return results.slice(-count);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
All but the first entry/entries of the list
|
All but the first entry/entries of the list
|
||||||
*/
|
*/
|
||||||
exports.rest = function(source,operator,options) {
|
exports.rest = function(source,operator,options) {
|
||||||
var count = parseInt(operator.operand) || 1;
|
var count = parseInt(operator.operand) || 1,
|
||||||
if(!$tw.utils.isArray(source)) {
|
results = [];
|
||||||
source = Object.keys(source).sort();
|
source(function(tiddler,title) {
|
||||||
}
|
results.push(title);
|
||||||
return source.slice(count);
|
});
|
||||||
|
return results.slice(count);
|
||||||
};
|
};
|
||||||
exports.butfirst = exports.rest;
|
exports.butfirst = exports.rest;
|
||||||
exports.bf = exports.rest;
|
exports.bf = exports.rest;
|
||||||
@ -65,11 +65,12 @@ exports.bf = exports.rest;
|
|||||||
All but the last entry/entries of the list
|
All but the last entry/entries of the list
|
||||||
*/
|
*/
|
||||||
exports.butlast = function(source,operator,options) {
|
exports.butlast = function(source,operator,options) {
|
||||||
var count = parseInt(operator.operand) || 1;
|
var count = parseInt(operator.operand) || 1,
|
||||||
if(!$tw.utils.isArray(source)) {
|
results = [];
|
||||||
source = Object.keys(source).sort();
|
source(function(tiddler,title) {
|
||||||
}
|
results.push(title);
|
||||||
return source.slice(0,-count);
|
});
|
||||||
|
return results.slice(0,-count);
|
||||||
};
|
};
|
||||||
exports.bl = exports.butlast;
|
exports.bl = exports.butlast;
|
||||||
|
|
||||||
@ -77,11 +78,12 @@ exports.bl = exports.butlast;
|
|||||||
The nth member of the list
|
The nth member of the list
|
||||||
*/
|
*/
|
||||||
exports.nth = function(source,operator,options) {
|
exports.nth = function(source,operator,options) {
|
||||||
var count = parseInt(operator.operand) || 1;
|
var count = parseInt(operator.operand) || 1,
|
||||||
if(!$tw.utils.isArray(source)) {
|
results = [];
|
||||||
source = Object.keys(source).sort();
|
source(function(tiddler,title) {
|
||||||
}
|
results.push(title);
|
||||||
return source.slice(count-1,count);
|
});
|
||||||
|
return results.slice(count - 1,count);
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
@ -16,22 +16,12 @@ Filter operator for returning the titles of the modules of a given type in this
|
|||||||
Export our filter function
|
Export our filter function
|
||||||
*/
|
*/
|
||||||
exports.modules = function(source,operator,options) {
|
exports.modules = function(source,operator,options) {
|
||||||
var results = [],
|
var results = [];
|
||||||
pushModules = function(type) {
|
source(function(tiddler,title) {
|
||||||
$tw.utils.each($tw.modules.types[type],function(moduleInfo,moduleName) {
|
$tw.utils.each($tw.modules.types[title],function(moduleInfo,moduleName) {
|
||||||
results.push(moduleName);
|
results.push(moduleName);
|
||||||
});
|
|
||||||
};
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
pushModules(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
});
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
pushModules(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
results.sort();
|
results.sort();
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -18,25 +18,14 @@ Export our filter function
|
|||||||
exports.next = function(source,operator,options) {
|
exports.next = function(source,operator,options) {
|
||||||
var results = [],
|
var results = [],
|
||||||
list = options.wiki.getTiddlerList(operator.operand);
|
list = options.wiki.getTiddlerList(operator.operand);
|
||||||
|
source(function(tiddler,title) {
|
||||||
function checkTiddler(title) {
|
|
||||||
var match = list.indexOf(title);
|
var match = list.indexOf(title);
|
||||||
// increment match and then test if result is in range
|
// increment match and then test if result is in range
|
||||||
match++;
|
match++;
|
||||||
if(match > 0 && match < list.length) {
|
if(match > 0 && match < list.length) {
|
||||||
results.push(list[match]);
|
results.push(list[match]);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -16,30 +16,15 @@ Filter operator for returning the titles of the shadow tiddlers within a plugin
|
|||||||
Export our filter function
|
Export our filter function
|
||||||
*/
|
*/
|
||||||
exports.plugintiddlers = function(source,operator,options) {
|
exports.plugintiddlers = function(source,operator,options) {
|
||||||
var results = [],
|
var results = [];
|
||||||
pushShadows;
|
source(function(tiddler,title) {
|
||||||
switch(operator.operand) {
|
var pluginInfo = options.wiki.getPluginInfo(title);
|
||||||
default:
|
if(pluginInfo) {
|
||||||
pushShadows = function(title) {
|
$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {
|
||||||
var pluginInfo = options.wiki.getPluginInfo(title);
|
results.push(title);
|
||||||
if(pluginInfo) {
|
});
|
||||||
$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {
|
}
|
||||||
results.push(title);
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
pushShadows(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
pushShadows(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
results.sort();
|
results.sort();
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -17,24 +17,17 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.prefix = function(source,operator,options) {
|
exports.prefix = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
if(operator.prefix === "!") {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
var match = title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase();
|
if(title.substr(0,operator.operand.length).toLowerCase() !== operator.operand.toLowerCase()) {
|
||||||
if(operator.prefix === "!") {
|
results.push(title);
|
||||||
match = !match;
|
}
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(source,function(element,title) {
|
source(function(tiddler,title) {
|
||||||
checkTiddler(title);
|
if(title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase()) {
|
||||||
|
results.push(title);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -18,25 +18,14 @@ Export our filter function
|
|||||||
exports.previous = function(source,operator,options) {
|
exports.previous = function(source,operator,options) {
|
||||||
var results = [],
|
var results = [],
|
||||||
list = options.wiki.getTiddlerList(operator.operand);
|
list = options.wiki.getTiddlerList(operator.operand);
|
||||||
|
source(function(tiddler,title) {
|
||||||
function checkTiddler(title) {
|
|
||||||
var match = list.indexOf(title);
|
var match = list.indexOf(title);
|
||||||
// decrement match and then test if result is in range
|
// increment match and then test if result is in range
|
||||||
match--;
|
match--;
|
||||||
if( match >= 0 ) {
|
if(match >= 0) {
|
||||||
results.push(list[match]);
|
results.push(list[match]);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,23 +17,11 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.removeprefix = function(source,operator,options) {
|
exports.removeprefix = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
source(function(tiddler,title) {
|
||||||
function checkTiddler(title) {
|
if(title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase()) {
|
||||||
var match = title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase();
|
|
||||||
if(match) {
|
|
||||||
results.push(title.substr(operator.operand.length));
|
results.push(title.substr(operator.operand.length));
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,34 +17,18 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.sameday = function(source,operator,options) {
|
exports.sameday = function(source,operator,options) {
|
||||||
var results = [],
|
var results = [],
|
||||||
isSameDay = function(dateField,dateString) {
|
targetDate = (new Date($tw.utils.parseDate(operator.operand))).setHours(0,0,0,0);
|
||||||
var date1 = (new Date(dateField)).setHours(0,0,0,0),
|
// Function to convert a date/time to a date integer
|
||||||
date2 = (new Date($tw.utils.parseDate(dateString))).setHours(0,0,0,0);
|
var isSameDay = function(dateField) {
|
||||||
return date1 === date2;
|
return (new Date(dateField)).setHours(0,0,0,0) === targetDate;
|
||||||
};
|
};
|
||||||
// Function to check an individual title
|
source(function(tiddler,title) {
|
||||||
function checkTiddler(title) {
|
if(tiddler && tiddler.fields.modified) {
|
||||||
var tiddler = options.wiki.getTiddler(title);
|
if(isSameDay(tiddler.fields.modified)) {
|
||||||
if(tiddler) {
|
|
||||||
var match = isSameDay(tiddler.fields.modified,operator.operand);
|
|
||||||
if(operator.prefix === "!") {
|
|
||||||
match = !match;
|
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
results.push(title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ Export our filter function
|
|||||||
exports.search = function(source,operator,options) {
|
exports.search = function(source,operator,options) {
|
||||||
var invert = operator.prefix === "!";
|
var invert = operator.prefix === "!";
|
||||||
return options.wiki.search(operator.operand,{
|
return options.wiki.search(operator.operand,{
|
||||||
titles: source,
|
source: source,
|
||||||
invert: invert
|
invert: invert
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -16,23 +16,13 @@ Filter operator for returning the source plugins for shadow tiddlers
|
|||||||
Export our filter function
|
Export our filter function
|
||||||
*/
|
*/
|
||||||
exports.shadowsource = function(source,operator,options) {
|
exports.shadowsource = function(source,operator,options) {
|
||||||
var results = [],
|
var results = [];
|
||||||
pushShadowSource = function(title) {
|
source(function(tiddler,title) {
|
||||||
var source = options.wiki.getShadowSource(title);
|
var source = options.wiki.getShadowSource(title);
|
||||||
if(source) {
|
if(source) {
|
||||||
$tw.utils.pushTop(results,source);
|
$tw.utils.pushTop(results,source);
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
pushShadowSource(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
pushShadowSource(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
results.sort();
|
results.sort();
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -40,15 +40,10 @@ exports.nsortcs = function(source,operator,options) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var prepare_results = function (source) {
|
var prepare_results = function (source) {
|
||||||
var results;
|
var results = [];
|
||||||
if($tw.utils.isArray(source)) {
|
source(function(tiddler,title) {
|
||||||
results = source;
|
results.push(title);
|
||||||
} else {
|
});
|
||||||
results = [];
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
results.push(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,31 +17,18 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.tag = function(source,operator,options) {
|
exports.tag = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
if(operator.prefix === "!") {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
var tiddler = options.wiki.getTiddler(title);
|
if(tiddler && !tiddler.hasTag(operator.operand)) {
|
||||||
if(tiddler) {
|
|
||||||
var match = tiddler.hasTag(operator.operand);
|
|
||||||
if(operator.prefix === "!") {
|
|
||||||
match = !match;
|
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
results.push(title);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(source,function(element,title) {
|
source(function(tiddler,title) {
|
||||||
checkTiddler(title);
|
if(tiddler && tiddler.hasTag(operator.operand)) {
|
||||||
|
results.push(title);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
// Sort the results if we are matching a tag
|
|
||||||
if(operator.prefix !== "!") {
|
|
||||||
results = options.wiki.sortByList(results,operator.operand);
|
results = options.wiki.sortByList(results,operator.operand);
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -17,20 +17,9 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.tagging = function(source,operator,options) {
|
exports.tagging = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
source(function(tiddler,title) {
|
||||||
function checkTiddler(title) {
|
|
||||||
$tw.utils.pushTop(results,options.wiki.getTiddlersWithTag(title));
|
$tw.utils.pushTop(results,options.wiki.getTiddlersWithTag(title));
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,23 +17,11 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.tags = function(source,operator,options) {
|
exports.tags = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
source(function(tiddler,title) {
|
||||||
function checkTiddler(title) {
|
|
||||||
var tiddler = options.wiki.getTiddler(title);
|
|
||||||
if(tiddler && tiddler.fields.tags) {
|
if(tiddler && tiddler.fields.tags) {
|
||||||
$tw.utils.pushTop(results,tiddler.fields.tags);
|
$tw.utils.pushTop(results,tiddler.fields.tags);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,35 +17,14 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.title = function(source,operator,options) {
|
exports.title = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
if(operator.prefix === "!") {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
var tiddler = options.wiki.getTiddler(title);
|
if(tiddler && tiddler.fields.title !== operator.operand) {
|
||||||
if(tiddler) {
|
|
||||||
var match = tiddler.fields[operator.operator] === operator.operand;
|
|
||||||
if(operator.prefix === "!") {
|
|
||||||
match = !match;
|
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
results.push(title);
|
results.push(title);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// If we're filtering a hashmap we change the behaviour to pass through missing tiddlers
|
results.push(operator.operand);
|
||||||
if(operator.prefix !== "!") {
|
|
||||||
results.push(operator.operand);
|
|
||||||
} else {
|
|
||||||
$tw.utils.each(source,function(element,title) {
|
|
||||||
if(title !== operator.operand) {
|
|
||||||
checkTiddler(title);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
@ -17,25 +17,19 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.untagged = function(source,operator,options) {
|
exports.untagged = function(source,operator,options) {
|
||||||
var results = [];
|
var results = [];
|
||||||
// Function to check an individual title
|
if(operator.prefix === "!") {
|
||||||
function checkTiddler(title) {
|
source(function(tiddler,title) {
|
||||||
var tiddler = options.wiki.getTiddler(title),
|
if(tiddler && $tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length > 0) {
|
||||||
match = tiddler && $tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length > 0;
|
$tw.utils.pushTop(results,title);
|
||||||
if(operator.prefix !== "!") {
|
}
|
||||||
match = !match;
|
|
||||||
}
|
|
||||||
if(match) {
|
|
||||||
$tw.utils.pushTop(results,title);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Iterate through the source tiddlers
|
|
||||||
if($tw.utils.isArray(source)) {
|
|
||||||
$tw.utils.each(source,function(title) {
|
|
||||||
checkTiddler(title);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(source,function(element,title) {
|
source(function(tiddler,title) {
|
||||||
checkTiddler(title);
|
if(tiddler) {
|
||||||
|
if(!tiddler.hasField("tags") || ($tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length === 0)) {
|
||||||
|
$tw.utils.pushTop(results,title);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -13,7 +13,7 @@ This is the main application logic for both the client and server
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// Set to `true` to enable performance instrumentation
|
// Set to `true` to enable performance instrumentation
|
||||||
var PERFORMANCE_INSTRUMENTATION = false;
|
var PERFORMANCE_INSTRUMENTATION = true;
|
||||||
|
|
||||||
var widget = require("$:/core/modules/widgets/widget.js");
|
var widget = require("$:/core/modules/widgets/widget.js");
|
||||||
|
|
||||||
|
@ -268,7 +268,12 @@ Synchronise a set of changes to the server
|
|||||||
Syncer.prototype.syncToServer = function(changes) {
|
Syncer.prototype.syncToServer = function(changes) {
|
||||||
var self = this,
|
var self = this,
|
||||||
now = new Date(),
|
now = new Date(),
|
||||||
filteredChanges = this.filterFn.call(this.wiki,changes);
|
filteredChanges = this.filterFn.call(this.wiki,function(callback) {
|
||||||
|
$tw.utils.each(changes,function(change,title) {
|
||||||
|
var tiddler = self.wiki.getTiddler(title);
|
||||||
|
callback(tiddler,title);
|
||||||
|
});
|
||||||
|
});
|
||||||
$tw.utils.each(changes,function(change,title,object) {
|
$tw.utils.each(changes,function(change,title,object) {
|
||||||
// Process the change if it is a deletion of a tiddler we're already syncing, or is on the filtered change list
|
// Process the change if it is a deletion of a tiddler we're already syncing, or is on the filtered change list
|
||||||
if((change.deleted && $tw.utils.hop(self.tiddlerInfo,title)) || filteredChanges.indexOf(title) !== -1) {
|
if((change.deleted && $tw.utils.hop(self.tiddlerInfo,title)) || filteredChanges.indexOf(title) !== -1) {
|
||||||
|
@ -35,21 +35,34 @@ exports.count = function(object) {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Push entries onto an array, removing them first if they already exist in the array
|
Push entries onto an array, removing them first if they already exist in the array
|
||||||
array: array to modify
|
array: array to modify (assumed to be free of duplicates)
|
||||||
value: a single value to push or an array of values to push
|
value: a single value to push or an array of values to push
|
||||||
*/
|
*/
|
||||||
exports.pushTop = function(array,value) {
|
exports.pushTop = function(array,value) {
|
||||||
var t,p;
|
var t,p;
|
||||||
if($tw.utils.isArray(value)) {
|
if($tw.utils.isArray(value)) {
|
||||||
// Remove any array entries that are duplicated in the new values
|
// Remove any array entries that are duplicated in the new values
|
||||||
for(t=0; t<value.length; t++) {
|
if(value.length !== 0) {
|
||||||
p = array.indexOf(value[t]);
|
if(array.length !== 0) {
|
||||||
if(p !== -1) {
|
if(value.length < array.length) {
|
||||||
array.splice(p,1);
|
for(t=0; t<value.length; t++) {
|
||||||
|
p = array.indexOf(value[t]);
|
||||||
|
if(p !== -1) {
|
||||||
|
array.splice(p,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for(t=array.length-1; t>=0; t--) {
|
||||||
|
p = value.indexOf(array[t]);
|
||||||
|
if(p !== -1) {
|
||||||
|
array.splice(t,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// Push the values on top of the main array
|
||||||
|
array.push.apply(array,value);
|
||||||
}
|
}
|
||||||
// Push the values on top of the main array
|
|
||||||
array.push.apply(array,value);
|
|
||||||
} else {
|
} else {
|
||||||
p = array.indexOf(value);
|
p = array.indexOf(value);
|
||||||
if(p !== -1) {
|
if(p !== -1) {
|
||||||
|
@ -56,17 +56,18 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
|
|||||||
// Create our element
|
// Create our element
|
||||||
var domNode = this.document.createElement("a");
|
var domNode = this.document.createElement("a");
|
||||||
// Assign classes
|
// Assign classes
|
||||||
$tw.utils.addClass(domNode,"tw-tiddlylink");
|
var classes = ["tw-tiddlylink"];
|
||||||
if(this.isShadow) {
|
if(this.isShadow) {
|
||||||
$tw.utils.addClass(domNode,"tw-tiddlylink-shadow");
|
classes.push("tw-tiddlylink-shadow");
|
||||||
}
|
}
|
||||||
if(this.isMissing && !this.isShadow) {
|
if(this.isMissing && !this.isShadow) {
|
||||||
$tw.utils.addClass(domNode,"tw-tiddlylink-missing");
|
classes.push("tw-tiddlylink-missing");
|
||||||
} else {
|
} else {
|
||||||
if(!this.isMissing) {
|
if(!this.isMissing) {
|
||||||
$tw.utils.addClass(domNode,"tw-tiddlylink-resolves");
|
classes.push("tw-tiddlylink-resolves");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
domNode.setAttribute("class",classes.join(" "));
|
||||||
// Set an href
|
// Set an href
|
||||||
var wikiLinkTemplateMacro = this.getVariable("tw-wikilink-template"),
|
var wikiLinkTemplateMacro = this.getVariable("tw-wikilink-template"),
|
||||||
wikiLinkTemplate = wikiLinkTemplateMacro ? wikiLinkTemplateMacro.trim() : "#$uri_encoded$",
|
wikiLinkTemplate = wikiLinkTemplateMacro ? wikiLinkTemplateMacro.trim() : "#$uri_encoded$",
|
||||||
@ -74,7 +75,8 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
|
|||||||
wikiLinkText = wikiLinkText.replace("$uri_doubleencoded$",encodeURIComponent(encodeURIComponent(this.to)));
|
wikiLinkText = wikiLinkText.replace("$uri_doubleencoded$",encodeURIComponent(encodeURIComponent(this.to)));
|
||||||
domNode.setAttribute("href",wikiLinkText);
|
domNode.setAttribute("href",wikiLinkText);
|
||||||
// Set the tooltip
|
// Set the tooltip
|
||||||
var tooltipWikiText = this.tooltip || this.getVariable("tw-wikilink-tooltip",{defaultValue: "<$transclude field='tooltip'><$transclude field='title'/></$transclude>"});
|
// HACK: Performance issues with re-parsing the tooltip prevent us defaulting the tooltip to "<$transclude field='tooltip'><$transclude field='title'/></$transclude>"
|
||||||
|
var tooltipWikiText = this.tooltip || this.getVariable("tw-wikilink-tooltip");
|
||||||
if(tooltipWikiText) {
|
if(tooltipWikiText) {
|
||||||
var tooltipText = this.wiki.renderText("text/plain","text/vnd.tiddlywiki",tooltipWikiText,{
|
var tooltipText = this.wiki.renderText("text/plain","text/vnd.tiddlywiki",tooltipWikiText,{
|
||||||
parseAsInline: true,
|
parseAsInline: true,
|
||||||
|
@ -57,7 +57,7 @@ exports.setTextReference = function(textRef,value,currTiddlerTitle) {
|
|||||||
title = tr.title || currTiddlerTitle;
|
title = tr.title || currTiddlerTitle;
|
||||||
// Check if it is a reference to a tiddler field
|
// Check if it is a reference to a tiddler field
|
||||||
if(tr.index) {
|
if(tr.index) {
|
||||||
var data = this.getTiddlerData(title,{});
|
var data = this.getTiddlerData(title,Object.create(null));
|
||||||
data[tr.index] = value;
|
data[tr.index] = value;
|
||||||
this.setTiddlerData(title,data,this.getModificationFields());
|
this.setTiddlerData(title,data,this.getModificationFields());
|
||||||
} else {
|
} else {
|
||||||
@ -79,7 +79,7 @@ exports.deleteTextReference = function(textRef,currTiddlerTitle) {
|
|||||||
title = tr.title || currTiddlerTitle;
|
title = tr.title || currTiddlerTitle;
|
||||||
tiddler = this.getTiddler(title);
|
tiddler = this.getTiddler(title);
|
||||||
if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {
|
if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {
|
||||||
fields = {};
|
fields = Object.create(null);
|
||||||
fields[tr.field] = undefined;
|
fields[tr.field] = undefined;
|
||||||
this.addTiddler(new $tw.Tiddler(tiddler,fields,this.getModificationFields()));
|
this.addTiddler(new $tw.Tiddler(tiddler,fields,this.getModificationFields()));
|
||||||
}
|
}
|
||||||
@ -122,11 +122,11 @@ This method should be called after the changes it describes have been made to th
|
|||||||
*/
|
*/
|
||||||
exports.enqueueTiddlerEvent = function(title,isDeleted) {
|
exports.enqueueTiddlerEvent = function(title,isDeleted) {
|
||||||
// Record the touch in the list of changed tiddlers
|
// Record the touch in the list of changed tiddlers
|
||||||
this.changedTiddlers = this.changedTiddlers || {};
|
this.changedTiddlers = this.changedTiddlers || Object.create(null);
|
||||||
this.changedTiddlers[title] = this.changedTiddlers[title] || {};
|
this.changedTiddlers[title] = this.changedTiddlers[title] || Object.create(null);
|
||||||
this.changedTiddlers[title][isDeleted ? "deleted" : "modified"] = true;
|
this.changedTiddlers[title][isDeleted ? "deleted" : "modified"] = true;
|
||||||
// Increment the change count
|
// Increment the change count
|
||||||
this.changeCount = this.changeCount || {};
|
this.changeCount = this.changeCount || Object.create(null);
|
||||||
if($tw.utils.hop(this.changeCount,title)) {
|
if($tw.utils.hop(this.changeCount,title)) {
|
||||||
this.changeCount[title]++;
|
this.changeCount[title]++;
|
||||||
} else {
|
} else {
|
||||||
@ -138,7 +138,7 @@ exports.enqueueTiddlerEvent = function(title,isDeleted) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
$tw.utils.nextTick(function() {
|
$tw.utils.nextTick(function() {
|
||||||
var changes = self.changedTiddlers;
|
var changes = self.changedTiddlers;
|
||||||
self.changedTiddlers = {};
|
self.changedTiddlers = Object.create(null);
|
||||||
self.eventsTriggered = false;
|
self.eventsTriggered = false;
|
||||||
self.dispatchEvent("change",changes);
|
self.dispatchEvent("change",changes);
|
||||||
});
|
});
|
||||||
@ -147,7 +147,7 @@ exports.enqueueTiddlerEvent = function(title,isDeleted) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.getChangeCount = function(title) {
|
exports.getChangeCount = function(title) {
|
||||||
this.changeCount = this.changeCount || {};
|
this.changeCount = this.changeCount || Object.create(null);
|
||||||
if($tw.utils.hop(this.changeCount,title)) {
|
if($tw.utils.hop(this.changeCount,title)) {
|
||||||
return this.changeCount[title];
|
return this.changeCount[title];
|
||||||
} else {
|
} else {
|
||||||
@ -223,7 +223,7 @@ exports.getCreationFields = function() {
|
|||||||
Return a hashmap of the fields that should be set when a tiddler is modified
|
Return a hashmap of the fields that should be set when a tiddler is modified
|
||||||
*/
|
*/
|
||||||
exports.getModificationFields = function() {
|
exports.getModificationFields = function() {
|
||||||
var fields = {},
|
var fields = Object.create(null),
|
||||||
modifier = this.getTiddlerText(USER_NAME_TITLE);
|
modifier = this.getTiddlerText(USER_NAME_TITLE);
|
||||||
fields.modified = new Date();
|
fields.modified = new Date();
|
||||||
if(modifier) {
|
if(modifier) {
|
||||||
@ -239,7 +239,7 @@ excludeTag: tag to exclude
|
|||||||
includeSystem: whether to include system tiddlers (defaults to false)
|
includeSystem: whether to include system tiddlers (defaults to false)
|
||||||
*/
|
*/
|
||||||
exports.getTiddlers = function(options) {
|
exports.getTiddlers = function(options) {
|
||||||
options = options || {};
|
options = options || Object.create(null);
|
||||||
var self = this,
|
var self = this,
|
||||||
sortField = options.sortField || "title",
|
sortField = options.sortField || "title",
|
||||||
tiddlers = [], t, titles = [];
|
tiddlers = [], t, titles = [];
|
||||||
@ -274,6 +274,23 @@ exports.countTiddlers = function(excludeTag) {
|
|||||||
return $tw.utils.count(tiddlers);
|
return $tw.utils.count(tiddlers);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Returns a function iterator(callback) that iterates through the specified titles, and invokes the callback with callback(tiddler,title)
|
||||||
|
*/
|
||||||
|
exports.makeTiddlerIterator = function(titles) {
|
||||||
|
var self = this;
|
||||||
|
if(!$tw.utils.isArray(titles)) {
|
||||||
|
titles = Object.keys(titles);
|
||||||
|
} else {
|
||||||
|
titles = titles.slice(0);
|
||||||
|
}
|
||||||
|
return function(callback) {
|
||||||
|
titles.forEach(function(title) {
|
||||||
|
callback(self.getTiddler(title),title);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Sort an array of tiddler titles by a specified field
|
Sort an array of tiddler titles by a specified field
|
||||||
titles: array of titles (sorted in place)
|
titles: array of titles (sorted in place)
|
||||||
@ -431,7 +448,7 @@ Get a hashmap by tag of arrays of tiddler titles
|
|||||||
exports.getTagMap = function() {
|
exports.getTagMap = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
return this.getGlobalCache("tagmap",function() {
|
return this.getGlobalCache("tagmap",function() {
|
||||||
var tags = {},
|
var tags = Object.create(null),
|
||||||
storeTags = function(tagArray,title) {
|
storeTags = function(tagArray,title) {
|
||||||
if(tagArray) {
|
if(tagArray) {
|
||||||
for(var index=0; index<tagArray.length; index++) {
|
for(var index=0; index<tagArray.length; index++) {
|
||||||
@ -532,7 +549,7 @@ Retrieve a tiddler as a JSON string of the fields
|
|||||||
exports.getTiddlerAsJson = function(title) {
|
exports.getTiddlerAsJson = function(title) {
|
||||||
var tiddler = this.getTiddler(title);
|
var tiddler = this.getTiddler(title);
|
||||||
if(tiddler) {
|
if(tiddler) {
|
||||||
var fields = {};
|
var fields = Object.create(null);
|
||||||
$tw.utils.each(tiddler.fields,function(value,name) {
|
$tw.utils.each(tiddler.fields,function(value,name) {
|
||||||
fields[name] = tiddler.getFieldString(name);
|
fields[name] = tiddler.getFieldString(name);
|
||||||
});
|
});
|
||||||
@ -574,7 +591,7 @@ exports.getTiddlerData = function(title,defaultData) {
|
|||||||
Extract an indexed field from within a data tiddler
|
Extract an indexed field from within a data tiddler
|
||||||
*/
|
*/
|
||||||
exports.extractTiddlerDataItem = function(title,index,defaultText) {
|
exports.extractTiddlerDataItem = function(title,index,defaultText) {
|
||||||
var data = this.getTiddlerData(title,{}),
|
var data = this.getTiddlerData(title,Object.create(null)),
|
||||||
text;
|
text;
|
||||||
if(data && $tw.utils.hop(data,index)) {
|
if(data && $tw.utils.hop(data,index)) {
|
||||||
text = data[index];
|
text = data[index];
|
||||||
@ -623,7 +640,7 @@ exports.getTiddlerList = function(title,field,index) {
|
|||||||
|
|
||||||
// Return a named global cache object. Global cache objects are cleared whenever a tiddler change occurs
|
// Return a named global cache object. Global cache objects are cleared whenever a tiddler change occurs
|
||||||
exports.getGlobalCache = function(cacheName,initializer) {
|
exports.getGlobalCache = function(cacheName,initializer) {
|
||||||
this.globalCache = this.globalCache || {};
|
this.globalCache = this.globalCache || Object.create(null);
|
||||||
if($tw.utils.hop(this.globalCache,cacheName)) {
|
if($tw.utils.hop(this.globalCache,cacheName)) {
|
||||||
return this.globalCache[cacheName];
|
return this.globalCache[cacheName];
|
||||||
} else {
|
} else {
|
||||||
@ -633,7 +650,7 @@ exports.getGlobalCache = function(cacheName,initializer) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.clearGlobalCache = function() {
|
exports.clearGlobalCache = function() {
|
||||||
this.globalCache = {};
|
this.globalCache = Object.create(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the named cache object for a tiddler. If the cache doesn't exist then the initializer function is invoked to create it
|
// Return the named cache object for a tiddler. If the cache doesn't exist then the initializer function is invoked to create it
|
||||||
@ -642,13 +659,13 @@ exports.getCacheForTiddler = function(title,cacheName,initializer) {
|
|||||||
// Temporarily disable caching so that tweakParseTreeNode() works
|
// Temporarily disable caching so that tweakParseTreeNode() works
|
||||||
return initializer();
|
return initializer();
|
||||||
|
|
||||||
this.caches = this.caches || {};
|
this.caches = this.caches || Object.create(null);
|
||||||
var caches = this.caches[title];
|
var caches = this.caches[title];
|
||||||
if(caches && caches[cacheName]) {
|
if(caches && caches[cacheName]) {
|
||||||
return caches[cacheName];
|
return caches[cacheName];
|
||||||
} else {
|
} else {
|
||||||
if(!caches) {
|
if(!caches) {
|
||||||
caches = {};
|
caches = Object.create(null);
|
||||||
this.caches[title] = caches;
|
this.caches[title] = caches;
|
||||||
}
|
}
|
||||||
caches[cacheName] = initializer();
|
caches[cacheName] = initializer();
|
||||||
@ -658,7 +675,7 @@ return initializer();
|
|||||||
|
|
||||||
// Clear all caches associated with a particular tiddler
|
// Clear all caches associated with a particular tiddler
|
||||||
exports.clearCache = function(title) {
|
exports.clearCache = function(title) {
|
||||||
this.caches = this.caches || {};
|
this.caches = this.caches || Object.create(null);
|
||||||
if($tw.utils.hop(this.caches,title)) {
|
if($tw.utils.hop(this.caches,title)) {
|
||||||
delete this.caches[title];
|
delete this.caches[title];
|
||||||
}
|
}
|
||||||
@ -877,7 +894,7 @@ Return an array of tiddler titles that match a search string
|
|||||||
text: The text string to search for
|
text: The text string to search for
|
||||||
options: see below
|
options: see below
|
||||||
Options available:
|
Options available:
|
||||||
titles: Hashmap or array of tiddler titles to limit search
|
source: an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)
|
||||||
exclude: An array of tiddler titles to exclude from the search
|
exclude: An array of tiddler titles to exclude from the search
|
||||||
invert: If true returns tiddlers that do not contain the specified string
|
invert: If true returns tiddlers that do not contain the specified string
|
||||||
caseSensitive: If true forces a case sensitive search
|
caseSensitive: If true forces a case sensitive search
|
||||||
@ -932,28 +949,13 @@ exports.search = function(text,options) {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
// Loop through all the tiddlers doing the search
|
// Loop through all the tiddlers doing the search
|
||||||
var results = [];
|
var results = [],
|
||||||
if($tw.utils.isArray(options.titles)) {
|
source = options.source || this.each;
|
||||||
for(t=0; t<options.titles.length; t++) {
|
source(function(tiddler,title) {
|
||||||
if(!!searchTiddler(options.titles[t]) === !options.invert) {
|
if(!!searchTiddler(title) === !options.invert) {
|
||||||
results.push(options.titles[t]);
|
results.push(title);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
});
|
||||||
if(options.titles) {
|
|
||||||
for(var title in options.titles) {
|
|
||||||
if(!!searchTiddler(title) === !options.invert) {
|
|
||||||
results.push(title);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.each(function(tiddler,title) {
|
|
||||||
if(!!searchTiddler(title) === !options.invert) {
|
|
||||||
results.push(title);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Remove any of the results we have to exclude
|
// Remove any of the results we have to exclude
|
||||||
if(options.exclude) {
|
if(options.exclude) {
|
||||||
for(t=0; t<options.exclude.length; t++) {
|
for(t=0; t<options.exclude.length; t++) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
title: $:/AdvancedSearch
|
title: $:/AdvancedSearch
|
||||||
|
|
||||||
<div class="tw-advanced-search">
|
<div class="tw-advanced-search">
|
||||||
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/AdvancedSearch]] [!is[shadow]!has[draft.of]tag[$:/tags/AdvancedSearch]] +[tag[$:/tags/AdvancedSearch]]" "$:/core/ui/AdvancedSearch/System">>
|
<<tabs "[all[tiddlers+shadows]tag[$:/tags/AdvancedSearch]!has[draft.of]]" "$:/core/ui/AdvancedSearch/System">>
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,7 +12,7 @@ caption: {{$:/language/Search/Filter/Caption}}
|
|||||||
<div class="tw-block-dropdown-wrapper">
|
<div class="tw-block-dropdown-wrapper">
|
||||||
<$reveal state=<<qualify "$:/state/filterDropdown">> type="nomatch" text="" default="">
|
<$reveal state=<<qualify "$:/state/filterDropdown">> type="nomatch" text="" default="">
|
||||||
<div class="tw-block-dropdown tw-edit-type-dropdown">
|
<div class="tw-block-dropdown tw-edit-type-dropdown">
|
||||||
<$list filter="[is[shadow]tag[$:/tags/Filter]] [!is[shadow]tag[$:/tags/Filter]] +[sort[description]]"><$link to={{!!filter}}><$transclude field="description"/></$link>
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/Filter]]"><$link to={{!!filter}}><$transclude field="description"/></$link>
|
||||||
</$list>
|
</$list>
|
||||||
</div>
|
</div>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
|
@ -17,7 +17,7 @@ caption: {{$:/language/Search/Shadows/Caption}}
|
|||||||
|
|
||||||
<<lingo Advanced/Matches>>
|
<<lingo Advanced/Matches>>
|
||||||
|
|
||||||
<$list filter="[is[shadow]search{$:/temp/advancedsearch}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
|
<$list filter="[all[shadows]search{$:/temp/advancedsearch}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
title: $:/ControlPanel
|
title: $:/ControlPanel
|
||||||
|
|
||||||
<div class="tw-control-panel">
|
<div class="tw-control-panel">
|
||||||
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/ControlPanel]] [!is[shadow]!has[draft.of]tag[$:/tags/ControlPanel]] +[tag[$:/tags/ControlPanel]]" "$:/core/ui/ControlPanel/Basics">>
|
<<tabs "[all[tiddlers+shadows]tag[$:/tags/ControlPanel]!has[draft.of]]" "$:/core/ui/ControlPanel/Basics">>
|
||||||
</div>
|
</div>
|
||||||
|
@ -5,5 +5,5 @@ caption: {{$:/language/ControlPanel/Advanced/Caption}}
|
|||||||
{{$:/language/ControlPanel/Advanced/Hint}}
|
{{$:/language/ControlPanel/Advanced/Hint}}
|
||||||
|
|
||||||
<div class="tw-control-panel">
|
<div class="tw-control-panel">
|
||||||
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/ControlPanel/Advanced]] [!is[shadow]!has[draft.of]tag[$:/tags/ControlPanel/Advanced]] +[tag[$:/tags/ControlPanel/Advanced]]" "$:/core/ui/ControlPanel/Advanced/TiddlerFields">>
|
<<tabs "[all[tiddlers+shadows]tag[$:/tags/ControlPanel/Advanced]!has[draft.of]]" "$:/core/ui/ControlPanel/Advanced/TiddlerFields">>
|
||||||
</div>
|
</div>
|
||||||
|
@ -5,5 +5,5 @@ caption: {{$:/language/ControlPanel/Appearance/Caption}}
|
|||||||
{{$:/language/ControlPanel/Appearance/Hint}}
|
{{$:/language/ControlPanel/Appearance/Hint}}
|
||||||
|
|
||||||
<div class="tw-control-panel">
|
<div class="tw-control-panel">
|
||||||
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/ControlPanel/Appearance]] [!is[shadow]!has[draft.of]tag[$:/tags/ControlPanel/Appearance]] +[tag[$:/tags/ControlPanel/Appearance]]" "$:/core/ui/ControlPanel/Appearance/Theme">>
|
<<tabs "[all[tiddlers+shadows]tag[$:/tags/ControlPanel/Appearance]!has[draft.of]]" "$:/core/ui/ControlPanel/Appearance/Theme">>
|
||||||
</div>
|
</div>
|
||||||
|
@ -13,5 +13,5 @@ caption: {{$:/language/ControlPanel/Basics/Caption}}
|
|||||||
|<<lingo Tiddlers/Prompt>> |''<$count filter="[!is[system]]"/>'' |
|
|<<lingo Tiddlers/Prompt>> |''<$count filter="[!is[system]]"/>'' |
|
||||||
|<<lingo Tags/Prompt>> |''<$count filter="[tags[]]"/>'' |
|
|<<lingo Tags/Prompt>> |''<$count filter="[tags[]]"/>'' |
|
||||||
|<<lingo SystemTiddlers/Prompt>> |''<$count filter="[is[system]]"/>'' |
|
|<<lingo SystemTiddlers/Prompt>> |''<$count filter="[is[system]]"/>'' |
|
||||||
|<<lingo ShadowTiddlers/Prompt>> |''<$count filter="[is[shadow]]"/>'' |
|
|<<lingo ShadowTiddlers/Prompt>> |''<$count filter="[all[shadows]]"/>'' |
|
||||||
|<<lingo OverriddenShadowTiddlers/Prompt>> |''<$count filter="[is[tiddler]is[shadow]]"/>'' |
|
|<<lingo OverriddenShadowTiddlers/Prompt>> |''<$count filter="[is[tiddler]is[shadow]]"/>'' |
|
||||||
|
@ -6,7 +6,7 @@ tw-tiddler-frame tw-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerCl
|
|||||||
<div class=<<frame-classes>>>
|
<div class=<<frame-classes>>>
|
||||||
<$set name="storyTiddler" value=<<currentTiddler>>>
|
<$set name="storyTiddler" value=<<currentTiddler>>>
|
||||||
<$keyboard key="ctrl+enter" message="tw-save-tiddler">
|
<$keyboard key="ctrl+enter" message="tw-save-tiddler">
|
||||||
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] +[tag[$:/tags/EditTemplate]]" variable="listItem">
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem">
|
||||||
<$transclude tiddler=<<listItem>>/>
|
<$transclude tiddler=<<listItem>>/>
|
||||||
</$list>
|
</$list>
|
||||||
</$keyboard>
|
</$keyboard>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
title: $:/core/ui/EditTemplate/controls
|
title: $:/core/ui/EditTemplate/controls
|
||||||
tags: $:/tags/EditTemplate
|
tags: $:/tags/EditTemplate
|
||||||
|
|
||||||
<span class="tw-tiddler-controls titlebar"> <$list filter="[is[shadow]!has[draft.of]tag[$:/tags/EditToolbar]] [!is[shadow]!has[draft.of]tag[$:/tags/EditToolbar]] +[tag[$:/tags/EditToolbar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list> </span>
|
<span class="tw-tiddler-controls titlebar"> <$list filter="[all[tiddlers+shadows]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list> </span>
|
||||||
|
@ -2,14 +2,36 @@ title: $:/core/ui/EditTemplate/fields
|
|||||||
tags: $:/tags/EditTemplate
|
tags: $:/tags/EditTemplate
|
||||||
|
|
||||||
\define lingo-base() $:/language/EditTemplate/
|
\define lingo-base() $:/language/EditTemplate/
|
||||||
<$fieldmangler><div class="tw-edit-fields">
|
<$fieldmangler>
|
||||||
<table class="tw-edit-fields"><tbody><$list filter="[is[current]fields[]] -title -tags -text -creator -created -modified -modifier -type -[[draft.title]] -[[draft.of]]" variable="currentField"><tr class="tw-edit-field"><td class="tw-edit-field-name"><<currentField>>:</td><td class="tw-edit-field-value"><$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}}/></td><td class="tw-edit-field-remove"><$button message="tw-remove-field" param=<<currentField>> class="btn-invisible">{{$:/core/images/delete-button}}</$button></td>
|
<div class="tw-edit-fields">
|
||||||
|
<table class="tw-edit-fields">
|
||||||
|
<tbody>
|
||||||
|
<$list filter="[all[current]fields[]] -title -tags -text -creator -created -modified -modifier -type -[[draft.title]] -[[draft.of]]" variable="currentField">
|
||||||
|
<tr class="tw-edit-field">
|
||||||
|
<td class="tw-edit-field-name">
|
||||||
|
<$text text=<<currentField>>/>:</td>
|
||||||
|
<td class="tw-edit-field-value">
|
||||||
|
<$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}}/>
|
||||||
|
</td>
|
||||||
|
<td class="tw-edit-field-remove">
|
||||||
|
<$button message="tw-remove-field" param=<<currentField>> class="btn-invisible">{{$:/core/images/delete-button}}</$button>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</$list>
|
</$list>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tw-edit-field-add"><em class="tw-edit"><<lingo Fields/Add/Prompt>></em> <span class="tw-edit-field-add-name"><$edit-text tiddler="$:/temp/NewFieldName" tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Name/Placeholder}} class="tw-edit-texteditor"/></span> <span class="tw-edit-field-add-button"><$button message="tw-add-field" param={{$:/temp/NewFieldName}} set="$:/temp/NewFieldName" setTo="" class=""><<lingo Fields/Add/Button>></$button></span></div>
|
<div class="tw-edit-field-add">
|
||||||
|
<em class="tw-edit">
|
||||||
|
<<lingo Fields/Add/Prompt>>
|
||||||
|
</em> <span class="tw-edit-field-add-name">
|
||||||
|
<$edit-text tiddler="$:/temp/NewFieldName" tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Name/Placeholder}} class="tw-edit-texteditor"/>
|
||||||
|
</span> <span class="tw-edit-field-add-button">
|
||||||
|
<$button message="tw-add-field" param={{$:/temp/NewFieldName}} set="$:/temp/NewFieldName" setTo="" class="">
|
||||||
|
<<lingo Fields/Add/Button>>
|
||||||
|
</$button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
</$fieldmangler>
|
</$fieldmangler>
|
||||||
|
@ -7,7 +7,7 @@ background-color:$(backgroundColor)$;
|
|||||||
\end
|
\end
|
||||||
<div class="tw-edit-tags">
|
<div class="tw-edit-tags">
|
||||||
<$fieldmangler>
|
<$fieldmangler>
|
||||||
<$list filter="[is[current]tags[]sort[title]]" storyview="pop" template="$:/core/ui/TagEditTemplate"/>
|
<$list filter="[all[current]tags[]sort[title]]" storyview="pop" template="$:/core/ui/TagEditTemplate"/>
|
||||||
|
|
||||||
<div class="tw-edit-add-tag">
|
<div class="tw-edit-add-tag">
|
||||||
<span class="tw-add-tag-name">
|
<span class="tw-add-tag-name">
|
||||||
|
@ -8,7 +8,7 @@ tags: $:/tags/EditTemplate
|
|||||||
<$reveal state=<<qualify "$:/state/typeDropdown">> type="nomatch" text="" default="">
|
<$reveal state=<<qualify "$:/state/typeDropdown">> type="nomatch" text="" default="">
|
||||||
<div class="tw-block-dropdown tw-edit-type-dropdown">
|
<div class="tw-block-dropdown tw-edit-type-dropdown">
|
||||||
<$linkcatcher to="!!type">
|
<$linkcatcher to="!!type">
|
||||||
<$list filter="[is[shadow]prefix[$:/language/Docs/Types/]] [!is[shadow]prefix[$:/language/Docs/Types/]] +[sort[description]]"><$link to={{!!name}}><$view field="description"/> (<$view field="name"/>)</$link>
|
<$list filter="[all[tiddlers+shadows]prefix[$:/language/Docs/Types/]] +[sort[description]]"><$link to={{!!name}}><$view field="description"/> (<$view field="name"/>)</$link>
|
||||||
</$list>
|
</$list>
|
||||||
</$linkcatcher>
|
</$linkcatcher>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
title: $:/core/Filters/Missing
|
title: $:/core/Filters/Missing
|
||||||
tags: $:/tags/Filter
|
tags: $:/tags/Filter
|
||||||
filter: [is[missing]sort[title]]
|
filter: [all[missing]sort[title]]
|
||||||
description: {{$:/language/Filters/Missing}}
|
description: {{$:/language/Filters/Missing}}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
title: $:/core/Filters/Orphans
|
title: $:/core/Filters/Orphans
|
||||||
tags: $:/tags/Filter
|
tags: $:/tags/Filter
|
||||||
filter: [is[orphan]sort[title]]
|
filter: [all[orphans]sort[title]]
|
||||||
description: {{$:/language/Filters/Orphans}}
|
description: {{$:/language/Filters/Orphans}}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
title: $:/core/Filters/OverriddenShadowTiddlers
|
title: $:/core/Filters/OverriddenShadowTiddlers
|
||||||
tags: $:/tags/Filter
|
tags: $:/tags/Filter
|
||||||
filter: [is[tiddler]is[shadow]]
|
filter: [is[shadow]]
|
||||||
description: {{$:/language/Filters/OverriddenShadowTiddlers}}
|
description: {{$:/language/Filters/OverriddenShadowTiddlers}}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
title: $:/core/Filters/ShadowTiddlers
|
title: $:/core/Filters/ShadowTiddlers
|
||||||
tags: $:/tags/Filter
|
tags: $:/tags/Filter
|
||||||
filter: [is[shadow]sort[title]]
|
filter: [all[shadows]sort[title]]
|
||||||
description: {{$:/language/Filters/ShadowTiddlers}}
|
description: {{$:/language/Filters/ShadowTiddlers}}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
title: $:/core/Filters/SystemTags
|
title: $:/core/Filters/SystemTags
|
||||||
tags: $:/tags/Filter
|
tags: $:/tags/Filter
|
||||||
filter: [tags[]is[system]] [is[shadow]tags[]is[system]] +[sort[title]]
|
filter: [all[tiddlers+shadows]tags[]is[system]sort[title]]
|
||||||
description: {{$:/language/Filters/SystemTags}}
|
description: {{$:/language/Filters/SystemTags}}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ title: $:/core/ui/MissingTemplate
|
|||||||
<div class="tw-drop-down">
|
<div class="tw-drop-down">
|
||||||
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
||||||
<hr>
|
<hr>
|
||||||
<$list filter="[is[current]backlinks[]sort[title]]" template="$:/core/ui/ListItemTemplate"/>
|
<$list filter="[all[current]backlinks[]sort[title]]" template="$:/core/ui/ListItemTemplate"/>
|
||||||
</div>
|
</div>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,4 +2,4 @@ title: $:/core/ui/MoreSideBar/Missing
|
|||||||
tags: $:/tags/MoreSideBar
|
tags: $:/tags/MoreSideBar
|
||||||
caption: {{$:/language/SideBar/Missing/Caption}}
|
caption: {{$:/language/SideBar/Missing/Caption}}
|
||||||
|
|
||||||
<$list filter="[is[missing]sort[title]]" template="$:/core/ui/MissingTemplate"/>
|
<$list filter="[all[missing]sort[title]]" template="$:/core/ui/MissingTemplate"/>
|
||||||
|
@ -2,4 +2,4 @@ title: $:/core/ui/MoreSideBar/Orphans
|
|||||||
tags: $:/tags/MoreSideBar
|
tags: $:/tags/MoreSideBar
|
||||||
caption: {{$:/language/SideBar/Orphans/Caption}}
|
caption: {{$:/language/SideBar/Orphans/Caption}}
|
||||||
|
|
||||||
<$list filter="[is[orphan]sort[title]]" template="$:/core/ui/ListItemTemplate"/>
|
<$list filter="[all[orphans]sort[title]]" template="$:/core/ui/ListItemTemplate"/>
|
||||||
|
@ -2,4 +2,4 @@ title: $:/core/ui/MoreSideBar/Shadows
|
|||||||
tags: $:/tags/MoreSideBar
|
tags: $:/tags/MoreSideBar
|
||||||
caption: {{$:/language/SideBar/Shadows/Caption}}
|
caption: {{$:/language/SideBar/Shadows/Caption}}
|
||||||
|
|
||||||
<$list filter="[is[shadow]sort[title]]" template="$:/core/ui/ListItemTemplate"/>
|
<$list filter="[all[shadows]sort[title]]" template="$:/core/ui/ListItemTemplate"/>
|
||||||
|
@ -7,7 +7,7 @@ caption: {{$:/language/SideBar/Tags/Caption}}
|
|||||||
|
|
||||||
<$list filter="[tags[]!is[system]sort[title]]">
|
<$list filter="[tags[]!is[system]sort[title]]">
|
||||||
|
|
||||||
<$transclude tiddler="$:/core/ui/TagTemplate"/> <small class="tw-menu-list-count"><$count filter="[is[current]tagging[]]"/></small>
|
<$transclude tiddler="$:/core/ui/TagTemplate"/> <small class="tw-menu-list-count"><$count filter="[all[current]tagging[]]"/></small>
|
||||||
|
|
||||||
</$list>
|
</$list>
|
||||||
|
|
||||||
|
@ -47,6 +47,6 @@ background-image: -ms-linear-gradient($gradient$);
|
|||||||
<$macrocall $name="makedatauri" type={{$title$!!type}} text={{$title$}}/>
|
<$macrocall $name="makedatauri" type={{$title$!!type}} text={{$title$}}/>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
<$list filter="[is[shadow]tag[$:/tags/stylesheet]] [!is[shadow]tag[$:/tags/stylesheet]]">
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/stylesheet]]">
|
||||||
<$transclude/>
|
<$transclude/>
|
||||||
</$list>
|
</$list>
|
||||||
|
@ -4,7 +4,7 @@ title: $:/core/ui/PageTemplate
|
|||||||
|
|
||||||
<$dropzone>
|
<$dropzone>
|
||||||
|
|
||||||
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/PageTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/PageTemplate]] +[tag[$:/tags/PageTemplate]]" variable="listItem">
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/PageTemplate]!has[draft.of]]" variable="listItem">
|
||||||
|
|
||||||
<$transclude tiddler=<<listItem>>/>
|
<$transclude tiddler=<<listItem>>/>
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@ tags: $:/tags/PageTemplate
|
|||||||
|
|
||||||
<div class="tw-alerts">
|
<div class="tw-alerts">
|
||||||
|
|
||||||
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/Alert]] [!is[shadow]!has[draft.of]tag[$:/tags/Alert]] +[sort[modified]]" template="$:/core/ui/AlertTemplate" storyview="pop"/>
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/Alert]!has[draft.of]]" template="$:/core/ui/AlertTemplate" storyview="pop"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,7 +12,7 @@ tags: $:/tags/PageTemplate
|
|||||||
|
|
||||||
<div class="tw-page-controls">
|
<div class="tw-page-controls">
|
||||||
|
|
||||||
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/PageControls]] [!is[shadow]!has[draft.of]tag[$:/tags/PageControls]] +[tag[$:/tags/PageControls]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/PageControls]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -2,5 +2,5 @@ title: $:/core/ui/PageTemplate/topleftbar
|
|||||||
tags: $:/tags/PageTemplate
|
tags: $:/tags/PageTemplate
|
||||||
|
|
||||||
<span class="tw-topbar tw-topbar-left">
|
<span class="tw-topbar tw-topbar-left">
|
||||||
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/TopLeftBar]] [!is[shadow]!has[draft.of]tag[$:/tags/TopLeftBar]] +[tag[$:/tags/TopLeftBar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/TopLeftBar]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
||||||
</span>
|
</span>
|
||||||
|
@ -2,5 +2,5 @@ title: $:/core/ui/PageTemplate/toprightbar
|
|||||||
tags: $:/tags/PageTemplate
|
tags: $:/tags/PageTemplate
|
||||||
|
|
||||||
<span class="tw-topbar tw-topbar-right">
|
<span class="tw-topbar tw-topbar-right">
|
||||||
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/TopRightBar]] [!is[shadow]!has[draft.of]tag[$:/tags/TopRightBar]] +[tag[$:/tags/TopRightBar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/TopRightBar]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
||||||
</span>
|
</span>
|
||||||
|
@ -3,5 +3,5 @@ tags: $:/tags/SideBar
|
|||||||
caption: {{$:/language/SideBar/More/Caption}}
|
caption: {{$:/language/SideBar/More/Caption}}
|
||||||
|
|
||||||
<div class="tw-more-sidebar">
|
<div class="tw-more-sidebar">
|
||||||
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/MoreSideBar]] [!is[shadow]!has[draft.of]tag[$:/tags/MoreSideBar]] +[tag[$:/tags/MoreSideBar]]" "$:/core/ui/MoreSideBar/Tags" "$:/state/tab/moresidebar">>
|
<<tabs "[all[tiddlers+shadows]tag[$:/tags/MoreSideBar]!has[draft.of]]" "$:/core/ui/MoreSideBar/Tags" "$:/state/tab/moresidebar">>
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,7 +26,7 @@ title: $:/core/ui/SideBarLists
|
|||||||
|
|
||||||
<$reveal state="$:/temp/search" type="match" text="">
|
<$reveal state="$:/temp/search" type="match" text="">
|
||||||
|
|
||||||
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/SideBar]] [!is[shadow]!has[draft.of]tag[$:/tags/SideBar]] +[tag[$:/tags/SideBar]]" "$:/core/ui/SideBar/Open" "$:/state/tab/sidebar">>
|
<<tabs "[all[tiddlers+shadows]tag[$:/tags/SideBar]!has[draft.of]]" "$:/core/ui/SideBar/Open" "$:/state/tab/sidebar">>
|
||||||
|
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,6 +11,6 @@ background-color:$(backgroundColor)$;
|
|||||||
</$set>
|
</$set>
|
||||||
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
||||||
<hr>
|
<hr>
|
||||||
<$list filter="[is[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
|
<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
|
||||||
</div>
|
</div>
|
||||||
</$reveal>
|
</$reveal>
|
@ -7,7 +7,7 @@ title: $:/TagManager
|
|||||||
<$reveal state=<<qualify "$:/state/iconDropdown/$title$">> type="nomatch" text="" default="">
|
<$reveal state=<<qualify "$:/state/iconDropdown/$title$">> type="nomatch" text="" default="">
|
||||||
<$linkcatcher to="$title$!!icon">
|
<$linkcatcher to="$title$!!icon">
|
||||||
<div class="tw-block-dropdown tw-edit-type-dropdown">
|
<div class="tw-block-dropdown tw-edit-type-dropdown">
|
||||||
<$list filter="[is[shadow]is[image]] [!is[shadow]is[image]] [is[shadow]tag[$:/tags/Image]] [!is[shadow]tag[$:/tags/Image]] +[sort[title]]">
|
<$list filter="[all[tiddlers+shadows]is[image]] [all[tiddlers+shadows]tag[$:/tags/Image]] +[sort[title]]">
|
||||||
<$link to={{!!title}}>
|
<$link to={{!!title}}>
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</$link>
|
</$link>
|
||||||
@ -28,7 +28,7 @@ title: $:/TagManager
|
|||||||
<$list filter="[tags[]!is[system]sort[title]]">
|
<$list filter="[tags[]!is[system]sort[title]]">
|
||||||
<tr>
|
<tr>
|
||||||
<td><$transclude tiddler="$:/core/ui/TagTemplate"/></td>
|
<td><$transclude tiddler="$:/core/ui/TagTemplate"/></td>
|
||||||
<td><$count filter="[is[current]tagging[]]"/></td>
|
<td><$count filter="[all[current]tagging[]]"/></td>
|
||||||
<td><$edit-text field="color" tag="input" type="color"/></td>
|
<td><$edit-text field="color" tag="input" type="color"/></td>
|
||||||
<td><$macrocall $name="iconEditor" title={{!!title}}/></td>
|
<td><$macrocall $name="iconEditor" title={{!!title}}/></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -11,7 +11,7 @@ background-color:$(backgroundColor)$;
|
|||||||
</$set>
|
</$set>
|
||||||
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
|
||||||
<hr>
|
<hr>
|
||||||
<$list filter="[is[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
|
<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
|
||||||
</div>
|
</div>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
</span>
|
</span>
|
||||||
|
@ -2,7 +2,7 @@ title: $:/core/ui/TiddlerFieldTemplate
|
|||||||
|
|
||||||
<tr class="tw-view-field">
|
<tr class="tw-view-field">
|
||||||
<td class="tw-view-field-name">
|
<td class="tw-view-field-name">
|
||||||
<<listItem>>
|
<$text text=<<listItem>>/>
|
||||||
</td>
|
</td>
|
||||||
<td class="tw-view-field-value">
|
<td class="tw-view-field-value">
|
||||||
<$view field=<<listItem>>/>
|
<$view field=<<listItem>>/>
|
||||||
|
@ -2,6 +2,6 @@ title: $:/core/ui/TiddlerFields
|
|||||||
|
|
||||||
<table class="tw-view-field-table">
|
<table class="tw-view-field-table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<$list filter="[is[current]fields[]sort[title]] -text" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/>
|
<$list filter="[all[current]fields[]sort[title]] -text" template="$:/core/ui/TiddlerFieldTemplate" variable="listItem"/>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
title: $:/core/ui/TiddlerInfo
|
title: $:/core/ui/TiddlerInfo
|
||||||
|
|
||||||
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo]] [!is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo]] +[tag[$:/tags/TiddlerInfo]]" "$:/core/ui/TiddlerInfo/References">>
|
<<tabs "[all[tiddlers+shadows]tag[$:/tags/TiddlerInfo]!has[draft.of]]" "$:/core/ui/TiddlerInfo/References">>
|
||||||
|
@ -2,7 +2,7 @@ title: $:/core/ui/TiddlerInfo/Advanced
|
|||||||
tags: $:/tags/TiddlerInfo
|
tags: $:/tags/TiddlerInfo
|
||||||
caption: {{$:/language/TiddlerInfo/Advanced/Caption}}
|
caption: {{$:/language/TiddlerInfo/Advanced/Caption}}
|
||||||
|
|
||||||
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo/Advanced]] [!is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo/Advanced]] +[tag[$:/tags/TiddlerInfo/Advanced]]" variable="listItem">
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/TiddlerInfo/Advanced]!has[draft.of]]" variable="listItem">
|
||||||
<$transclude tiddler=<<listItem>>/>
|
<$transclude tiddler=<<listItem>>/>
|
||||||
|
|
||||||
</$list>
|
</$list>
|
||||||
|
@ -2,13 +2,13 @@ title: $:/core/ui/TiddlerInfo/Advanced/PluginInfo
|
|||||||
tags: $:/tags/TiddlerInfo/Advanced
|
tags: $:/tags/TiddlerInfo/Advanced
|
||||||
|
|
||||||
\define lingo-base() $:/language/TiddlerInfo/Advanced/PluginInfo/
|
\define lingo-base() $:/language/TiddlerInfo/Advanced/PluginInfo/
|
||||||
<$list filter="[is[current]has[plugin-type]]">
|
<$list filter="[all[current]has[plugin-type]]">
|
||||||
|
|
||||||
! <<lingo Heading>>
|
! <<lingo Heading>>
|
||||||
|
|
||||||
<<lingo Hint>>
|
<<lingo Hint>>
|
||||||
<ul>
|
<ul>
|
||||||
<$list filter="[is[current]plugintiddlers[]sort[title]]" emptyMessage=<<lingo Empty/Hint>>>
|
<$list filter="[all[current]plugintiddlers[]sort[title]]" emptyMessage=<<lingo Empty/Hint>>>
|
||||||
<li>
|
<li>
|
||||||
<$link to={{!!title}}>
|
<$link to={{!!title}}>
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
|
@ -6,17 +6,17 @@ tags: $:/tags/TiddlerInfo/Advanced
|
|||||||
|
|
||||||
! <<lingo Heading>>
|
! <<lingo Heading>>
|
||||||
|
|
||||||
<$list filter="[is[current]!is[shadow]]">
|
<$list filter="[all[current]!is[shadow]]">
|
||||||
|
|
||||||
<<lingo NotShadow/Hint>>
|
<<lingo NotShadow/Hint>>
|
||||||
|
|
||||||
</$list>
|
</$list>
|
||||||
|
|
||||||
<$list filter="[is[current]is[shadow]]">
|
<$list filter="[all[current]is[shadow]]">
|
||||||
|
|
||||||
<<lingo Shadow/Hint>>
|
<<lingo Shadow/Hint>>
|
||||||
|
|
||||||
<$list filter="[is[current]shadowsource[]]">
|
<$list filter="[all[current]shadowsource[]]">
|
||||||
|
|
||||||
<$set name="pluginTiddler" value=<<currentTiddler>>>
|
<$set name="pluginTiddler" value=<<currentTiddler>>>
|
||||||
<<lingo Shadow/Source>>
|
<<lingo Shadow/Source>>
|
||||||
@ -24,7 +24,7 @@ tags: $:/tags/TiddlerInfo/Advanced
|
|||||||
|
|
||||||
</$list>
|
</$list>
|
||||||
|
|
||||||
<$list filter="[is[current]is[shadow]is[tiddler]]">
|
<$list filter="[all[current]is[shadow]is[tiddler]]">
|
||||||
|
|
||||||
<<lingo OverriddenShadow/Hint>>
|
<<lingo OverriddenShadow/Hint>>
|
||||||
|
|
||||||
|
@ -3,4 +3,4 @@ tags: $:/tags/TiddlerInfo
|
|||||||
caption: {{$:/language/TiddlerInfo/Listed/Caption}}
|
caption: {{$:/language/TiddlerInfo/Listed/Caption}}
|
||||||
|
|
||||||
\define lingo-base() $:/language/TiddlerInfo/
|
\define lingo-base() $:/language/TiddlerInfo/
|
||||||
<$list filter="[is[current]listed[]!is[system]]" emptyMessage=<<lingo Listed/Empty>> template="$:/core/ui/ListItemTemplate"/>
|
<$list filter="[all[current]listed[]!is[system]]" emptyMessage=<<lingo Listed/Empty>> template="$:/core/ui/ListItemTemplate"/>
|
||||||
|
@ -3,5 +3,5 @@ tags: $:/tags/TiddlerInfo
|
|||||||
caption: {{$:/language/TiddlerInfo/References/Caption}}
|
caption: {{$:/language/TiddlerInfo/References/Caption}}
|
||||||
|
|
||||||
\define lingo-base() $:/language/TiddlerInfo/
|
\define lingo-base() $:/language/TiddlerInfo/
|
||||||
<$list filter="[is[current]backlinks[]sort[title]]" emptyMessage=<<lingo References/Empty>> template="$:/core/ui/ListItemTemplate">
|
<$list filter="[all[current]backlinks[]sort[title]]" emptyMessage=<<lingo References/Empty>> template="$:/core/ui/ListItemTemplate">
|
||||||
</$list>
|
</$list>
|
||||||
|
@ -3,4 +3,4 @@ tags: $:/tags/TiddlerInfo
|
|||||||
caption: {{$:/language/TiddlerInfo/Tagging/Caption}}
|
caption: {{$:/language/TiddlerInfo/Tagging/Caption}}
|
||||||
|
|
||||||
\define lingo-base() $:/language/TiddlerInfo/
|
\define lingo-base() $:/language/TiddlerInfo/
|
||||||
<$list filter="[is[current]tagging[]]" emptyMessage=<<lingo Tagging/Empty>> template="$:/core/ui/ListItemTemplate"/>
|
<$list filter="[all[current]tagging[]]" emptyMessage=<<lingo Tagging/Empty>> template="$:/core/ui/ListItemTemplate"/>
|
||||||
|
@ -3,6 +3,6 @@ title: $:/core/ui/ViewTemplate
|
|||||||
\define frame-classes()
|
\define frame-classes()
|
||||||
tw-tiddler-frame tw-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
|
tw-tiddler-frame tw-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
|
||||||
\end
|
\end
|
||||||
<$set name="storyTiddler" value=<<currentTiddler>>><$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] +[tag[$:/tags/ViewTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
<$set name="storyTiddler" value=<<currentTiddler>>><$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[all[tiddlers+shadows]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
||||||
</div>
|
</div>
|
||||||
</$tiddler></$set></$set>
|
</$tiddler></$set></$set>
|
||||||
|
@ -2,7 +2,7 @@ title: $:/core/ui/ViewTemplate/classic
|
|||||||
tags: $:/tags/ViewTemplate $:/tags/EditTemplate
|
tags: $:/tags/ViewTemplate $:/tags/EditTemplate
|
||||||
|
|
||||||
\define lingo-base() $:/language/ClassicWarning/
|
\define lingo-base() $:/language/ClassicWarning/
|
||||||
<$list filter="[is[current]type[text/x-tiddlywiki]]">
|
<$list filter="[all[current]type[text/x-tiddlywiki]]">
|
||||||
<div class="tw-message-box">
|
<div class="tw-message-box">
|
||||||
|
|
||||||
<<lingo Hint>>
|
<<lingo Hint>>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
title: $:/core/ui/ViewTemplate/tags
|
title: $:/core/ui/ViewTemplate/tags
|
||||||
tags: $:/tags/ViewTemplate
|
tags: $:/tags/ViewTemplate
|
||||||
|
|
||||||
<div class="tw-tags-wrapper"><$list filter="[is[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>
|
<div class="tw-tags-wrapper"><$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>
|
||||||
|
@ -7,19 +7,19 @@ fill:$(foregroundColor)$;
|
|||||||
<div class="tw-tiddler-title">
|
<div class="tw-tiddler-title">
|
||||||
<div class="titlebar">
|
<div class="titlebar">
|
||||||
<span class="tw-tiddler-controls">
|
<span class="tw-tiddler-controls">
|
||||||
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewToolbar]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewToolbar]] +[tag[$:/tags/ViewToolbar]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
<$list filter="[all[tiddlers+shadows]tag[$:/tags/ViewToolbar]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
||||||
</span>
|
</span>
|
||||||
<$set name="foregroundColor" value={{!!color}}>
|
<$set name="foregroundColor" value={{!!color}}>
|
||||||
<span style=<<title-styles>>>
|
<span style=<<title-styles>>>
|
||||||
<$transclude tiddler={{!!icon}}/>
|
<$transclude tiddler={{!!icon}}/>
|
||||||
</span>
|
</span>
|
||||||
</$set>
|
</$set>
|
||||||
<$list filter="[is[current]removeprefix[$:/]]">
|
<$list filter="[all[current]removeprefix[$:/]]">
|
||||||
<span class="title" title={{$:/language/SystemTiddler/Tooltip}}>
|
<span class="title" title={{$:/language/SystemTiddler/Tooltip}}>
|
||||||
<span class="tw-system-title-prefix">$:/</span><$text text=<<currentTiddler>>/>
|
<span class="tw-system-title-prefix">$:/</span><$text text=<<currentTiddler>>/>
|
||||||
</span>
|
</span>
|
||||||
</$list>
|
</$list>
|
||||||
<$list filter="[is[current]!prefix[$:/]]">
|
<$list filter="[all[current]!prefix[$:/]]">
|
||||||
<span class="title">
|
<span class="title">
|
||||||
<$view field="title"/>
|
<$view field="title"/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -9,7 +9,7 @@ title: $:/snippets/modules
|
|||||||
|
|
||||||
<$macrocall $name="describeModuleType" type=<<currentTiddler>>/>
|
<$macrocall $name="describeModuleType" type=<<currentTiddler>>/>
|
||||||
|
|
||||||
<ul><$list filter="[is[current]modules[]]"><li><$link><<currentTiddler>></$link>
|
<ul><$list filter="[all[current]modules[]]"><li><$link><<currentTiddler>></$link>
|
||||||
</li>
|
</li>
|
||||||
</$list>
|
</$list>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -8,12 +8,12 @@ title: $:/snippets/paletteeditor
|
|||||||
|
|
||||||
<<lingo Prompt>> <$link to={{$:/palette}}><$macrocall $name="currentTiddler" $output="text/plain"/></$link>
|
<<lingo Prompt>> <$link to={{$:/palette}}><$macrocall $name="currentTiddler" $output="text/plain"/></$link>
|
||||||
|
|
||||||
<$list filter="[is[current]is[shadow]is[tiddler]]" variable="listItem">
|
<$list filter="[all[current]is[shadow]is[tiddler]]" variable="listItem">
|
||||||
<<lingo Prompt/Modified>>
|
<<lingo Prompt/Modified>>
|
||||||
<$button message="tw-delete-tiddler" param={{$:/palette}}><<lingo Reset/Caption>></$button>
|
<$button message="tw-delete-tiddler" param={{$:/palette}}><<lingo Reset/Caption>></$button>
|
||||||
</$list>
|
</$list>
|
||||||
|
|
||||||
<$list filter="[is[current]is[shadow]!is[tiddler]]" variable="listItem">
|
<$list filter="[all[current]is[shadow]!is[tiddler]]" variable="listItem">
|
||||||
<<lingo Clone/Prompt>>
|
<<lingo Clone/Prompt>>
|
||||||
</$list>
|
</$list>
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ title: $:/snippets/paletteeditor
|
|||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<$list filter="[is[current]indexes[]]" variable="colourName">
|
<$list filter="[all[current]indexes[]]" variable="colourName">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
''<$macrocall $name="describePaletteColour" colour=<<colourName>>/>''<br/>
|
''<$macrocall $name="describePaletteColour" colour=<<colourName>>/>''<br/>
|
||||||
|
@ -4,7 +4,7 @@ title: $:/snippets/paletteswitcher
|
|||||||
<<lingo Prompt>> <$view tiddler={{$:/palette}} field="name"/>
|
<<lingo Prompt>> <$view tiddler={{$:/palette}} field="name"/>
|
||||||
|
|
||||||
<$linkcatcher to="$:/palette">
|
<$linkcatcher to="$:/palette">
|
||||||
<div class="tw-chooser"><$list filter="[is[shadow]tag[$:/tags/Palette]] [!is[shadow]tag[$:/tags/Palette]] +[sort[description]]"><div class="tw-chooser-item"><$link to={{!!title}}><div><$reveal state="$:/palette" type="match" text={{!!title}}>•</$reveal><$reveal state="$:/palette" type="nomatch" text={{!!title}}> </$reveal> ''<$view field="name" format="text"/>'' - <$view field="description" format="text"/></div><$transclude tiddler="$:/snippets/currpalettepreview"/></$link></div>
|
<div class="tw-chooser"><$list filter="[all[tiddlers+shadows]tag[$:/tags/Palette]sort[description]]"><div class="tw-chooser-item"><$link to={{!!title}}><div><$reveal state="$:/palette" type="match" text={{!!title}}>•</$reveal><$reveal state="$:/palette" type="nomatch" text={{!!title}}> </$reveal> ''<$view field="name" format="text"/>'' - <$view field="description" format="text"/></div><$transclude tiddler="$:/snippets/currpalettepreview"/></$link></div>
|
||||||
</$list>
|
</$list>
|
||||||
</div>
|
</div>
|
||||||
</$linkcatcher>
|
</$linkcatcher>
|
@ -144,7 +144,7 @@ describe("Filter tests", function() {
|
|||||||
expect(wiki.filterTiddlers("[!tag[one]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one");
|
expect(wiki.filterTiddlers("[!tag[one]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one");
|
||||||
expect(wiki.filterTiddlers("[prefix[Tidd]tag[one]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
expect(wiki.filterTiddlers("[prefix[Tidd]tag[one]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||||
expect(wiki.filterTiddlers("[!is[shadow]tag[two]sort[title]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three");
|
expect(wiki.filterTiddlers("[!is[shadow]tag[two]sort[title]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three");
|
||||||
expect(wiki.filterTiddlers("[is[shadow]tag[two]sort[title]]").join(",")).toBe("$:/TiddlerFive");
|
expect(wiki.filterTiddlers("[all[shadows]tag[two]sort[title]]").join(",")).toBe("$:/TiddlerFive");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle the tags operator", function() {
|
it("should handle the tags operator", function() {
|
||||||
@ -156,7 +156,7 @@ describe("Filter tests", function() {
|
|||||||
expect(wiki.filterTiddlers("[[one]tagging[]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
expect(wiki.filterTiddlers("[[one]tagging[]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||||
expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
expect(wiki.filterTiddlers("[[one]tagging[]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||||
expect(wiki.filterTiddlers("[[two]tagging[]sort[title]]").join(",")).toBe("$:/TiddlerFive,$:/TiddlerTwo,Tiddler Three");
|
expect(wiki.filterTiddlers("[[two]tagging[]sort[title]]").join(",")).toBe("$:/TiddlerFive,$:/TiddlerTwo,Tiddler Three");
|
||||||
expect(wiki.filterTiddlers("[is[current]tagging[]sort[title]]","one").join(",")).toBe("Tiddler Three,TiddlerOne");
|
expect(wiki.filterTiddlers("[all[current]tagging[]sort[title]]","one").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle the untagged operator", function() {
|
it("should handle the untagged operator", function() {
|
||||||
@ -166,12 +166,12 @@ describe("Filter tests", function() {
|
|||||||
|
|
||||||
it("should handle the links operator", function() {
|
it("should handle the links operator", function() {
|
||||||
expect(wiki.filterTiddlers("[!is[shadow]links[]sort[title]]").join(",")).toBe("a fourth tiddler,one,Tiddler Three,TiddlerSix,TiddlerTwo,TiddlerZero");
|
expect(wiki.filterTiddlers("[!is[shadow]links[]sort[title]]").join(",")).toBe("a fourth tiddler,one,Tiddler Three,TiddlerSix,TiddlerTwo,TiddlerZero");
|
||||||
expect(wiki.filterTiddlers("[is[shadow]links[]sort[title]]").join(",")).toBe("TiddlerOne");
|
expect(wiki.filterTiddlers("[all[shadows]links[]sort[title]]").join(",")).toBe("TiddlerOne");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle the backlinks operator", function() {
|
it("should handle the backlinks operator", function() {
|
||||||
expect(wiki.filterTiddlers("[!is[shadow]backlinks[]sort[title]]").join(",")).toBe("a fourth tiddler,one");
|
expect(wiki.filterTiddlers("[!is[shadow]backlinks[]sort[title]]").join(",")).toBe("a fourth tiddler,one");
|
||||||
expect(wiki.filterTiddlers("[is[shadow]backlinks[]sort[title]]").join(",")).toBe("Tiddler Three");
|
expect(wiki.filterTiddlers("[all[shadows]backlinks[]sort[title]]").join(",")).toBe("Tiddler Three");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle the has operator", function() {
|
it("should handle the has operator", function() {
|
||||||
@ -187,7 +187,7 @@ describe("Filter tests", function() {
|
|||||||
|
|
||||||
it("should handle the list operator", function() {
|
it("should handle the list operator", function() {
|
||||||
expect(wiki.filterTiddlers("[list[TiddlerSeventh]sort[title]]").join(",")).toBe("a fourth tiddler,MissingTiddler,Tiddler Three,TiddlerOne");
|
expect(wiki.filterTiddlers("[list[TiddlerSeventh]sort[title]]").join(",")).toBe("a fourth tiddler,MissingTiddler,Tiddler Three,TiddlerOne");
|
||||||
expect(wiki.filterTiddlers("[tag[one]list[TiddlerSeventh]sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
expect(wiki.filterTiddlers("[tag[one]list[TiddlerSeventh]sort[title]]").join(",")).toBe("a fourth tiddler,MissingTiddler,Tiddler Three,TiddlerOne");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle the next operator", function() {
|
it("should handle the next operator", function() {
|
||||||
@ -232,12 +232,12 @@ describe("Filter tests", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should handle the '[is[shadow]]' operator", function() {
|
it("should handle the '[is[shadow]]' operator", function() {
|
||||||
expect(wiki.filterTiddlers("[is[shadow]sort[title]]").join(",")).toBe("$:/TiddlerFive,Tiddler8,TiddlerSeventh,TiddlerSix");
|
expect(wiki.filterTiddlers("[all[shadows]sort[title]]").join(",")).toBe("$:/TiddlerFive,Tiddler8,TiddlerSeventh,TiddlerSix");
|
||||||
expect(wiki.filterTiddlers("[!is[shadow]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne");
|
expect(wiki.filterTiddlers("[!is[shadow]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should handle the '[is[missing]]' operator", function() {
|
it("should handle the '[is[missing]]' operator", function() {
|
||||||
expect(wiki.filterTiddlers("[is[missing]]").join(",")).toBe("TiddlerZero,TiddlerTwo");
|
expect(wiki.filterTiddlers("[all[missing]]").join(",")).toBe("TiddlerZero,TiddlerTwo");
|
||||||
expect(wiki.filterTiddlers("[!is[missing]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne");
|
expect(wiki.filterTiddlers("[!is[missing]sort[title]]").join(",")).toBe("$:/TiddlerTwo,a fourth tiddler,one,Tiddler Three,TiddlerOne");
|
||||||
expect(wiki.filterTiddlers("[[TiddlerOne]is[missing]]").join(",")).toBe("");
|
expect(wiki.filterTiddlers("[[TiddlerOne]is[missing]]").join(",")).toBe("");
|
||||||
expect(wiki.filterTiddlers("[[TiddlerZero]is[missing]]").join(",")).toBe("TiddlerZero");
|
expect(wiki.filterTiddlers("[[TiddlerZero]is[missing]]").join(",")).toBe("TiddlerZero");
|
||||||
|
@ -6,13 +6,33 @@ type: text/vnd.tiddlywiki
|
|||||||
|
|
||||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.8-beta...v5.0.9-beta]]//
|
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.8-beta...v5.0.9-beta]]//
|
||||||
|
|
||||||
|
!! Highlights
|
||||||
|
|
||||||
|
* Improved layout, including a ''hamburger'' icon for dismissing the sidebar
|
||||||
|
* New ''Filter'' tab in [[$:/AdvancedSearch]]
|
||||||
|
* Initial implementation of CecilyView
|
||||||
|
* Overhaul of inconsistencies in TiddlerFilters (see [[Changes to filters in 5.0.9-beta]])
|
||||||
|
*
|
||||||
|
|
||||||
!! Documentation Improvements
|
!! Documentation Improvements
|
||||||
|
|
||||||
*
|
* Demo of [[Making curved text with SVG]]
|
||||||
|
* [[Community]] links are now broken up into individual tiddlers
|
||||||
|
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/a19432541e776bfb63b1b985a60f472e9f1d4352]] overview diagram of [[TiddlyWiki Architecture]]
|
||||||
|
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/7b57561160173667031b5bc15a4f7553d8514c1c]] documentation from buggyj: [[Developing plugins using Node.js and GitHub]]
|
||||||
|
|
||||||
!! Usability Improvements
|
!! Usability Improvements
|
||||||
|
|
||||||
*
|
* Made the dropdown arrow icon [[skinnier|https://github.com/Jermolene/TiddlyWiki5/commit/ec90ac99cf2767b6ff20902d8b01aa1c36778147]]
|
||||||
|
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/bca1d552803c1839e7385765314f81c5307632b8]] validation of legal characters for fieldnames
|
||||||
|
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/45a362c2859ed401a0af5ca3bbbc976710bf4acf]] a dropdown for tags in edit mode
|
||||||
|
* Added blacklisting of unsage HTML [[elements|https://github.com/Jermolene/TiddlyWiki5/commit/ba6edd42c125cb19d955a1cb3f54a2d367cb79dc]] and [[attributes|https://github.com/Jermolene/TiddlyWiki5/commit/ba6edd42c125cb19d955a1cb3f54a2d367cb79dc]]
|
||||||
|
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/baa8cf3dd098bab0a7a8c78b24747c69bd40889f]] a warning indicator to tiddlers in TiddlyWikiClassic format
|
||||||
|
* [[Add|https://github.com/Jermolene/TiddlyWiki5/commit/42c67cfeb732fccb10b8ab574c84090dc2471352]] tiddler info ''Advanced'' panel with information about plugins and shadow tiddlers
|
||||||
|
* [[Improved|https://github.com/Jermolene/TiddlyWiki5/commit/96457d801159958b897f98e22aa9af53b97f0e35]] layout of [[$:/ControlPanel]] ''Plugins'' tab
|
||||||
|
* [[Enhance|https://github.com/Jermolene/TiddlyWiki5/commit/f48701544eda4f79af86b1ad44340e7182bcf024]] viewing of system tiddlers by fading down the `$:/` prefix
|
||||||
|
* [[Extend|https://github.com/Jermolene/TiddlyWiki5/commit/dd3ee2a603cba35770a8f109e070f271d72861f8]] [[$:/TagManager]] to allow icons to be assigned to tags
|
||||||
|
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/87c4839fed789b80e0942014c05175e36aacc157]] support for `list-before` and `list-after` fields for controlling tag ordering (see TiddlerTags for details)
|
||||||
|
|
||||||
!! Scalability Improvements
|
!! Scalability Improvements
|
||||||
|
|
||||||
@ -20,8 +40,28 @@ type: text/vnd.tiddlywiki
|
|||||||
|
|
||||||
!! Hackability Improvements
|
!! Hackability Improvements
|
||||||
|
|
||||||
*
|
* [[Updated|https://github.com/Jermolene/TiddlyWiki5/commit/bdbbf94326f70db0f8ef196270ab9e92bfde10fb]] [[Transclusion in WikiText]] syntax to allow translusion of a template without affecting the current tiddler
|
||||||
|
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/8a7d0f53d380e9ca93ee34d8ad05090d511e95c4]] `sourceURL` handling to `eval()` so that tiddler modules can be [[properly debugged|https://chromedevtools.googlecode.com/svn-history/r421/trunk/tutorials/b
|
||||||
|
reapoints/index.html#regular]] in Chrome
|
||||||
|
* New ScrollableWidget giving better control over scrollable regions
|
||||||
|
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/d3c0296a87198296cff26aa7ce7bb8274cdcc3f7]] new CSS class `tw-site-title` for the site title
|
||||||
|
* [[Disable|https://github.com/Jermolene/TiddlyWiki5/commit/e397e4d15951c1395c7752a7563f002ca459206e]] the TiddlyWeb sync adaptor unless the wiki is loaded over HTTP
|
||||||
|
* Added a [[high resolution timer mechanism|https://github.com/Jermolene/TiddlyWiki5/commit/dcce4879347e4829d75f10248477731b18b829ef]] and a [[performance measurement mechanism|https://github.com/Jermolene/TiddlyWiki5/commit/d402d3c5a619b6b1642ab03c74ff03a864846a0b]]
|
||||||
|
* Added a [[basic CSV parser|https://github.com/Jermolene/TiddlyWiki5/commit/5a085f792722c74d259464386138c731b2f014cc]]
|
||||||
|
* Several measures to enforce the TiddlyWiki programming model:
|
||||||
|
** [[Refactor|https://github.com/Jermolene/TiddlyWiki5/commit/9de17aa206b21df5c4e29e61bba5d6b49aca6c71]] wiki store object to make members be private
|
||||||
|
** Freeze tiddler object and [[fields|https://github.com/Jermolene/TiddlyWiki5/commit/279626a3e3fbd75d60fc3be49b68a99d8ba0a95d]] tiddler fields to enforce their immutability
|
||||||
|
* [[Extend|https://github.com/Jermolene/TiddlyWiki5/commit/f649b5b037bfd2e7c48d1ba65ffa37064456523d]] the ButtonWidget to be able to set text references
|
||||||
|
* [[Add|https://github.com/Jermolene/TiddlyWiki5/commit/afa677b9a0b1dff1239dc1ea08edd210b9736af9]] a class to tiddler frames in view mode
|
||||||
|
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/50cf9678cb469e443e220b063e2355c844e417e7]] support for [[WidgetMessage: tw-home]]
|
||||||
|
* [[Hidden|https://github.com/Jermolene/TiddlyWiki5/commit/2608a323ebf3d8a8e925eda6d3a10ebb8f41d383]] system tags from the sidebar ''Tags' tab
|
||||||
|
* [[Allow|https://github.com/Jermolene/TiddlyWiki5/commit/98872bbe7c62faa4aa209fa421c2989aeef3aaf2]] pasting and import of HTML content
|
||||||
|
* [[Add|https://github.com/Jermolene/TiddlyWiki5/commit/a5a2c718b1d5671652d01e3567dba1c6795b7521]] support for a tooltip on the LinkWidget
|
||||||
|
|
||||||
!! Bug Fixes
|
!! Bug Fixes
|
||||||
|
|
||||||
*
|
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/aa631518152cda5643805c143bf0000bca8d767f]] problem with occasional freezes of the sync mechanism - thanks to buggyj
|
||||||
|
* Fixed problem with [[tiddlers|https://github.com/Jermolene/TiddlyWiki5/commit/1e960ffcac566c742c44b18d6f0e809d4457b249]] or [[fields|https://github.com/Jermolene/TiddlyWiki5/commit/ea46f85a8a5ad29e8602cbb13667c853903681a6]] called `__proto__`
|
||||||
|
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/aec618793f41b937676a5a165764dc19d9bbb2b2]] with refreshing the D3 plugin
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,4 +8,4 @@ ShadowTiddlers can be overridden with an ordinary tiddler of the same name. If t
|
|||||||
|
|
||||||
The current shadow tiddlers are:
|
The current shadow tiddlers are:
|
||||||
|
|
||||||
<$list filter="[is[shadow]sort[title]]"/>
|
<$list filter="[all[shadows]sort[title]]"/>
|
||||||
|
@ -22,4 +22,4 @@ System tags are used to give special behaviour to tiddlers:
|
|||||||
|
|
||||||
These are the system tags in use in this wiki:
|
These are the system tags in use in this wiki:
|
||||||
|
|
||||||
{{{ [is[shadow]tags[]prefix[$:/]] [!is[shadow]tags[]prefix[$:/]] +[sort[title]] }}}
|
{{{ [all[tiddlers+shadows]tags[]prefix[$:/]] +[sort[title]] }}}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user