From 14a8f4c4e373db213b3d42d30edaea8354ae57e3 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 23 Feb 2012 10:35:12 -0800 Subject: Adding url clean up to HTML on save --- js/mediators/io-mediator.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 4dc29c3c..c4f3b361 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js @@ -205,7 +205,8 @@ exports.IoMediator = Montage.create(Component, { template.document.content.document.head.innerHTML = template.head; //Getting all CSS (style or link) tags var styletags = template.document.content.document.getElementsByTagName('style'), - linktags = template.document.content.document.getElementsByTagName('link'); + linktags = template.document.content.document.getElementsByTagName('link'), + url = new RegExp(window.location.protocol+'//'+window.location.host+'/js/document/templates/montage-html/', 'gi'); //Looping through link tags and removing file recreated elements for (var j in styletags) { if (styletags[j].getAttribute) { @@ -271,7 +272,7 @@ exports.IoMediator = Montage.create(Component, { } } // - return template.document.content.document.documentElement.outerHTML; + return template.document.content.document.documentElement.outerHTML.replace(url, ''); } }, //////////////////////////////////////////////////////////////////// -- cgit v1.2.3