Example #1
0
  function init(filePath, containerElementID) {
    console.log("Initalization HTML Editor...");

    fileDirectory = TSCORE.TagUtils.extractContainingDirectoryPath(filePath);

    $containerElement = $('#' + containerElementID);

    currentFilePath = filePath;

    $containerElement.empty();
    $containerElement.css("background-color", "white");

    var extPath = extensionDirectory + "/index.html";
    $containerElement.append($('<iframe>', {
      id: "iframeViewer",
      sandbox: "allow-same-origin allow-scripts allow-modals",
      scrolling: "no",
      style: "background-color: white; overflow: hidden;",
      src: extPath + "?cp=" + filePath + "&setLng=" + TSCORE.currentLanguage,
      "nwdisable": "",
      "nwfaketop": ""
    }));

    TSCORE.IO.loadTextFilePromise(filePath).then(function(content) {
      exports.setContent(content);
    },
    function(error) {
      TSCORE.hideLoadingAnimation();
      TSCORE.showAlertDialog("Loading " + filePath + " failed.");
      console.error("Loading file " + filePath + " failed " + error);
    });
  }
Example #2
0
 function init(fPath, containerElementID) {
   console.log("Initalization Text Viewer...");
   containerElID = containerElementID;
   $containerElement = $('#' + containerElID);
   filePath = fPath;
   TSCORE.IO.loadTextFilePromise(filePath).then(function(content) {
     exports.setContent(content);
   }, 
   function(error) {
     TSCORE.hideLoadingAnimation();
     TSCORE.showAlertDialog("Loading " + filePath + " failed.");
     console.error("Loading file " + filePath + " failed " + error);
   });
 }