1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00
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:
Jermolene 2017-06-24 22:30:26 +01:00
parent ef9efbc399
commit a5e565e198

View File

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