diff options
author | Jose Antonio Marquez | 2012-02-29 11:29:09 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-29 11:29:09 -0800 |
commit | 98f1cfc58f545702a18166ab216362d667c18915 (patch) | |
tree | d7e20e1b5bb83cc1a85b49b9b02b413b0aa9b002 /js | |
parent | da83f44b0ecf379b0950a88d1c378fbedb80e386 (diff) | |
parent | bb3e42b531848b400670df6caf0f3ce02adf1243 (diff) | |
download | ninja-98f1cfc58f545702a18166ab216362d667c18915.tar.gz |
Merge branch 'refs/heads/FileIO' into FileIO-Build-Candidate
Diffstat (limited to 'js')
-rwxr-xr-x | js/document/html-document.js | 3 | ||||
-rw-r--r-- | js/mediators/io-mediator.js | 17 |
2 files changed, 12 insertions, 8 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js index 6853f4d7..60eecc59 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js | |||
@@ -649,7 +649,8 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
649 | //TODO: Add logic to handle save before preview | 649 | //TODO: Add logic to handle save before preview |
650 | this.saveAll(); | 650 | this.saveAll(); |
651 | //Launching 'blank' tab for testing movie | 651 | //Launching 'blank' tab for testing movie |
652 | chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]}); | 652 | window.open(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]); |
653 | //chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]}); | ||
653 | } | 654 | } |
654 | }, | 655 | }, |
655 | //////////////////////////////////////////////////////////////////// | 656 | //////////////////////////////////////////////////////////////////// |
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 6b26668b..e763c67c 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js | |||
@@ -39,6 +39,12 @@ exports.IoMediator = Montage.create(Component, { | |||
39 | enumerable: false, | 39 | enumerable: false, |
40 | value: ProjectIo | 40 | value: ProjectIo |
41 | }, | 41 | }, |
42 | //////////////////////////////////////////////////////////////////// | ||
43 | // | ||
44 | appTemplatesUrl: { | ||
45 | enumerable: false, | ||
46 | value: new RegExp(chrome.extension.getURL('js/document/templates/montage-html/'), 'gi') | ||
47 | }, | ||
42 | //////////////////////////////////////////////////////////////////// | 48 | //////////////////////////////////////////////////////////////////// |
43 | // | 49 | // |
44 | fileNew: { | 50 | fileNew: { |
@@ -209,8 +215,7 @@ exports.IoMediator = Montage.create(Component, { | |||
209 | template.document.content.document.head.innerHTML = template.head; | 215 | template.document.content.document.head.innerHTML = template.head; |
210 | //Getting all CSS (style or link) tags | 216 | //Getting all CSS (style or link) tags |
211 | var styletags = template.document.content.document.getElementsByTagName('style'), | 217 | var styletags = template.document.content.document.getElementsByTagName('style'), |
212 | linktags = template.document.content.document.getElementsByTagName('link'), | 218 | linktags = template.document.content.document.getElementsByTagName('link'); |
213 | url = new RegExp(chrome.extension.getURL('js/document/templates/montage-html/'), 'gi'); //TODO: Make public into var | ||
214 | //Looping through link tags and removing file recreated elements | 219 | //Looping through link tags and removing file recreated elements |
215 | for (var j in styletags) { | 220 | for (var j in styletags) { |
216 | if (styletags[j].getAttribute) { | 221 | if (styletags[j].getAttribute) { |
@@ -345,7 +350,7 @@ exports.IoMediator = Montage.create(Component, { | |||
345 | webgltag.innerHTML = json; | 350 | webgltag.innerHTML = json; |
346 | } | 351 | } |
347 | // | 352 | // |
348 | return this.getPrettyHtml(template.document.content.document.documentElement.outerHTML.replace(url, '')); | 353 | return this.getPrettyHtml(template.document.content.document.documentElement.outerHTML.replace(this.appTemplatesUrl, '')); |
349 | } | 354 | } |
350 | }, | 355 | }, |
351 | //////////////////////////////////////////////////////////////////// | 356 | //////////////////////////////////////////////////////////////////// |
@@ -354,7 +359,7 @@ exports.IoMediator = Montage.create(Component, { | |||
354 | enumerable: false, | 359 | enumerable: false, |
355 | value: function (list) { | 360 | value: function (list) { |
356 | //Variable to store CSS definitions | 361 | //Variable to store CSS definitions |
357 | var i, str, url, css = ''; | 362 | var i, str, css = ''; |
358 | //Looping through list | 363 | //Looping through list |
359 | if (list && list.length > 0) { | 364 | if (list && list.length > 0) { |
360 | //Adding each list item to string and also adding breaks | 365 | //Adding each list item to string and also adding breaks |
@@ -362,10 +367,8 @@ exports.IoMediator = Montage.create(Component, { | |||
362 | css += list[i].cssText; | 367 | css += list[i].cssText; |
363 | } | 368 | } |
364 | } | 369 | } |
365 | //TODO: Add better logic for creating this string | ||
366 | url = new RegExp(chrome.extension.getURL('js/document/templates/montage-html/'), 'gi'); | ||
367 | //Returning the CSS string | 370 | //Returning the CSS string |
368 | return this.getPrettyCss(css.replace(url, '')); | 371 | return this.getPrettyCss(css.replace(this.appTemplatesUrl, '')); |
369 | } | 372 | } |
370 | }, | 373 | }, |
371 | //////////////////////////////////////////////////////////////////// | 374 | //////////////////////////////////////////////////////////////////// |