mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-27 09:24:45 +00:00
Block temporary state tiddlers from import/upgrade
This commit is contained in:
parent
a9279fcfed
commit
2bbe9f76ec
@ -9,5 +9,6 @@ Listing/Title/Caption: Title
|
|||||||
Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin
|
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/Suppressed/Version: Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>)
|
||||||
Upgrader/Plugins/Upgraded: Upgraded plugin from <<incoming>> to <<upgraded>>
|
Upgrader/Plugins/Upgraded: Upgraded plugin from <<incoming>> to <<upgraded>>
|
||||||
|
Upgrader/State/Suppressed: Blocked temporary state tiddler
|
||||||
Upgrader/System/Suppressed: Blocked system tiddler
|
Upgrader/System/Suppressed: Blocked system tiddler
|
||||||
Upgrader/ThemeTweaks/Created: Migrated theme tweak from <$text text=<<from>>/>
|
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 */
|
/*global $tw: false */
|
||||||
"use strict";
|
"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) {
|
exports.upgrade = function(wiki,titles,tiddlers) {
|
||||||
var self = this,
|
var self = this,
|
||||||
@ -22,6 +23,14 @@ exports.upgrade = function(wiki,titles,tiddlers) {
|
|||||||
if(DONT_IMPORT_LIST.indexOf(title) !== -1) {
|
if(DONT_IMPORT_LIST.indexOf(title) !== -1) {
|
||||||
tiddlers[title] = Object.create(null);
|
tiddlers[title] = Object.create(null);
|
||||||
messages[title] = $tw.language.getString("Import/Upgrader/System/Suppressed");
|
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;
|
return messages;
|
||||||
|
Loading…
Reference in New Issue
Block a user