diff options
-rwxr-xr-x | js/document/html-document.js | 11 |
1 files changed, 3 insertions, 8 deletions
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, { | |||
466 | } | 466 | } |
467 | } else { | 467 | } else { |
468 | //None local stylesheet, probably on a CDN (locked) | 468 | //None local stylesheet, probably on a CDN (locked) |
469 | //this._document.styleSheets[i].href; | ||
470 | tag = this.iframe.contentWindow.document.createElement('style'); | 469 | tag = this.iframe.contentWindow.document.createElement('style'); |
471 | tag.setAttribute('type', 'text/css'); | 470 | tag.setAttribute('type', 'text/css'); |
472 | tag.setAttribute('data-ninja-external-url', this._document.styleSheets[i].href); | 471 | tag.setAttribute('data-ninja-external-url', this._document.styleSheets[i].href); |
473 | tag.setAttribute('data-ninja-file-read-only', "true"); | 472 | tag.setAttribute('data-ninja-file-read-only', "true"); |
474 | tag.setAttribute('data-ninja-file-name', this._document.styleSheets[i].href.split('/')[this._document.styleSheets[i].href.split('/').length-1]); | 473 | tag.setAttribute('data-ninja-file-name', this._document.styleSheets[i].href.split('/')[this._document.styleSheets[i].href.split('/').length-1]); |
475 | 474 | ||
476 | |||
477 | |||
478 | //TODO: Figure out cross-domain XHR issue, might need cloud to handle | 475 | //TODO: Figure out cross-domain XHR issue, might need cloud to handle |
479 | /* | 476 | /* |
480 | var xhr = new XMLHttpRequest(); | 477 | var xhr = new XMLHttpRequest(); |
@@ -484,12 +481,12 @@ var xhr = new XMLHttpRequest(); | |||
484 | if (xhr.readyState === 4) { | 481 | if (xhr.readyState === 4) { |
485 | console.log(xhr); | 482 | console.log(xhr); |
486 | } | 483 | } |
484 | //tag.innerHTML = xhr.responseText //xhr.response; | ||
487 | */ | 485 | */ |
488 | 486 | ||
489 | //TODO: Add rules content | 487 | //Currently no external styles will load if unable to load via XHR request |
490 | //tag.innerHTML = xhr.responseText //xhr.response; | ||
491 | |||
492 | 488 | ||
489 | //Disabling external style sheets | ||
493 | query = this._templateDocument.html.querySelectorAll(['link']); | 490 | query = this._templateDocument.html.querySelectorAll(['link']); |
494 | for (var j in query) { | 491 | for (var j in query) { |
495 | if (query[j].href === this._document.styleSheets[i].href) { | 492 | if (query[j].href === this._document.styleSheets[i].href) { |
@@ -499,8 +496,6 @@ var xhr = new XMLHttpRequest(); | |||
499 | this._templateDocument.head.insertBefore(tag, query[j]); | 496 | this._templateDocument.head.insertBefore(tag, query[j]); |
500 | } | 497 | } |
501 | } | 498 | } |
502 | |||
503 | |||
504 | } | 499 | } |
505 | } | 500 | } |
506 | } | 501 | } |