mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Tweaks for #2918
A couple of fixes: * Fixed problem with loading saver in a file URI within Beaker * Fixed problem when saving to a directory-style URI with an implicit “/index.html” * Switched to double quotes for strings
This commit is contained in:
parent
ef9efbc399
commit
a5e565e198
@ -20,16 +20,14 @@ var BeakerSaver = function(wiki) {
|
||||
this.wiki = wiki;
|
||||
};
|
||||
|
||||
var dat = new DatArchive('' + window.location);
|
||||
|
||||
BeakerSaver.prototype.save = function(text,method,callback) {
|
||||
var path = (location.pathname.toString()).split("#")[0];
|
||||
|
||||
dat.stat(path).then(function(value) {
|
||||
if(value.isDirectory) {
|
||||
path = path + "/index.html";
|
||||
var dat = new DatArchive("" + window.location),
|
||||
pathname = ("" + window.location.pathname).split("#")[0];
|
||||
dat.stat(pathname).then(function(value) {
|
||||
if(value.isDirectory()) {
|
||||
pathname = pathname + "/index.html";
|
||||
}
|
||||
dat.writeFile(path,text,"utf8").then(function(value) {
|
||||
dat.writeFile(pathname,text,"utf8").then(function(value) {
|
||||
callback(null);
|
||||
},function(reason) {
|
||||
callback("Beaker Saver Write Error: " + reason);
|
||||
|
Loading…
Reference in New Issue
Block a user