From 18ed2faf824aff1686f0165d025dd406e04da6a8 Mon Sep 17 00:00:00 2001 From: bimlas Date: Mon, 10 Dec 2018 22:32:32 +0100 Subject: [PATCH] Implement in $:/core/upgraders instead of navigator.js The core module tiddlers are not blocked, they are only marked. --- core/language/en-GB/Import.multids | 3 ++- core/modules/upgraders/system.js | 17 +++++++++++++++-- core/modules/widgets/navigator.js | 19 +------------------ 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/core/language/en-GB/Import.multids b/core/language/en-GB/Import.multids index 3c7ced320..bb8376d44 100644 --- a/core/language/en-GB/Import.multids +++ b/core/language/en-GB/Import.multids @@ -18,5 +18,6 @@ Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming < Upgrader/Plugins/Upgraded: Upgraded plugin from <> to <> Upgrader/State/Suppressed: Blocked temporary state tiddler Upgrader/System/Suppressed: Blocked system tiddler +Upgrader/System/Warning: Warning: Core module tiddler +Upgrader/System/Alert: You are about importing core module tiddlers. It is strongly recommend in the strongest terms NOT to use any hack that requires overwriting a core module, because it is likely to make the system unusable. Never import such tiddlers into an important wiki, just into a testing environment! Upgrader/ThemeTweaks/Created: Migrated theme tweak from <$text text=<>/> -Warning/Core: You are about importing risky tiddlers (<>). It is strongly recommend in the strongest terms NOT to use any hack that requires overwriting a core module, because it is likely to make the system unusable. Never import such tiddlers into an important wiki, just into a testing environment! diff --git a/core/modules/upgraders/system.js b/core/modules/upgraders/system.js index 3dae00422..a5f9970da 100644 --- a/core/modules/upgraders/system.js +++ b/core/modules/upgraders/system.js @@ -13,11 +13,13 @@ Upgrader module that suppresses certain system tiddlers that shouldn't be import "use strict"; var DONT_IMPORT_LIST = ["$:/StoryList","$:/HistoryList"], - DONT_IMPORT_PREFIX_LIST = ["$:/temp/","$:/state/"]; + DONT_IMPORT_PREFIX_LIST = ["$:/temp/","$:/state/"], + WARN_IMPORT_PREFIX_LIST = ["$:/core/modules/"]; exports.upgrade = function(wiki,titles,tiddlers) { var self = this, - messages = {}; + messages = {}, + showAlert = false; // Check for tiddlers on our list $tw.utils.each(titles,function(title) { if(DONT_IMPORT_LIST.indexOf(title) !== -1) { @@ -31,6 +33,17 @@ exports.upgrade = function(wiki,titles,tiddlers) { messages[title] = $tw.language.getString("Import/Upgrader/State/Suppressed"); } } + for(var t=0; t