merge to latest tw5

This commit is contained in:
buggyj 2014-08-25 13:01:30 +02:00
commit 36a7b1149f
466 changed files with 6701 additions and 1585 deletions

26
bld.cmd
View File

@ -35,19 +35,18 @@ node .\tiddlywiki.js ^
.\editions\tw5.com ^
--verbose ^
--output . ^
--rendertiddler ReadMe .\readme.md text/html ^
--rendertiddler ContributingTemplate .\contributing.md text/html ^
--rendertiddler $:/core/copyright.txt .\licenses\copyright.md text/plain ^
--build readmes ^
--output %TW5_BUILD_OUTPUT% ^
--rendertiddler $:/core/save/all index.html text/plain ^
--savetiddler $:/favicon.ico favicon.ico ^
--rendertiddler $:/editions/tw5.com/download-empty empty.html text/plain ^
--rendertiddler $:/editions/tw5.com/download-empty empty.hta text/plain ^
--savetiddler $:/green_favicon.ico %TW5_BUILD_OUTPUT%/static/favicon.ico ^
--rendertiddler $:/core/templates/static.template.html static.html text/plain ^
--rendertiddler $:/core/templates/alltiddlers.template.html alltiddlers.html text/plain ^
--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html static text/plain ^
--rendertiddler $:/core/templates/static.template.css static\static.css text/plain ^
--build favicon empty static index ^
|| exit 1
rem upgrade.html: custom edition for handling upgrades
node .\tiddlywiki.js ^
.\editions\upgrade ^
--verbose ^
--output %TW5_BUILD_OUTPUT% ^
--build upgrade ^
|| exit 1
rem encrypted.html: a version of the main file encrypted with the password "password"
@ -56,8 +55,7 @@ node .\tiddlywiki.js ^
.\editions\tw5.com ^
--verbose ^
--output %TW5_BUILD_OUTPUT% ^
--password password ^
--rendertiddler $:/core/save/all encrypted.html text/plain ^
--build encrypted ^
|| exit 1
rem tahoelafs.html: empty wiki with plugin for Tahoe-LAFS

26
bld.sh
View File

@ -36,19 +36,18 @@ node ./tiddlywiki.js \
./editions/tw5.com \
--verbose \
--output . \
--rendertiddler ReadMe ./readme.md text/html \
--rendertiddler ContributingTemplate ./contributing.md text/html \
--rendertiddler $:/core/copyright.txt ./licenses/copyright.md text/plain \
--build readmes \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all index.html text/plain \
--savetiddler $:/favicon.ico favicon.ico \
--rendertiddler $:/editions/tw5.com/download-empty empty.html text/plain \
--rendertiddler $:/editions/tw5.com/download-empty empty.hta text/plain \
--savetiddler $:/green_favicon.ico static/favicon.ico \
--rendertiddler $:/core/templates/static.template.html static.html text/plain \
--rendertiddler $:/core/templates/alltiddlers.template.html alltiddlers.html text/plain \
--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html static text/plain \
--rendertiddler $:/core/templates/static.template.css static/static.css text/plain \
--build favicon empty static index \
|| exit 1
# upgrade.html: custom edition for handling upgrades
node ./tiddlywiki.js \
./editions/upgrade \
--verbose \
--output $TW5_BUILD_OUTPUT \
--build upgrade \
|| exit 1
# encrypted.html: a version of the main file encrypted with the password "password"
@ -57,8 +56,7 @@ node ./tiddlywiki.js \
./editions/tw5.com \
--verbose \
--output $TW5_BUILD_OUTPUT \
--password password \
--rendertiddler $:/core/save/all encrypted.html text/plain \
--build encrypted \
|| exit 1
# tahoelafs.html: empty wiki with plugin for Tahoe-LAFS

View File

@ -187,7 +187,7 @@ $tw.utils.deepDefaults = function(object /*, sourceObjectList */) {
$tw.utils.each(Array.prototype.slice.call(arguments,1),function(source) {
if(source) {
for (var p in source) {
if(object[p] == null) {
if(object[p] === null || object[p] === undefined) {
object[p] = source[p];
}
if(typeof object[p] === "object" && typeof source[p] === "object") {
@ -615,7 +615,7 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
tiddler = $tw.wiki.getTiddler(name) || $tw.wiki.getTiddler(name + ".js") || $tw.wiki.getTiddler(moduleName) || $tw.wiki.getTiddler(moduleName + ".js") ,
_exports = {},
sandbox = {
module: {},
module: {exports: _exports},
//moduleInfo: moduleInfo,
exports: _exports,
console: console,
@ -967,19 +967,22 @@ $tw.Wiki = function(options) {
this.registerPluginTiddlers = function(pluginType,titles) {
var self = this,
registeredTitles = [],
checkTiddler = function(tiddler) {
checkTiddler = function(tiddler,title) {
if(tiddler && tiddler.fields.type === "application/json" && tiddler.fields["plugin-type"] === pluginType) {
pluginTiddlers.push(tiddler);
registeredTitles.push(tiddler.fields.title);
var disablingTiddler = self.getTiddler("$:/config/Plugins/Disabled/" + title);
if(title === "$:/core" || !disablingTiddler || (disablingTiddler.fields.text || "").trim() !== "yes") {
pluginTiddlers.push(tiddler);
registeredTitles.push(tiddler.fields.title);
}
}
};
if(titles) {
$tw.utils.each(titles,function(title) {
checkTiddler(self.getTiddler(title));
checkTiddler(self.getTiddler(title),title);
});
} else {
this.each(function(tiddler,title) {
checkTiddler(tiddler);
checkTiddler(tiddler,title);
});
}
return registeredTitles;
@ -1425,7 +1428,7 @@ $tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
} else {
// If not, read all the files in the directory
$tw.utils.each(files,function(file) {
if(!excludeRegExp.test(file)) {
if(!excludeRegExp.test(file) && file !== "plugin.info") {
tiddlers.push.apply(tiddlers,$tw.loadTiddlersFromPath(filepath + path.sep + file,excludeRegExp));
}
});
@ -1442,53 +1445,102 @@ Load the tiddlers from a plugin folder, and package them up into a proper JSON p
*/
$tw.loadPluginFolder = function(filepath,excludeRegExp) {
excludeRegExp = excludeRegExp || $tw.boot.excludeRegExp;
var stat, files, pluginInfo, pluginTiddlers = [], f, file, titlePrefix, t;
if(fs.existsSync(filepath)) {
stat = fs.statSync(filepath);
if(stat.isDirectory()) {
// Read the plugin information
pluginInfo = JSON.parse(fs.readFileSync(filepath + path.sep + "plugin.info","utf8"));
// Read the plugin files
files = fs.readdirSync(filepath);
for(f=0; f<files.length; f++) {
file = files[f];
if(!excludeRegExp.test(file) && file !== "plugin.info" && file !== "tiddlywiki.files") {
var tiddlerFiles = $tw.loadTiddlersFromPath(filepath + path.sep + file,excludeRegExp);
$tw.utils.each(tiddlerFiles,function(tiddlerFile) {
pluginTiddlers.push.apply(pluginTiddlers,tiddlerFile.tiddlers);
});
}
}
// Save the plugin tiddlers into the plugin info
pluginInfo.tiddlers = pluginInfo.tiddlers || Object.create(null);
for(t=0; t<pluginTiddlers.length; t++) {
if(pluginTiddlers[t].title) {
pluginInfo.tiddlers[pluginTiddlers[t].title] = pluginTiddlers[t];
if(fs.existsSync(filepath) && fs.statSync(filepath).isDirectory()) {
// Read the plugin information
var pluginInfo = JSON.parse(fs.readFileSync(filepath + path.sep + "plugin.info","utf8"));
// Read the plugin files
var pluginFiles = $tw.loadTiddlersFromPath(filepath,excludeRegExp);
// Save the plugin tiddlers into the plugin info
pluginInfo.tiddlers = pluginInfo.tiddlers || Object.create(null);
for(var f=0; f<pluginFiles.length; f++) {
var tiddlers = pluginFiles[f].tiddlers;
for(var t=0; t<tiddlers.length; t++) {
var tiddler= tiddlers[t];
if(tiddler.title) {
pluginInfo.tiddlers[tiddler.title] = tiddler;
}
}
}
}
// Give the plugin the same version number as the core if it doesn't have one
if(pluginInfo && !("version" in pluginInfo)) {
pluginInfo.version = $tw.packageInfo.version;
}
// Save the plugin tiddler
if(pluginInfo) {
var fields = {
title: pluginInfo.title,
type: "application/json",
text: JSON.stringify({tiddlers: pluginInfo.tiddlers},null,4),
"plugin-priority": pluginInfo["plugin-priority"],
"name": pluginInfo["name"],
"version": pluginInfo["version"],
"thumbnail": pluginInfo["thumbnail"],
"description": pluginInfo["description"],
"plugin-type": pluginInfo["plugin-type"] || "plugin",
"dependents": $tw.utils.stringifyList(pluginInfo["dependents"] || [])
// Give the plugin the same version number as the core if it doesn't have one
if(!("version" in pluginInfo)) {
pluginInfo.version = $tw.packageInfo.version;
}
return fields;
// Use "plugin" as the plugin-type if we don't have one
if(!("plugin-type" in pluginInfo)) {
pluginInfo["plugin-type"] = "plugin";
}
pluginInfo.dependents = pluginInfo.dependents || [];
pluginInfo.type = "application/json";
// Set plugin text
pluginInfo.text = JSON.stringify({tiddlers: pluginInfo.tiddlers},null,4);
delete pluginInfo.tiddlers;
// Deserialise array fields (currently required for the dependents field)
for(var field in pluginInfo) {
if($tw.utils.isArray(pluginInfo[field])) {
pluginInfo[field] = $tw.utils.stringifyList(pluginInfo[field]);
}
}
return pluginInfo;
} else {
return null;
return null;
}
};
/*
name: Name of the plugin to find
paths: array of file paths to search for it
Returns the path of the plugin folder
*/
$tw.findLibraryItem = function(name,paths) {
var pathIndex = 0;
do {
var pluginPath = path.resolve(paths[pathIndex],"./" + name)
if(fs.existsSync(pluginPath) && fs.statSync(pluginPath).isDirectory()) {
return pluginPath;
}
} while(++pathIndex < paths.length);
return null;
};
/*
name: Name of the plugin to load
paths: array of file paths to search for it
*/
$tw.loadPlugin = function(name,paths) {
var pluginPath = $tw.findLibraryItem(name,paths);
if(pluginPath) {
var pluginFields = $tw.loadPluginFolder(pluginPath);
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
};
/*
libraryPath: Path of library folder for these plugins (relative to core path)
envVar: Environment variable name for these plugins
Returns an array of search paths
*/
$tw.getLibraryItemSearchPaths = function(libraryPath,envVar) {
var pluginPaths = [path.resolve($tw.boot.corePath,libraryPath)],
env = process.env[envVar];
if(env) {
Array.prototype.push.apply(pluginPaths,env.split(":"));
}
return pluginPaths;
};
/*
plugins: Array of names of plugins (eg, "tiddlywiki/filesystemadaptor")
libraryPath: Path of library folder for these plugins (relative to core path)
envVar: Environment variable name for these plugins
*/
$tw.loadPlugins = function(plugins,libraryPath,envVar) {
if(plugins) {
var pluginPaths = $tw.getLibraryItemSearchPaths(libraryPath,envVar);
for(var t=0; t<plugins.length; t++) {
$tw.loadPlugin(plugins[t],pluginPaths);
}
}
};
@ -1520,36 +1572,10 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
}
});
}
// Load any plugins listed in the wiki info file
if(wikiInfo.plugins) {
var pluginBasePath = path.resolve($tw.boot.corePath,$tw.config.pluginsPath);
for(var t=0; t<wikiInfo.plugins.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(pluginBasePath,"./" + wikiInfo.plugins[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
}
// Load any themes listed in the wiki info file
if(wikiInfo.themes) {
var themesBasePath = path.resolve($tw.boot.corePath,$tw.config.themesPath);
for(var t=0; t<wikiInfo.themes.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(themesBasePath,"./" + wikiInfo.themes[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
}
// Load any languages listed in the wiki info file
if(wikiInfo.languages) {
var languagesBasePath = path.resolve($tw.boot.corePath,$tw.config.languagesPath);
for(var t=0; t<wikiInfo.languages.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(languagesBasePath,"./" + wikiInfo.languages[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
}
// Load any plugins, themes and languages listed in the wiki info file
$tw.loadPlugins(wikiInfo.plugins,$tw.config.pluginsPath,$tw.config.pluginsEnvVar);
$tw.loadPlugins(wikiInfo.themes,$tw.config.themesPath,$tw.config.themesEnvVar);
$tw.loadPlugins(wikiInfo.languages,$tw.config.languagesPath,$tw.config.languagesEnvVar);
// Load the wiki files, registering them as writable
var resolvedWikiPath = path.resolve(wikiPath,$tw.config.wikiTiddlersSubDir);
$tw.utils.each($tw.loadTiddlersFromPath(resolvedWikiPath),function(tiddlerFile) {
@ -1565,20 +1591,21 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
$tw.wiki.addTiddlers(tiddlerFile.tiddlers);
});
// Save the original tiddler file locations if requested
if(wikiInfo.config && wikiInfo.config["retain-original-tiddler-path"]) {
var output = [];
var config = wikiInfo.config || {};
if(config["retain-original-tiddler-path"]) {
var output = {};
for(var title in $tw.boot.files) {
output.push(title + ": " + path.relative(resolvedWikiPath,$tw.boot.files[title].filepath) + "\n");
output[title] = path.relative(resolvedWikiPath,$tw.boot.files[title].filepath);
}
$tw.wiki.addTiddler({title: "$:/config/OriginalTiddlerPaths", type: "application/x-tiddler-dictionary", text: output.join("")});
$tw.wiki.addTiddler({title: "$:/config/OriginalTiddlerPaths", type: "application/json", text: JSON.stringify(output)});
}
// Save the path to the tiddlers folder for the filesystemadaptor
$tw.boot.wikiTiddlersPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiTiddlersSubDir);
$tw.boot.wikiTiddlersPath = path.resolve($tw.boot.wikiPath,config["default-tiddler-location"] || $tw.config.wikiTiddlersSubDir);
// Load any plugins within the wiki folder
var wikiPluginsPath = path.resolve(wikiPath,$tw.config.wikiPluginsSubDir);
if(fs.existsSync(wikiPluginsPath)) {
var pluginFolders = fs.readdirSync(wikiPluginsPath);
for(t=0; t<pluginFolders.length; t++) {
for(var t=0; t<pluginFolders.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(wikiPluginsPath,"./" + pluginFolders[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
@ -1589,7 +1616,7 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
var wikiThemesPath = path.resolve(wikiPath,$tw.config.wikiThemesSubDir);
if(fs.existsSync(wikiThemesPath)) {
var themeFolders = fs.readdirSync(wikiThemesPath);
for(t=0; t<themeFolders.length; t++) {
for(var t=0; t<themeFolders.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(wikiThemesPath,"./" + themeFolders[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
@ -1600,7 +1627,7 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
var wikiLanguagesPath = path.resolve(wikiPath,$tw.config.wikiLanguagesSubDir);
if(fs.existsSync(wikiLanguagesPath)) {
var languageFolders = fs.readdirSync(wikiLanguagesPath);
for(t=0; t<languageFolders.length; t++) {
for(var t=0; t<languageFolders.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(wikiLanguagesPath,"./" + languageFolders[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
@ -1661,7 +1688,11 @@ $tw.boot.startup = function(options) {
wikiOutputSubDir: "./output",
jsModuleHeaderRegExpString: "^\\/\\*\\\\(?:\\r?\\n)((?:^[^\\r\\n]*(?:\\r?\\n))+?)(^\\\\\\*\\/$(?:\\r?\\n)?)",
fileExtensionInfo: Object.create(null), // Map file extension to {type:}
contentTypeInfo: Object.create(null) // Map type to {encoding:,extension:}
contentTypeInfo: Object.create(null), // Map type to {encoding:,extension:}
pluginsEnvVar: "TIDDLYWIKI_PLUGIN_PATH",
themesEnvVar: "TIDDLYWIKI_THEME_PATH",
languagesEnvVar: "TIDDLYWIKI_LANGUAGE_PATH",
editionsEnvVar: "TIDDLYWIKI_EDITION_PATH"
}
});
if(!$tw.boot.tasks.readBrowserTiddlers) {
@ -1699,6 +1730,8 @@ $tw.boot.startup = function(options) {
$tw.utils.registerFileType("text/plain","utf8",".txt");
$tw.utils.registerFileType("text/css","utf8",".css");
$tw.utils.registerFileType("text/html","utf8",".html");
$tw.config.fileExtensionInfo[".htm"] = {type: "text/html"};
$tw.config.fileExtensionInfo[".hta"] = {type: "text/html"};
$tw.utils.registerFileType("application/hta","utf16le",".hta",{deserializerType:"text/html"});
$tw.utils.registerFileType("application/javascript","utf8",".js");
$tw.utils.registerFileType("application/json","utf8",".json");
@ -1757,9 +1790,15 @@ Execute the remaining eligible startup tasks
*/
$tw.boot.executeNextStartupTask = function() {
// Find the next eligible task
var taskIndex = 0;
var taskIndex = 0, task,
asyncTaskCallback = function() {
if(task.name) {
$tw.boot.executedStartupModules[task.name] = true;
}
return $tw.boot.executeNextStartupTask();
};
while(taskIndex < $tw.boot.remainingStartupModules.length) {
var task = $tw.boot.remainingStartupModules[taskIndex];
task = $tw.boot.remainingStartupModules[taskIndex];
if($tw.boot.isStartupTaskEligible(task)) {
// Remove this task from the list
$tw.boot.remainingStartupModules.splice(taskIndex,1);
@ -1783,12 +1822,7 @@ $tw.boot.executeNextStartupTask = function() {
}
return $tw.boot.executeNextStartupTask();
} else {
task.startup(function() {
if(task.name) {
$tw.boot.executedStartupModules[task.name] = true;
}
return $tw.boot.executeNextStartupTask();
});
task.startup(asyncTaskCallback);
return true;
}
}

12
core/acknowledgements.tid Normal file
View File

@ -0,0 +1,12 @@
title: $:/Acknowledgements
type: text/vnd.tiddlywiki
TiddlyWiki incorporates code from these fine OpenSource projects:
* [[The Stanford Javascript Crypto Library|http://bitwiseshiftleft.github.io/sjcl/]]
* [[The Jasmine JavaScript Test Framework|http://pivotal.github.io/jasmine/]]
* [[Normalize.css by Nicolas Gallagher|http://necolas.github.io/normalize.css/]]
And media from these projects:
* World flag icons from [[Wikipedia|http://commons.wikimedia.org/wiki/Category:SVG_flags_by_country]]

View File

@ -1,3 +0,0 @@
title: $:/config/EditorTypeMappings/image/gif
bitmap

View File

@ -1,3 +0,0 @@
title: $:/config/EditorTypeMappings/image/jpeg
bitmap

View File

@ -1,3 +0,0 @@
title: $:/config/EditorTypeMappings/image/jpg
bitmap

View File

@ -1,3 +0,0 @@
title: $:/config/EditorTypeMappings/image/png
bitmap

View File

@ -1,3 +0,0 @@
title: $:/config/EditorTypeMappings/image/x-icon
bitmap

View File

@ -1,3 +0,0 @@
title: $:/config/EditorTypeMappings/text/vnd.tiddlywiki
text

8
core/icon.tid Normal file
View File

@ -0,0 +1,8 @@
title: $:/core/icon
tags: $:/tags/Image
<svg width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z M85.1274062,95.4080042 C81.5494069,95.3047989 79.9756384,95.3136745 78.1534289,92.2560668 L76.733228,92.2975844 C75.0801573,92.2226776 75.7690718,92.256631 74.6662332,92.2006037 C72.822332,92.1273894 73.1177105,90.3396383 72.7933215,89.3950941 C72.2744094,86.1888106 73.4800004,82.9659571 73.4419681,79.7590415 C73.428503,78.6206623 71.8498363,74.5912119 71.2858469,73.150598 C69.5178104,73.490271 67.7401827,73.5550323 65.9465048,73.6462337 C61.8120677,73.6358996 57.7056703,73.1192806 53.628962,72.4632293 C52.8345141,75.8119659 50.473106,80.4990751 52.4249964,83.9024219 C54.794228,87.4227874 56.45684,88.3980868 59.0339286,88.6103485 C61.6109895,88.8224384 62.1929077,91.7913467 61.5694236,92.8517379 C61.0175661,93.5845847 60.0476425,93.7176093 59.2235739,93.8951553 L57.5752147,93.9742093 C56.2780933,93.9296822 55.1187057,93.5723203 53.9629071,93.0211763 C52.0327307,91.9217335 50.0392154,89.6360411 48.5580719,87.9950695 C48.9028934,88.6503604 49.1085703,89.9296134 48.7958122,90.5249222 C47.9200982,91.7907825 44.1326257,91.7830485 42.3980986,90.996433 C40.4277043,90.1030197 35.6664658,83.8299171 34.9303347,79.1316435 C36.8887135,75.3525836 39.7416856,72.0607931 41.1850909,67.9459622 C38.038852,65.8974525 36.3537697,62.5626501 36.5725198,58.7851619 L36.6514762,58.3478913 C33.5557196,58.9392548 35.1611076,58.7192345 31.8308843,58.9762949 C21.2252017,58.9431831 11.8983553,51.6054609 17.1501626,40.2013394 C17.4916881,39.5260388 17.8165752,38.9120742 18.3955298,39.205288 C18.8602051,39.440565 18.793457,40.3843583 18.5597268,41.4309776 C15.5577203,55.057365 30.2297484,55.161659 39.2489049,52.6401668 C40.1440491,52.3898612 41.9243599,50.7040626 43.1576153,50.1452033 C45.1734825,49.231769 47.3615008,48.8611654 49.5329344,48.5941256 C54.9337165,47.9661653 61.4247946,50.8693254 64.7228943,50.9641212 C68.0210328,51.0589131 72.7127563,50.1582941 75.5928121,50.3479196 C77.6825379,50.4454833 79.734518,50.8303777 81.7507717,51.3786556 C83.0558682,44.8897102 83.1481363,40.1071855 86.2420439,39 C88.0578592,39.2926449 89.4570618,41.8175853 90.4927503,43.1666676 C92.6062592,43.0809984 94.6134653,43.6270518 96.6091885,44.233091 C100.222332,43.7098824 103.254293,41.6394732 106.445091,40.0288813 C103.211767,42.7223157 102.77315,47.1042714 103.142605,51.1564486 C103.280001,53.2591496 102.697713,55.5420684 101.977868,57.6949551 C100.630795,61.2025356 98.0292951,64.8997754 95.009908,64.7101481 C93.868464,64.673306 93.2053722,64.0138 92.3570101,63.3096933 C92.1924386,64.7358711 91.5456263,66.0084523 90.9221089,67.2697748 C89.4822206,70.066388 85.7194927,71.2987762 82.2354164,74.2849828 C78.7515768,77.2712347 83.3502408,87.9363951 84.4652464,89.8796277 C85.5800708,91.8230453 88.6922789,92.5339992 87.484639,94.28798 C87.1151913,94.8672415 86.5502884,95.0744181 85.9465544,95.2991347 L85.1274062,95.4080042 Z M45.0303574,86.5575217 L45.5828655,86.699414 C46.277142,86.4290005 47.6727292,86.8469317 48.4130246,87.0512628 C47.0498362,85.7357167 44.9960929,83.8038623 43.5164417,82.5859671 C43.0307739,81.1115156 43.2380006,79.6278431 43.3424927,78.122648 L43.3634516,77.9981264 C42.7802099,79.2030731 42.040056,80.3743566 41.6422405,81.6426885 C41.176708,83.3537773 43.7112632,85.1999538 44.6940603,86.2580263 L45.0303574,86.5575217 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,9 @@
title: $:/core/images/clone-button
tags: $:/tags/Image
<svg class="tw-clone-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M32.2650915,96 L32.2650915,120.002359 C32.2650915,124.419334 35.8432884,128 40.2627323,128 L120.002359,128 C124.419334,128 128,124.421803 128,120.002359 L128,40.2627323 C128,35.8457573 124.421803,32.2650915 120.002359,32.2650915 L96,32.2650915 L96,48 L108.858899,48 C110.519357,48 111.853018,49.3405131 111.853018,50.9941198 L111.853018,108.858899 C111.853018,110.519357 110.512505,111.853018 108.858899,111.853018 L50.9941198,111.853018 C49.333661,111.853018 48,110.512505 48,108.858899 L48,96 L32.2650915,96 Z"></path>
<path d="M40,56 L32.0070969,56 C27.5881712,56 24,52.418278 24,48 C24,43.5907123 27.5848994,40 32.0070969,40 L40,40 L40,32.0070969 C40,27.5881712 43.581722,24 48,24 C52.4092877,24 56,27.5848994 56,32.0070969 L56,40 L63.9929031,40 C68.4118288,40 72,43.581722 72,48 C72,52.4092877 68.4151006,56 63.9929031,56 L56,56 L56,63.9929031 C56,68.4118288 52.418278,72 48,72 C43.5907123,72 40,68.4151006 40,63.9929031 L40,56 Z M7.9992458,0 C3.58138434,0 0,3.5881049 0,7.9992458 L0,88.0007542 C0,92.4186157 3.5881049,96 7.9992458,96 L88.0007542,96 C92.4186157,96 96,92.4118951 96,88.0007542 L96,7.9992458 C96,3.58138434 92.4118951,0 88.0007542,0 L7.9992458,0 Z M19.0010118,16 C17.3435988,16 16,17.336731 16,19.0010118 L16,76.9989882 C16,78.6564012 17.336731,80 19.0010118,80 L76.9989882,80 C78.6564012,80 80,78.663269 80,76.9989882 L80,19.0010118 C80,17.3435988 78.663269,16 76.9989882,16 L19.0010118,16 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,15 @@
title: $:/core/images/close-all-button
tags: $:/tags/Image
<svg class="tw-close-all-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M53.9827008,89.3556477 C56.4275461,87.3639978 57.9887999,84.3311393 57.9887999,80.9340168 C57.9887999,74.9354419 53.1208368,70.0726361 47.1158999,70.0726361 C44.078736,70.0726361 41.3324226,71.3165963 39.359689,73.3222993 L39.3567754,73.3194062 L3.099103,109.537527 L3.10272197,109.541128 C1.18328516,111.499774 0,114.181157 0,117.138619 C0,123.137194 4.86796314,128 10.8729,128 C13.8490664,128 16.5459476,126.805505 18.5093193,124.870257 L18.5232339,124.884102 L53.9827008,89.3556477 Z"></path>
<path d="M53.9827008,19.3556477 C56.4275461,17.3639978 57.9887999,14.3311393 57.9887999,10.9340168 C57.9887999,4.93544186 53.1208368,0.0726360641 47.1158999,0.0726360641 C44.078736,0.0726360641 41.3324226,1.31659634 39.359689,3.3222993 L39.3567754,3.31940621 L3.099103,39.5375274 L3.10272197,39.5411281 C1.18328516,41.4997737 0,44.1811574 0,47.1386193 C0,53.1371942 4.86796314,58 10.8729,58 C13.8490664,58 16.5459476,56.8055047 18.5093193,54.870257 L18.5232339,54.8841017 L53.9827008,19.3556477 Z"></path>
<path d="M123.982701,19.3556477 C126.427546,17.3639978 127.9888,14.3311393 127.9888,10.9340168 C127.9888,4.93544186 123.120837,0.0726360641 117.1159,0.0726360641 C114.078736,0.0726360641 111.332423,1.31659634 109.359689,3.3222993 L109.356775,3.31940621 L73.099103,39.5375274 L73.102722,39.5411281 C71.1832852,41.4997737 70,44.1811574 70,47.1386193 C70,53.1371942 74.8679631,58 80.8729,58 C83.8490664,58 86.5459476,56.8055047 88.5093193,54.870257 L88.5232339,54.8841017 L123.982701,19.3556477 Z"></path>
<path d="M123.982701,89.3556477 C126.427546,87.3639978 127.9888,84.3311393 127.9888,80.9340168 C127.9888,74.9354419 123.120837,70.0726361 117.1159,70.0726361 C114.078736,70.0726361 111.332423,71.3165963 109.359689,73.3222993 L109.356775,73.3194062 L73.099103,109.537527 L73.102722,109.541128 C71.1832852,111.499774 70,114.181157 70,117.138619 C70,123.137194 74.8679631,128 80.8729,128 C83.8490664,128 86.5459476,126.805505 88.5093193,124.870257 L88.5232339,124.884102 L123.982701,89.3556477 Z"></path>
<path d="M19.0968372,73.831398 C17.1051319,71.5224249 14.1594885,70.0611168 10.8729,70.0611168 C4.87432504,70.0611168 0.0115192444,74.92908 0.0115192444,80.9340168 C0.0115192444,84.1948309 1.44542995,87.1203819 3.71646837,89.1132541 L39.4956787,124.931536 L39.5183554,124.908745 C41.4770057,126.828213 44.1584112,128.011519 47.1158999,128.011519 C53.1144749,128.011519 57.9772807,123.143556 57.9772807,117.138619 C57.9772807,113.981762 56.6333409,111.139133 54.4869671,109.152809 L19.0968372,73.831398 Z"></path>
<path d="M19.0968372,3.83139798 C17.1051319,1.52242486 14.1594885,0.0611168197 10.8729,0.0611168197 C4.87432504,0.0611168197 0.0115192444,4.92907996 0.0115192444,10.9340168 C0.0115192444,14.1948309 1.44542995,17.1203819 3.71646837,19.1132541 L39.4956787,54.9315363 L39.5183554,54.908745 C41.4770057,56.8282126 44.1584112,58.0115192 47.1158999,58.0115192 C53.1144749,58.0115192 57.9772807,53.1435561 57.9772807,47.1386193 C57.9772807,43.9817625 56.6333409,41.1391325 54.4869671,39.1528094 L19.0968372,3.83139798 Z"></path>
<path d="M89.0968372,3.83139798 C87.1051319,1.52242486 84.1594885,0.0611168197 80.8729,0.0611168197 C74.874325,0.0611168197 70.0115192,4.92907996 70.0115192,10.9340168 C70.0115192,14.1948309 71.4454299,17.1203819 73.7164684,19.1132541 L109.495679,54.9315363 L109.518355,54.908745 C111.477006,56.8282126 114.158411,58.0115192 117.1159,58.0115192 C123.114475,58.0115192 127.977281,53.1435561 127.977281,47.1386193 C127.977281,43.9817625 126.633341,41.1391325 124.486967,39.1528094 L89.0968372,3.83139798 Z"></path>
<path d="M89.0968372,73.831398 C87.1051319,71.5224249 84.1594885,70.0611168 80.8729,70.0611168 C74.874325,70.0611168 70.0115192,74.92908 70.0115192,80.9340168 C70.0115192,84.1948309 71.4454299,87.1203819 73.7164684,89.1132541 L109.495679,124.931536 L109.518355,124.908745 C111.477006,126.828213 114.158411,128.011519 117.1159,128.011519 C123.114475,128.011519 127.977281,123.143556 127.977281,117.138619 C127.977281,113.981762 126.633341,111.139133 124.486967,109.152809 L89.0968372,73.831398 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/close-others-button
tags: $:/tags/Image
<svg class="tw-image-close-others-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 127">
<g fill-rule="evenodd">
<path d="M64,128 C99.346224,128 128,99.346224 128,64 C128,28.653776 99.346224,0 64,0 C28.653776,0 0,28.653776 0,64 C0,99.346224 28.653776,128 64,128 Z M64,112 C90.509668,112 112,90.509668 112,64 C112,37.490332 90.509668,16 64,16 C37.490332,16 16,37.490332 16,64 C16,90.509668 37.490332,112 64,112 Z M64,96 C81.673112,96 96,81.673112 96,64 C96,46.326888 81.673112,32 64,32 C46.326888,32 32,46.326888 32,64 C32,81.673112 46.326888,96 64,96 Z M64,80 C72.836556,80 80,72.836556 80,64 C80,55.163444 72.836556,48 64,48 C55.163444,48 48,55.163444 48,64 C48,72.836556 55.163444,80 64,80 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,4 @@
title: $:/core/images/download-button
tags: $:/tags/Image
<svg class="tw-image-download-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 129 128"><g fill-rule="evenodd"><path class="tw-image-download-button-ring" d="M64,128 C99.346224,128 128,99.346224 128,64 C128,28.653776 99.346224,0 64,0 C28.653776,0 0,28.653776 0,64 C0,99.346224 28.653776,128 64,128 Z M64,112 C90.509668,112 112,90.509668 112,64 C112,37.490332 90.509668,16 64,16 C37.490332,16 16,37.490332 16,64 C16,90.509668 37.490332,112 64,112 Z"/><path d="M34.3496823,66.4308767 L61.2415823,93.634668 C63.0411536,95.4551107 65.9588502,95.4551107 67.7584215,93.634668 L94.6503215,66.4308767 C96.4498928,64.610434 96.4498928,61.6588981 94.6503215,59.8384554 C93.7861334,58.9642445 92.6140473,58.4731195 91.3919019,58.4731195 L82.9324098,58.4731195 C80.3874318,58.4731195 78.3243078,56.3860674 78.3243078,53.8115729 L78.3243078,38.6615466 C78.3243078,36.0870521 76.2611837,34 73.7162058,34 L55.283798,34 C52.7388201,34 50.675696,36.0870521 50.675696,38.6615466 L50.675696,38.6615466 L50.675696,53.8115729 C50.675696,56.3860674 48.612572,58.4731195 46.0675941,58.4731195 L37.608102,58.4731195 C35.063124,58.4731195 33,60.5601716 33,63.134666 C33,64.3709859 33.4854943,65.5566658 34.3496823,66.4308767 L34.3496823,66.4308767 Z"/></g></svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/export-button
tags: $:/tags/Image
<svg class="tw-image-export-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M128.078948,81.2190241 L128.078948,103.072887 C128.078948,110.252507 122.258391,116.079527 115.07837,116.079527 L13.0007031,116.079527 C5.81517113,116.079527 0.0001254444,110.256256 0.0001254444,103.072887 L0.0001254444,60.043677 C0.0001254444,52.8640576 5.82068232,47.037037 13.0007031,47.037037 L50.9939627,47.037037 C46.9232966,53.1682159 47.3681412,61.433368 52.4317358,67.049353 L36.0221654,67.049353 C31.0486129,67.049353 27.016752,71.0784493 27.016752,76.0490922 L27.016752,86.0668561 C27.016752,91.0372749 31.0503474,95.0665954 36.0221654,95.0665954 L92.0569077,95.0665954 C97.0304602,95.0665954 101.062321,91.0374991 101.062321,86.0668561 L101.062321,76.6968446 L104.185741,73.5608014 L108.938546,78.3104149 C114.124001,83.4958696 121.907794,84.4351094 128.078948,81.2190241 L128.078948,81.2190241 Z M126.997239,16.6885444 C127.022653,13.3460126 124.333584,10.6569433 120.991052,10.682357 L71.0419165,11.0621275 C67.6993847,11.0875413 64.9691114,13.8178146 64.9436976,17.1603465 C64.9314934,18.7654933 65.5574285,20.3000438 66.6838081,21.4264234 L74.4804244,29.2230397 C76.8259808,31.5685961 76.7968452,35.4006519 74.4153482,37.7821489 L60.4010471,51.79645 C58.0195502,54.1779469 57.9904145,58.0100028 60.3359709,60.3555592 L77.324037,77.3436253 C79.6695934,79.6891817 83.5016493,79.6600461 85.8831462,77.2785491 L99.8974474,63.264248 C102.278944,60.8827511 106.111,60.8536154 108.456557,63.1991718 L116.253173,70.9957881 C118.598729,73.3413446 122.430785,73.3122089 124.812282,70.930712 C125.955921,69.7870731 126.605265,68.2428265 126.617469,66.6376797 L126.997239,16.6885444 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,19 @@
title: $:/core/images/full-screen-button
tags: $:/tags/Image
<svg class="tw-image-full-screen-button tw-image-button" class="tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g>
<g>
<path d="M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z"></path>
</g>
<g transform="translate(104.000000, 104.000000) rotate(-180.000000) translate(-104.000000, -104.000000) translate(80.000000, 80.000000)">
<path d="M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z"></path>
</g>
<g transform="translate(24.000000, 104.000000) rotate(-90.000000) translate(-24.000000, -104.000000) translate(0.000000, 80.000000)">
<path d="M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z"></path>
</g>
<g transform="translate(104.000000, 24.000000) rotate(90.000000) translate(-104.000000, -24.000000) translate(80.000000, 0.000000)">
<path d="M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z"></path>
</g>
</g>
</svg>

10
core/images/globe.tid Normal file
View File

@ -0,0 +1,10 @@
title: $:/core/images/globe
tags: $:/tags/Image
<svg class="tw-image-globe tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M72.8111354,37.1275855 C72.8111354,37.9789875 72.8111354,38.8303894 72.8111354,39.6817913 C72.8111354,41.8784743 73.7885604,46.5631866 72.8111354,48.5143758 C71.3445471,51.4420595 68.1617327,52.0543531 66.4170946,54.3812641 C65.2352215,55.9575873 61.7987417,64.9821523 62.7262858,67.3005778 C66.6959269,77.2228204 74.26087,70.4881886 80.6887657,76.594328 C81.5527211,77.415037 83.5758191,78.8666631 83.985137,79.8899578 C87.2742852,88.1128283 76.4086873,94.8989524 87.7419325,106.189751 C88.9872885,107.430443 91.555495,102.372895 91.8205061,101.575869 C92.6726866,99.0129203 98.5458765,96.1267309 100.908882,94.5234439 C102.928056,93.1534443 105.782168,91.8557166 107.236936,89.7775886 C109.507391,86.5342557 108.717505,82.2640435 110.334606,79.0328716 C112.473794,74.7585014 114.163418,69.3979002 116.332726,65.0674086 C120.230862,57.2857361 121.054075,67.1596684 121.400359,67.5059523 C121.757734,67.8633269 122.411167,67.5059523 122.916571,67.5059523 C123.011132,67.5059523 124.364019,67.6048489 124.432783,67.5059523 C125.0832,66.5705216 123.390209,49.5852316 123.114531,48.2089091 C121.710578,41.1996597 116.17083,32.4278331 111.249523,27.7092761 C104.975994,21.6942076 104.160516,11.5121686 92.9912146,12.7547535 C92.7872931,12.7774397 87.906794,22.9027026 85.2136766,26.2672064 C81.486311,30.9237934 82.7434931,22.1144904 78.6876623,22.1144904 C78.6065806,22.1144904 77.5045497,22.0107615 77.4353971,22.1144904 C76.8488637,22.9942905 75.9952305,26.0101404 75.1288269,26.5311533 C74.8635477,26.6906793 73.4071369,26.2924966 73.2826811,26.5311533 C71.0401728,30.8313939 81.5394677,28.7427264 79.075427,34.482926 C76.7225098,39.9642538 72.747373,32.4860199 72.747373,43.0434079"></path>
<path d="M44.4668556,7.01044608 C54.151517,13.1403033 45.1489715,19.2084878 47.1611905,23.2253896 C48.8157833,26.5283781 51.4021933,28.6198851 48.8753629,33.038878 C46.8123257,36.6467763 42.0052989,37.0050492 39.251679,39.7621111 C36.2115749,42.8060154 33.7884281,48.7028116 32.4624592,52.6732691 C30.8452419,57.5158356 47.0088721,59.5388126 44.5246867,63.6811917 C43.1386839,65.9923513 37.7785192,65.1466282 36.0880227,63.8791519 C34.9234453,63.0059918 32.4946425,63.3331166 31.6713597,62.0997342 C29.0575851,58.1839669 29.4107339,54.0758543 28.0457962,49.9707786 C27.1076833,47.1493864 21.732611,47.8501656 20.2022714,49.3776393 C19.6790362,49.8998948 19.8723378,51.1703278 19.8723378,51.8829111 C19.8723378,57.1682405 26.9914913,55.1986414 26.9914913,58.3421973 C26.9914913,72.9792302 30.9191897,64.8771867 38.1313873,69.6793121 C48.1678018,76.3618966 45.9763926,76.981595 53.0777543,84.0829567 C56.7511941,87.7563965 60.8192437,87.7689005 62.503478,93.3767069 C64.1046972,98.7081071 53.1759798,98.7157031 50.786754,100.825053 C49.663965,101.816317 47.9736094,104.970571 46.5680513,105.439676 C44.7757187,106.037867 43.334221,105.93607 41.6242359,107.219093 C39.1967302,109.040481 37.7241465,112.151588 37.6034934,112.030935 C35.4555278,109.88297 34.0848666,96.5511248 33.7147244,93.7726273 C33.1258872,89.3524817 28.1241923,88.2337027 26.7275443,84.7420826 C25.1572737,80.8164061 28.2518481,75.223612 25.599097,70.9819941 C19.0797019,60.557804 13.7775712,56.4811506 10.2493953,44.6896152 C9.3074899,41.5416683 13.5912267,38.1609942 15.1264825,35.8570308 C17.0029359,33.0410312 17.7876232,30.0028946 19.8723378,27.2224065 C22.146793,24.1888519 40.8551166,9.46076832 43.8574051,8.63490613 L44.4668556,7.01044608 Z"></path>
<path d="M64,126 C98.2416545,126 126,98.2416545 126,64 C126,29.7583455 98.2416545,2 64,2 C29.7583455,2 2,29.7583455 2,64 C2,98.2416545 29.7583455,126 64,126 Z M64,120 C94.927946,120 120,94.927946 120,64 C120,33.072054 94.927946,8 64,8 C33.072054,8 8,33.072054 8,64 C8,94.927946 33.072054,120 64,120 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/import-button
tags: $:/tags/Image
<svg class="tw-image-import-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M105.449437,94.2138951 C105.449437,94.2138951 110.049457,94.1897106 110.049457,99.4026111 C110.049457,104.615512 105.163246,104.615511 105.163246,104.615511 L45.0075072,105.157833 C45.0075072,105.157833 0.367531803,106.289842 0.367532368,66.6449212 C0.367532934,27.0000003 45.0428249,27.0000003 45.0428249,27.0000003 L105.532495,27.0000003 C105.532495,27.0000003 138.996741,25.6734987 138.996741,55.1771866 C138.996741,84.6808745 105.727102,82.8457535 105.727102,82.8457535 L56.1735087,82.8457535 C56.1735087,82.8457535 22.6899229,85.1500223 22.6899229,66.0913753 C22.6899229,47.0327282 56.1735087,49.3383013 56.1735087,49.3383013 L105.727102,49.3383013 C105.727102,49.3383013 111.245209,49.3383024 111.245209,54.8231115 C111.245209,60.3079206 105.727102,60.5074524 105.727102,60.5074524 L56.1735087,60.5074524 C56.1735087,60.5074524 37.48913,60.5074528 37.48913,66.6449195 C37.48913,72.7823862 56.1735087,71.6766023 56.1735087,71.6766023 L105.727102,71.6766029 C105.727102,71.6766029 127.835546,73.1411469 127.835546,55.1771866 C127.835546,35.5304025 105.727102,38.3035317 105.727102,38.3035317 L45.0428249,38.3035317 C45.0428249,38.3035317 11.5287276,38.3035313 11.5287276,66.6449208 C11.5287276,94.9863103 45.0428244,93.9579678 45.0428244,93.9579678 L105.449437,94.2138951 Z" transform="translate(69.367532, 66.000000) rotate(-45.000000) translate(-69.367532, -66.000000) "></path>
</g>
</svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/locked-padlock
tags: $:/tags/Image
<svg class="tw-image-locked-padlock tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M96.4723753,64 L105,64 L105,96.0097716 C105,113.673909 90.6736461,128 73.001193,128 L55.998807,128 C38.3179793,128 24,113.677487 24,96.0097716 L24,64 L32.0000269,64 C32.0028554,48.2766389 32.3030338,16.2688026 64.1594984,16.2688041 C95.9543927,16.2688056 96.4648869,48.325931 96.4723753,64 Z M80.5749059,64 L48.4413579,64 C48.4426205,47.71306 48.5829272,31.9999996 64.1595001,31.9999996 C79.8437473,31.9999996 81.1369461,48.1359182 80.5749059,64 Z M67.7315279,92.3641717 C70.8232551,91.0923621 73,88.0503841 73,84.5 C73,79.8055796 69.1944204,76 64.5,76 C59.8055796,76 56,79.8055796 56,84.5 C56,87.947435 58.0523387,90.9155206 61.0018621,92.2491029 L55.9067479,115.020857 L72.8008958,115.020857 L67.7315279,92.3641717 L67.7315279,92.3641717 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/permalink-button
tags: $:/tags/Image
<svg class="tw-image-permalink-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 129 125">
<g fill-rule="evenodd">
<path d="M114,92.0520153 L85.0841463,92.0520153 L77.4459963,128.151367 L64.6248159,128.151367 L72.2629659,92.0520153 L47.8936301,92.0520153 L40.2554801,128.151367 L27.4342997,128.151367 L35.0724497,92.0520153 L17.7047515,92.0520153 L17.7047515,80.1401384 L37.6184997,80.1401384 L44.5292069,47.4961401 L17.7047515,47.4961401 L17.7047515,35.5842633 L46.9843266,35.5842633 L54.6224766,-0.151367188 L67.443657,-0.151367188 L59.805507,35.5842633 L84.1748428,35.5842633 L91.8129928,-0.151367188 L104.634173,-0.151367188 L97.0869535,35.5842633 L114,35.5842633 L114,47.4961401 L94.6318339,47.4961401 L87.7211267,80.1401384 L114,80.1401384 L114,92.0520153 Z M81.8106535,47.4961401 L57.3503873,47.4961401 L50.5306105,80.1401384 L74.8999463,80.1401384 L81.8106535,47.4961401 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,10 @@
title: $:/core/images/permaview-button
tags: $:/tags/Image
<svg class="tw-image-permaview-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M111.6744,92.2645264 L82.9006479,92.2645264 L75.300034,128.289805 L62.5418608,128.289805 L70.1424746,92.2645264 L45.8928971,92.2645264 L38.2922833,128.289805 L25.53411,128.289805 L33.1347239,92.2645264 L15.8523757,92.2645264 L15.8523757,80.3770918 L35.6682618,80.3770918 L42.5450077,47.8000762 L15.8523757,47.8000762 L15.8523757,35.9126416 L44.9880621,35.9126416 L52.588676,0.250337625 L65.3468492,0.250337625 L57.7462354,35.9126416 L81.9958129,35.9126416 L89.5964268,0.250337625 L102.3546,0.250337625 L94.8444696,35.9126416 L111.6744,35.9126416 L111.6744,47.8000762 L92.4014152,47.8000762 L85.5246693,80.3770918 L111.6744,80.3770918 L111.6744,92.2645264 Z M79.643242,47.8000762 L55.3031809,47.8000762 L48.5169186,80.3770918 L72.7664961,80.3770918 L79.643242,47.8000762 Z"></path>
<rect x="15.9992745" y="57.8809888" width="95.528227" height="11.975377"></rect>
<path d="M70.8113396,0.098602426 L83.5061663,0.219342965 L56.0934841,128.105958 L43.968839,128.22602 L70.8113396,0.098602426 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/plugin-generic-language
tags: $:/tags/Image
<svg width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M61.2072232,68.1369825 C56.8829239,70.9319564 54.2082892,74.793177 54.2082892,79.0581634 C54.2082892,86.9638335 63.3980995,93.4821994 75.2498076,94.3940006 C77.412197,98.2964184 83.8475284,101.178858 91.5684735,101.403106 C86.4420125,100.27851 82.4506393,97.6624107 80.9477167,94.3948272 C92.8046245,93.4861461 102,86.9662269 102,79.0581634 C102,70.5281905 91.3014611,63.6132813 78.1041446,63.6132813 C71.5054863,63.6132813 65.5315225,65.3420086 61.2072232,68.1369825 Z M74.001066,53.9793443 C69.6767667,56.7743182 63.7028029,58.5030456 57.1041446,58.5030456 C54.4851745,58.5030456 51.9646095,58.2307276 49.6065315,57.7275105 C46.2945155,59.9778212 41.2235699,61.4171743 35.5395922,61.4171743 C35.4545771,61.4171743 35.3696991,61.4168523 35.2849622,61.4162104 C39.404008,60.5235193 42.7961717,58.6691298 44.7630507,56.286533 C37.8379411,53.5817651 33.2082892,48.669413 33.2082892,43.0581634 C33.2082892,34.5281905 43.9068281,27.6132812 57.1041446,27.6132812 C70.3014611,27.6132812 81,34.5281905 81,43.0581634 C81,47.3231498 78.3253653,51.1843704 74.001066,53.9793443 Z M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/plugin-generic-plugin
tags: $:/tags/Image
<svg width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M40.3972881,76.4456988 L40.3972881,95.3404069 L54.5170166,95.3404069 L54.5170166,95.3404069 C54.5165526,95.3385183 54.516089,95.3366295 54.515626,95.3347404 C54.6093153,95.3385061 54.7034848,95.3404069 54.7980982,95.3404069 C58.6157051,95.3404069 61.710487,92.245625 61.710487,88.4280181 C61.710487,86.6197822 61.01617,84.9737128 59.8795929,83.7418666 L59.8795929,83.7418666 C59.8949905,83.7341665 59.9104102,83.7265043 59.925852,83.7188798 C58.8840576,82.5086663 58.2542926,80.9336277 58.2542926,79.2114996 C58.2542926,75.3938927 61.3490745,72.2991108 65.1666814,72.2991108 C68.9842884,72.2991108 72.0790703,75.3938927 72.0790703,79.2114996 C72.0790703,81.1954221 71.2432806,82.9841354 69.9045961,84.2447446 L69.9045961,84.2447446 C69.9333407,84.2629251 69.9619885,84.281245 69.9905383,84.2997032 L69.9905383,84.2997032 C69.1314315,85.4516923 68.6228758,86.8804654 68.6228758,88.4280181 C68.6228758,91.8584969 71.1218232,94.7053153 74.3986526,95.2474079 C74.3913315,95.2784624 74.3838688,95.3094624 74.3762652,95.3404069 L95.6963988,95.3404069 L95.6963988,75.5678578 L95.6963988,75.5678578 C95.6466539,75.5808558 95.5967614,75.5934886 95.5467242,75.6057531 C95.5504899,75.5120637 95.5523907,75.4178943 95.5523907,75.3232809 C95.5523907,71.505674 92.4576088,68.4108921 88.6400019,68.4108921 C86.831766,68.4108921 85.1856966,69.105209 83.9538504,70.2417862 L83.9538504,70.2417862 C83.9461503,70.2263886 83.938488,70.2109688 83.9308636,70.1955271 C82.7206501,71.2373215 81.1456115,71.8670865 79.4234834,71.8670865 C75.6058765,71.8670865 72.5110946,68.7723046 72.5110946,64.9546976 C72.5110946,61.1370907 75.6058765,58.0423088 79.4234834,58.0423088 C81.4074059,58.0423088 83.1961192,58.8780985 84.4567284,60.2167829 L84.4567284,60.2167829 C84.4749089,60.1880383 84.4932288,60.1593906 84.511687,60.1308407 L84.511687,60.1308407 C85.6636761,60.9899475 87.0924492,61.4985032 88.6400019,61.4985032 C92.0704807,61.4985032 94.9172991,58.9995558 95.4593917,55.7227265 C95.538755,55.7414363 95.6177614,55.761071 95.6963988,55.7816184 L95.6963988,40.0412962 L74.3762652,40.0412962 L74.3762652,40.0412962 C74.3838688,40.0103516 74.3913315,39.9793517 74.3986526,39.9482971 L74.3986526,39.9482971 C71.1218232,39.4062046 68.6228758,36.5593862 68.6228758,33.1289073 C68.6228758,31.5813547 69.1314315,30.1525815 69.9905383,29.0005925 C69.9619885,28.9821342 69.9333407,28.9638143 69.9045961,28.9456339 C71.2432806,27.6850247 72.0790703,25.8963113 72.0790703,23.9123888 C72.0790703,20.0947819 68.9842884,17 65.1666814,17 C61.3490745,17 58.2542926,20.0947819 58.2542926,23.9123888 C58.2542926,25.6345169 58.8840576,27.2095556 59.925852,28.419769 L59.925852,28.419769 C59.9104102,28.4273935 59.8949905,28.4350558 59.8795929,28.4427558 C61.01617,29.674602 61.710487,31.3206715 61.710487,33.1289073 C61.710487,36.9465143 58.6157051,40.0412962 54.7980982,40.0412962 C54.7034848,40.0412962 54.6093153,40.0393953 54.515626,40.0356296 L54.515626,40.0356296 C54.516089,40.0375187 54.5165526,40.0394075 54.5170166,40.0412962 L40.3972881,40.0412962 L40.3972881,52.887664 L40.3972881,52.887664 C40.4916889,53.3430132 40.5412962,53.8147625 40.5412962,54.2980982 C40.5412962,58.1157051 37.4465143,61.210487 33.6289073,61.210487 C32.0813547,61.210487 30.6525815,60.7019313 29.5005925,59.8428245 C29.4821342,59.8713744 29.4638143,59.9000221 29.4456339,59.9287667 C28.1850247,58.5900823 26.3963113,57.7542926 24.4123888,57.7542926 C20.5947819,57.7542926 17.5,60.8490745 17.5,64.6666814 C17.5,68.4842884 20.5947819,71.5790703 24.4123888,71.5790703 C26.134517,71.5790703 27.7095556,70.9493053 28.919769,69.9075109 L28.919769,69.9075109 C28.9273935,69.9229526 28.9350558,69.9383724 28.9427558,69.95377 C30.174602,68.8171928 31.8206715,68.1228758 33.6289073,68.1228758 C37.4465143,68.1228758 40.5412962,71.2176578 40.5412962,75.0352647 C40.5412962,75.5186004 40.4916889,75.9903496 40.3972881,76.4456988 Z M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/plugin-generic-theme
tags: $:/tags/Image
<svg width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M27.6619958,98.5383065 C27.5690581,98.5388896 27.4761291,98.539182 27.383212,98.539182 C41.5122315,92.2342259 36.7359182,71.4340774 52.2062903,71.4340772 C52.3396942,72.0325374 52.4778143,72.6764878 52.6543744,73.3309353 C41.7206358,71.5725612 42.70852,93.6013809 27.6619958,98.5383065 Z M27.962646,98.5354078 C44.3675979,98.3221342 60.9448114,89.104528 60.944811,79.6231217 C57.0326028,79.6231217 55.0057081,78.1546059 53.8483468,76.2715831 C46.8437297,73.3160546 41.0335584,95.5643154 27.9626323,98.5354081 Z M60.4476718,66.8723739 C57.4632888,63.6421817 54.9582687,60.7541572 53.4305549,58.7453802 C47.3662923,50.7715364 44.307483,54.9700909 40.8462757,58.7453801 C37.3850684,62.5206692 41.7580858,65.5796149 38.4732643,68.2464352 C35.1884428,70.9132556 35.391237,71.8376623 29.8473278,66.9588778 C24.3034186,62.0800933 23.919977,60.7368279 26.4649349,57.9530299 C29.0098928,55.1692318 31.1369568,59.5524845 36.3357237,54.6053302 C41.5344905,49.6581758 37.1673192,45.2736183 37.1673192,45.2736183 C37.1673192,45.2736183 47.9916921,23.1463023 62.4556497,24.7805686 C76.9196074,26.4148348 56.9839048,22.6644011 52.0250205,40.0179431 C49.9018746,47.4478606 52.4201529,45.6971267 56.4460414,48.8353078 C57.8695188,49.9449088 63.120208,53.6842856 69.3136884,58.3372485 C77.8095419,50.1273311 87.3705002,40.8200581 90.1462007,38.0443577 C94.9225135,33.268045 99.6988262,38.0443577 94.9225134,42.8206705 C92.2168565,45.5263274 83.0052228,54.3768782 74.6585455,62.4104777 C84.7196352,70.2010353 95.1107413,79.0341049 95.1107416,82.5307694 C95.1107421,88.9149413 92.3944614,92.7263341 86.6764506,90.6368273 C83.0906414,89.3264812 73.3126471,80.2536547 65.0234105,71.7029822 C62.8994697,73.7599251 61.2357389,75.3821997 60.3189624,76.2989761 C57.6045976,78.4574835 53.6647127,73.2589589 55.5426497,71.5226634 C56.5140946,70.6244887 58.249291,68.9770292 60.4476718,66.8723739 L60.4476718,66.8723739 Z M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/refresh-button
tags: $:/tags/Image
<svg class="tw-image-refresh-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M106.369002,39.4325143 C116.529932,60.3119371 112.939592,86.1974934 95.5979797,103.539105 C73.7286194,125.408466 38.2713806,125.408466 16.4020203,103.539105 C-5.46734008,81.6697449 -5.46734008,46.2125061 16.4020203,24.3431458 C19.5262146,21.2189514 24.5915344,21.2189514 27.7157288,24.3431458 C30.8399231,27.4673401 30.8399231,32.5326599 27.7157288,35.6568542 C12.0947571,51.2778259 12.0947571,76.6044251 27.7157288,92.2253967 C43.3367004,107.846368 68.6632996,107.846368 84.2842712,92.2253967 C97.71993,78.7897379 99.5995262,58.1740623 89.9230597,42.729491 L83.4844861,54.9932839 C81.4307001,58.9052072 76.5945372,60.4115251 72.682614,58.3577391 C68.7706907,56.3039532 67.2643728,51.4677903 69.3181587,47.555867 L84.4354914,18.7613158 C86.4966389,14.8353707 91.3577499,13.3347805 95.273202,15.415792 L124.145886,30.7612457 C128.047354,32.8348248 129.52915,37.6785572 127.455571,41.5800249 C125.381992,45.4814927 120.53826,46.9632892 116.636792,44.8897102 L106.369002,39.4325143 Z M98.1470904,27.0648707 C97.9798954,26.8741582 97.811187,26.6843098 97.6409651,26.4953413 L98.6018187,26.1987327 L98.1470904,27.0648707 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,4 @@
title: $:/core/images/right-arrow
tags: $:/tags/Image
<svg class="tw-image-right-arrow tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128"><path d="M72.7982405,98.6541105 L127.184015,43.9832042 C130.938662,40.2089635 130.938662,34.0896964 127.184015,30.3154557 C123.429583,26.5412364 117.342116,26.5412364 113.587684,30.3154557 L66.0000107,78.152522 L18.4123803,30.3154557 C14.6578195,26.5412364 8.57048132,26.5412364 4.81592057,30.3154557 C1.06135981,34.0896964 1.06135981,40.2089635 4.81592057,43.9832042 L59.2017595,98.6541105 C62.9563202,102.428351 69.0436798,102.428351 72.7982405,98.6541126 L72.7982405,98.6541105 Z" transform="translate(66.000000, 64.484791) rotate(-90.000000) translate(-66.000000, -64.484791) "/></svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/star-filled
tags: $:/tags/Image
<svg class="tw-image-star-filled tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="nonzero">
<path d="M61.8361286,96.8228569 L99.1627704,124.110219 C101.883827,126.099427 105.541968,123.420868 104.505636,120.198072 L90.2895569,75.9887263 L89.0292911,79.8977279 L126.314504,52.5528988 C129.032541,50.5595011 127.635256,46.2255025 124.273711,46.2229134 L78.1610486,46.1873965 L81.4604673,48.6032923 L67.1773543,4.41589688 C66.1361365,1.19470104 61.6144265,1.19470104 60.5732087,4.41589688 L46.2900957,48.6032923 L49.5895144,46.1873965 L3.47685231,46.2229134 C0.115307373,46.2255025 -1.28197785,50.5595011 1.43605908,52.5528988 L38.7212719,79.8977279 L37.4610061,75.9887263 L23.2449266,120.198072 C22.2085954,123.420868 25.8667356,126.099427 28.5877926,124.110219 L65.9144344,96.8228569 L61.8361286,96.8228569 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,11 @@
title: $:/core/images/storyview-classic
tags: $:/tags/Image
<svg class="tw-image-storyview-classic tw-image-button" width="22pt" height="22pt" viewBox="0 0 129 128">
<g fill-rule="evenodd">
<path d="M9.99919566,0 C4.48152297,0 0.00856547772,4.48053479 0.00856547772,9.99063018 L0.00856547772,118.00937 C0.00856547772,123.527043 4.48910027,128 9.99919566,128 L118.017935,128 C123.535608,128 128.008565,123.519465 128.008565,118.00937 L128.008565,9.99063018 C128.008565,4.47295749 123.528031,0 118.017935,0 L9.99919566,0 Z M9.00856548,9 L9.00856548,119 L119.008565,119 L119.008565,9 L9.00856548,9 Z"></path>
<rect x="16.0098828" y="16" width="96.203165" height="32"></rect>
<rect x="16.0098828" y="55" width="96.203165" height="23"></rect>
<rect x="16.0207797" y="85" width="96.203165" height="24"></rect>
</g>
</svg>

View File

@ -0,0 +1,12 @@
title: $:/core/images/storyview-pop
tags: $:/tags/Image
<svg class="tw-image-storyview-pop tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M9.99919566,0 C4.48152297,0 0.00856547772,4.48053479 0.00856547772,9.99063018 L0.00856547772,118.00937 C0.00856547772,123.527043 4.48910027,128 9.99919566,128 L118.017935,128 C123.535608,128 128.008565,123.519465 128.008565,118.00937 L128.008565,9.99063018 C128.008565,4.47295749 123.528031,0 118.017935,0 L9.99919566,0 Z M9.00856548,9 L9.00856548,119 L119.008565,119 L119.008565,9 L9.00856548,9 Z"></path>
<rect x="16.0098828" y="16" width="96.203165" height="32"></rect>
<path d="M16.0098828,55 L16.0098828,78 L112.213048,78 L112.213048,55 L16.0098828,55 Z M18.5049414,57.5 L18.5049414,75.5 L109.717989,75.5 L109.717989,57.5 L18.5049414,57.5 Z"></path>
<rect x="25.6164067" y="60.5" width="76.9901172" height="12"></rect>
<rect x="16.0207797" y="85" width="96.203165" height="24"></rect>
</g>
</svg>

View File

@ -0,0 +1,9 @@
title: $:/core/images/storyview-zoomin
tags: $:/tags/Image
<svg class="tw-image-storyview-zoomin tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M9.99919566,0 C4.48152297,0 0.00856547772,4.48053479 0.00856547772,9.99063018 L0.00856547772,118.00937 C0.00856547772,123.527043 4.48910027,128 9.99919566,128 L118.017935,128 C123.535608,128 128.008565,123.519465 128.008565,118.00937 L128.008565,9.99063018 C128.008565,4.47295749 123.528031,0 118.017935,0 L9.99919566,0 Z M9.00856548,9 L9.00856548,119 L119.008565,119 L119.008565,9 L9.00856548,9 Z"></path>
<rect x="16.0098828" y="16" width="96.203165" height="57.9273639"></rect>
</g>
</svg>

View File

@ -0,0 +1,9 @@
title: $:/core/images/tag-button
tags: $:/tags/Image
<svg class="tw-image-tag-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M18.1643182,47.6600756 L18.1677196,51.7651887 C18.1708869,55.5878829 20.3581578,60.8623899 23.0531352,63.5573673 L84.9021823,125.406414 C87.5996731,128.103905 91.971139,128.096834 94.6717387,125.396234 L125.766905,94.3010679 C128.473612,91.5943612 128.472063,87.2264889 125.777085,84.5315115 L63.9280381,22.6824644 C61.2305472,19.9849735 55.9517395,17.801995 52.1318769,17.8010313 L25.0560441,17.7942007 C21.2311475,17.7932358 18.1421354,20.8872832 18.1452985,24.7049463 L18.1535504,34.6641936 C18.2481119,34.6754562 18.3439134,34.6864294 18.4409623,34.6971263 C22.1702157,35.1081705 26.9295004,34.6530132 31.806204,33.5444844 C32.1342781,33.0700515 32.5094815,32.6184036 32.9318197,32.1960654 C35.6385117,29.4893734 39.5490441,28.718649 42.94592,29.8824694 C43.0432142,29.8394357 43.1402334,29.7961748 43.2369683,29.7526887 L43.3646982,30.0368244 C44.566601,30.5115916 45.6933052,31.2351533 46.6655958,32.2074439 C50.4612154,36.0030635 50.4663097,42.1518845 46.6769742,45.94122 C43.0594074,49.5587868 37.2914155,49.7181264 33.4734256,46.422636 C28.1082519,47.5454734 22.7987486,48.0186448 18.1643182,47.6600756 Z"></path>
<path d="M47.6333528,39.5324628 L47.6562932,39.5834939 C37.9670934,43.9391617 26.0718874,46.3819521 17.260095,45.4107025 C5.27267473,44.0894301 -1.02778744,36.4307276 2.44271359,24.0779512 C5.56175386,12.9761516 14.3014034,4.36129832 24.0466405,1.54817001 C34.7269254,-1.53487574 43.7955833,3.51606438 43.7955834,14.7730751 L35.1728168,14.7730752 C35.1728167,9.91428944 32.0946059,8.19982862 26.4381034,9.83267419 C19.5270911,11.8276553 13.046247,18.2159574 10.7440788,26.4102121 C8.82861123,33.2280582 11.161186,36.0634845 18.2047888,36.8398415 C25.3302805,37.6252244 35.7353482,35.4884477 44.1208333,31.7188498 L44.1475077,31.7781871 C44.159701,31.7725635 44.1718402,31.7671479 44.1839238,31.7619434 C45.9448098,31.0035157 50.4503245,38.3109156 47.7081571,39.5012767 C47.6834429,39.512005 47.6585061,39.5223987 47.6333528,39.5324628 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,12 @@
title: $:/core/images/theme-button
tags: $:/tags/Image
<svg class="tw-image-theme-button tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 129">
<g fill-rule="evenodd">
<g transform="translate(6.762422, 19.968999)">
<path d="M0.824945506,108.186742 C0.664785639,108.187747 0.504640965,108.188251 0.344516735,108.188251 C24.6927592,97.3230528 16.4618388,61.4785938 43.121606,61.4785936 C43.3514982,62.5099075 43.5895175,63.6196137 43.8937798,64.7474092 C25.0518979,61.7172401 26.754298,99.6790423 0.824939051,108.186742 Z M1.34304326,108.181747 C29.613352,107.814217 58.1805158,91.9297101 58.1805151,75.5906019 C51.4386888,75.5906018 47.9457839,73.0599394 45.9513275,69.8149659 C33.880418,64.7217657 23.8678719,103.061726 1.34301955,108.181748 Z"></path>
<path d="M48.871084,61.6312522 C45.6348746,64.6233738 52.4243955,73.581882 57.1020034,69.8621716 C65.3329228,61.631253 108.502656,20.4006304 116.733576,12.169711 C124.964495,3.9387916 116.733576,-4.29212771 108.502656,3.9387916 C100.271737,12.1697108 57.4180113,53.7289683 48.871084,61.6312522 Z"></path>
</g>
<path d="M62.2824054,71.6211067 C57.93733,66.8541323 54.3123948,62.6301561 51.9937779,59.5814279 C41.5433616,45.8402704 36.2721798,53.0755512 30.307554,59.5814276 C24.3429282,66.0873041 31.8788571,71.3587209 26.2181932,75.9543964 C20.5575294,80.5500719 20.9070004,82.1430826 11.3532982,73.7355757 C1.79959591,65.3280689 1.13881905,63.0132479 5.52449152,58.2159872 C9.91016399,53.4187265 13.5756887,60.9722938 22.5346144,52.4469667 C31.4935401,43.9216395 23.9676854,36.3658236 23.9676854,36.3658236 C23.9676854,36.3658236 42.6210998,-1.76571499 67.5465342,1.05058165 C92.4719685,3.8668783 58.1171911,-2.5961653 49.5716499,27.3088291 C45.9128772,40.1126497 50.2525733,37.0956468 57.1903023,42.5036084 C59.4792141,44.2878157 67.5103988,50.0176866 77.2457031,57.2905766 C71.4143155,62.9019825 66.2337717,67.8661661 62.2824054,71.6211067 Z M73.4870997,83.4678852 C87.4278174,97.7290403 103.323635,112.360587 109.285731,114.539289 C119.139459,118.140092 123.820369,111.571999 123.820368,100.570289 C123.820367,94.7414103 107.064445,80.3074425 90.2759123,67.2185217 C83.6390655,73.6178 77.7700759,79.2918373 73.4870997,83.4678852 Z"></path>
</g>
</svg>

View File

@ -0,0 +1,8 @@
title: $:/core/images/unlocked-padlock
tags: $:/tags/Image
<svg class="tw-image-unlocked-padlock tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<path d="M48.6266053,64 L105,64 L105,96.0097716 C105,113.673909 90.6736461,128 73.001193,128 L55.998807,128 C38.3179793,128 24,113.677487 24,96.0097716 L24,64 L30.136303,64 C19.6806213,51.3490406 2.77158986,28.2115132 25.8366966,8.85759246 C50.4723026,-11.8141335 71.6711028,13.2108337 81.613302,25.0594855 C91.5555012,36.9081373 78.9368488,47.4964439 69.1559674,34.9513593 C59.375086,22.4062748 47.9893192,10.8049522 35.9485154,20.9083862 C23.9077117,31.0118202 34.192312,43.2685325 44.7624679,55.8655518 C47.229397,58.805523 48.403443,61.5979188 48.6266053,64 Z M67.7315279,92.3641717 C70.8232551,91.0923621 73,88.0503841 73,84.5 C73,79.8055796 69.1944204,76 64.5,76 C59.8055796,76 56,79.8055796 56,84.5 C56,87.947435 58.0523387,90.9155206 61.0018621,92.2491029 L55.9067479,115.020857 L72.8008958,115.020857 L67.7315279,92.3641717 L67.7315279,92.3641717 Z"></path>
</g>
</svg>

View File

@ -4,23 +4,57 @@ AdvancedSearch/Caption: advanced search
AdvancedSearch/Hint: Advanced search
Cancel/Caption: cancel
Cancel/Hint: Cancel editing this tiddler
Clone/Caption: clone
Clone/Hint: Clone this tiddler
Close/Caption: close
Close/Hint: Close this tiddler
CloseAll/Caption: close all
CloseAll/Hint: Close all tiddlers
CloseOthers/Caption: close others
CloseOthers/Hint: Close other tiddlers
ControlPanel/Caption: control panel
ControlPanel/Hint: Open control panel
Delete/Caption: delete
Delete/Hint: Delete this tiddler
Edit/Caption: edit
Edit/Hint: Edit this tiddler
Encryption/Caption: encryption
Encryption/Hint: Set or clear a password for saving this wiki
Encryption/ClearPassword/Caption: clear password
Encryption/ClearPassword/Hint: Clear the password and save this wiki without encryption
Encryption/SetPassword/Caption: set password
Encryption/SetPassword/Hint: Set a password for saving this wiki with encryption
FullScreen/Caption: full-screen
FullScreen/Hint: Enter or leave full-screen mode
Import/Caption: import
Import/Hint: Import files
Info/Caption: info
Info/Hint: Show information for this tiddler
Home/Caption: home
Home/Hint: Open the default tiddlers
Language/Caption: language
Language/Hint: Choose the user interface language
NewTiddler/Caption: new tiddler
NewTiddler/Hint: Create a new tiddler
More/Caption: more
More/Hint: More actions
Permalink/Caption: permalink
Permalink/Hint: Set browser address bar to a direct link to this tiddler
Permaview/Caption: permaview
Permaview/Hint: Set browser address bar to a direct link to all the tiddlers in this story
Refresh/Caption: refresh
Refresh/Hint: Perform a full refresh of the wiki
Save/Caption: save
Save/Hint: Save this tiddler
SaveWiki/Caption: save changes
SaveWiki/Hint: Save changes
StoryView/Caption: storyview
StoryView/Hint: Choose the story visualisation
HideSideBar/Caption: hide sidebar
HideSideBar/Hint: Hide sidebar
ShowSideBar/Caption: show sidebar
ShowSideBar/Hint: Show sidebar
TagManager/Caption: tag manager
TagManager/Hint: Open tag manager
Theme/Caption: theme
Theme/Hint: Choose the display theme

View File

@ -1,6 +1,10 @@
title: $:/language/ControlPanel/
Advanced/Caption: Advanced
Advanced/EditorTypes/Caption: Editor Types
Advanced/EditorTypes/Editor/Caption: Editor
Advanced/EditorTypes/Hint: These tiddlers determine which editor is used to edit specific tiddler types.
Advanced/EditorTypes/Type/Caption: Type
Advanced/Hint: Internal information about this TiddlyWiki
Advanced/LoadedModules/Caption: Loaded Modules
Advanced/LoadedModules/Hint: These are the currently loaded tiddler modules linked to their source tiddlers. Any italicised modules lack a source tiddler, typically because they were setup during the boot process.
@ -15,6 +19,10 @@ Advanced/Settings/NavigationHistory/Caption: Navigation History
Advanced/Settings/NavigationHistory/Hint: Update browser history when navigating to a tiddler:
Advanced/Settings/NavigationHistory/No/Description: Do not update history
Advanced/Settings/NavigationHistory/Yes/Description: Update history
Advanced/Settings/ToolbarButtons/Caption: Toolbar Buttons
Advanced/Settings/ToolbarButtons/Hint: Default toolbar button appearance:
Advanced/Settings/ToolbarButtons/Text/Description: Include text
Advanced/Settings/ToolbarButtons/Icons/Description: Include icon
Advanced/TiddlerFields/Caption: Tiddler Fields
Advanced/TiddlerFields/Hint: This is the full set of TiddlerFields in use in this wiki (including system tiddlers but excluding shadow tiddlers).
Appearance/Caption: Appearance
@ -32,6 +40,14 @@ Appearance/StoryView/Caption: Story View
Appearance/StoryView/Prompt: Current view:
Appearance/Theme/Caption: Theme
Appearance/Theme/Prompt: Current theme:
Appearance/Toolbars/Caption: Toolbars
Appearance/Toolbars/Hint: Select which toolbar buttons are displayed
Appearance/Toolbars/EditToolbar/Caption: Edit Toolbar
Appearance/Toolbars/EditToolbar/Hint: Choose which buttons are displayed for tiddlers in edit mode
Appearance/Toolbars/ViewToolbar/Caption: View Toolbar
Appearance/Toolbars/ViewToolbar/Hint: Choose which buttons are displayed for tiddlers in view mode
Appearance/Toolbars/PageControls/Caption: Page Toolbar
Appearance/Toolbars/PageControls/Hint: Choose which buttons are displayed on the main page toolbar
Basics/AnimDuration/Prompt: Animation duration:
Basics/Caption: Basics
Basics/DefaultTiddlers/BottomHint: Use &#91;&#91;double square brackets&#93;&#93; for titles with spaces. Or you can choose to <$button set="$:/DefaultTiddlers" setTo="[list[$:/StoryList]]">retain story ordering</$button>
@ -48,9 +64,12 @@ Basics/Title/Prompt: Title of this ~TiddlyWiki:
Basics/Username/Prompt: Username for signing edits:
Basics/Version/Prompt: ~TiddlyWiki version:
Plugins/Caption: Plugins
Plugins/Fields/Description: Description
Plugins/Fields/Title: Title
Plugins/Fields/Version: Version
Plugins/Disable/Caption: disable
Plugins/Disable/Hint: Disable this plugin when reloading page
Plugins/Disabled/Status: (disabled)
Plugins/Empty/Hint: None
Plugins/Enable/Caption: enable
Plugins/Enable/Hint: Enable this plugin when reloading page
Plugins/Language/Prompt: Languages
Plugins/Plugin/Prompt: Plugins
Plugins/Theme/Prompt: Themes

View File

@ -6,6 +6,7 @@ alert-highlight: Alert highlight
alert-muted-foreground: Alert muted foreground
background: General background
blockquote-bar: Blockquote bar
dirty-indicator: Unsaved changes indicator
code-background: Code background
code-border: Code border
code-foreground: Code foreground

View File

@ -0,0 +1,14 @@
title: $:/language/Import/
Listing/Cancel/Caption: Cancel
Listing/Hint: These tiddlers are ready to import:
Listing/Import/Caption: Import
Listing/Select/Caption: Select
Listing/Status/Caption: Status
Listing/Title/Caption: Title
Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin
Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>)
Upgrader/Plugins/Upgraded: Upgraded plugin from <<incoming>> to <<upgraded>>
Upgrader/State/Suppressed: Blocked temporary state tiddler
Upgrader/System/Suppressed: Blocked system tiddler
Upgrader/ThemeTweaks/Created: Migrated theme tweak from <$text text=<<from>>/>

View File

@ -8,6 +8,7 @@ ConfirmCancelTiddler: Do you wish to discard changes to the tiddler "<$text text
ConfirmDeleteTiddler: Do you wish to delete the tiddler "<$text text=<<title>>/>"?
ConfirmOverwriteTiddler: Do you wish to overwrite the tiddler "<$text text=<<title>>/>"?
ConfirmEditShadowTiddler: You are about to edit a ShadowTiddler. Any changes will override the default system making future upgrades non-trivial. Are you sure you want to edit "<$text text=<<title>>/>"?
DropMessage: Drop here (or click escape to cancel)
InvalidFieldName: Illegal characters in field name "<$text text=<<fieldName>>/>". Fields can only contain lowercase letters, digits and the characters underscore (`_`), hyphen (`-`) and period (`.`)
MissingTiddler/Hint: Missing tiddler "<$text text=<<currentTiddler>>/>" - click {{$:/core/images/edit-button}} to create
RecentChanges/DateFormat: DDth MMM YYYY
@ -30,3 +31,4 @@ TagManager/Colour/Heading: Colour
TagManager/Count/Heading: Count
TagManager/Icon/Heading: Icon
TagManager/Tag/Heading: Tag
UnsavedChangesWarning: You have unsaved changes in TiddlyWiki

View File

@ -1,6 +1,7 @@
title: $:/language/SideBar/
All/Caption: All
Contents/Caption: Contents
Drafts/Caption: Drafts
Missing/Caption: Missing
More/Caption: More
@ -10,8 +11,6 @@ Recent/Caption: Recent
Shadows/Caption: Shadows
System/Caption: System
Tags/Caption: Tags
Tags/TagManager/Caption: Tag Manager
Tags/Untagged/Caption: untagged
Tools/Caption: Tools
Types/Caption: Types

View File

@ -18,3 +18,4 @@ References/Caption: References
References/Empty: No tiddlers link to this one
Tagging/Caption: Tagging
Tagging/Empty: No tiddlers are tagged with this one
Tools/Caption: Tools

View File

@ -0,0 +1,13 @@
title: $:/languages/en-GB/icon
type: image/svg+xml
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30" width="1200" height="600">
<clipPath id="t">
<path d="M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"/>
</clipPath>
<path d="M0,0 v30 h60 v-30 z" fill="#00247d"/>
<path d="M0,0 L60,30 M60,0 L0,30" stroke="#fff" stroke-width="6"/>
<path d="M0,0 L60,30 M60,0 L0,30" clip-path="url(#t)" stroke="#cf142b" stroke-width="4"/>
<path d="M30,0 v30 M0,15 h60" stroke="#fff" stroke-width="10"/>
<path d="M30,0 v30 M0,15 h60" stroke="#cf142b" stroke-width="6"/>
</svg>

View File

@ -33,7 +33,10 @@ var Commander = function(commandTokens,callback,wiki,streams) {
Add a string of tokens to the command queue
*/
Commander.prototype.addCommandTokens = function(commandTokens) {
Array.prototype.push.apply(this.commandTokens,commandTokens);
var params = commandTokens.slice(0);
params.unshift(0);
params.unshift(this.nextToken);
Array.prototype.splice.apply(this.commandTokens,params);
};
/*

View File

@ -34,7 +34,7 @@ Command.prototype.execute = function() {
for(var editionIndex=0; editionIndex<editions.length; editionIndex++) {
var editionName = editions[editionIndex];
// Check the edition exists
var editionPath = path.resolve($tw.boot.corePath,$tw.config.editionsPath) + path.sep + editionName;
var editionPath = $tw.findLibraryItem(editionName,$tw.getLibraryItemSearchPaths($tw.config.editionsPath,$tw.config.editionsEnvVar));
if(!$tw.utils.isDirectory(editionPath)) {
return "Edition '" + editionName + "' not found";
}

View File

@ -0,0 +1,70 @@
/*\
title: $:/core/modules/commands/makelibrary.js
type: application/javascript
module-type: command
Command to pack all of the plugins in the library into a plugin tiddler of type "library"
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
name: "makelibrary",
synchronous: true
};
var UPGRADE_LIBRARY_TITLE = "$:/UpgradeLibrary";
var Command = function(params,commander,callback) {
this.params = params;
this.commander = commander;
this.callback = callback;
};
Command.prototype.execute = function() {
var wiki = this.commander.wiki,
fs = require("fs"),
path = require("path"),
upgradeLibraryTitle = this.params[0] || UPGRADE_LIBRARY_TITLE,
tiddlers = {};
// Collect up the library plugins
var collectPlugins = function(folder) {
var pluginFolders = fs.readdirSync(folder);
for(var p=0; p<pluginFolders.length; p++) {
if(!$tw.boot.excludeRegExp.test(pluginFolders[p])) {
pluginFields = $tw.loadPluginFolder(path.resolve(folder,"./" + pluginFolders[p]));
if(pluginFields && pluginFields.title) {
tiddlers[pluginFields.title] = pluginFields;
}
}
}
},
collectPublisherPlugins = function(folder) {
var publisherFolders = fs.readdirSync(folder);
for(var t=0; t<publisherFolders.length; t++) {
if(!$tw.boot.excludeRegExp.test(publisherFolders[t])) {
collectPlugins(path.resolve(folder,"./" + publisherFolders[t]));
}
}
};
collectPublisherPlugins(path.resolve($tw.boot.corePath,$tw.config.pluginsPath));
collectPublisherPlugins(path.resolve($tw.boot.corePath,$tw.config.themesPath));
collectPlugins(path.resolve($tw.boot.corePath,$tw.config.languagesPath));
// Save the upgrade library tiddler
var pluginFields = {
title: upgradeLibraryTitle,
type: "application/json",
"plugin-type": "library",
"text": JSON.stringify({tiddlers: tiddlers},null,$tw.config.preferences.jsonSpaces)
};
wiki.addTiddler(new $tw.Tiddler(pluginFields));
return null;
};
exports.Command = Command;
})();

View File

@ -33,7 +33,7 @@ function parseFilterOperation(operators,filterString,p) {
operator.prefix = filterString.charAt(p++);
}
// Get the operator name
var nextBracketPos = filterString.substring(p).search(/[\[\{\/]/);
var nextBracketPos = filterString.substring(p).search(/[\[\{<\/]/);
if(nextBracketPos === -1) {
throw "Missing [ in filter expression";
}
@ -54,24 +54,28 @@ function parseFilterOperation(operators,filterString,p) {
p = nextBracketPos + 1;
switch (bracket) {
case '{': // Curly brackets
operator.indirect = true;
nextBracketPos = filterString.indexOf('}',p);
break;
case '[': // Square brackets
nextBracketPos = filterString.indexOf(']',p);
break;
case '/': // regexp brackets
var rex = /^((?:[^\\\/]*|\\.)*)\/(?:\(([mygi]+)\))?/g,
rexMatch = rex.exec(filterString.substring(p));
if(rexMatch) {
operator.regexp = new RegExp(rexMatch[1], rexMatch[2]);
nextBracketPos = p + rex.lastIndex - 1;
}
else {
throw "Unterminated regular expression in filter expression";
}
break;
case "{": // Curly brackets
operator.indirect = true;
nextBracketPos = filterString.indexOf("}",p);
break;
case "[": // Square brackets
nextBracketPos = filterString.indexOf("]",p);
break;
case "<": // Angle brackets
operator.variable = true;
nextBracketPos = filterString.indexOf(">",p);
break;
case "/": // regexp brackets
var rex = /^((?:[^\\\/]*|\\.)*)\/(?:\(([mygi]+)\))?/g,
rexMatch = rex.exec(filterString.substring(p));
if(rexMatch) {
operator.regexp = new RegExp(rexMatch[1], rexMatch[2]);
nextBracketPos = p + rex.lastIndex - 1;
}
else {
throw "Unterminated regular expression in filter expression";
}
break;
}
if(nextBracketPos === -1) {
@ -193,6 +197,9 @@ exports.compileFilter = function(filterString) {
if(operator.indirect) {
operand = self.getTextReference(operator.operand,"",currTiddlerTitle);
}
if(operator.variable) {
operand = widget.getVariable(operator.operand,{defaultValue: ""});
}
results = operatorFunction(accumulator,{
operator: operator.operator,
operand: operand,

View File

@ -18,7 +18,7 @@ Export our filter function
exports.plugintiddlers = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
var pluginInfo = options.wiki.getPluginInfo(title);
var pluginInfo = options.wiki.getPluginInfo(title) || options.wiki.getTiddlerData(title,{tiddlers:[]});
if(pluginInfo) {
$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {
results.push(title);

View File

@ -0,0 +1,24 @@
/*\
title: $:/core/modules/info/platform.js
type: application/javascript
module-type: info
Initialise basic platform $:/info/ tiddlers
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.getInfoTiddlerFields = function() {
var mapBoolean = function(value) {return value ? "yes" : "no"},
infoTiddlerFields = [];
// Basics
infoTiddlerFields.push({title: "$:/info/browser", text: mapBoolean(!!$tw.browser)});
infoTiddlerFields.push({title: "$:/info/node", text: mapBoolean(!!$tw.node)});
return infoTiddlerFields;
};
})();

View File

@ -99,11 +99,13 @@ exports.parseStringLiteral = function(source,pos) {
type: "string",
start: pos
};
var reString = /(?:"([^"]*)")|(?:'([^']*)')/g;
var reString = /(?:"""([\s\S]*?)"""|"([^"]*)")|(?:'([^']*)')/g;
reString.lastIndex = pos;
var match = reString.exec(source);
if(match && match.index === pos) {
node.value = match[1] === undefined ? match[2] : match[1];
node.value = match[1] !== undefined ? match[1] :(
match[2] !== undefined ? match[2] : match[3]
);
node.end = pos + match[0].length;
return node;
} else {
@ -120,7 +122,7 @@ exports.parseMacroParameter = function(source,pos) {
start: pos
};
// Define our regexp
var reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^\s>"'=]+)))/g;
var reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^\s>"'=]+)))/g;
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
// Look for the parameter
@ -134,7 +136,9 @@ exports.parseMacroParameter = function(source,pos) {
token.match[3] !== undefined ? token.match[3] : (
token.match[4] !== undefined ? token.match[4] : (
token.match[5] !== undefined ? token.match[5] : (
""
token.match[6] !== undefined ? token.match[6] : (
""
)
)
)
)

View File

@ -1,79 +0,0 @@
/*\
title: $:/core/modules/parsers/wikiparser/rules/emphasis.js
type: application/javascript
module-type: wikirule
Wiki text inline rule for emphasis. For example:
```
This is ''bold'' text
This is //italic// text
This is __underlined__ text
This is ^^superscript^^ text
This is ,,subscript,, text
This is ~~strikethrough~~ text
```
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "emphasis";
exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /''|\/\/|__|\^\^|,,|~~/mg;
};
exports.parse = function() {
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
// Figure out which element and closing regexp to use
var tag,reEnd;
switch(this.match[0]) {
case "''": // Bold
tag = "strong";
reEnd = /''/mg;
break;
case "//": // Italics
tag = "em";
reEnd = /\/\//mg;
break;
case "__": // Underline
tag = "u";
reEnd = /__/mg;
break;
case "^^": // Superscript
tag = "sup";
reEnd = /\^\^/mg;
break;
case ",,": // Subscript
tag = "sub";
reEnd = /,,/mg;
break;
case "~~": // Strikethrough
tag = "strike";
reEnd = /~~/mg;
break;
}
// Parse the run including the terminator
var tree = this.parser.parseInlineRun(reEnd,{eatTerminator: true});
// Return the classed span
return [{
type: "element",
tag: tag,
children: tree
}];
};
})();

View File

@ -0,0 +1,50 @@
/*\
title: $:/core/modules/parsers/wikiparser/rules/emphasis/bold.js
type: application/javascript
module-type: wikirule
Wiki text inline rule for emphasis - bold. For example:
```
This is ''bold'' text
```
This wikiparser can be modified using the rules eg:
```
\rules except bold
\rules only bold
```
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "bold";
exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /''/mg;
};
exports.parse = function() {
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
// Parse the run including the terminator
var tree = this.parser.parseInlineRun(/''/mg,{eatTerminator: true});
// Return the classed span
return [{
type: "element",
tag: "strong",
children: tree
}];
};
})();

View File

@ -0,0 +1,50 @@
/*\
title: $:/core/modules/parsers/wikiparser/rules/emphasis/italic.js
type: application/javascript
module-type: wikirule
Wiki text inline rule for emphasis - italic. For example:
```
This is //italic// text
```
This wikiparser can be modified using the rules eg:
```
\rules except italic
\rules only italic
```
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "italic";
exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /\/\//mg;
};
exports.parse = function() {
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
// Parse the run including the terminator
var tree = this.parser.parseInlineRun(/\/\//mg,{eatTerminator: true});
// Return the classed span
return [{
type: "element",
tag: "em",
children: tree
}];
};
})();

View File

@ -0,0 +1,50 @@
/*\
title: $:/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js
type: application/javascript
module-type: wikirule
Wiki text inline rule for emphasis - strikethrough. For example:
```
This is ~~strikethrough~~ text
```
This wikiparser can be modified using the rules eg:
```
\rules except strikethrough
\rules only strikethrough
```
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "strikethrough";
exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /~~/mg;
};
exports.parse = function() {
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
// Parse the run including the terminator
var tree = this.parser.parseInlineRun(/~~/mg,{eatTerminator: true});
// Return the classed span
return [{
type: "element",
tag: "strike",
children: tree
}];
};
})();

View File

@ -0,0 +1,50 @@
/*\
title: $:/core/modules/parsers/wikiparser/rules/emphasis/subscript.js
type: application/javascript
module-type: wikirule
Wiki text inline rule for emphasis - subscript. For example:
```
This is ,,subscript,, text
```
This wikiparser can be modified using the rules eg:
```
\rules except subscript
\rules only subscript
```
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "subscript";
exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /,,/mg;
};
exports.parse = function() {
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
// Parse the run including the terminator
var tree = this.parser.parseInlineRun(/,,/mg,{eatTerminator: true});
// Return the classed span
return [{
type: "element",
tag: "sub",
children: tree
}];
};
})();

View File

@ -0,0 +1,50 @@
/*\
title: $:/core/modules/parsers/wikiparser/rules/emphasis/superscript.js
type: application/javascript
module-type: wikirule
Wiki text inline rule for emphasis - superscript. For example:
```
This is ^^superscript^^ text
```
This wikiparser can be modified using the rules eg:
```
\rules except superscript
\rules only superscript
```
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "superscript";
exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /\^\^/mg;
};
exports.parse = function() {
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
// Parse the run including the terminator
var tree = this.parser.parseInlineRun(/\^\^/mg,{eatTerminator: true});
// Return the classed span
return [{
type: "element",
tag: "sup",
children: tree
}];
};
})();

View File

@ -0,0 +1,50 @@
/*\
title: $:/core/modules/parsers/wikiparser/rules/emphasis/underscore.js
type: application/javascript
module-type: wikirule
Wiki text inline rule for emphasis - underscore. For example:
```
This is __underscore__ text
```
This wikiparser can be modified using the rules eg:
```
\rules except underscore
\rules only underscore
```
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "underscore";
exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /__/mg;
};
exports.parse = function() {
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
// Parse the run including the terminator
var tree = this.parser.parseInlineRun(/__/mg,{eatTerminator: true});
// Return the classed span
return [{
type: "element",
tag: "u",
children: tree
}];
};
})();

View File

@ -48,7 +48,7 @@ exports.parse = function() {
// Advance the parser position to past the tag
this.parser.pos = tag.end;
// Check for an immediately following double linebreak
var hasLineBreak = !tag.isSelfClosing && !!$tw.utils.parseTokenRegExp(this.parser.source,this.parser.pos,/([^\S\n]*\r?\n(?:[^\S\n]*\r?\n|$))/g);
var hasLineBreak = !tag.isSelfClosing && !!$tw.utils.parseTokenRegExp(this.parser.source,this.parser.pos,/([^\S\n\r]*\r?\n(?:[^\S\n\r]*\r?\n|$))/g);
// Set whether we're in block mode
tag.isBlock = this.is.block || hasLineBreak;
// Parse the body if we need to
@ -125,7 +125,7 @@ exports.parseTag = function(source,pos,options) {
pos = token.end;
// Check for a required line break
if(options.requireLineBreak) {
token = $tw.utils.parseTokenRegExp(source,pos,/([^\S\n]*\r?\n(?:[^\S\n]*\r?\n|$))/g);
token = $tw.utils.parseTokenRegExp(source,pos,/([^\S\n\r]*\r?\n(?:[^\S\n\r]*\r?\n|$))/g);
if(!token) {
return null;
}

View File

@ -35,12 +35,12 @@ exports.parse = function() {
// Move past the macro call
this.parser.pos = this.matchRegExp.lastIndex;
var params = [],
reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg,
reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg,
paramMatch = reParam.exec(paramString);
while(paramMatch) {
// Process this parameter
var paramInfo = {
value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]
value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] || paramMatch[6]
};
if(paramMatch[1]) {
paramInfo.name = paramMatch[1];

View File

@ -35,12 +35,12 @@ exports.parse = function() {
// Move past the macro call
this.parser.pos = this.matchRegExp.lastIndex;
var params = [],
reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg,
reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg,
paramMatch = reParam.exec(paramString);
while(paramMatch) {
// Process this parameter
var paramInfo = {
value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]
value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]|| paramMatch[6]
};
if(paramMatch[1]) {
paramInfo.name = paramMatch[1];

View File

@ -27,7 +27,7 @@ Instantiate parse rule
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /^\\define\s+([^(\s]+)\(\s*([^)]*)\)(\r?\n)?/mg;
this.matchRegExp = /^\\define\s+([^(\s]+)\(\s*([^)]*)\)(\s*\r?\n)?/mg;
};
/*
@ -40,12 +40,12 @@ exports.parse = function() {
var paramString = this.match[2],
params = [];
if(paramString !== "") {
var reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))?/mg,
var reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))?/mg,
paramMatch = reParam.exec(paramString);
while(paramMatch) {
// Save the parameter details
var paramInfo = {name: paramMatch[1]},
defaultValue = paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5];
defaultValue = paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] || paramMatch[6];
if(defaultValue) {
paramInfo["default"] = defaultValue;
}
@ -58,7 +58,7 @@ exports.parse = function() {
var reEnd;
if(this.match[3]) {
// If so, the end of the body is marked with \end
reEnd = /(\r?\n\\end\r?\n)/mg;
reEnd = /(\r?\n\\end(?:$|\r?\n))/mg;
} else {
// Otherwise, the end of the definition is marked by the end of the line
reEnd = /(\r?\n)/mg;

View File

@ -24,10 +24,10 @@ exports.name = "wikilink";
exports.types = {inline: true};
var textPrimitives = {
upperLetter: "[A-Z\u00c0-\u00de\u0150\u0170]",
lowerLetter: "[a-z0-9_\\-\u00df-\u00ff\u0151\u0171]",
anyLetter: "[A-Za-z0-9_\\-\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]",
anyLetterStrict: "[A-Za-z0-9\u00c0-\u00de\u00df-\u00ff\u0150\u0170\u0151\u0171]"
upperLetter: "[A-Z\u00c0-\u00d6\u00d8-\u00de\u0150\u0170]",
lowerLetter: "[a-z0-9\u00df-\u00f6\u00f8-\u00ff\u0151\u0171]",
anyLetter: "[A-Za-z0-9\u00c0-\u00d6\u00d8-\u00de\u00df-\u00f6\u00f8-\u00ff\u0150\u0170\u0151\u0171]",
blockPrefixLetters: "[A-Za-z0-9\-_\u00c0-\u00d6\u00d8-\u00de\u00df-\u00f6\u00f8-\u00ff\u0150\u0170\u0151\u0171]"
};
textPrimitives.unWikiLink = "~";
@ -54,9 +54,9 @@ exports.parse = function() {
if(linkText.substr(0,1) === textPrimitives.unWikiLink) {
return [{type: "text", text: linkText.substr(1)}];
}
// If the link has been preceded with a letter then don't treat it as a link
// If the link has been preceded with a blocked letter then don't treat it as a link
if(this.match.index > 0) {
var preRegExp = new RegExp(textPrimitives.anyLetterStrict,"mg");
var preRegExp = new RegExp(textPrimitives.blockPrefixLetters,"mg");
preRegExp.lastIndex = this.match.index-1;
var preMatch = preRegExp.exec(this.parser.source);
if(preMatch && preMatch.index === this.match.index-1) {

View File

@ -0,0 +1,177 @@
/*\
title: $:/core/modules/saver-handler.js
type: application/javascript
module-type: global
The saver handler tracks changes to the store and handles saving the entire wiki via saver modules.
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Instantiate the saver handler with the following options:
wiki: wiki to be synced
dirtyTracking: true if dirty tracking should be performed
*/
function SaverHandler(options) {
var self = this;
this.wiki = options.wiki;
this.dirtyTracking = options.dirtyTracking;
// Make a logger
this.logger = new $tw.utils.Logger("saver-handler");
// Initialise our savers
if($tw.browser) {
this.initSavers();
}
// Only do dirty tracking if required
if(this.dirtyTracking) {
// Compile the dirty tiddler filter
this.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter));
// Count of tiddlers that have been changed but not yet saved
this.numTasksInQueue = 0;
// Listen out for changes to tiddlers
this.wiki.addEventListener("change",function(changes) {
var filteredChanges = self.filterFn.call(self.wiki,function(callback) {
$tw.utils.each(changes,function(change,title) {
var tiddler = self.wiki.getTiddler(title);
callback(tiddler,title);
});
});
self.numTasksInQueue += filteredChanges.length;
self.updateDirtyStatus();
});
// Browser event handlers
if($tw.browser) {
// Set up our beforeunload handler
window.addEventListener("beforeunload",function(event) {
var confirmationMessage = undefined;
if(self.isDirty()) {
confirmationMessage = $tw.language.getString("UnsavedChangesWarning");
event.returnValue = confirmationMessage; // Gecko
}
return confirmationMessage;
});
}
}
// Install the save action handlers
if($tw.browser) {
$tw.rootWidget.addEventListener("tw-save-wiki",function(event) {
self.saveWiki({
template: event.param,
downloadType: "text/plain"
});
});
$tw.rootWidget.addEventListener("tw-auto-save-wiki",function(event) {
self.saveWiki({
method: "autosave",
template: event.param,
downloadType: "text/plain"
});
});
$tw.rootWidget.addEventListener("tw-download-file",function(event) {
self.saveWiki({
method: "download",
template: event.param,
downloadType: "text/plain"
});
});
}
}
SaverHandler.prototype.titleSyncFilter = "$:/config/SyncFilter";
SaverHandler.prototype.titleAutoSave = "$:/config/AutoSave";
SaverHandler.prototype.titleSavedNotification = "$:/language/Notifications/Save/Done";
/*
Select the appropriate saver modules and set them up
*/
SaverHandler.prototype.initSavers = function(moduleType) {
moduleType = moduleType || "saver";
// Instantiate the available savers
this.savers = [];
var self = this;
$tw.modules.forEachModuleOfType(moduleType,function(title,module) {
if(module.canSave(self)) {
self.savers.push(module.create(self.wiki));
}
});
// Sort the savers into priority order
this.savers.sort(function(a,b) {
if(a.info.priority < b.info.priority) {
return -1;
} else {
if(a.info.priority > b.info.priority) {
return +1;
} else {
return 0;
}
}
});
};
/*
Save the wiki contents. Options are:
method: "save" or "download"
template: the tiddler containing the template to save
downloadType: the content type for the saved file
*/
SaverHandler.prototype.saveWiki = function(options) {
options = options || {};
var self = this,
method = options.method || "save",
template = options.template || "$:/core/save/all",
downloadType = options.downloadType || "text/plain",
text = this.wiki.renderTiddler(downloadType,template),
callback = function(err) {
if(err) {
alert("Error while saving:\n\n" + err);
} else {
$tw.notifier.display(self.titleSavedNotification);
if(options.callback) {
options.callback();
}
}
};
// Ignore autosave if disabled
if(method === "autosave" && this.wiki.getTiddlerText(this.titleAutoSave,"yes") !== "yes") {
return false;
}
// Call the highest priority saver that supports this method
for(var t=this.savers.length-1; t>=0; t--) {
var saver = this.savers[t];
if(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback)) {
this.logger.log("Saving wiki with method",method,"through saver",saver.info.name);
// Clear the task queue if we're saving (rather than downloading)
if(method !== "download") {
this.numTasksInQueue = 0;
this.updateDirtyStatus();
}
return true;
}
}
return false;
};
/*
Checks whether the wiki is dirty (ie the window shouldn't be closed)
*/
SaverHandler.prototype.isDirty = function() {
return this.numTasksInQueue > 0;
};
/*
Update the document body with the class "tw-dirty" if the wiki has unsaved/unsynced changes
*/
SaverHandler.prototype.updateDirtyStatus = function() {
if($tw.browser) {
$tw.utils.toggleClass(document.body,"tw-dirty",this.isDirty());
}
};
exports.SaverHandler = SaverHandler;
})();

View File

@ -0,0 +1,48 @@
/*\
title: $:/core/modules/startup/info.js
type: application/javascript
module-type: startup
Initialise $:/info tiddlers via $:/temp/info-plugin pseudo-plugin
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
// Export name and synchronous status
exports.name = "info";
exports.before = ["startup"];
exports.after = ["load-modules"];
exports.synchronous = true;
exports.startup = function() {
// Collect up the info tiddlers
var infoTiddlerFields = {};
// Give each info module a chance to fill in as many info tiddlers as they want
$tw.modules.forEachModuleOfType("info",function(title,moduleExports) {
if(moduleExports && moduleExports.getInfoTiddlerFields) {
var tiddlerFieldsArray = moduleExports.getInfoTiddlerFields(infoTiddlerFields);
$tw.utils.each(tiddlerFieldsArray,function(fields) {
if(fields) {
infoTiddlerFields[fields.title] = fields;
}
});
}
});
// Bake the info tiddlers into a plugin
var fields = {
title: "$:/temp/info-plugin",
type: "application/json",
"plugin-type": "info",
text: JSON.stringify({tiddlers: infoTiddlerFields},null,$tw.config.preferences.jsonSpaces)
};
$tw.wiki.addTiddler(new $tw.Tiddler(fields));
$tw.wiki.readPluginInfo();
$tw.wiki.registerPluginTiddlers("info");
$tw.wiki.unpackPluginTiddlers();
};
})();

View File

@ -15,7 +15,7 @@ Password handling
// Export name and synchronous status
exports.name = "password";
exports.platforms = ["browser"];
exports.after = ["rootwidget"];
exports.after = ["startup"];
exports.synchronous = true;
exports.startup = function() {

View File

@ -15,21 +15,11 @@ Setup the root widget and the core root widget handlers
// Export name and synchronous status
exports.name = "rootwidget";
exports.platforms = ["browser"];
exports.after = ["load-modules"];
exports.after = ["startup"];
exports.before = ["story"];
exports.synchronous = true;
var widget = require("$:/core/modules/widgets/widget.js");
exports.startup = function() {
// Create a root widget for attaching event handlers. By using it as the parentWidget for another widget tree, one can reuse the event handlers
$tw.rootWidget = new widget.widget({
type: "widget",
children: []
},{
wiki: $tw.wiki,
document: document
});
// Install the modal message mechanism
$tw.modal = new $tw.utils.Modal($tw.wiki);
$tw.rootWidget.addEventListener("tw-modal",function(event) {
@ -45,27 +35,16 @@ exports.startup = function() {
$tw.rootWidget.addEventListener("tw-scroll",function(event) {
$tw.pageScroller.handleEvent(event);
});
// Install the save action handlers
$tw.rootWidget.addEventListener("tw-save-wiki",function(event) {
$tw.syncer.saveWiki({
template: event.param,
downloadType: "text/plain"
var fullscreen = $tw.utils.getFullScreenApis();
if(fullscreen) {
$tw.rootWidget.addEventListener("tw-full-screen",function(event) {
if(document[fullscreen._fullscreenElement]) {
document[fullscreen._exitFullscreen]();
} else {
document.documentElement[fullscreen._requestFullscreen](Element.ALLOW_KEYBOARD_INPUT);
}
});
});
$tw.rootWidget.addEventListener("tw-auto-save-wiki",function(event) {
$tw.syncer.saveWiki({
method: "autosave",
template: event.param,
downloadType: "text/plain"
});
});
$tw.rootWidget.addEventListener("tw-download-file",function(event) {
$tw.syncer.saveWiki({
method: "download",
template: event.param,
downloadType: "text/plain"
});
});
}
// If we're being viewed on a data: URI then give instructions for how to save
if(document.location.protocol === "data:") {
$tw.rootWidget.dispatchEvent({

View File

@ -3,7 +3,7 @@ title: $:/core/modules/startup.js
type: application/javascript
module-type: startup
This is the main application logic for both the client and server
Miscellaneous startup logic for both the client and server.
\*/
(function(){
@ -20,6 +20,8 @@ exports.synchronous = true;
// Set to `true` to enable performance instrumentation
var PERFORMANCE_INSTRUMENTATION = false;
var widget = require("$:/core/modules/widgets/widget.js");
exports.startup = function() {
var modules,n,m,f;
if($tw.browser) {
@ -50,19 +52,31 @@ exports.startup = function() {
});
// Clear outstanding tiddler store change events to avoid an unnecessary refresh cycle at startup
$tw.wiki.clearTiddlerEventQueue();
// Set up the syncer object
$tw.syncer = new $tw.Syncer({wiki: $tw.wiki});
// Create a root widget for attaching event handlers. By using it as the parentWidget for another widget tree, one can reuse the event handlers
if($tw.browser) {
$tw.rootWidget = new widget.widget({
type: "widget",
children: []
},{
wiki: $tw.wiki,
document: document
});
}
// Find a working syncadaptor
$tw.syncadaptor = undefined;
$tw.modules.forEachModuleOfType("syncadaptor",function(title,module) {
if(!$tw.syncadaptor && module.adaptorClass) {
$tw.syncadaptor = new module.adaptorClass({wiki: $tw.wiki});
}
});
// Set up the syncer object if we've got a syncadaptor
if($tw.syncadaptor) {
$tw.syncer = new $tw.Syncer({wiki: $tw.wiki, syncadaptor: $tw.syncadaptor});
}
// Setup the saver handler
$tw.saverHandler = new $tw.SaverHandler({wiki: $tw.wiki, dirtyTracking: !$tw.syncadaptor});
// Host-specific startup
if($tw.browser) {
// Set up our beforeunload handler
window.addEventListener("beforeunload",function(event) {
var confirmationMessage = undefined;
if($tw.syncer.isDirty()) {
confirmationMessage = "You have unsaved changes in TiddlyWiki";
event.returnValue = confirmationMessage; // Gecko
}
return confirmationMessage;
});
// Install the popup manager
$tw.popup = new $tw.utils.Popup({
rootElement: document.body

View File

@ -35,7 +35,10 @@ exports.startup = function() {
// Set up location hash update
$tw.wiki.addEventListener("change",function(changes) {
if($tw.utils.hop(changes,DEFAULT_STORY_TITLE) || $tw.utils.hop(changes,DEFAULT_HISTORY_TITLE)) {
updateLocationHash();
updateLocationHash({
updateAddressBar: $tw.wiki.getTiddlerText(CONFIG_UPDATE_ADDRESS_BAR,"permaview").trim(),
updateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,"no").trim()
});
}
});
// Listen for changes to the browser location hash
@ -46,12 +49,34 @@ exports.startup = function() {
openStartupTiddlers({defaultToCurrentStory: true});
}
},false)
// Listen for the tw-browser-refresh message
$tw.rootWidget.addEventListener("tw-browser-refresh",function(event) {
window.location.hash = "";
window.location.reload(true);
});
// Listen for the tw-home message
$tw.rootWidget.addEventListener("tw-home",function(event) {
window.location.hash = "";
var storyFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE),
storyList = $tw.wiki.filterTiddlers(storyFilter);
$tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: "", list: storyList},$tw.wiki.getModificationFields());
});
// Listen for the tw-permalink message
$tw.rootWidget.addEventListener("tw-permalink",function(event) {
updateLocationHash({
updateAddressBar: "permalink",
updateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,"no").trim(),
targetTiddler: event.param || event.tiddlerTitle
});
});
// Listen for the tw-permaview message
$tw.rootWidget.addEventListener("tw-permaview",function(event) {
updateLocationHash({
updateAddressBar: "permaview",
updateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,"no").trim(),
targetTiddler: event.param || event.tiddlerTitle
});
});
}
};
@ -107,30 +132,39 @@ function openStartupTiddlers(options) {
}
}
function updateLocationHash() {
var updateAddressBar = $tw.wiki.getTiddlerText(CONFIG_UPDATE_ADDRESS_BAR,"permaview").trim();
if(updateAddressBar !== "no") {
/*
options: See below
options.updateAddressBar: "permalink", "permaview" or "no" (defaults to "permaview")
options.updateHistory: "yes" or "no" (defaults to "no")
options.targetTiddler: optional title of target tiddler for permalink
*/
function updateLocationHash(options) {
if(options.updateAddressBar !== "no") {
// Get the story and the history stack
var storyList = $tw.wiki.getTiddlerList(DEFAULT_STORY_TITLE),
historyList = $tw.wiki.getTiddlerData(DEFAULT_HISTORY_TITLE,[]);
var targetTiddler = "";
// The target tiddler is the one at the top of the stack
if(historyList.length > 0) {
targetTiddler = historyList[historyList.length-1].title;
}
// Blank the target tiddler if it isn't present in the story
if(storyList.indexOf(targetTiddler) === -1) {
historyList = $tw.wiki.getTiddlerData(DEFAULT_HISTORY_TITLE,[]),
targetTiddler = "";
if(options.targetTiddler) {
targetTiddler = options.targetTiddler;
} else {
// The target tiddler is the one at the top of the stack
if(historyList.length > 0) {
targetTiddler = historyList[historyList.length-1].title;
}
// Blank the target tiddler if it isn't present in the story
if(storyList.indexOf(targetTiddler) === -1) {
targetTiddler = "";
}
}
// Assemble the location hash
if(updateAddressBar === "permalink") {
if(options.updateAddressBar === "permalink") {
$tw.locationHash = "#" + encodeURIComponent(targetTiddler)
} else {
$tw.locationHash = "#" + encodeURIComponent(targetTiddler) + ":" + encodeURIComponent($tw.utils.stringifyList(storyList));
}
// Only change the location hash if we must, thus avoiding unnecessary onhashchange events
if($tw.utils.getLocationHash() !== $tw.locationHash) {
if($tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,"no").trim() === "yes") {
if(options.updateHistory === "yes") {
// Assign the location hash so that history is updated
window.location.hash = $tw.locationHash;
} else {

View File

@ -1,34 +0,0 @@
/*\
title: $:/core/modules/startup/syncer-browser.js
type: application/javascript
module-type: startup
Startup handling
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
// Export name and synchronous status
exports.name = "syncer-browser";
exports.platforms = ["browser"];
exports.after = ["rootwidget"];
exports.synchronous = true;
exports.startup = function() {
// Listen out for login/logout/refresh events in the browser
$tw.rootWidget.addEventListener("tw-login",function() {
$tw.syncer.handleLoginEvent();
});
$tw.rootWidget.addEventListener("tw-logout",function() {
$tw.syncer.handleLogoutEvent();
});
$tw.rootWidget.addEventListener("tw-server-refresh",function() {
$tw.syncer.handleRefreshEvent();
});
};
})();

View File

@ -12,6 +12,8 @@ Views the story as a linear sequence
/*global $tw: false */
"use strict";
var easing = "cubic-bezier(0.645, 0.045, 0.355, 1)"; // From http://easings.net/#easeInOutCubic
var ClassicStoryView = function(listWidget) {
this.listWidget = listWidget;
}
@ -51,8 +53,8 @@ ClassicStoryView.prototype.insert = function(widget) {
$tw.utils.forceLayout(targetElement);
// Transition to the final position
$tw.utils.setStyle(targetElement,[
{transition: "opacity " + duration + "ms ease-in-out, " +
"margin-bottom " + duration + "ms ease-in-out"},
{transition: "opacity " + duration + "ms " + easing + ", " +
"margin-bottom " + duration + "ms " + easing},
{marginBottom: currMarginBottom + "px"},
{opacity: "1.0"}
]);
@ -80,9 +82,9 @@ ClassicStoryView.prototype.remove = function(widget) {
]);
$tw.utils.forceLayout(targetElement);
$tw.utils.setStyle(targetElement,[
{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms ease-in-out, " +
"opacity " + duration + "ms ease-in-out, " +
"margin-bottom " + duration + "ms ease-in-out"},
{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms " + easing + ", " +
"opacity " + duration + "ms " + easing + ", " +
"margin-bottom " + duration + "ms " + easing},
{transform: "translateX(-" + currWidth + "px)"},
{marginBottom: (-currHeight) + "px"},
{opacity: "0.0"}

View File

@ -12,6 +12,8 @@ Zooms between individual tiddlers
/*global $tw: false */
"use strict";
var easing = "cubic-bezier(0.645, 0.045, 0.355, 1)"; // From http://easings.net/#easeInOutCubic
var ZoominListView = function(listWidget) {
var self = this;
this.listWidget = listWidget;
@ -77,7 +79,7 @@ ZoominListView.prototype.navigateTo = function(historyInfo) {
this.currentTiddlerDomNode = targetElement;
// Transform the target tiddler to its natural size
$tw.utils.setStyle(targetElement,[
{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms ease-in, opacity " + duration + "ms ease-in"},
{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms " + easing + ", opacity " + duration + "ms " + easing},
{opacity: "1.0"},
{transform: "translateX(0px) translateY(0px) scale(1)"},
{zIndex: "500"},
@ -88,7 +90,7 @@ ZoominListView.prototype.navigateTo = function(historyInfo) {
x = zoomBounds.left - targetBounds.left - (sourceBounds.left - targetBounds.left) * scale;
y = zoomBounds.top - targetBounds.top - (sourceBounds.top - targetBounds.top) * scale;
$tw.utils.setStyle(prevCurrentTiddler,[
{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms ease-in, opacity " + duration + "ms ease-in"},
{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms " + easing + ", opacity " + duration + "ms " + easing},
{opacity: "0.0"},
{transformOrigin: "0 0"},
{transform: "translateX(" + x + "px) translateY(" + y + "px) scale(" + scale + ")"},
@ -151,7 +153,7 @@ ZoominListView.prototype.remove = function(widget) {
{display: "block"},
{transformOrigin: "50% 50%"},
{transform: "translateX(0px) translateY(0px) scale(10)"},
{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms ease-in, opacity " + duration + "ms ease-in"},
{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms " + easing + ", opacity " + duration + "ms " + easing},
{opacity: "0"},
{zIndex: "500"}
]);
@ -164,7 +166,7 @@ ZoominListView.prototype.remove = function(widget) {
$tw.utils.setStyle(targetElement,[
{transformOrigin: "50% 50%"},
{transform: "translateX(0px) translateY(0px) scale(0.1)"},
{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms ease-in, opacity " + duration + "ms ease-in"},
{transition: $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms " + easing + ", opacity " + duration + "ms " + easing},
{opacity: "0"},
{zIndex: "0"}
]);

View File

@ -14,24 +14,15 @@ The syncer tracks changes to the store. If a syncadaptor is used then individual
/*
Instantiate the syncer with the following options:
syncadaptor: reference to syncadaptor to be used
wiki: wiki to be synced
*/
function Syncer(options) {
var self = this;
this.wiki = options.wiki;
this.syncadaptor = options.syncadaptor
// Make a logger
this.logger = new $tw.utils.Logger("syncer" + ($tw.browser ? "-browser" : "") + ($tw.node ? "-server" : ""));
// Find a working syncadaptor
this.syncadaptor = undefined;
$tw.modules.forEachModuleOfType("syncadaptor",function(title,module) {
if(!self.syncadaptor && module.adaptorClass) {
self.syncadaptor = new module.adaptorClass(self);
}
});
// Initialise our savers
if($tw.browser) {
this.initSavers();
}
// Compile the dirty tiddler filter
this.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter));
// Record information for known tiddlers
@ -45,12 +36,32 @@ function Syncer(options) {
this.wiki.addEventListener("change",function(changes) {
self.syncToServer(changes);
});
// Listen out for lazyLoad events
if(this.syncadaptor) {
this.wiki.addEventListener("lazyLoad",function(title) {
self.handleLazyLoadEvent(title);
// Browser event handlers
if($tw.browser) {
// Set up our beforeunload handler
window.addEventListener("beforeunload",function(event) {
var confirmationMessage = undefined;
if(self.isDirty()) {
confirmationMessage = $tw.language.getString("UnsavedChangesWarning");
event.returnValue = confirmationMessage; // Gecko
}
return confirmationMessage;
});
// Listen out for login/logout/refresh events in the browser
$tw.rootWidget.addEventListener("tw-login",function() {
self.handleLoginEvent();
});
$tw.rootWidget.addEventListener("tw-logout",function() {
self.handleLogoutEvent();
});
$tw.rootWidget.addEventListener("tw-server-refresh",function() {
self.handleRefreshEvent();
});
}
// Listen out for lazyLoad events
this.wiki.addEventListener("lazyLoad",function(title) {
self.handleLazyLoadEvent(title);
});
// Get the login status
this.getStatus(function (err,isLoggedIn) {
// Do a sync from the server
@ -64,13 +75,13 @@ Constants
Syncer.prototype.titleIsLoggedIn = "$:/status/IsLoggedIn";
Syncer.prototype.titleUserName = "$:/status/UserName";
Syncer.prototype.titleSyncFilter = "$:/config/SyncFilter";
Syncer.prototype.titleAutoSave = "$:/config/AutoSave";
Syncer.prototype.titleSavedNotification = "$:/language/Notifications/Save/Done";
Syncer.prototype.taskTimerInterval = 1 * 1000; // Interval for sync timer
Syncer.prototype.throttleInterval = 1 * 1000; // Defer saving tiddlers if they've changed in the last 1s...
Syncer.prototype.fallbackInterval = 10 * 1000; // Unless the task is older than 10s
Syncer.prototype.pollTimerInterval = 60 * 1000; // Interval for polling for changes from the adaptor
/*
Read (or re-read) the latest tiddler info from the store
*/
@ -90,78 +101,6 @@ Syncer.prototype.readTiddlerInfo = function() {
});
};
/*
Select the appropriate saver modules and set them up
*/
Syncer.prototype.initSavers = function(moduleType) {
moduleType = moduleType || "saver";
// Instantiate the available savers
this.savers = [];
var self = this;
$tw.modules.forEachModuleOfType(moduleType,function(title,module) {
if(module.canSave(self)) {
self.savers.push(module.create(self.wiki));
}
});
// Sort the savers into priority order
this.savers.sort(function(a,b) {
if(a.info.priority < b.info.priority) {
return -1;
} else {
if(a.info.priority > b.info.priority) {
return +1;
} else {
return 0;
}
}
});
};
/*
Save the wiki contents. Options are:
method: "save" or "download"
template: the tiddler containing the template to save
downloadType: the content type for the saved file
*/
Syncer.prototype.saveWiki = function(options) {
options = options || {};
var self = this,
method = options.method || "save",
template = options.template || "$:/core/save/all",
downloadType = options.downloadType || "text/plain",
text = this.wiki.renderTiddler(downloadType,template),
callback = function(err) {
if(err) {
alert("Error while saving:\n\n" + err);
} else {
$tw.notifier.display(self.titleSavedNotification);
if(options.callback) {
options.callback();
}
}
};
// Ignore autosave if we've got a syncadaptor or autosave is disabled
if(method === "autosave") {
if(this.syncadaptor || this.wiki.getTiddlerText(this.titleAutoSave,"yes") !== "yes") {
return false;
}
}
// Call the highest priority saver that supports this method
for(var t=this.savers.length-1; t>=0; t--) {
var saver = this.savers[t];
if(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback)) {
this.logger.log("Saving wiki with method",method,"through saver",saver.info.name);
// Clear the task queue if we're saving (rather than downloading)
if(method !== "download") {
this.readTiddlerInfo();
this.taskQueue = {};
}
return true;
}
}
return false;
};
/*
Checks whether the wiki is dirty (ie the window shouldn't be closed)
*/
@ -169,6 +108,15 @@ Syncer.prototype.isDirty = function() {
return (this.numTasksInQueue() > 0) || (this.numTasksInProgress() > 0);
};
/*
Update the document body with the class "tw-dirty" if the wiki has unsaved/unsynced changes
*/
Syncer.prototype.updateDirtyStatus = function() {
if($tw.browser) {
$tw.utils.toggleClass(document.body,"tw-dirty",this.isDirty());
}
};
/*
Save an incoming tiddler in the store, and updates the associated tiddlerInfo
*/
@ -401,11 +349,10 @@ Syncer.prototype.enqueueSyncTask = function(task) {
// this.logger.log("Queuing up sync task with type:",task.type,"title:",task.title);
// If it is not in the queue, insert it
this.taskQueue[task.title] = task;
this.updateDirtyStatus();
}
// Process the queue
if(this.syncadaptor) {
$tw.utils.nextTick(function() {self.processTaskQueue.call(self);});
}
$tw.utils.nextTick(function() {self.processTaskQueue.call(self);});
};
/*
@ -449,6 +396,7 @@ Syncer.prototype.processTaskQueue = function() {
// Remove the task from the queue and add it to the in progress list
delete this.taskQueue[task.title];
this.taskInProgress[task.title] = task;
this.updateDirtyStatus();
// Dispatch the task
this.dispatchTask(task,function(err) {
if(err) {
@ -456,6 +404,7 @@ Syncer.prototype.processTaskQueue = function() {
}
// Mark that this task is no longer in progress
delete self.taskInProgress[task.title];
self.updateDirtyStatus();
// Process the next task
self.processTaskQueue.call(self);
});
@ -484,7 +433,7 @@ Syncer.prototype.chooseNextTask = function() {
// Exclude the task if it is a save and the tiddler has been modified recently, but not hit the fallback time
if(task.type === "save" && (now - task.lastModificationTime) < self.throttleInterval &&
(now - task.queueTime) < self.fallbackInterval) {
return;
return;
}
// Exclude the task if it is newer than the current best candidate
if(candidateTask && candidateTask.queueTime < task.queueTime) {
@ -546,6 +495,8 @@ Syncer.prototype.dispatchTask = function(task,callback) {
}
// Invoke the callback
callback(null);
},{
tiddlerInfo: self.tiddlerInfo[task.title]
});
}
};

View File

@ -18,7 +18,7 @@ exports.hasTag = function(tag) {
exports.isPlugin = function() {
return this.fields.type === "application/json" && this.hasField("plugin-type");
}
};
exports.isDraft = function() {
return this.hasField("draft.of");
@ -57,4 +57,52 @@ exports.getFieldStringBlock = function(options) {
return fields.join("\n");
};
/*
Compare two tiddlers for equality
tiddler: the tiddler to compare
excludeFields: array of field names to exclude from the comparison
*/
exports.isEqual = function(tiddler,excludeFields) {
excludeFields = excludeFields || [];
var self = this,
differences = []; // Fields that have differences
// Add to the differences array
function addDifference(fieldName) {
// Check for this field being excluded
if(excludeFields.indexOf(fieldName) === -1) {
// Save the field as a difference
$tw.utils.pushTop(differences,fieldName);
}
}
// Returns true if the two values of this field are equal
function isFieldValueEqual(fieldName) {
var valueA = self.fields[fieldName],
valueB = tiddler.fields[fieldName];
// Check for identical string values
if(typeof(valueA) === "string" && typeof(valueB) === "string" && valueA === valueB) {
return true;
}
// Check for identical array values
if($tw.utils.isArray(valueA) && $tw.utils.isArray(valueB) && $tw.utils.isArrayEqual(valueA,valueB)) {
return true;
}
// Otherwise the fields must be different
return false;
}
// Compare our fields
for(var fieldName in this.fields) {
if(!isFieldValueEqual(fieldName)) {
addDifference(fieldName);
}
}
// There's a difference for every field in the other tiddler that we don't have
for(fieldName in tiddler.fields) {
if(!(fieldName in this.fields)) {
addDifference(fieldName);
}
}
// Return whether there were any differences
return differences.length === 0;
};
})();

View File

@ -0,0 +1,75 @@
/*\
title: $:/core/modules/upgraders/plugins.js
type: application/javascript
module-type: upgrader
Upgrader module that checks that plugins are newer than any already installed version
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var UPGRADE_LIBRARY_TITLE = "$:/UpgradeLibrary";
var BLOCKED_PLUGINS = {
"$:/plugins/tiddlywiki/fullscreen": {
versions: ["*"]
}
};
exports.upgrade = function(wiki,titles,tiddlers) {
var self = this,
messages = {},
upgradeLibrary,
getLibraryTiddler = function(title) {
if(!upgradeLibrary) {
upgradeLibrary = wiki.getTiddlerData(UPGRADE_LIBRARY_TITLE,{});
upgradeLibrary.tiddlers = upgradeLibrary.tiddlers || {};
}
return upgradeLibrary.tiddlers[title];
};
// Go through all the incoming tiddlers
$tw.utils.each(titles,function(title) {
var incomingTiddler = tiddlers[title];
// Check if we're dealing with a plugin
if(incomingTiddler && incomingTiddler["plugin-type"] && incomingTiddler["version"]) {
// Upgrade the incoming plugin if we've got a newer version in the upgrade library
var libraryTiddler = getLibraryTiddler(title);
if(libraryTiddler && libraryTiddler["plugin-type"] && libraryTiddler["version"]) {
if($tw.utils.checkVersions(libraryTiddler.version,incomingTiddler.version)) {
tiddlers[title] = libraryTiddler;
messages[title] = $tw.language.getString("Import/Upgrader/Plugins/Upgraded",{variables: {incoming: incomingTiddler.version, upgraded: libraryTiddler.version}});
return;
}
}
// Suppress the incoming plugin if it is older than the currently installed one
var existingTiddler = wiki.getTiddler(title);
if(existingTiddler && existingTiddler.hasField("plugin-type") && existingTiddler.hasField("version")) {
// Reject the incoming plugin by blanking all its fields
if($tw.utils.checkVersions(existingTiddler.fields.version,incomingTiddler.version)) {
tiddlers[title] = Object.create(null);
messages[title] = $tw.language.getString("Import/Upgrader/Plugins/Suppressed/Version",{variables: {incoming: incomingTiddler.version, existing: existingTiddler.fields.version}});
return;
}
}
}
if(incomingTiddler && incomingTiddler["plugin-type"]) {
// Check whether the plugin is on the blocked list
var blockInfo = BLOCKED_PLUGINS[title];
if(blockInfo) {
if(blockInfo.versions.indexOf("*") !== -1 || (incomingTiddler.version && blockInfo.versions.indexOf(incomingTiddler.version) !== -1)) {
tiddlers[title] = Object.create(null);
messages[title] = $tw.language.getString("Import/Upgrader/Plugins/Suppressed/Incompatible");
return;
}
}
}
});
return messages;
};
})();

View File

@ -0,0 +1,39 @@
/*\
title: $:/core/modules/upgraders/system.js
type: application/javascript
module-type: upgrader
Upgrader module that suppresses certain system tiddlers that shouldn't be imported
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var DONT_IMPORT_LIST = ["$:/StoryList","$:/HistoryList"],
DONT_IMPORT_PREFIX_LIST = ["$:/temp/","$:/state/"];
exports.upgrade = function(wiki,titles,tiddlers) {
var self = this,
messages = {};
// Check for tiddlers on our list
$tw.utils.each(titles,function(title) {
if(DONT_IMPORT_LIST.indexOf(title) !== -1) {
tiddlers[title] = Object.create(null);
messages[title] = $tw.language.getString("Import/Upgrader/System/Suppressed");
} else {
for(var t=0; t<DONT_IMPORT_PREFIX_LIST.length; t++) {
var prefix = DONT_IMPORT_PREFIX_LIST[t];
if(title.substr(0,prefix.length) === prefix) {
tiddlers[title] = Object.create(null);
messages[title] = $tw.language.getString("Import/Upgrader/State/Suppressed");
}
}
}
});
return messages;
};
})();

View File

@ -0,0 +1,65 @@
/*\
title: $:/core/modules/upgraders/themetweaks.js
type: application/javascript
module-type: upgrader
Upgrader module that handles the change in theme tweak storage introduced in 5.0.14-beta.
Previously, theme tweaks were stored in two data tiddlers:
* $:/themes/tiddlywiki/vanilla/metrics
* $:/themes/tiddlywiki/vanilla/settings
Now, each tweak is stored in its own separate tiddler.
This upgrader copies any values from the old format to the new. The old data tiddlers are not deleted in case they have been used to store additional indexes.
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var MAPPINGS = {
"$:/themes/tiddlywiki/vanilla/metrics": {
"fontsize": "$:/themes/tiddlywiki/vanilla/metrics/fontsize",
"lineheight": "$:/themes/tiddlywiki/vanilla/metrics/lineheight",
"storyleft": "$:/themes/tiddlywiki/vanilla/metrics/storyleft",
"storytop": "$:/themes/tiddlywiki/vanilla/metrics/storytop",
"storyright": "$:/themes/tiddlywiki/vanilla/metrics/storyright",
"storywidth": "$:/themes/tiddlywiki/vanilla/metrics/storywidth",
"tiddlerwidth": "$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth"
},
"$:/themes/tiddlywiki/vanilla/settings": {
"fontfamily": "$:/themes/tiddlywiki/vanilla/settings/fontfamily"
}
};
exports.upgrade = function(wiki,titles,tiddlers) {
var self = this,
messages = {};
// Check for tiddlers on our list
$tw.utils.each(titles,function(title) {
var mapping = MAPPINGS[title];
if(mapping) {
var tiddler = new $tw.Tiddler(tiddlers[title]),
tiddlerData = wiki.getTiddlerData(tiddler,{});
for(var index in mapping) {
var mappedTitle = mapping[index];
if(!tiddlers[mappedTitle] || tiddlers[mappedTitle].title !== mappedTitle) {
tiddlers[mappedTitle] = {
title: mappedTitle,
text: tiddlerData[index]
}
messages[mappedTitle] = $tw.language.getString("Import/Upgrader/ThemeTweaks/Created",{variables: {
from: title + "##" + index
}})
}
}
}
});
return messages;
};
})();

View File

@ -46,7 +46,17 @@ exports.decryptStoreArea = function(encryptedStoreArea,password) {
}
};
exports.decryptStoreAreaInteractive = function(encryptedStoreArea,callback) {
/*
Attempt to extract the tiddlers from an encrypted store area using the current password. If that fails, the user is prompted for a password.
encryptedStoreArea: text of the TiddlyWiki encrypted store area
callback: function(tiddlers) called with the array of decrypted tiddlers
The following configuration settings are supported:
$tw.config.usePasswordVault: causes any password entered by the user to also be put into the system password vault
*/
exports.decryptStoreAreaInteractive = function(encryptedStoreArea,callback,options) {
// Try to decrypt with the current password
var tiddlers = $tw.utils.decryptStoreArea(encryptedStoreArea);
if(tiddlers) {
@ -66,6 +76,9 @@ exports.decryptStoreAreaInteractive = function(encryptedStoreArea,callback) {
// Attempt to decrypt the tiddlers
var tiddlers = $tw.utils.decryptStoreArea(encryptedStoreArea,data.password);
if(tiddlers) {
if($tw.config.usePasswordVault) {
$tw.crypto.setPassword(data.password);
}
callback(tiddlers);
// Exit and remove the password prompt
return true;

View File

@ -130,4 +130,31 @@ exports.convertEventName = function(eventName) {
return newEventName;
};
/*
Return the names of the fullscreen APIs
*/
exports.getFullScreenApis = function() {
var d = document,
db = d.body,
result = {
"_requestFullscreen": db.webkitRequestFullscreen !== undefined ? "webkitRequestFullscreen" :
db.mozRequestFullScreen !== undefined ? "mozRequestFullScreen" :
db.msRequestFullscreen !== undefined ? "msRequestFullscreen" :
db.requestFullscreen !== undefined ? "requestFullscreen" : "",
"_exitFullscreen": d.webkitExitFullscreen !== undefined ? "webkitExitFullscreen" :
d.mozCancelFullScreen !== undefined ? "mozCancelFullScreen" :
d.msExitFullscreen !== undefined ? "msExitFullscreen" :
d.exitFullscreen !== undefined ? "exitFullscreen" : "",
"_fullscreenElement": d.webkitFullscreenElement !== undefined ? "webkitFullscreenElement" :
d.mozFullScreenElement !== undefined ? "mozFullScreenElement" :
d.msFullscreenElement !== undefined ? "msFullscreenElement" :
d.fullscreenElement !== undefined ? "fullscreenElement" : ""
};
if(!result._requestFullscreen || !result._exitFullscreen || !result._fullscreenElement) {
return null;
} else {
return result;
}
};
})();

View File

@ -29,7 +29,7 @@ exports.removeChildren = function(node) {
};
exports.hasClass = function(el,className) {
return el && el.className && el.className.split(" ").indexOf(className) !== -1;
return el && el.className && el.className.toString().split(" ").indexOf(className) !== -1;
};
exports.addClass = function(el,className) {
@ -96,8 +96,11 @@ exports.getBoundingPageRect = function(element) {
Saves a named password in the browser
*/
exports.savePassword = function(name,password) {
if(window.localStorage) {
localStorage.setItem("tw5-password-" + name,password);
try {
if(window.localStorage) {
localStorage.setItem("tw5-password-" + name,password);
}
} catch(e) {
}
};
@ -105,7 +108,11 @@ exports.savePassword = function(name,password) {
Retrieve a named password from the browser
*/
exports.getPassword = function(name) {
return window.localStorage ? localStorage.getItem("tw5-password-" + name) : "";
try {
return window.localStorage ? localStorage.getItem("tw5-password-" + name) : "";
} catch(e) {
return "";
}
};
/*

View File

@ -67,20 +67,27 @@ Modal.prototype.display = function(title,options) {
modalFooter.appendChild(modalFooterButtons);
modalWrapper.appendChild(modalFooter);
// Render the title of the message
var titleText;
if(tiddler && tiddler.fields && tiddler.fields.subtitle) {
titleText = tiddler.fields.subtitle;
} else {
titleText = title;
}
var headerParser = this.wiki.parseText("text/vnd.tiddlywiki",titleText,{parseAsInline: true}),
headerWidgetNode = this.wiki.makeWidget(headerParser,{parentWidget: $tw.rootWidget, document: document});
var headerWidgetNode = this.wiki.makeTranscludeWidget(title,{
field: "subtitle",
children: [{
type: "text",
attributes: {
text: {
type: "string",
value: title
}}}],
parentWidget: $tw.rootWidget,
document: document
});
headerWidgetNode.render(headerTitle,null);
this.wiki.addEventListener("change",function(changes) {
headerWidgetNode.refresh(changes,modalHeader,null);
});
// Render the body of the message
var bodyWidgetNode = this.wiki.makeTranscludeWidget(title,{parentWidget: $tw.rootWidget, document: document});
var bodyWidgetNode = this.wiki.makeTranscludeWidget(title,{
parentWidget: $tw.rootWidget,
document: document
});
bodyWidgetNode.render(modalBody,null);
this.wiki.addEventListener("change",function(changes) {
bodyWidgetNode.refresh(changes,modalBody,null);
@ -100,14 +107,31 @@ Modal.prototype.display = function(title,options) {
modalFooterHelp.appendChild(link);
modalFooterHelp.style.float = "left";
}
var footerText;
if(tiddler && tiddler.fields && tiddler.fields.footer) {
footerText = tiddler.fields.footer;
} else {
footerText = '<$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>';
}
var footerParser = this.wiki.parseText("text/vnd.tiddlywiki",footerText,{parseAsInline: true}),
footerWidgetNode = this.wiki.makeWidget(footerParser,{parentWidget: $tw.rootWidget, document: document});
var footerWidgetNode = this.wiki.makeTranscludeWidget(title,{
field: "footer",
children: [{
type: "button",
attributes: {
message: {
type: "string",
value: "tw-close-tiddler"
},
"class": {
type: "string",
value: "btn btn-primary"
}
},
children: [{
type: "text",
attributes: {
text: {
type: "string",
value: "Close"
}}}
]}],
parentWidget: $tw.rootWidget,
document: document
});
footerWidgetNode.render(modalFooterButtons,null);
this.wiki.addEventListener("change",function(changes) {
footerWidgetNode.refresh(changes,modalFooterButtons,null);

View File

@ -55,22 +55,63 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) {
CheckboxWidget.prototype.getValue = function() {
var tiddler = this.wiki.getTiddler(this.checkboxTitle);
return tiddler ? tiddler.hasTag(this.checkboxTag) : false;
if(tiddler) {
if(this.checkboxTag) {
return tiddler.hasTag(this.checkboxTag);
}
if(this.checkboxField) {
var value = tiddler.fields[this.checkboxField] || this.checkboxDefault || "";
if(value === this.checkboxChecked) {
return true;
}
if(value === this.checkboxUnchecked) {
return false;
}
}
} else {
if(this.checkboxTag) {
return false;
}
if(this.checkboxField) {
if(this.checkboxDefault === this.checkboxChecked) {
return true;
}
if(this.checkboxDefault === this.checkboxUnchecked) {
return false;
}
}
}
return false;
};
CheckboxWidget.prototype.handleChangeEvent = function(event) {
var checked = this.inputDomNode.checked,
tiddler = this.wiki.getTiddler(this.checkboxTitle);
if(tiddler && tiddler.hasTag(this.checkboxTag) !== checked) {
var newTags = (tiddler.fields.tags || []).slice(0),
pos = newTags.indexOf(this.checkboxTag);
tiddler = this.wiki.getTiddler(this.checkboxTitle),
fallbackFields = {text: ""},
newFields = {title: this.checkboxTitle},
hasChanged = false;
// Set the tag if specified
if(this.checkboxTag && (!tiddler || tiddler.hasTag(this.checkboxTag) !== checked)) {
newFields.tags = tiddler ? (tiddler.fields.tags || []).slice(0) : [];
var pos = newFields.tags.indexOf(this.checkboxTag);
if(pos !== -1) {
newTags.splice(pos,1);
newFields.tags.splice(pos,1);
}
if(checked) {
newTags.push(this.checkboxTag);
newFields.tags.push(this.checkboxTag);
}
this.wiki.addTiddler(new $tw.Tiddler(tiddler,{tags: newTags},this.wiki.getModificationFields()));
hasChanged = true;
}
// Set the field if specified
if(this.checkboxField) {
var value = checked ? this.checkboxChecked : this.checkboxUnchecked;
if(!tiddler || tiddler.fields[this.checkboxField] !== value) {
newFields[this.checkboxField] = value;
hasChanged = true;
}
}
if(hasChanged) {
this.wiki.addTiddler(new $tw.Tiddler(fallbackFields,tiddler,newFields,this.wiki.getModificationFields()));
}
};
@ -81,6 +122,10 @@ CheckboxWidget.prototype.execute = function() {
// Get the parameters from the attributes
this.checkboxTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
this.checkboxTag = this.getAttribute("tag");
this.checkboxField = this.getAttribute("field");
this.checkboxChecked = this.getAttribute("checked");
this.checkboxUnchecked = this.getAttribute("unchecked");
this.checkboxDefault = this.getAttribute("default");
// Make the child widgets
this.makeChildWidgets();
};
@ -90,7 +135,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
CheckboxWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes["class"]) {
if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.field || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes["class"]) {
this.refreshSelf();
return true;
} else {

View File

@ -192,10 +192,12 @@ DropZoneWidget.prototype.handlePasteEvent = function(event) {
});
} else if(item.kind === "string") {
// Create tiddlers from string items
var type = item.type;
item.getAsString(function(str) {
var tiddlerFields = {
title: self.wiki.generateNewTitle("Untitled"),
text: str
text: str,
type: type
};
self.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify([tiddlerFields])});
});

View File

@ -46,28 +46,11 @@ EditWidget.prototype.execute = function() {
this.editIndex = this.getAttribute("index");
this.editClass = this.getAttribute("class");
this.editPlaceholder = this.getAttribute("placeholder");
// Get the content type of the thing we're editing
var type;
if(this.editField === "text") {
var tiddler = this.wiki.getTiddler(this.editTitle);
if(tiddler) {
type = tiddler.fields.type;
}
}
type = type || "text/vnd.tiddlywiki";
// Choose the appropriate edit widget
var editorType = this.wiki.getTiddlerText(EDITOR_MAPPING_PREFIX + type);
if(!editorType) {
var typeInfo = $tw.config.contentTypeInfo[type];
if(typeInfo && typeInfo.encoding === "base64") {
editorType = "binary";
} else {
editorType = "text";
}
}
this.editorType = this.getEditorType();
// Make the child widgets
this.makeChildWidgets([{
type: "edit-" + editorType,
type: "edit-" + this.editorType,
attributes: {
tiddler: {type: "string", value: this.editTitle},
field: {type: "string", value: this.editField},
@ -78,12 +61,35 @@ EditWidget.prototype.execute = function() {
}]);
};
EditWidget.prototype.getEditorType = function() {
// Get the content type of the thing we're editing
var type;
if(this.editField === "text") {
var tiddler = this.wiki.getTiddler(this.editTitle);
if(tiddler) {
type = tiddler.fields.type;
}
}
type = type || "text/vnd.tiddlywiki";
var editorType = this.wiki.getTiddlerText(EDITOR_MAPPING_PREFIX + type);
if(!editorType) {
var typeInfo = $tw.config.contentTypeInfo[type];
if(typeInfo && typeInfo.encoding === "base64") {
editorType = "binary";
} else {
editorType = "text";
}
}
return editorType;
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
EditWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index) {
// Refresh if an attribute has changed, or the type associated with the target tiddler has changed
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || (changedTiddlers[this.editTitle] && this.getEditorType() !== this.editorType)) {
this.refreshSelf();
return true;
} else {

View File

@ -105,6 +105,9 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
if(this.imageTooltip) {
domNode.setAttribute("title",this.imageTooltip);
}
if(this.imageAlt) {
domNode.setAttribute("alt",this.imageAlt);
}
// Insert element
parent.insertBefore(domNode,nextSibling);
this.domNodes.push(domNode);
@ -120,6 +123,7 @@ ImageWidget.prototype.execute = function() {
this.imageHeight = this.getAttribute("height");
this.imageClass = this.getAttribute("class");
this.imageTooltip = this.getAttribute("tooltip");
this.imageAlt = this.getAttribute("alt");
};
/*

View File

@ -56,7 +56,11 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
// Create our element
var domNode = this.document.createElement("a");
// Assign classes
var classes = ["tw-tiddlylink"];
var classes = [];
if(this.linkClasses) {
classes.push(this.linkClasses);
}
classes.push("tw-tiddlylink");
if(this.isShadow) {
classes.push("tw-tiddlylink-shadow");
}
@ -182,6 +186,8 @@ LinkWidget.prototype.execute = function() {
// Get the link title and aria label
this.tooltip = this.getAttribute("tooltip");
this["aria-label"] = this.getAttribute("aria-label");
// Get the link classes
this.linkClasses = this.getAttribute("class");
// Determine the link characteristics
this.isMissing = !this.wiki.tiddlerExists(this.to);
this.isShadow = this.wiki.isShadowTiddler(this.to);

View File

@ -12,6 +12,8 @@ Navigator widget
/*global $tw: false */
"use strict";
var IMPORT_TITLE = "$:/Import";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var NavigatorWidget = function(parseTreeNode,options) {
@ -26,7 +28,8 @@ var NavigatorWidget = function(parseTreeNode,options) {
{type: "tw-close-all-tiddlers", handler: "handleCloseAllTiddlersEvent"},
{type: "tw-close-other-tiddlers", handler: "handleCloseOtherTiddlersEvent"},
{type: "tw-new-tiddler", handler: "handleNewTiddlerEvent"},
{type: "tw-import-tiddlers", handler: "handleImportTiddlersEvent"}
{type: "tw-import-tiddlers", handler: "handleImportTiddlersEvent"},
{type: "tw-perform-import", handler: "handlePerformImportEvent"}
]);
};
@ -307,7 +310,8 @@ NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {
{title: draftTitle}
}
));
} else if(!this.wiki.isDraftModified(title)) {
}
if(!isRename && !this.wiki.isDraftModified(title)) {
event.type = "tw-cancel-tiddler";
this.dispatchEvent(event);
} else if(isConfirmed) {
@ -401,7 +405,7 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
return false;
};
// Import JSON tiddlers
// Import JSON tiddlers into a pending import tiddler
NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
var self = this;
// Get the tiddlers
@ -410,54 +414,83 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
tiddlers = JSON.parse(event.param);
} catch(e) {
}
// Get the current $:/Import tiddler
var importTiddler = this.wiki.getTiddler(IMPORT_TITLE),
importData = this.wiki.getTiddlerData(IMPORT_TITLE,{}),
newFields = new Object({
title: IMPORT_TITLE,
type: "application/json",
"plugin-type": "import",
"status": "pending"
}),
incomingTiddlers = [];
// Process each tiddler
var importedTiddlers = [];
importData.tiddlers = importData.tiddlers || {};
$tw.utils.each(tiddlers,function(tiddlerFields) {
var title = tiddlerFields.title;
// Add it to the store
var imported = self.wiki.importTiddler(new $tw.Tiddler(
self.wiki.getCreationFields(),
self.wiki.getModificationFields(),
tiddlerFields
));
if(imported) {
importedTiddlers.push(title);
if(title) {
incomingTiddlers.push(title);
importData.tiddlers[title] = tiddlerFields;
}
});
// Get the story and history details
var storyList = this.getStoryList(),
history = [];
// Create the import report tiddler
if(importedTiddlers.length === 0) {
return false;
// Give the active upgrader modules a chance to process the incoming tiddlers
var messages = this.wiki.invokeUpgraders(incomingTiddlers,importData.tiddlers);
$tw.utils.each(messages,function(message,title) {
newFields["message-" + title] = message;
});
// Deselect any suppressed tiddlers
$tw.utils.each(importData.tiddlers,function(tiddler,title) {
if($tw.utils.count(tiddler) === 0) {
newFields["selection-" + title] = "unchecked";
}
});
// Save the $:/Import tiddler
newFields.text = JSON.stringify(importData,null,$tw.config.preferences.jsonSpaces);
this.wiki.addTiddler(new $tw.Tiddler(importTiddler,newFields));
// Update the story and history details
if(this.getVariable("tw-auto-open-on-import") !== "no") {
var storyList = this.getStoryList(),
history = [];
// Add it to the story
if(storyList.indexOf(IMPORT_TITLE) === -1) {
storyList.unshift(IMPORT_TITLE);
}
// And to history
history.push(IMPORT_TITLE);
// Save the updated story and history
this.saveStoryList(storyList);
this.addToHistory(history);
}
var title;
if(importedTiddlers.length > 1) {
title = this.wiki.generateNewTitle("$:/temp/ImportReport");
var tiddlerFields = {
title: title,
text: "# [[" + importedTiddlers.join("]]\n# [[") + "]]\n"
};
this.wiki.addTiddler(new $tw.Tiddler(
self.wiki.getCreationFields(),
tiddlerFields,
self.wiki.getModificationFields()
));
} else {
title = importedTiddlers[0];
}
// Add it to the story
if(storyList.indexOf(title) === -1) {
storyList.unshift(title);
}
// And to history
history.push(title);
// Save the updated story and history
this.saveStoryList(storyList);
this.addToHistory(history);
return false;
};
//
NavigatorWidget.prototype.handlePerformImportEvent = function(event) {
var self = this,
importTiddler = this.wiki.getTiddler(event.param),
importData = this.wiki.getTiddlerData(event.param,{tiddlers: {}}),
importReport = [];
// Add the tiddlers to the store
importReport.push("The following tiddlers were imported:\n");
$tw.utils.each(importData.tiddlers,function(tiddlerFields) {
var title = tiddlerFields.title;
if(title && importTiddler && importTiddler.fields["selection-" + title] !== "unchecked") {
self.wiki.addTiddler(new $tw.Tiddler(tiddlerFields));
importReport.push("# [[" + tiddlerFields.title + "]]");
}
});
// Replace the $:/Import tiddler with an import report
this.wiki.addTiddler(new $tw.Tiddler({
title: IMPORT_TITLE,
text: importReport.join("\n"),
"status": "complete"
}));
// Navigate to the $:/Import tiddler
this.addToHistory([IMPORT_TITLE]);
// Send a notification event
this.dispatchEvent({type: "tw-auto-save-wiki"});
};
exports.navigator = NavigatorWidget;
})();

View File

@ -30,8 +30,9 @@ TextNodeWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
var text = this.getAttribute("text",this.parseTreeNode.text),
textNode = this.document.createTextNode(text);
var text = this.getAttribute("text",this.parseTreeNode.text);
text = text.replace(/\r/mg,"");
var textNode = this.document.createTextNode(text);
parent.insertBefore(textNode,nextSibling);
this.domNodes.push(textNode);
};

View File

@ -44,16 +44,33 @@ TiddlerWidget.prototype.execute = function() {
this.setVariable("missingTiddlerClass",(this.wiki.tiddlerExists(this.tiddlerTitle) || this.wiki.isShadowTiddler(this.tiddlerTitle)) ? "tw-tiddler-exists" : "tw-tiddler-missing");
this.setVariable("shadowTiddlerClass",this.wiki.isShadowTiddler(this.tiddlerTitle) ? "tw-tiddler-shadow" : "");
this.setVariable("systemTiddlerClass",this.wiki.isSystemTiddler(this.tiddlerTitle) ? "tw-tiddler-system" : "");
this.setVariable("tiddlerTagClasses",this.getTagClasses())
// Construct the child widgets
this.makeChildWidgets();
};
/*
Create a string of CSS classes derived from the tags of the current tiddler
*/
TiddlerWidget.prototype.getTagClasses = function() {
var tiddler = this.wiki.getTiddler(this.tiddlerTitle);
if(tiddler) {
var tags = [];
$tw.utils.each(tiddler.fields.tags,function(tag) {
tags.push("tw-tagged-" + encodeURIComponent(tag));
});
return tags.join(" ");
} else {
return "";
}
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
TiddlerWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.tiddler) {
if(changedAttributes.tiddler || changedTiddlers[this.tiddlerTitle]) {
this.refreshSelf();
return true;
} else {

View File

@ -39,17 +39,10 @@ Compute the internal state of the widget
TranscludeWidget.prototype.execute = function() {
// Get our parameters
this.transcludeTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
this.transcludeSubTiddler = this.getAttribute("subtiddler");
this.transcludeField = this.getAttribute("field");
this.transcludeIndex = this.getAttribute("index");
this.transcludeMode = this.getAttribute("mode");
// Check for recursion
var recursionMarker = this.makeRecursionMarker();
if(this.parentWidget && this.parentWidget.hasVariable("transclusion",recursionMarker)) {
this.makeChildWidgets([{type: "text", text: "Recursive transclusion error in transclude widget"}]);
return;
}
// Set context variables for recursion detection
this.setVariable("transclusion",recursionMarker);
// Parse the text reference
var parseAsInline = !this.parseTreeNode.isBlock;
if(this.transcludeMode === "inline") {
@ -61,8 +54,20 @@ TranscludeWidget.prototype.execute = function() {
this.transcludeTitle,
this.transcludeField,
this.transcludeIndex,
{parseAsInline: parseAsInline}),
{
parseAsInline: parseAsInline,
subTiddler: this.transcludeSubTiddler
}),
parseTreeNodes = parser ? parser.tree : this.parseTreeNode.children;
// Set context variables for recursion detection
var recursionMarker = this.makeRecursionMarker();
this.setVariable("transclusion",recursionMarker);
// Check for recursion
if(parser) {
if(this.parentWidget && this.parentWidget.hasVariable("transclusion",recursionMarker)) {
parseTreeNodes = [{type: "text", text: "Recursive transclusion error in transclude widget"}];
}
}
// Construct the child widgets
this.makeChildWidgets(parseTreeNodes);
};
@ -80,6 +85,8 @@ TranscludeWidget.prototype.makeRecursionMarker = function() {
output.push(this.transcludeField || "");
output.push("|");
output.push(this.transcludeIndex || "");
output.push("|");
output.push(this.transcludeSubTiddler || "");
output.push("}");
return output.join("");
};

View File

@ -18,11 +18,8 @@ Create a widget object for a parse tree node
options: see below
Options include:
wiki: mandatory reference to wiki associated with this render tree
variables: optional hashmap of context variables (see below)
parentWidget: optional reference to a parent renderer node for the context chain
document: optional document object to use instead of global document
Context variables include:
currentTiddler: title of the tiddler providing the context
*/
var Widget = function(parseTreeNode,options) {
if(arguments.length > 0) {
@ -136,7 +133,7 @@ Widget.prototype.substituteVariableParameters = function(text,formalParams,actua
Widget.prototype.substituteVariableReferences = function(text) {
var self = this;
return text.replace(/\$\(([^\)\$]+)\)\$/g,function(match,p1,offset,string) {
return (text || "").replace(/\$\(([^\)\$]+)\)\$/g,function(match,p1,offset,string) {
return self.getVariable(p1,{defaultValue: ""});
});
};

View File

@ -554,6 +554,17 @@ exports.sortByList = function(array,listTitle) {
}
};
exports.getSubTiddler = function(title,subTiddlerTitle) {
var bundleInfo = this.getPluginInfo(title) || this.getTiddlerData(title);
if(bundleInfo) {
var subTiddler = bundleInfo.tiddlers[subTiddlerTitle];
if(subTiddler) {
return new $tw.Tiddler(subTiddler);
}
}
return null;
};
/*
Retrieve a tiddler as a JSON string of the fields
*/
@ -571,16 +582,22 @@ exports.getTiddlerAsJson = function(title) {
};
/*
Get a tiddlers content as a JavaScript object. How this is done depends on the type of the tiddler:
Get the content of a tiddler as a JavaScript object. How this is done depends on the type of the tiddler:
application/json: the tiddler JSON is parsed into an object
application/x-tiddler-dictionary: the tiddler is parsed as sequence of name:value pairs
Other types currently just return null.
titleOrTiddler: string tiddler title or a tiddler object
defaultData: default data to be returned if the tiddler is missing or doesn't contain data
*/
exports.getTiddlerData = function(title,defaultData) {
var tiddler = this.getTiddler(title),
exports.getTiddlerData = function(titleOrTiddler,defaultData) {
var tiddler = titleOrTiddler,
data;
if(!(tiddler instanceof $tw.Tiddler)) {
tiddler = this.getTiddler(tiddler)
}
if(tiddler && tiddler.fields.text) {
switch(tiddler.fields.type) {
case "application/json":
@ -601,8 +618,8 @@ exports.getTiddlerData = function(title,defaultData) {
/*
Extract an indexed field from within a data tiddler
*/
exports.extractTiddlerDataItem = function(title,index,defaultText) {
var data = this.getTiddlerData(title,Object.create(null)),
exports.extractTiddlerDataItem = function(titleOrTiddler,index,defaultText) {
var data = this.getTiddlerData(titleOrTiddler,Object.create(null)),
text;
if(data && $tw.utils.hop(data,index)) {
text = data[index];
@ -786,31 +803,38 @@ exports.parseTiddler = function(title,options) {
};
exports.parseTextReference = function(title,field,index,options) {
if(field === "text" || (!field && !index)) {
// Force the tiddler to be lazily loaded
this.getTiddlerText(title);
// Parse it
return this.parseTiddler(title,options);
var tiddler,text;
if(options.subTiddler) {
tiddler = this.getSubTiddler(title,options.subTiddler);
} else {
var text;
if(field) {
if(field === "title") {
text = title;
} else {
var tiddler = this.getTiddler(title);
if(!tiddler || !tiddler.hasField(field)) {
return null;
}
text = tiddler.fields[field];
}
return this.parseText("text/vnd.tiddlywiki",text.toString(),options);
} else if(index) {
text = this.extractTiddlerDataItem(title,index,"");
if(text === undefined) {
tiddler = this.getTiddler(title);
if(field === "text" || (!field && !index)) {
this.getTiddlerText(title); // Force the tiddler to be lazily loaded
return this.parseTiddler(title,options);
}
}
if(field === "text" || (!field && !index)) {
if(tiddler && tiddler.fields) {
return this.parseText(tiddler.fields.type || "text/vnd.tiddlywiki",tiddler.fields.text,options);
} else {
return null;
}
} else if(field) {
if(field === "title") {
text = title;
} else {
if(!tiddler || !tiddler.hasField(field)) {
return null;
}
return this.parseText("text/vnd.tiddlywiki",text,options);
text = tiddler.fields[field];
}
return this.parseText("text/vnd.tiddlywiki",text.toString(),options);
} else if(index) {
text = this.extractTiddlerDataItem(tiddler,index,undefined);
if(text === undefined) {
return null;
}
return this.parseText("text/vnd.tiddlywiki",text,options);
}
};
@ -856,19 +880,30 @@ exports.makeWidget = function(parser,options) {
/*
Make a widget tree for transclusion
title: target tiddler title
options: as for wiki.makeWidget() (including parseAsInline)
options: as for wiki.makeWidget() plus:
options.field: optional field to transclude (defaults to "text")
options.children: optional array of children for the transclude widget
*/
exports.makeTranscludeWidget = function(title,options) {
options = options || {};
var parseTree = {tree: [{
type: "transclude",
attributes: {
tiddler: {
name: "tiddler",
type: "string",
value: title}},
isBlock: !options.parseAsInline}
type: "element",
tag: "div",
children: [{
type: "transclude",
attributes: {
tiddler: {
name: "tiddler",
type: "string",
value: title}},
isBlock: !options.parseAsInline}]}
]};
if(options.field) {
parseTree.tree[0].children[0].attributes.field = {type: "string", value: options.field};
}
if(options.children) {
parseTree.tree[0].children[0].children = options.children;
}
return $tw.wiki.makeWidget(parseTree,options);
};
@ -1085,27 +1120,16 @@ exports.readFile = function(file,callback) {
Check whether the specified draft tiddler has been modified
*/
exports.isDraftModified = function(title) {
var tiddler = this.getTiddler(title);
var tiddler = this.getTiddler(title);
if(!tiddler.isDraft()) {
return false;
}
var ignoredFields = ["created", "modified", "title", "draft.title", "draft.of", "tags"],
var ignoredFields = ["created", "modified", "title", "draft.title", "draft.of"],
origTiddler = this.getTiddler(tiddler.fields["draft.of"]);
if(!origTiddler) {
return true;
}
if(tiddler.fields["draft.title"] !== tiddler.fields["draft.of"]) {
return true;
}
if(!$tw.utils.isArrayEqual(tiddler.fields.tags,origTiddler.fields.tags)) {
return true;
}
return !Object.keys(tiddler.fields).every(function(field) {
if(ignoredFields.indexOf(field) >= 0) {
return true;
}
return tiddler.fields[field] === origTiddler.fields[field];
});
return !tiddler.isEqual(origTiddler,ignoredFields);
};
/*
@ -1125,4 +1149,31 @@ exports.addToHistory = function(title,fromPageRect,historyTitle) {
this.setTiddlerData(historyTitle,historyList,{"current-tiddler": titles[titles.length-1]});
};
/*
Invoke the available upgrader modules
titles: array of tiddler titles to be processed
tiddlers: hashmap by title of tiddler fields of pending import tiddlers. These can be modified by the upgraders. An entry with no fields indicates a tiddler that was pending import has been suppressed. When entries are added to the pending import the tiddlers hashmap may have entries that are not present in the titles array
Returns a hashmap of messages keyed by tiddler title.
*/
exports.invokeUpgraders = function(titles,tiddlers) {
// Collect up the available upgrader modules
var self = this;
if(!this.upgraderModules) {
this.upgraderModules = [];
$tw.modules.forEachModuleOfType("upgrader",function(title,module) {
if(module.upgrade) {
self.upgraderModules.push(module);
}
});
}
// Invoke each upgrader in turn
var messages = {};
for(var t=0; t<this.upgraderModules.length; t++) {
var upgrader = this.upgraderModules[t],
upgraderMessages = upgrader.upgrade(this,titles,tiddlers);
$tw.utils.extend(messages,upgraderMessages);
}
return messages;
};
})();

View File

@ -13,6 +13,7 @@ blockquote-bar: <<colour muted-foreground>>
code-background: #f7f7f9
code-border: #e1e1e8
code-foreground: #dd1144
dirty-indicator: #ff0000
download-background: #66cccc
download-foreground: <<colour background>>
dragger-background: <<colour foreground>>
@ -22,10 +23,10 @@ dropdown-border: <<colour muted-foreground>>
dropdown-tab-background-selected: #fff
dropdown-tab-background: #ececec
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover:
external-link-background-visited:
external-link-background:
external-link-foreground-hover:
external-link-background-hover: inherit
external-link-background-visited: inherit
external-link-background: inherit
external-link-foreground-hover: inherit
external-link-foreground-visited: #0000aa
external-link-foreground: #0000ee
foreground: #333333

View File

@ -13,6 +13,7 @@ blockquote-bar: <<colour muted-foreground>>
code-background: #f7f7f9
code-border: #e1e1e8
code-foreground: #dd1144
dirty-indicator: #ff0000
download-background: #34c734
download-foreground: <<colour foreground>>
dragger-background: <<colour foreground>>
@ -22,10 +23,10 @@ dropdown-border: <<colour muted-foreground>>
dropdown-tab-background-selected: #fff
dropdown-tab-background: #ececec
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover:
external-link-background-visited:
external-link-background:
external-link-foreground-hover:
external-link-background-hover: inherit
external-link-background-visited: inherit
external-link-background: inherit
external-link-foreground-hover: inherit
external-link-foreground-visited: #0000aa
external-link-foreground: #0000ee
foreground: #333353

View File

@ -0,0 +1,105 @@
title: $:/palettes/Muted
name: Muted
description: Bright tiddlers on a muted background
tags: $:/tags/Palette
type: application/x-tiddler-dictionary
alert-background: #ffe476
alert-border: #b99e2f
alert-highlight: #881122
alert-muted-foreground: #b99e2f
background: #ffffff
blockquote-bar: <<colour muted-foreground>>
code-background: #f7f7f9
code-border: #e1e1e8
code-foreground: #dd1144
dirty-indicator: #ff0000
download-background: #34c734
download-foreground: <<colour background>>
dragger-background: <<colour foreground>>
dragger-foreground: <<colour background>>
dropdown-background: <<colour background>>
dropdown-border: <<colour muted-foreground>>
dropdown-tab-background-selected: #fff
dropdown-tab-background: #ececec
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover: inherit
external-link-background-visited: inherit
external-link-background: inherit
external-link-foreground-hover: inherit
external-link-foreground-visited: #0000aa
external-link-foreground: #0000ee
foreground: #333333
message-background: #ecf2ff
message-border: #cfd6e6
message-foreground: #547599
modal-backdrop: <<colour foreground>>
modal-background: <<colour background>>
modal-border: #999999
modal-footer-background: #f5f5f5
modal-footer-border: #dddddd
modal-header-border: #eeeeee
muted-foreground: #bbb
notification-background: #ffffdd
notification-border: #999999
page-background: #6f6f70
pre-background: #f5f5f5
pre-border: #cccccc
primary: #29a6ee
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #c2c1c2
sidebar-foreground-shadow: rgba(255,255,255,0)
sidebar-foreground: #d3d2d4
sidebar-muted-foreground-hover: #444444
sidebar-muted-foreground: #c0c0c0
sidebar-tab-background-selected: #6f6f70
sidebar-tab-background: #666667
sidebar-tab-border-selected: #999
sidebar-tab-border: #515151
sidebar-tab-divider: #999
sidebar-tab-foreground-selected:
sidebar-tab-foreground: #999
sidebar-tiddler-link-foreground-hover: #444444
sidebar-tiddler-link-foreground: #d1d0d2
static-alert-foreground: #aaaaaa
tab-background-selected: #ffffff
tab-background: #d8d8d8
tab-border-selected: #d8d8d8
tab-border: #cccccc
tab-divider: #d8d8d8
tab-foreground-selected: <<colour tab-foreground>>
tab-foreground: #666666
table-border: #dddddd
table-footer-background: #a8a8a8
table-header-background: #f0f0f0
tag-background: #d5ad34
tag-foreground: #ffffff
tiddler-background: <<colour background>>
tiddler-border: <<colour background>>
tiddler-controls-foreground-hover: #888888
tiddler-controls-foreground-selected: #444444
tiddler-controls-foreground: #cccccc
tiddler-editor-background: #f8f8f8
tiddler-editor-border-image: #ffffff
tiddler-editor-border: #cccccc
tiddler-editor-fields-even: #e0e8e0
tiddler-editor-fields-odd: #f0f4f0
tiddler-info-background: #f8f8f8
tiddler-info-border: #dddddd
tiddler-info-tab-background: #f8f8f8
tiddler-link-background: <<colour background>>
tiddler-link-foreground: <<colour primary>>
tiddler-subtitle-foreground: #c0c0c0
tiddler-title-foreground: #182955
toolbar-new-button:
toolbar-options-button:
toolbar-save-button:
toolbar-info-button:
toolbar-edit-button:
toolbar-close-button:
toolbar-delete-button:
toolbar-cancel-button:
toolbar-done-button:
untagged-background: #999999
very-muted-foreground: #888888

View File

@ -13,6 +13,7 @@ blockquote-bar: <<colour muted-foreground>>
code-background: #f7f7f9
code-border: #e1e1e8
code-foreground: #dd1144
dirty-indicator: #ff0000
download-background: #34c734
download-foreground: <<colour background>>
dragger-background: <<colour foreground>>
@ -22,10 +23,10 @@ dropdown-border: <<colour muted-foreground>>
dropdown-tab-background-selected: #fff
dropdown-tab-background: #ececec
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover:
external-link-background-visited:
external-link-background:
external-link-foreground-hover:
external-link-background-hover: inherit
external-link-background-visited: inherit
external-link-background: inherit
external-link-foreground-hover: inherit
external-link-foreground-visited: #0000aa
external-link-foreground: #0000ee
foreground: #333333

View File

@ -13,6 +13,7 @@ blockquote-bar: <<colour muted-foreground>>
code-background: #f7f7f9
code-border: #e1e1e8
code-foreground: #dd1144
dirty-indicator: #ff0000
download-background: #34c734
download-foreground: <<colour background>>
dragger-background: <<colour foreground>>
@ -22,10 +23,10 @@ dropdown-border: <<colour muted-foreground>>
dropdown-tab-background-selected: #fff
dropdown-tab-background: #ececec
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover:
external-link-background-visited:
external-link-background:
external-link-foreground-hover:
external-link-background-hover: inherit
external-link-background-visited: inherit
external-link-background: inherit
external-link-foreground-hover: inherit
external-link-foreground-visited: #0000aa
external-link-foreground: #0000ee
foreground: #333333

View File

@ -13,6 +13,7 @@ blockquote-bar: <<colour muted-foreground>>
code-background: #f7f7f9
code-border: #e1e1e8
code-foreground: #dd1144
dirty-indicator: #ff0000
download-background: #34c734
download-foreground: <<colour background>>
dragger-background: <<colour foreground>>
@ -22,10 +23,10 @@ dropdown-border: <<colour muted-foreground>>
dropdown-tab-background-selected: #fff
dropdown-tab-background: #ececec
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover:
external-link-background-visited:
external-link-background:
external-link-foreground-hover:
external-link-background-hover: inherit
external-link-background-visited: inherit
external-link-background: inherit
external-link-foreground-hover: inherit
external-link-foreground-visited: #0000aa
external-link-foreground: #0000ee
foreground: #333333
@ -47,7 +48,7 @@ pre-border: #cccccc
primary: #5778d8
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #ffffff
sidebar-controls-foreground: #aaaaaa
sidebar-foreground-shadow: rgba(255,255,255, 0.8)
sidebar-foreground: #acacac
sidebar-muted-foreground-hover: #444444

View File

@ -3,5 +3,6 @@
"description": "TiddlyWiki5 core plugin",
"author": "JeremyRuston",
"core-version": ">=5.0.0",
"plugin-priority": "0"
"plugin-priority": "0",
"list": "readme"
}

8
core/readme.tid Normal file
View File

@ -0,0 +1,8 @@
title: $:/core/readme
This plugin contains TiddlyWiki's core components, comprising:
* JavaScript code modules
* Icons
* Templates needed to create TiddlyWiki's user interface
* British English (''en-GB'') translations of the localisable strings used by the core

View File

@ -1,6 +1,6 @@
title: $:/core/save/all
\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
\end
{{$:/core/templates/tiddlywiki5.html}}

View File

@ -1,6 +1,6 @@
title: $:/core/save/empty
\define saveTiddlerFilter()
[is[system]] -[prefix[$:/state/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
[is[system]] -[prefix[$:/state/popup/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
\end
{{$:/core/templates/tiddlywiki5.html}}

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