aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/html-document.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 54647d65..a56a7e3c 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -511,12 +511,14 @@ exports.HTMLDocument = Montage.create(TextDocument, {
511 511
512 fileCouldDirUrl = this.application.ninja.coreIoApi.rootUrl+escape((this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+cssUrl.split(cssUrl.split('/')[cssUrl.split('/').length-1])[0]).replace(/\/\//gi, '/')); 512 fileCouldDirUrl = this.application.ninja.coreIoApi.rootUrl+escape((this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+cssUrl.split(cssUrl.split('/')[cssUrl.split('/').length-1])[0]).replace(/\/\//gi, '/'));
513 513
514
515 //TODO: Fix regEx to have logic for all possible URLs strings (currently prefixing all url())
516 prefixUrl = 'url('+fileCouldDirUrl;
517 tag.innerHTML = cssData.content.replace(/url\(/gi, prefixUrl);
514 518
515 //TODO: Fix regEx to have logic for all possible URLs strings 519 //console.log(("http://hello.com, https://google.com").replace(/(\b(?:(?:https?|ftp|file|[A-Za-z]+):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gi, 'hello'))
516 prefixUrl = '('+fileCouldDirUrl+'../';
517 tag.innerHTML = cssData.content.replace(/\(\.\.\//gi, prefixUrl);
518
519 520
521 //console.log(tag.innerHTML);
520 522
521 //Looping through DOM to insert style tag at location of link element 523 //Looping through DOM to insert style tag at location of link element
522 query = this._templateDocument.html.querySelectorAll(['link']); 524 query = this._templateDocument.html.querySelectorAll(['link']);