1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-19 08:14:50 +00:00

More tw5dropbox updates

This commit is contained in:
Jeremy Ruston 2012-10-11 14:56:30 +01:00
parent 63e486298c
commit d416781110
4 changed files with 14 additions and 9 deletions

View File

@ -12,9 +12,13 @@ Startup the Dropbox main app
/*global $tw: false */
"use strict";
var titleLoadedWikis = "$:/plugins/dropbox/LoadedWikis";
exports.startup = function() {
$tw.wiki.addTiddler({title: titleLoadedWikis, text: "no"},true);
// Load tiddlers
$tw.plugins.dropbox.loadWikiFiles("/",function() {
$tw.wiki.addTiddler({title: titleLoadedWikis, text: "yes"},true);
console.log("Loaded all wikis",$tw.wiki.tiddlers);
});
};

View File

@ -2,9 +2,15 @@ title: TiddlyWiki5 in the Sky with Dropbox
Welcome to TiddlyWiki5 in the Sky with Dropbox.
<<reveal state:[[$:/plugins/dropbox/LoadedWikis]] type:nomatch text:yes><
Loading your wikis from Dropbox
>>
<<reveal state:[[$:/plugins/dropbox/LoadedWikis]] type:match text:yes><
! Your ~TiddlyWikis
((( [tag[wiki]] ))(WikiTemplate))
<<transclude filter:[tag[wiki]] templateTitle:WikiTemplate emptyMessage:"You haven't created any wikis yet">>
>>
! Create new ~TiddlyWiki

View File

@ -1,10 +1,4 @@
title: WikiTemplate
<div class="alert">
<div>
<<view title>>
</div>
<div>
<<view url link>>
</div>
<div class="alert"><<view title>> - <<link throughField:urlView><View>> <<link throughField:urlEdit><Edit>>
</div>

View File

@ -86,7 +86,8 @@ $tw.plugins.dropbox.loadWikiFiles = function(path,callback) {
for(var s=0; s<stats.length; s++) {
var stat = stats[s];
if(!stat.isFile && stat.isFolder) {
$tw.wiki.addTiddler({title: stat.name, text: "wiki", tags: ["wiki"], url: $tw.plugins.dropbox.userInfo.publicAppUrl + stat.path + "/index.html"});
var url = $tw.plugins.dropbox.userInfo.publicAppUrl + stat.path + "/index.html";
$tw.wiki.addTiddler({title: stat.name, text: "wiki", tags: ["wiki"], urlView: url, urlEdit: url + "?edit=true"});
}
}
callback();