Skip to content

TagSpaces is an offline, open source, document manager with tagging support

editorHTML with new promise api

Borislav Sapundzhiev29ead96d1a58
diff --git a/data/ext/editorHTML/extension.js b/data/ext/editorHTML/extension.js
index 048f5b279..d386fd4d8 100644
--- a/data/ext/editorHTML/extension.js
+++ b/data/ext/editorHTML/extension.js
@@ -17,7 +17,7 @@ define(function(require, exports, module) {
var extensionSupportedFileTypes = ["html", "htm"];
var TSCORE = require("tscore");
-
+ //var TSPOSTIO = require("tspostioapi");
var extensionsPath = TSCORE.Config.getExtensionPath();
var extensionDirectory = extensionsPath + "/" + extensionID;
@@ -52,8 +52,17 @@ define(function(require, exports, module) {
"nwdisable": "",
"nwfaketop": ""
}));
- TSCORE.IO.loadTextFile(filePath);
+ TSCORE.IO.loadTextFilePromise(filePath).then(function(content) {
+ //TSPOSTIO.loadTextFile(content);
+ exports.setContent(content);
+ },
+ function(error) {
+ TSCORE.hideLoadingAnimation();
+ TSCORE.showAlertDialog("Loading " + filePath + " failed.");
+ console.error("Loading file " + filePath + " failed " + error);
+ }
+ );
//if (!window.addEventListener) {
// window.attachEvent('onmessage', function(e) {alert(e.origin);alert(e.data);});
//} else {