kopia lustrzana https://github.com/miklobit/TiddlyWiki5
rodzic
3108cb4f29
commit
6e44a20804
|
@ -18,9 +18,18 @@ var TiddlyFoxSaver = function(wiki) {
|
||||||
TiddlyFoxSaver.prototype.save = function(text,callback) {
|
TiddlyFoxSaver.prototype.save = function(text,callback) {
|
||||||
var messageBox = document.getElementById("tiddlyfox-message-box");
|
var messageBox = document.getElementById("tiddlyfox-message-box");
|
||||||
if(messageBox) {
|
if(messageBox) {
|
||||||
|
// Get the pathname of this document
|
||||||
|
var pathname = document.location.pathname;
|
||||||
|
// Test for a Windows path of the form /x:/blah/blah
|
||||||
|
if(/^\/[A-Z]\:\//.test(pathname)) {
|
||||||
|
// Remove the leading slash
|
||||||
|
pathname = pathname.substr(1);
|
||||||
|
// Convert slashes to backslashes
|
||||||
|
pathname = pathname.replace(/\//g,"\\");
|
||||||
|
}
|
||||||
// Create the message element and put it in the message box
|
// Create the message element and put it in the message box
|
||||||
var message = document.createElement("div");
|
var message = document.createElement("div");
|
||||||
message.setAttribute("data-tiddlyfox-path",decodeURIComponent(document.location.pathname));
|
message.setAttribute("data-tiddlyfox-path",decodeURIComponent(pathname));
|
||||||
message.setAttribute("data-tiddlyfox-content",text);
|
message.setAttribute("data-tiddlyfox-content",text);
|
||||||
messageBox.appendChild(message);
|
messageBox.appendChild(message);
|
||||||
// Add an event handler for when the file has been saved
|
// Add an event handler for when the file has been saved
|
||||||
|
|
Ładowanie…
Reference in New Issue