Beginning of one-shot UI for upgrade.html

print-window-tiddler
Jermolene 2014-07-14 14:53:21 +01:00
rodzic 07f13b310d
commit c0edca78c8
11 zmienionych plików z 109 dodań i 16 usunięć

Wyświetl plik

@ -40,6 +40,15 @@ node .\tiddlywiki.js ^
--build favicon empty static index ^
|| 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"
node .\tiddlywiki.js ^

9
bld.sh
Wyświetl plik

@ -41,6 +41,15 @@ node ./tiddlywiki.js \
--build favicon empty static index \
|| 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"
node ./tiddlywiki.js \

Wyświetl plik

@ -420,7 +420,8 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
newFields = new Object({
title: IMPORT_TITLE,
type: "application/json",
"plugin-type": "import"
"plugin-type": "import",
"status": "pending"
}),
incomingTiddlers = [];
// Process each tiddler
@ -446,18 +447,21 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
// Save the $:/Import tiddler
newFields.text = JSON.stringify(importData,null,$tw.config.preferences.jsonSpaces);
this.wiki.addTiddler(new $tw.Tiddler(importTiddler,newFields));
// Get the story and history details
var storyList = this.getStoryList(),
history = [];
// Add it to the story
if(storyList.indexOf(IMPORT_TITLE) === -1) {
storyList.unshift(IMPORT_TITLE);
// Update the story and history details
debugger;
if(this.getVariable("tw-auto-open-on-import") !== "no") {
var storyList = this.getStoryList(),
history = [];
// Add it to the story
if(storyList.indexOf(IMPORT_TITLE) === -1) {
storyList.unshift(IMPORT_TITLE);
}
// And to history
history.push(IMPORT_TITLE);
// Save the updated story and history
this.saveStoryList(storyList);
this.addToHistory(history);
}
// And to history
history.push(IMPORT_TITLE);
// Save the updated story and history
this.saveStoryList(storyList);
this.addToHistory(history);
return false;
};
@ -477,7 +481,11 @@ NavigatorWidget.prototype.handlePerformImportEvent = function(event) {
}
});
// 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
this.addToHistory([IMPORT_TITLE]);
};

Wyświetl plik

@ -9,9 +9,6 @@
"build": {
"index": [
"--rendertiddler","$:/core/save/all","index.html","text/plain"],
"upgrade": [
"--makelibrary",
"--rendertiddler","$:/core/save/all","upgrade.html","text/plain"],
"externalimages": [
"--savetiddlers","[is[image]]","images",
"--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",

Wyświetl plik

@ -0,0 +1,14 @@
{
"plugins": [
"tiddlywiki/upgrade"
],
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
],
"build": {
"upgrade": [
"--makelibrary",
"--rendertiddler","$:/core/save/all","upgrade.html","text/plain"]
}
}

Wyświetl plik

@ -0,0 +1 @@
title: $:/DefaultTiddlers

Wyświetl plik

@ -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>

Wyświetl plik

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/upgrade",
"description": "User interface for upgrading TiddlyWiki documents",
"author": "JeremyRuston",
"core-version": ">=5.0.0"
}

Wyświetl plik

@ -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}}

Wyświetl plik

@ -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>

Wyświetl plik

@ -0,0 +1,6 @@
title: $:/plugins/tiddlywiki/upgrade/set-auto-open-on-import
tags: $:/tags/Macro
\define tw-auto-open-on-import()
no
\end