kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Block temporary state tiddlers from import/upgrade
rodzic
a9279fcfed
commit
2bbe9f76ec
|
@ -9,5 +9,6 @@ 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>>/>
|
||||
|
|
|
@ -12,7 +12,8 @@ Upgrader module that suppresses certain system tiddlers that shouldn't be import
|
|||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var DONT_IMPORT_LIST = ["$:/StoryList","$:/HistoryList"];
|
||||
var DONT_IMPORT_LIST = ["$:/StoryList","$:/HistoryList"],
|
||||
DONT_IMPORT_PREFIX_LIST = ["$:/temp/","$:/state/"];
|
||||
|
||||
exports.upgrade = function(wiki,titles,tiddlers) {
|
||||
var self = this,
|
||||
|
@ -22,6 +23,14 @@ exports.upgrade = function(wiki,titles,tiddlers) {
|
|||
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;
|
||||
|
|
Ładowanie…
Reference in New Issue