From d4ac479796f0341163e02ba50fa892773212a445 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Sat, 25 Feb 2012 16:21:18 -0800 Subject: Cleaning up comments for external styles loading --- js/document/html-document.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'js') diff --git a/js/document/html-document.js b/js/document/html-document.js index 4059c2a5..472d15de 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -466,15 +466,12 @@ exports.HTMLDocument = Montage.create(TextDocument, { } } else { //None local stylesheet, probably on a CDN (locked) - //this._document.styleSheets[i].href; tag = this.iframe.contentWindow.document.createElement('style'); tag.setAttribute('type', 'text/css'); tag.setAttribute('data-ninja-external-url', this._document.styleSheets[i].href); tag.setAttribute('data-ninja-file-read-only', "true"); tag.setAttribute('data-ninja-file-name', this._document.styleSheets[i].href.split('/')[this._document.styleSheets[i].href.split('/').length-1]); - - //TODO: Figure out cross-domain XHR issue, might need cloud to handle /* var xhr = new XMLHttpRequest(); @@ -484,12 +481,12 @@ var xhr = new XMLHttpRequest(); if (xhr.readyState === 4) { console.log(xhr); } + //tag.innerHTML = xhr.responseText //xhr.response; */ - //TODO: Add rules content - //tag.innerHTML = xhr.responseText //xhr.response; - + //Currently no external styles will load if unable to load via XHR request + //Disabling external style sheets query = this._templateDocument.html.querySelectorAll(['link']); for (var j in query) { if (query[j].href === this._document.styleSheets[i].href) { @@ -499,8 +496,6 @@ var xhr = new XMLHttpRequest(); this._templateDocument.head.insertBefore(tag, query[j]); } } - - } } } -- cgit v1.2.3