From af264108c2c74351c7048bc87d068699aaa18bc3 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 10 Oct 2012 21:59:25 +0100 Subject: [PATCH] More rearchitecting of tw5dropbox --- dbld.sh | 13 ++- tw5dropbox/appwiki/plugins/dropbox-app.js | 22 +++++ tw5dropbox/appwiki/plugins/tiddlywiki.files | 36 +++++++++ .../wiki/AllTiddlers.tid | 0 tw5dropbox/appwiki/wiki/DefaultTiddlers.tid | 3 + tw5dropbox/appwiki/wiki/PageTemplate.tid | 80 +++++++++++++++++++ tw5dropbox/appwiki/wiki/SiteSubtitle.tid | 4 + tw5dropbox/appwiki/wiki/SiteTitle.tid | 4 + .../appwiki/wiki/index.template.html.tid | 37 +++++++++ .../wiki/styles.template.css.tid | 0 .../wiki/tw5dropbox.template.js.tid | 0 tw5dropbox/mainwiki/plugins/dropbox-main.js | 22 +++++ tw5dropbox/mainwiki/plugins/tiddlywiki.files | 8 ++ .../TiddlyWiki5 in the Sky with Dropbox.tid | 11 +++ tw5dropbox/mainwiki/tiddlers/WikiTemplate.tid | 10 +++ tw5dropbox/mainwiki/wiki/DefaultTiddlers.tid | 2 +- tw5dropbox/mainwiki/wiki/PageTemplate.tid | 50 +----------- .../mainwiki/wiki/index.template.html.tid | 32 +++++++- tw5dropbox/plugins/dropbox.js | 38 +++++++-- 19 files changed, 310 insertions(+), 62 deletions(-) create mode 100644 tw5dropbox/appwiki/plugins/dropbox-app.js create mode 100644 tw5dropbox/appwiki/plugins/tiddlywiki.files rename tw5dropbox/{mainwiki => appwiki}/wiki/AllTiddlers.tid (100%) create mode 100644 tw5dropbox/appwiki/wiki/DefaultTiddlers.tid create mode 100644 tw5dropbox/appwiki/wiki/PageTemplate.tid create mode 100644 tw5dropbox/appwiki/wiki/SiteSubtitle.tid create mode 100644 tw5dropbox/appwiki/wiki/SiteTitle.tid create mode 100644 tw5dropbox/appwiki/wiki/index.template.html.tid rename tw5dropbox/{mainwiki => appwiki}/wiki/styles.template.css.tid (100%) rename tw5dropbox/{mainwiki => appwiki}/wiki/tw5dropbox.template.js.tid (100%) create mode 100644 tw5dropbox/mainwiki/plugins/dropbox-main.js create mode 100644 tw5dropbox/mainwiki/tiddlers/TiddlyWiki5 in the Sky with Dropbox.tid create mode 100644 tw5dropbox/mainwiki/tiddlers/WikiTemplate.tid diff --git a/dbld.sh b/dbld.sh index c5214f4ea..71e1d8f28 100755 --- a/dbld.sh +++ b/dbld.sh @@ -2,13 +2,22 @@ # build TiddlyWiki5 in the Sky for Dropbox +pushd tw5dropbox/appwiki > /dev/null + +node ../../core/boot.js \ + --verbose \ + --savetiddler $:/core/templates/tw5dropbox.template.js ../../../../../Apps/Static\ Web\ Apps/TiddlyWiki5/public/tw5dropbox.js text/plain [!is[shadow]] \ + --savetiddler $:/core/templates/index.template.html ../../../../../Apps/TiddlyWiki5/My\ TiddlyWiki/index.html text/plain [!is[shadow]] \ + --savetiddler $:/core/templates/styles.template.css ../../../../../Apps/Static\ Web\ Apps/TiddlyWiki5/public/styles.css text/plain [!is[shadow]] \ + || exit 1 + +popd > /dev/null + pushd tw5dropbox/mainwiki > /dev/null node ../../core/boot.js \ --verbose \ - --savetiddler $:/core/templates/tw5dropbox.template.js ../../../../../Apps/Static\ Web\ Apps/TiddlyWiki5/public/tw5dropbox.js text/plain [!is[shadow]] \ --savetiddler $:/core/templates/index.template.html ../../../../../Apps/Static\ Web\ Apps/TiddlyWiki5/public/index.html text/plain [!is[shadow]] \ - --savetiddler $:/core/templates/styles.template.css ../../../../../Apps/Static\ Web\ Apps/TiddlyWiki5/public/styles.css text/plain [!is[shadow]] \ || exit 1 popd > /dev/null diff --git a/tw5dropbox/appwiki/plugins/dropbox-app.js b/tw5dropbox/appwiki/plugins/dropbox-app.js new file mode 100644 index 000000000..a2fe81ffa --- /dev/null +++ b/tw5dropbox/appwiki/plugins/dropbox-app.js @@ -0,0 +1,22 @@ +/*\ +title: $:/plugins/dropbox/dropbox-app.js +type: application/javascript +module-type: dropbox-startup + +Startup the Dropbox wiki app + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports.startup = function() { + // Load tiddlers + $tw.plugins.dropbox.loadTiddlerFiles("/My TiddlyWiki/tiddlers",function() { + console.log("Loaded all tiddlers",$tw.wiki.tiddlers); + }); +}; + +})(); diff --git a/tw5dropbox/appwiki/plugins/tiddlywiki.files b/tw5dropbox/appwiki/plugins/tiddlywiki.files new file mode 100644 index 000000000..444b38c19 --- /dev/null +++ b/tw5dropbox/appwiki/plugins/tiddlywiki.files @@ -0,0 +1,36 @@ +{ + "tiddlers": [ + { + "file": "../../plugins/async.js", + "fields": { + "title": "$:/plugins/dropbox/async.js", + "type": "application/javascript", + "library": "yes" + } + }, + { + "file": "../../plugins/dropbox.js", + "fields": { + "title": "$:/plugins/dropbox/dropbox.js", + "type": "application/javascript", + "module-type": "startup" + } + }, + { + "file": "../../plugins/logoutmacro.js", + "fields": { + "title": "$:/plugins/dropbox/logoutmacro.js", + "type": "application/javascript", + "module-type": "macro" + } + }, + { + "file": "dropbox-app.js", + "fields": { + "title": "$:/plugins/dropbox/dropbox-app.js", + "type": "application/javascript", + "module-type": "dropbox-startup" + } + } + ] +} \ No newline at end of file diff --git a/tw5dropbox/mainwiki/wiki/AllTiddlers.tid b/tw5dropbox/appwiki/wiki/AllTiddlers.tid similarity index 100% rename from tw5dropbox/mainwiki/wiki/AllTiddlers.tid rename to tw5dropbox/appwiki/wiki/AllTiddlers.tid diff --git a/tw5dropbox/appwiki/wiki/DefaultTiddlers.tid b/tw5dropbox/appwiki/wiki/DefaultTiddlers.tid new file mode 100644 index 000000000..8e7370cfb --- /dev/null +++ b/tw5dropbox/appwiki/wiki/DefaultTiddlers.tid @@ -0,0 +1,3 @@ +title: $:/DefaultTiddlers + +AllTiddlers diff --git a/tw5dropbox/appwiki/wiki/PageTemplate.tid b/tw5dropbox/appwiki/wiki/PageTemplate.tid new file mode 100644 index 000000000..29f4ccca8 --- /dev/null +++ b/tw5dropbox/appwiki/wiki/PageTemplate.tid @@ -0,0 +1,80 @@ +title: $:/templates/PageTemplate + + +<< + + +{{navigation-panel{ +<< + <> +>> +}}} + + +<> + + + + + +
+<> +
+ +>> + diff --git a/tw5dropbox/appwiki/wiki/SiteSubtitle.tid b/tw5dropbox/appwiki/wiki/SiteSubtitle.tid new file mode 100644 index 000000000..85b1e8136 --- /dev/null +++ b/tw5dropbox/appwiki/wiki/SiteSubtitle.tid @@ -0,0 +1,4 @@ +title: SiteSubtitle +type: application/x-tiddler + +for Dropbox \ No newline at end of file diff --git a/tw5dropbox/appwiki/wiki/SiteTitle.tid b/tw5dropbox/appwiki/wiki/SiteTitle.tid new file mode 100644 index 000000000..5ef449a9a --- /dev/null +++ b/tw5dropbox/appwiki/wiki/SiteTitle.tid @@ -0,0 +1,4 @@ +title: SiteTitle +type: application/x-tiddler + +TiddlyWiki5 in the Sky \ No newline at end of file diff --git a/tw5dropbox/appwiki/wiki/index.template.html.tid b/tw5dropbox/appwiki/wiki/index.template.html.tid new file mode 100644 index 000000000..946896b37 --- /dev/null +++ b/tw5dropbox/appwiki/wiki/index.template.html.tid @@ -0,0 +1,37 @@ +title: $:/core/templates/index.template.html +type: text/x-tiddlywiki-html + + + + + + + + + + + +> +" /> +<<tiddler "$:/core/wiki/title">> + + + +<> + + + + + + + + + + + + \ No newline at end of file diff --git a/tw5dropbox/mainwiki/wiki/styles.template.css.tid b/tw5dropbox/appwiki/wiki/styles.template.css.tid similarity index 100% rename from tw5dropbox/mainwiki/wiki/styles.template.css.tid rename to tw5dropbox/appwiki/wiki/styles.template.css.tid diff --git a/tw5dropbox/mainwiki/wiki/tw5dropbox.template.js.tid b/tw5dropbox/appwiki/wiki/tw5dropbox.template.js.tid similarity index 100% rename from tw5dropbox/mainwiki/wiki/tw5dropbox.template.js.tid rename to tw5dropbox/appwiki/wiki/tw5dropbox.template.js.tid diff --git a/tw5dropbox/mainwiki/plugins/dropbox-main.js b/tw5dropbox/mainwiki/plugins/dropbox-main.js new file mode 100644 index 000000000..9c73faa1a --- /dev/null +++ b/tw5dropbox/mainwiki/plugins/dropbox-main.js @@ -0,0 +1,22 @@ +/*\ +title: $:/plugins/dropbox/dropbox-main.js +type: application/javascript +module-type: dropbox-startup + +Startup the Dropbox main app + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports.startup = function() { + // Load tiddlers + $tw.plugins.dropbox.loadWikiFiles("/",function() { + console.log("Loaded all wikis",$tw.wiki.tiddlers); + }); +}; + +})(); diff --git a/tw5dropbox/mainwiki/plugins/tiddlywiki.files b/tw5dropbox/mainwiki/plugins/tiddlywiki.files index 155dd95c3..f4d1b632f 100644 --- a/tw5dropbox/mainwiki/plugins/tiddlywiki.files +++ b/tw5dropbox/mainwiki/plugins/tiddlywiki.files @@ -23,6 +23,14 @@ "type": "application/javascript", "module-type": "macro" } + }, + { + "file": "dropbox-main.js", + "fields": { + "title": "$:/plugins/dropbox/dropbox-main.js", + "type": "application/javascript", + "module-type": "dropbox-startup" + } } ] } \ No newline at end of file diff --git a/tw5dropbox/mainwiki/tiddlers/TiddlyWiki5 in the Sky with Dropbox.tid b/tw5dropbox/mainwiki/tiddlers/TiddlyWiki5 in the Sky with Dropbox.tid new file mode 100644 index 000000000..493ad15e6 --- /dev/null +++ b/tw5dropbox/mainwiki/tiddlers/TiddlyWiki5 in the Sky with Dropbox.tid @@ -0,0 +1,11 @@ +title: TiddlyWiki5 in the Sky with Dropbox + +Welcome to TiddlyWiki5 in the Sky with Dropbox. + +! Your ~TiddlyWikis + +((( [tag[wiki]] ))(WikiTemplate)) + +! Create new ~TiddlyWiki + ++ diff --git a/tw5dropbox/mainwiki/tiddlers/WikiTemplate.tid b/tw5dropbox/mainwiki/tiddlers/WikiTemplate.tid new file mode 100644 index 000000000..641be1e10 --- /dev/null +++ b/tw5dropbox/mainwiki/tiddlers/WikiTemplate.tid @@ -0,0 +1,10 @@ +title: WikiTemplate + +
+
+<> +
+
+<> +
+
diff --git a/tw5dropbox/mainwiki/wiki/DefaultTiddlers.tid b/tw5dropbox/mainwiki/wiki/DefaultTiddlers.tid index 8e7370cfb..6b000ce49 100644 --- a/tw5dropbox/mainwiki/wiki/DefaultTiddlers.tid +++ b/tw5dropbox/mainwiki/wiki/DefaultTiddlers.tid @@ -1,3 +1,3 @@ title: $:/DefaultTiddlers -AllTiddlers +[[TiddlyWiki5 in the Sky with Dropbox]] diff --git a/tw5dropbox/mainwiki/wiki/PageTemplate.tid b/tw5dropbox/mainwiki/wiki/PageTemplate.tid index d9d88c376..b622d2a4a 100644 --- a/tw5dropbox/mainwiki/wiki/PageTemplate.tid +++ b/tw5dropbox/mainwiki/wiki/PageTemplate.tid @@ -3,16 +3,6 @@ title: $:/templates/PageTemplate << - -{{navigation-panel{ -<< - <> ->> -}}} - - -<> - diff --git a/tw5dropbox/mainwiki/wiki/index.template.html.tid b/tw5dropbox/mainwiki/wiki/index.template.html.tid index af56c551a..e4faa51d3 100644 --- a/tw5dropbox/mainwiki/wiki/index.template.html.tid +++ b/tw5dropbox/mainwiki/wiki/index.template.html.tid @@ -14,6 +14,7 @@ type: text/x-tiddlywiki-html > " /> + <<tiddler "$:/core/wiki/title">> @@ -22,7 +23,15 @@ type: text/x-tiddlywiki-html - +
+<> +
+ +