From 3638492098a21aef63842366fbfc035fc6414fb0 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Sun, 26 Feb 2012 11:32:10 -0800 Subject: Fixed issue with losing track of Ninja template css Also cleaned up URL getter for app in cleaning string code. --- js/mediators/io-mediator.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js/mediators') diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 315fb6a7..c33ccced 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js @@ -205,11 +205,11 @@ exports.IoMediator = Montage.create(Component, { //Getting all CSS (style or link) tags var styletags = template.document.content.document.getElementsByTagName('style'), linktags = template.document.content.document.getElementsByTagName('link'), - url = new RegExp(window.location.protocol+'//'+window.location.host+'/js/document/templates/montage-html/', 'gi'); + url = new RegExp(chrome.extension.getURL('js/document/templates/montage-html/'), 'gi'); //Looping through link tags and removing file recreated elements for (var j in styletags) { if (styletags[j].getAttribute) { - if(styletags[j].getAttribute('data-ninja-uri') !== null) {//TODO: Use querySelectorAll + if(styletags[j].getAttribute('data-ninja-uri') !== null && !styletags[j].getAttribute('data-ninja-template')) {//TODO: Use querySelectorAll try { //Checking head first template.document.content.document.head.removeChild(styletags[j]); @@ -241,7 +241,7 @@ exports.IoMediator = Montage.create(Component, { if (template.styles[i].ownerNode) { if (template.styles[i].ownerNode.getAttribute) { //Checking for node not to be loaded from file - if (template.styles[i].ownerNode.getAttribute('data-ninja-uri') === null) { + if (template.styles[i].ownerNode.getAttribute('data-ninja-uri') === null && !template.styles[i].ownerNode.getAttribute('data-ninja-template')) { //Inseting data from rules array into tag as string docStyles[styleCounter].innerHTML = this.getCssFromRules(template.styles[i].cssRules); //Syncing