More tw5dropbox updates

print-window-tiddler
Jeremy Ruston 2012-10-11 14:56:30 +01:00
rodzic 63e486298c
commit d416781110
4 zmienionych plików z 14 dodań i 9 usunięć

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -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();