From d264092596ba697cd04738566184270dc608be63 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 22 Feb 2012 23:53:38 -0800 Subject: Temp fix for CSS url data Added a temp fix to parse out the app url that is placed in the CSS styles. --- js/document/html-document.js | 2 +- js/mediators/io-mediator.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/document/html-document.js b/js/document/html-document.js index 3f417ffc..143b1598 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -558,7 +558,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { enumerable: false, value: function () { //TODO: Add logic to handle save before preview - this.save(); + this.saveAll(); //Launching 'blank' tab for testing movie chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]}); } diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 7606b168..4dc29c3c 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js @@ -280,7 +280,7 @@ exports.IoMediator = Montage.create(Component, { enumerable: false, value: function (list) { //Variable to store CSS definitions - var i, str, css = ''; + var i, str, url, css = ''; //Looping through list if (list && list.length > 0) { //Adding each list item to string and also adding breaks @@ -292,8 +292,10 @@ exports.IoMediator = Montage.create(Component, { css += '\n'+str; } } + //TODO: Add better logic for creating this string + url = new RegExp(window.location.protocol+'//'+window.location.host+'/js/document/templates/montage-html/', 'gi'); //Returning the CSS string - return css; + return css.replace(url, ''); } } //////////////////////////////////////////////////////////////////// -- cgit v1.2.3