From 8b0988b6dd2fe7f5977f70f651f7155c78ee872b Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 7 Mar 2012 19:04:19 -0800 Subject: Adding To-do comments for CDN stylesheets Removed inserting CDN styles into head as it was proper because the hierarchy would be lost, and there is no current fast-alternative to achieve a preview. --- js/document/html-document.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'js') diff --git a/js/document/html-document.js b/js/document/html-document.js index 6e1f654b..a05219bc 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -614,12 +614,9 @@ exports.HTMLDocument = Montage.create(TextDocument, { } } } - - - - /* -//TODO: Figure out cross-domain XHR issue, might need cloud to handle + + //TODO: Figure out cross-domain XHR issue, might need cloud to handle var xhr = new XMLHttpRequest(); xhr.open("GET", this._document.styleSheets[i].href, true); xhr.send(); @@ -627,15 +624,19 @@ exports.HTMLDocument = Montage.create(TextDocument, { if (xhr.readyState === 4) { console.log(xhr); } -*/ //tag.innerHTML = xhr.responseText //xhr.response; - tag.innerHTML = 'noRULEjustHACK{background: #000}' - //Currently no external styles will load if unable to load via XHR request - + */ + //Temp rule so it's registered in the array + tag.innerHTML = 'noRULEjustHACK{background: #000}'; //Disabling external style sheets query = this._templateDocument.html.querySelectorAll(['link']); for (var k in query) { if (query[k].href === this._document.styleSheets[i].href) { + + //TODO: Removed the temp insertion of the stylesheet + //because it wasn't the proper way to do it + //need to be handled via XHR with proxy in Cloud Sim + //Disabling style sheet to reload via inserting in style tag //var tempCSS = query[k].cloneNode(true); //tempCSS.setAttribute('data-ninja-template', 'true'); -- cgit v1.2.3