mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-15 10:30:03 +00:00
Beginning of one-shot UI for upgrade.html
This commit is contained in:
parent
07f13b310d
commit
c0edca78c8
9
bld.cmd
9
bld.cmd
@ -40,6 +40,15 @@ node .\tiddlywiki.js ^
|
|||||||
--build favicon empty static index ^
|
--build favicon empty static index ^
|
||||||
|| exit 1
|
|| 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"
|
rem encrypted.html: a version of the main file encrypted with the password "password"
|
||||||
|
|
||||||
node .\tiddlywiki.js ^
|
node .\tiddlywiki.js ^
|
||||||
|
9
bld.sh
9
bld.sh
@ -41,6 +41,15 @@ node ./tiddlywiki.js \
|
|||||||
--build favicon empty static index \
|
--build favicon empty static index \
|
||||||
|| exit 1
|
|| 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"
|
# encrypted.html: a version of the main file encrypted with the password "password"
|
||||||
|
|
||||||
node ./tiddlywiki.js \
|
node ./tiddlywiki.js \
|
||||||
|
@ -420,7 +420,8 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
|||||||
newFields = new Object({
|
newFields = new Object({
|
||||||
title: IMPORT_TITLE,
|
title: IMPORT_TITLE,
|
||||||
type: "application/json",
|
type: "application/json",
|
||||||
"plugin-type": "import"
|
"plugin-type": "import",
|
||||||
|
"status": "pending"
|
||||||
}),
|
}),
|
||||||
incomingTiddlers = [];
|
incomingTiddlers = [];
|
||||||
// Process each tiddler
|
// Process each tiddler
|
||||||
@ -446,7 +447,9 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
|||||||
// Save the $:/Import tiddler
|
// Save the $:/Import tiddler
|
||||||
newFields.text = JSON.stringify(importData,null,$tw.config.preferences.jsonSpaces);
|
newFields.text = JSON.stringify(importData,null,$tw.config.preferences.jsonSpaces);
|
||||||
this.wiki.addTiddler(new $tw.Tiddler(importTiddler,newFields));
|
this.wiki.addTiddler(new $tw.Tiddler(importTiddler,newFields));
|
||||||
// Get the story and history details
|
// Update the story and history details
|
||||||
|
debugger;
|
||||||
|
if(this.getVariable("tw-auto-open-on-import") !== "no") {
|
||||||
var storyList = this.getStoryList(),
|
var storyList = this.getStoryList(),
|
||||||
history = [];
|
history = [];
|
||||||
// Add it to the story
|
// Add it to the story
|
||||||
@ -458,6 +461,7 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
|||||||
// Save the updated story and history
|
// Save the updated story and history
|
||||||
this.saveStoryList(storyList);
|
this.saveStoryList(storyList);
|
||||||
this.addToHistory(history);
|
this.addToHistory(history);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -477,7 +481,11 @@ NavigatorWidget.prototype.handlePerformImportEvent = function(event) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Replace the $:/Import tiddler with an import report
|
// Replace the $:/Import tiddler with an import report
|
||||||
this.wiki.addTiddler(new $tw.Tiddler({title: IMPORT_TITLE, text: importReport.join("\n")}));
|
this.wiki.addTiddler(new $tw.Tiddler({
|
||||||
|
title: IMPORT_TITLE,
|
||||||
|
text: importReport.join("\n"),
|
||||||
|
"status": "complete"
|
||||||
|
}));
|
||||||
// Navigate to the $:/Import tiddler
|
// Navigate to the $:/Import tiddler
|
||||||
this.addToHistory([IMPORT_TITLE]);
|
this.addToHistory([IMPORT_TITLE]);
|
||||||
};
|
};
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
"build": {
|
"build": {
|
||||||
"index": [
|
"index": [
|
||||||
"--rendertiddler","$:/core/save/all","index.html","text/plain"],
|
"--rendertiddler","$:/core/save/all","index.html","text/plain"],
|
||||||
"upgrade": [
|
|
||||||
"--makelibrary",
|
|
||||||
"--rendertiddler","$:/core/save/all","upgrade.html","text/plain"],
|
|
||||||
"externalimages": [
|
"externalimages": [
|
||||||
"--savetiddlers","[is[image]]","images",
|
"--savetiddlers","[is[image]]","images",
|
||||||
"--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
|
"--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
|
||||||
|
14
editions/upgrade/tiddlywiki.info
Normal file
14
editions/upgrade/tiddlywiki.info
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"plugins": [
|
||||||
|
"tiddlywiki/upgrade"
|
||||||
|
],
|
||||||
|
"themes": [
|
||||||
|
"tiddlywiki/vanilla",
|
||||||
|
"tiddlywiki/snowwhite"
|
||||||
|
],
|
||||||
|
"build": {
|
||||||
|
"upgrade": [
|
||||||
|
"--makelibrary",
|
||||||
|
"--rendertiddler","$:/core/save/all","upgrade.html","text/plain"]
|
||||||
|
}
|
||||||
|
}
|
1
plugins/tiddlywiki/upgrade/DefaultTiddlers.tid
Normal file
1
plugins/tiddlywiki/upgrade/DefaultTiddlers.tid
Normal file
@ -0,0 +1 @@
|
|||||||
|
title: $:/DefaultTiddlers
|
34
plugins/tiddlywiki/upgrade/UpgradeWizard.tid
Normal file
34
plugins/tiddlywiki/upgrade/UpgradeWizard.tid
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
title: $:/UpgradeWizard
|
||||||
|
tags: $:/tags/StoryBackdrop
|
||||||
|
|
||||||
|
<$list filter="[[$:/Import]is[missing]]">
|
||||||
|
|
||||||
|
Drag a TiddlyWiki file here to upgrade it
|
||||||
|
|
||||||
|
<$browse/>
|
||||||
|
|
||||||
|
</$list>
|
||||||
|
|
||||||
|
<$reveal state="$:/Import!!status" type="match" text="pending">
|
||||||
|
|
||||||
|
And now there's a pending import
|
||||||
|
|
||||||
|
<$set name="storyTiddler" value="$:/Import">
|
||||||
|
|
||||||
|
<$tiddler tiddler="$:/Import">
|
||||||
|
|
||||||
|
<$transclude tiddler="$:/core/ui/ViewTemplate/import"/>
|
||||||
|
|
||||||
|
</$tiddler>
|
||||||
|
|
||||||
|
</$set>
|
||||||
|
|
||||||
|
</$reveal>
|
||||||
|
|
||||||
|
<$reveal state="$:/Import!!status" type="match" text="complete">
|
||||||
|
|
||||||
|
All done
|
||||||
|
|
||||||
|
{{$:/plugins/tiddlywiki/upgrade/save}}
|
||||||
|
|
||||||
|
</$reveal>
|
6
plugins/tiddlywiki/upgrade/plugin.info
Normal file
6
plugins/tiddlywiki/upgrade/plugin.info
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"title": "$:/plugins/tiddlywiki/upgrade",
|
||||||
|
"description": "User interface for upgrading TiddlyWiki documents",
|
||||||
|
"author": "JeremyRuston",
|
||||||
|
"core-version": ">=5.0.0"
|
||||||
|
}
|
6
plugins/tiddlywiki/upgrade/save-tiddler-filter.tid
Normal file
6
plugins/tiddlywiki/upgrade/save-tiddler-filter.tid
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
title: $:/plugins/tiddlywiki/upgrade/save-tiddler-filter
|
||||||
|
|
||||||
|
\define saveTiddlerFilter()
|
||||||
|
[is[tiddler]] -[[$:/UpgradeLibrary]] -[[$:/plugins/tiddlywiki/upgrade]] -[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}}
|
3
plugins/tiddlywiki/upgrade/save.tid
Normal file
3
plugins/tiddlywiki/upgrade/save.tid
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
title: $:/plugins/tiddlywiki/upgrade/save
|
||||||
|
|
||||||
|
<$button message="tw-download-file" param="$:/plugins/tiddlywiki/upgrade/save-tiddler-filter" class="btn-big-green">Save upgraded ~TiddlyWiki file {{$:/core/images/save-button}}</$button>
|
6
plugins/tiddlywiki/upgrade/set-auto-open-on-import.tid
Normal file
6
plugins/tiddlywiki/upgrade/set-auto-open-on-import.tid
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
title: $:/plugins/tiddlywiki/upgrade/set-auto-open-on-import
|
||||||
|
tags: $:/tags/Macro
|
||||||
|
|
||||||
|
\define tw-auto-open-on-import()
|
||||||
|
no
|
||||||
|
\end
|
Loading…
x
Reference in New Issue
Block a user