aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-03-07 19:04:19 -0800
committerJose Antonio Marquez2012-03-07 19:04:19 -0800
commit8b0988b6dd2fe7f5977f70f651f7155c78ee872b (patch)
treed7850e9dd685e3cc4bee62a46fe2edaf42ae003a /js/document
parentbb83bfb7af1e82dfbce7661fe2eb7612ff730c6f (diff)
downloadninja-8b0988b6dd2fe7f5977f70f651f7155c78ee872b.tar.gz
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.
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/html-document.js19
1 files changed, 10 insertions, 9 deletions
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, {
614 } 614 }
615 } 615 }
616 } 616 }
617
618
619
620
621 /* 617 /*
622//TODO: Figure out cross-domain XHR issue, might need cloud to handle 618
619 //TODO: Figure out cross-domain XHR issue, might need cloud to handle
623 var xhr = new XMLHttpRequest(); 620 var xhr = new XMLHttpRequest();
624 xhr.open("GET", this._document.styleSheets[i].href, true); 621 xhr.open("GET", this._document.styleSheets[i].href, true);
625 xhr.send(); 622 xhr.send();
@@ -627,15 +624,19 @@ exports.HTMLDocument = Montage.create(TextDocument, {
627 if (xhr.readyState === 4) { 624 if (xhr.readyState === 4) {
628 console.log(xhr); 625 console.log(xhr);
629 } 626 }
630*/
631 //tag.innerHTML = xhr.responseText //xhr.response; 627 //tag.innerHTML = xhr.responseText //xhr.response;
632 tag.innerHTML = 'noRULEjustHACK{background: #000}' 628 */
633 //Currently no external styles will load if unable to load via XHR request 629 //Temp rule so it's registered in the array
634 630 tag.innerHTML = 'noRULEjustHACK{background: #000}';
635 //Disabling external style sheets 631 //Disabling external style sheets
636 query = this._templateDocument.html.querySelectorAll(['link']); 632 query = this._templateDocument.html.querySelectorAll(['link']);
637 for (var k in query) { 633 for (var k in query) {
638 if (query[k].href === this._document.styleSheets[i].href) { 634 if (query[k].href === this._document.styleSheets[i].href) {
635
636 //TODO: Removed the temp insertion of the stylesheet
637 //because it wasn't the proper way to do it
638 //need to be handled via XHR with proxy in Cloud Sim
639
639 //Disabling style sheet to reload via inserting in style tag 640 //Disabling style sheet to reload via inserting in style tag
640 //var tempCSS = query[k].cloneNode(true); 641 //var tempCSS = query[k].cloneNode(true);
641 //tempCSS.setAttribute('data-ninja-template', 'true'); 642 //tempCSS.setAttribute('data-ninja-template', 'true');