upgrade TiddlyWiki to v2.9.1
Basically, TiddlyWiki "classic" is in maintenance mode, but it is still supported. This minor upgarde brings some bugfixes, most notably a minor adjustment to work well with the new Firefox Quantum, which switched to the more restricted WebExtensions and discontinued support for the old-style XUL based plug-ins. This bold move by the firefox project placed a lot of well established, mature extensions on the brink of extinction. Especially TiddlyWiki has gradually lost its original appeal of a low-ceremony guerrilla wiki. However, it is still a sweet little gem for experienced users, albeit a bit brittle to use. You are now either - forced to enter the target destination on each save - or forced to arrange tiddly wiki to reside within your default download folder and use a firefox plug-in to automate the save process (I use at the moment https://addons.mozilla.org/en-GB/firefox/addon/file-backups/ - or forced to install a 100 MB blurb of java-script based local server to run TiddlyWikiDesktop The bitter irony of the situation is, what still works more-or-less painless is to place your TiddlyWiki into the cloud. Yikes, here we go.
This commit is contained in:
parent
572bd38fec
commit
7e562a4c66
2 changed files with 65 additions and 43 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<script id="versionArea" type="text/javascript">
|
||||
//<![CDATA[
|
||||
var version = {title: "TiddlyWiki", major: 2, minor: 8, revision: 1, date: new Date("June 23, 2013"), extensions: {}};
|
||||
var version = {title: "TiddlyWiki", major: 2, minor: 9, revision: 1, date: new Date("April 12, 2018"), extensions: {}};
|
||||
|
||||
//]]>
|
||||
</script>
|
||||
|
|
@ -46,7 +46,7 @@ DAMAGE.
|
|||
<!--}}}-->
|
||||
|
||||
<!--PRE-HEAD-END-->
|
||||
<title> Empty TiddlyWiki 2.8.1 - a local web scrapbook in a single HTML page </title>
|
||||
<title>TiddlyWiki 2.9.1 (classic)</title>
|
||||
<style id="styleArea" type="text/css">
|
||||
#saveTest {display:none;}
|
||||
#messageArea {display:none;}
|
||||
|
|
@ -453,7 +453,7 @@ table.listView th, table.listView td, table.listView tr {padding:0 3px 0 3px;}
|
|||
.viewer code {font-size:1.2em; line-height:1.4em;}
|
||||
|
||||
.editor {font-size:1.1em;}
|
||||
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
|
||||
.editor input, .editor textarea {display:block; width:100%; box-sizing: border-box; font:inherit;}
|
||||
.editorFooter {padding:0.25em 0; font-size:.9em;}
|
||||
.editorFooter .button {padding-top:0; padding-bottom:0;}
|
||||
|
||||
|
|
@ -602,6 +602,7 @@ config.options = {
|
|||
chkInsertTabs: false,
|
||||
chkUsePreForStorage: true, // Whether to use <pre> format for storage
|
||||
chkDisplayInstrumentation: false,
|
||||
chkRemoveExtraMarkers: false, // #162
|
||||
txtBackupFolder: "",
|
||||
txtEditorFocus: "text",
|
||||
txtMainTab: "tabTimeline",
|
||||
|
|
@ -718,7 +719,7 @@ if(!((new RegExp("[\u0150\u0170]","g")).test("\u0150"))) {
|
|||
}
|
||||
config.textPrimitives.sliceSeparator = "::";
|
||||
config.textPrimitives.sectionSeparator = "##";
|
||||
config.textPrimitives.urlPattern = "(?:file|http|https|mailto|ftp|irc|news|data):[^\\s'\"]+(?:/|\\b)";
|
||||
config.textPrimitives.urlPattern = "(?:file|http|https|mailto|ftp|irc|news|data):[^\\s'\"]+(?:/|\\b|\\[|\\])"; // #132
|
||||
config.textPrimitives.unWikiLink = "~";
|
||||
config.textPrimitives.wikiLink = "(?:(?:" + config.textPrimitives.upperLetter + "+" +
|
||||
config.textPrimitives.lowerLetter + "+" +
|
||||
|
|
@ -765,7 +766,7 @@ config.shadowTiddlers = {
|
|||
AdvancedOptions: '<<options>>',
|
||||
PluginManager: '<<plugins>>',
|
||||
SystemSettings: '',
|
||||
ToolbarCommands: '|~ViewToolbar|closeTiddler closeOthers +editTiddler > fields syncing permalink references jump|\n|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|',
|
||||
ToolbarCommands: '|~ViewToolbar|closeTiddler closeOthers +editTiddler > fields permalink references jump|\n|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|', // #160
|
||||
WindowTitle: '<<tiddler SiteTitle>> - <<tiddler SiteSubtitle>>'
|
||||
};
|
||||
|
||||
|
|
@ -833,6 +834,7 @@ merge(config.optionsDesc,{
|
|||
chkForceMinorUpdate: "Don't update modifier username and date when editing tiddlers",
|
||||
chkConfirmDelete: "Require confirmation before deleting tiddlers",
|
||||
chkInsertTabs: "Use the tab key to insert tab characters instead of moving between fields",
|
||||
chkRemoveExtraMarkers: "Replace unused transclusion markers with blanks", // #162
|
||||
txtBackupFolder: "Name of folder to use for backups",
|
||||
txtMaxEditRows: "Maximum number of rows in edit boxes",
|
||||
txtTheme: "Name of the theme to use",
|
||||
|
|
@ -2673,7 +2675,7 @@ config.macros.tiddler.handler = function(place,macroName,params,wikifier,paramSt
|
|||
refresh: "content", tiddler: tiddlerName
|
||||
});
|
||||
if(args!==undefined)
|
||||
wrapper.setAttribute("args","[["+args.join("]] [[")+"]]");
|
||||
wrapper.macroArgs=args; // #154
|
||||
this.transclude(wrapper,tiddlerName,args);
|
||||
};
|
||||
|
||||
|
|
@ -2695,6 +2697,12 @@ config.macros.tiddler.transclude = function(wrapper,tiddlerName,args)
|
|||
var placeholderRE = new RegExp("\\$" + (i + 1),"mg");
|
||||
text = text.replace(placeholderRE,args[i]);
|
||||
}
|
||||
// #162 start
|
||||
if (n && config.options.chkRemoveExtraMarkers) for(i=n; i<9; i++) {
|
||||
var placeholderRE = new RegExp("\\$" + (i + 1),"mg");
|
||||
text = text.replace(placeholderRE,"");
|
||||
}
|
||||
// #162 end
|
||||
config.macros.tiddler.renderText(wrapper,text,tiddlerName);
|
||||
} finally {
|
||||
stack.pop();
|
||||
|
|
@ -3073,7 +3081,7 @@ config.macros.newTiddler.onClickNewTiddler = function()
|
|||
var customFields = this.getAttribute("customFields");
|
||||
if(!customFields && !store.isShadowTiddler(title))
|
||||
customFields = String.encodeHashMap(config.defaultCustomFields);
|
||||
story.displayTiddler(null,title,template,false,null,null);
|
||||
story.displayTiddler(this,title,template,false,null,null); // #161
|
||||
var tiddlerElem = story.getTiddler(title);
|
||||
if(customFields)
|
||||
story.addCustomFields(tiddlerElem,customFields);
|
||||
|
|
@ -3894,7 +3902,7 @@ TiddlyWiki.prototype.getRecursiveTiddlerText = function(title,defaultText,depth)
|
|||
};
|
||||
|
||||
//TiddlyWiki.prototype.slicesRE = /(?:^([\'\/]{0,2})~?([\.\w]+)\:\1[\t\x20]*([^\n]+)[\t\x20]*$)|(?:^\|([\'\/]{0,2})~?([\.\w]+)\:?\4\|[\t\x20]*([^\n]+)[\t\x20]*\|$)/gm;
|
||||
TiddlyWiki.prototype.slicesRE = /(?:^([\'\/]{0,2})~?([\.\w]+)\:\1[\t\x20]*([^\n]*)[\t\x20]*$)|(?:^\|([\'\/]{0,2})~?([\.\w]+)\:?\4\|[\t\x20]*([^\|\n]*)[\t\x20]*\|$)/gm;
|
||||
TiddlyWiki.prototype.slicesRE = /(?:^([\'\/]{0,2})~?([\.\w]+)\:\1[\t\x20]*([^\n]+)[\t\x20]*$)|(?:^\|\x20?([\'\/]{0,2})~?([^\|\s\:\~\'\/]|(?:[^\|\s~\'\/][^\|\n\f\r]*[^\|\s\:\'\/]))\:?\4[\x20\t]*\|[\t\x20]*([^\n\t\x20](?:[^\n]*[^\n\t\x20])?)[\t\x20]*\|$)/gm; // #112
|
||||
// @internal
|
||||
TiddlyWiki.prototype.calcAllSlices = function(title)
|
||||
{
|
||||
|
|
@ -4385,11 +4393,11 @@ config.filters = {
|
|||
};
|
||||
|
||||
// Filter a list of tiddlers
|
||||
TiddlyWiki.prototype.filterTiddlers = function(filter)
|
||||
TiddlyWiki.prototype.filterTiddlers = function(filter,results)
|
||||
{
|
||||
var re = /([^\s\[\]]+)|(?:\[([ \w\.\-]+)\[([^\]]+)\]\])|(?:\[\[([^\]]+)\]\])/mg;
|
||||
|
||||
var results = [];
|
||||
results = results || [];
|
||||
if(filter) {
|
||||
var match = re.exec(filter);
|
||||
while(match) {
|
||||
|
|
@ -4763,7 +4771,7 @@ Story.prototype.refreshTiddler = function(title,template,force,customFields,defa
|
|||
var tags = [];
|
||||
tiddler.set(title,store.getTiddlerText(title),config.views.wikified.shadowModifier,version.date,tags,version.date);
|
||||
} else {
|
||||
var text = template=="EditTemplate" ?
|
||||
var text = template==config.tiddlerTemplates[DEFAULT_EDIT_TEMPLATE] ? // #166
|
||||
config.views.editor.defaultText.format([title]) :
|
||||
config.views.wikified.defaultText.format([title]);
|
||||
text = defaultText || text;
|
||||
|
|
@ -6056,6 +6064,7 @@ config.refreshers = {
|
|||
|
||||
tiddler: function(e,changeList)
|
||||
{
|
||||
if (startingUp) return true; // #147
|
||||
var title = e.getAttribute("tiddler");
|
||||
var template = e.getAttribute("template");
|
||||
if(changeList && (changeList.indexOf && changeList.indexOf(title) != -1) && !story.isDirty(title))
|
||||
|
|
@ -6069,7 +6078,7 @@ config.refreshers = {
|
|||
{
|
||||
var title = e.getAttribute("tiddler");
|
||||
var force = e.getAttribute("force");
|
||||
var args = e.getAttribute("args");
|
||||
var args = e.macroArgs; // #154
|
||||
if(force != null || changeList == null || (changeList.indexOf && changeList.indexOf(title) != -1)) {
|
||||
jQuery(e).empty();
|
||||
config.macros.tiddler.transclude(e,title,args);
|
||||
|
|
@ -6268,9 +6277,12 @@ function getCookies()
|
|||
function loadCookies()
|
||||
{
|
||||
var i,cookies = getCookies();
|
||||
if(cookies['TiddlyWiki']) {
|
||||
if(cookies['TiddlyWikiClassicOptions']) // TW291 and later //#159
|
||||
cookies = cookies['TiddlyWikiClassicOptions'].replace(/%22/g,'"').replace(/%25/g,'%').decodeHashMap(); // #159
|
||||
else if(cookies['TiddlyWikiOptions']) // TW290 beta //#159
|
||||
cookies = cookies['TiddlyWikiOptions'].replace(/%25/g,'%').decodeHashMap(); // #159
|
||||
else if(cookies['TiddlyWiki']) // TW281 and earlier
|
||||
cookies = cookies['TiddlyWiki'].decodeHashMap();
|
||||
}
|
||||
for(i in cookies) {
|
||||
if(config.optionsSource[i] != 'setting') {
|
||||
setOption(i,cookies[i]);
|
||||
|
|
@ -6324,7 +6336,10 @@ function saveCookie(name)
|
|||
value = value == null ? 'false' : value;
|
||||
cookies[key] = value;
|
||||
}
|
||||
document.cookie = 'TiddlyWiki=' + String.encodeHashMap(cookies) + '; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/';
|
||||
// TW291 and later (#159)
|
||||
document.cookie = 'TiddlyWikiClassicOptions='
|
||||
+ String.encodeHashMap(cookies).replace(/%/g,'%25').replace(/"/g,'%22')
|
||||
+ '; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/';
|
||||
cookies = getCookies();
|
||||
var c;
|
||||
for(c in cookies) {
|
||||
|
|
@ -6639,7 +6654,7 @@ function recreateOriginal()
|
|||
content=content.replace(/<div id="saveTest">savetest<\/div>/,'<div id="saveTest"></div>');
|
||||
content=content.replace(/script><applet [^\>]*><\/applet>/g,'script>');
|
||||
content=content.replace(/><head>/,'>\n<head>');
|
||||
content=content.replace(/\n\n<\/body><\/html>$/,'</body>\n</html>\n');
|
||||
content=content.replace(/\n\n<\/body><\/html>$/,'</'+'body>\n</'+'html>\n'); // #170
|
||||
content=content.replace(/(<(meta) [^\>]*[^\/])>/g,'$1 />');
|
||||
content=content.replace(/<noscript>[^\<]*<\/noscript>/,
|
||||
function(m){return m.replace(/</g,'<').replace(/>/g,'>');});
|
||||
|
|
@ -7043,7 +7058,7 @@ function javaDebugInformation () {
|
|||
var applet = document.applets['TiddlySaver'];
|
||||
var what = [
|
||||
["Java Version", applet.getJavaVersion],
|
||||
["Last Exception", applet.getLastErrorMessage],
|
||||
["Last Exception", applet.getLastErrorMsg], // #156
|
||||
["Last Exception Stack Trace", applet.getLastErrorStackTrace],
|
||||
["System Properties", applet.getSystemProperties] ];
|
||||
|
||||
|
|
@ -8714,11 +8729,7 @@ String.prototype.format = function(s)
|
|||
// Escape any special RegExp characters with that character preceded by a backslash
|
||||
String.prototype.escapeRegExp = function()
|
||||
{
|
||||
var s = "\\^$*+?()=!|,{}[].";
|
||||
var t,c = this;
|
||||
for(t=0; t<s.length; t++)
|
||||
c = c.replace(new RegExp("\\" + s.substr(t,1),"g"),"\\" + s.substr(t,1));
|
||||
return c;
|
||||
return this.replace(/[\-\/\\\^\$\*\+\?\.\(\)\|\[\]\{\}]/g, '\\$&'); // #157
|
||||
};
|
||||
|
||||
// Convert "\" to "\s", newlines to "\n" (and remove carriage returns)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<script id="versionArea" type="text/javascript">
|
||||
//<![CDATA[
|
||||
var version = {title: "TiddlyWiki", major: 2, minor: 8, revision: 1, date: new Date("June 23, 2013"), extensions: {}};
|
||||
var version = {title: "TiddlyWiki", major: 2, minor: 9, revision: 1, date: new Date("April 12, 2018"), extensions: {}};
|
||||
|
||||
//]]>
|
||||
</script>
|
||||
|
|
@ -454,7 +454,7 @@ table.listView th, table.listView td, table.listView tr {padding:0 3px 0 3px;}
|
|||
.viewer code {font-size:1.2em; line-height:1.4em;}
|
||||
|
||||
.editor {font-size:1.1em;}
|
||||
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
|
||||
.editor input, .editor textarea {display:block; width:100%; box-sizing: border-box; font:inherit;}
|
||||
.editorFooter {padding:0.25em 0; font-size:.9em;}
|
||||
.editorFooter .button {padding-top:0; padding-bottom:0;}
|
||||
|
||||
|
|
@ -10347,6 +10347,7 @@ config.options = {
|
|||
chkInsertTabs: false,
|
||||
chkUsePreForStorage: true, // Whether to use <pre> format for storage
|
||||
chkDisplayInstrumentation: false,
|
||||
chkRemoveExtraMarkers: false, // #162
|
||||
txtBackupFolder: "",
|
||||
txtEditorFocus: "text",
|
||||
txtMainTab: "tabTimeline",
|
||||
|
|
@ -10463,7 +10464,7 @@ if(!((new RegExp("[\u0150\u0170]","g")).test("\u0150"))) {
|
|||
}
|
||||
config.textPrimitives.sliceSeparator = "::";
|
||||
config.textPrimitives.sectionSeparator = "##";
|
||||
config.textPrimitives.urlPattern = "(?:file|http|https|mailto|ftp|irc|news|data):[^\\s'\"]+(?:/|\\b)";
|
||||
config.textPrimitives.urlPattern = "(?:file|http|https|mailto|ftp|irc|news|data):[^\\s'\"]+(?:/|\\b|\\[|\\])"; // #132
|
||||
config.textPrimitives.unWikiLink = "~";
|
||||
config.textPrimitives.wikiLink = "(?:(?:" + config.textPrimitives.upperLetter + "+" +
|
||||
config.textPrimitives.lowerLetter + "+" +
|
||||
|
|
@ -10510,7 +10511,7 @@ config.shadowTiddlers = {
|
|||
AdvancedOptions: '<<options>>',
|
||||
PluginManager: '<<plugins>>',
|
||||
SystemSettings: '',
|
||||
ToolbarCommands: '|~ViewToolbar|closeTiddler closeOthers +editTiddler > fields syncing permalink references jump|\n|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|',
|
||||
ToolbarCommands: '|~ViewToolbar|closeTiddler closeOthers +editTiddler > fields permalink references jump|\n|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|', // #160
|
||||
WindowTitle: '<<tiddler SiteTitle>> - <<tiddler SiteSubtitle>>'
|
||||
};
|
||||
|
||||
|
|
@ -10578,6 +10579,7 @@ merge(config.optionsDesc,{
|
|||
chkForceMinorUpdate: "Don't update modifier username and date when editing tiddlers",
|
||||
chkConfirmDelete: "Require confirmation before deleting tiddlers",
|
||||
chkInsertTabs: "Use the tab key to insert tab characters instead of moving between fields",
|
||||
chkRemoveExtraMarkers: "Replace unused transclusion markers with blanks", // #162
|
||||
txtBackupFolder: "Name of folder to use for backups",
|
||||
txtMaxEditRows: "Maximum number of rows in edit boxes",
|
||||
txtTheme: "Name of the theme to use",
|
||||
|
|
@ -12418,7 +12420,7 @@ config.macros.tiddler.handler = function(place,macroName,params,wikifier,paramSt
|
|||
refresh: "content", tiddler: tiddlerName
|
||||
});
|
||||
if(args!==undefined)
|
||||
wrapper.setAttribute("args","[["+args.join("]] [[")+"]]");
|
||||
wrapper.macroArgs=args; // #154
|
||||
this.transclude(wrapper,tiddlerName,args);
|
||||
};
|
||||
|
||||
|
|
@ -12440,6 +12442,12 @@ config.macros.tiddler.transclude = function(wrapper,tiddlerName,args)
|
|||
var placeholderRE = new RegExp("\\$" + (i + 1),"mg");
|
||||
text = text.replace(placeholderRE,args[i]);
|
||||
}
|
||||
// #162 start
|
||||
if (n && config.options.chkRemoveExtraMarkers) for(i=n; i<9; i++) {
|
||||
var placeholderRE = new RegExp("\\$" + (i + 1),"mg");
|
||||
text = text.replace(placeholderRE,"");
|
||||
}
|
||||
// #162 end
|
||||
config.macros.tiddler.renderText(wrapper,text,tiddlerName);
|
||||
} finally {
|
||||
stack.pop();
|
||||
|
|
@ -12818,7 +12826,7 @@ config.macros.newTiddler.onClickNewTiddler = function()
|
|||
var customFields = this.getAttribute("customFields");
|
||||
if(!customFields && !store.isShadowTiddler(title))
|
||||
customFields = String.encodeHashMap(config.defaultCustomFields);
|
||||
story.displayTiddler(null,title,template,false,null,null);
|
||||
story.displayTiddler(this,title,template,false,null,null); // #161
|
||||
var tiddlerElem = story.getTiddler(title);
|
||||
if(customFields)
|
||||
story.addCustomFields(tiddlerElem,customFields);
|
||||
|
|
@ -13639,7 +13647,7 @@ TiddlyWiki.prototype.getRecursiveTiddlerText = function(title,defaultText,depth)
|
|||
};
|
||||
|
||||
//TiddlyWiki.prototype.slicesRE = /(?:^([\'\/]{0,2})~?([\.\w]+)\:\1[\t\x20]*([^\n]+)[\t\x20]*$)|(?:^\|([\'\/]{0,2})~?([\.\w]+)\:?\4\|[\t\x20]*([^\n]+)[\t\x20]*\|$)/gm;
|
||||
TiddlyWiki.prototype.slicesRE = /(?:^([\'\/]{0,2})~?([\.\w]+)\:\1[\t\x20]*([^\n]*)[\t\x20]*$)|(?:^\|([\'\/]{0,2})~?([\.\w]+)\:?\4\|[\t\x20]*([^\|\n]*)[\t\x20]*\|$)/gm;
|
||||
TiddlyWiki.prototype.slicesRE = /(?:^([\'\/]{0,2})~?([\.\w]+)\:\1[\t\x20]*([^\n]+)[\t\x20]*$)|(?:^\|\x20?([\'\/]{0,2})~?([^\|\s\:\~\'\/]|(?:[^\|\s~\'\/][^\|\n\f\r]*[^\|\s\:\'\/]))\:?\4[\x20\t]*\|[\t\x20]*([^\n\t\x20](?:[^\n]*[^\n\t\x20])?)[\t\x20]*\|$)/gm; // #112
|
||||
// @internal
|
||||
TiddlyWiki.prototype.calcAllSlices = function(title)
|
||||
{
|
||||
|
|
@ -14130,11 +14138,11 @@ config.filters = {
|
|||
};
|
||||
|
||||
// Filter a list of tiddlers
|
||||
TiddlyWiki.prototype.filterTiddlers = function(filter)
|
||||
TiddlyWiki.prototype.filterTiddlers = function(filter,results)
|
||||
{
|
||||
var re = /([^\s\[\]]+)|(?:\[([ \w\.\-]+)\[([^\]]+)\]\])|(?:\[\[([^\]]+)\]\])/mg;
|
||||
|
||||
var results = [];
|
||||
results = results || [];
|
||||
if(filter) {
|
||||
var match = re.exec(filter);
|
||||
while(match) {
|
||||
|
|
@ -14508,7 +14516,7 @@ Story.prototype.refreshTiddler = function(title,template,force,customFields,defa
|
|||
var tags = [];
|
||||
tiddler.set(title,store.getTiddlerText(title),config.views.wikified.shadowModifier,version.date,tags,version.date);
|
||||
} else {
|
||||
var text = template=="EditTemplate" ?
|
||||
var text = template==config.tiddlerTemplates[DEFAULT_EDIT_TEMPLATE] ? // #166
|
||||
config.views.editor.defaultText.format([title]) :
|
||||
config.views.wikified.defaultText.format([title]);
|
||||
text = defaultText || text;
|
||||
|
|
@ -15801,6 +15809,7 @@ config.refreshers = {
|
|||
|
||||
tiddler: function(e,changeList)
|
||||
{
|
||||
if (startingUp) return true; // #147
|
||||
var title = e.getAttribute("tiddler");
|
||||
var template = e.getAttribute("template");
|
||||
if(changeList && (changeList.indexOf && changeList.indexOf(title) != -1) && !story.isDirty(title))
|
||||
|
|
@ -15814,7 +15823,7 @@ config.refreshers = {
|
|||
{
|
||||
var title = e.getAttribute("tiddler");
|
||||
var force = e.getAttribute("force");
|
||||
var args = e.getAttribute("args");
|
||||
var args = e.macroArgs; // #154
|
||||
if(force != null || changeList == null || (changeList.indexOf && changeList.indexOf(title) != -1)) {
|
||||
jQuery(e).empty();
|
||||
config.macros.tiddler.transclude(e,title,args);
|
||||
|
|
@ -16013,9 +16022,12 @@ function getCookies()
|
|||
function loadCookies()
|
||||
{
|
||||
var i,cookies = getCookies();
|
||||
if(cookies['TiddlyWiki']) {
|
||||
if(cookies['TiddlyWikiClassicOptions']) // TW291 and later //#159
|
||||
cookies = cookies['TiddlyWikiClassicOptions'].replace(/%22/g,'"').replace(/%25/g,'%').decodeHashMap(); // #159
|
||||
else if(cookies['TiddlyWikiOptions']) // TW290 beta //#159
|
||||
cookies = cookies['TiddlyWikiOptions'].replace(/%25/g,'%').decodeHashMap(); // #159
|
||||
else if(cookies['TiddlyWiki']) // TW281 and earlier
|
||||
cookies = cookies['TiddlyWiki'].decodeHashMap();
|
||||
}
|
||||
for(i in cookies) {
|
||||
if(config.optionsSource[i] != 'setting') {
|
||||
setOption(i,cookies[i]);
|
||||
|
|
@ -16069,7 +16081,10 @@ function saveCookie(name)
|
|||
value = value == null ? 'false' : value;
|
||||
cookies[key] = value;
|
||||
}
|
||||
document.cookie = 'TiddlyWiki=' + String.encodeHashMap(cookies) + '; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/';
|
||||
// TW291 and later (#159)
|
||||
document.cookie = 'TiddlyWikiClassicOptions='
|
||||
+ String.encodeHashMap(cookies).replace(/%/g,'%25').replace(/"/g,'%22')
|
||||
+ '; expires=Fri, 1 Jan 2038 12:00:00 UTC; path=/';
|
||||
cookies = getCookies();
|
||||
var c;
|
||||
for(c in cookies) {
|
||||
|
|
@ -16384,7 +16399,7 @@ function recreateOriginal()
|
|||
content=content.replace(/<div id="saveTest">savetest<\/div>/,'<div id="saveTest"></div>');
|
||||
content=content.replace(/script><applet [^\>]*><\/applet>/g,'script>');
|
||||
content=content.replace(/><head>/,'>\n<head>');
|
||||
content=content.replace(/\n\n<\/body><\/html>$/,'</body>\n</html>\n');
|
||||
content=content.replace(/\n\n<\/body><\/html>$/,'</'+'body>\n</'+'html>\n'); // #170
|
||||
content=content.replace(/(<(meta) [^\>]*[^\/])>/g,'$1 />');
|
||||
content=content.replace(/<noscript>[^\<]*<\/noscript>/,
|
||||
function(m){return m.replace(/</g,'<').replace(/>/g,'>');});
|
||||
|
|
@ -16788,7 +16803,7 @@ function javaDebugInformation () {
|
|||
var applet = document.applets['TiddlySaver'];
|
||||
var what = [
|
||||
["Java Version", applet.getJavaVersion],
|
||||
["Last Exception", applet.getLastErrorMessage],
|
||||
["Last Exception", applet.getLastErrorMsg], // #156
|
||||
["Last Exception Stack Trace", applet.getLastErrorStackTrace],
|
||||
["System Properties", applet.getSystemProperties] ];
|
||||
|
||||
|
|
@ -18459,11 +18474,7 @@ String.prototype.format = function(s)
|
|||
// Escape any special RegExp characters with that character preceded by a backslash
|
||||
String.prototype.escapeRegExp = function()
|
||||
{
|
||||
var s = "\\^$*+?()=!|,{}[].";
|
||||
var t,c = this;
|
||||
for(t=0; t<s.length; t++)
|
||||
c = c.replace(new RegExp("\\" + s.substr(t,1),"g"),"\\" + s.substr(t,1));
|
||||
return c;
|
||||
return this.replace(/[\-\/\\\^\$\*\+\?\.\(\)\|\[\]\{\}]/g, '\\$&'); // #157
|
||||
};
|
||||
|
||||
// Convert "\" to "\s", newlines to "\n" (and remove carriage returns)
|
||||
|
|
|
|||
Loading…
Reference in a new issue