aboutsummaryrefslogtreecommitdiff
path: root/js/mediators
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-25 16:18:27 -0800
committerJose Antonio Marquez2012-02-25 16:18:27 -0800
commitc6b44313ff8bcc17835ca77793bf425c451a4e75 (patch)
tree1f2b04f15080c78e72f043f3d1d0cae51293548c /js/mediators
parenta8da19dde22332d352213984fcdcd10e36087df1 (diff)
downloadninja-c6b44313ff8bcc17835ca77793bf425c451a4e75.tar.gz
Cleaning up ninja-data attributes
Added logic to load cross-domain CSS from CDN, but need to explore how to load without impacting permissions.
Diffstat (limited to 'js/mediators')
-rw-r--r--js/mediators/io-mediator.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js
index 16bb98ea..315fb6a7 100644
--- a/js/mediators/io-mediator.js
+++ b/js/mediators/io-mediator.js
@@ -209,7 +209,7 @@ exports.IoMediator = Montage.create(Component, {
209 //Looping through link tags and removing file recreated elements 209 //Looping through link tags and removing file recreated elements
210 for (var j in styletags) { 210 for (var j in styletags) {
211 if (styletags[j].getAttribute) { 211 if (styletags[j].getAttribute) {
212 if(styletags[j].getAttribute('ninjauri') !== null) {//TODO: Use querySelectorAll 212 if(styletags[j].getAttribute('data-ninja-uri') !== null) {//TODO: Use querySelectorAll
213 try { 213 try {
214 //Checking head first 214 //Checking head first
215 template.document.content.document.head.removeChild(styletags[j]); 215 template.document.content.document.head.removeChild(styletags[j]);
@@ -241,7 +241,7 @@ exports.IoMediator = Montage.create(Component, {
241 if (template.styles[i].ownerNode) { 241 if (template.styles[i].ownerNode) {
242 if (template.styles[i].ownerNode.getAttribute) { 242 if (template.styles[i].ownerNode.getAttribute) {
243 //Checking for node not to be loaded from file 243 //Checking for node not to be loaded from file
244 if (template.styles[i].ownerNode.getAttribute('ninjauri') === null) { 244 if (template.styles[i].ownerNode.getAttribute('data-ninja-uri') === null) {
245 //Inseting data from rules array into tag as string 245 //Inseting data from rules array into tag as string
246 docStyles[styleCounter].innerHTML = this.getCssFromRules(template.styles[i].cssRules); 246 docStyles[styleCounter].innerHTML = this.getCssFromRules(template.styles[i].cssRules);
247 //Syncing <style> tags count since it might be mixed with <link> 247 //Syncing <style> tags count since it might be mixed with <link>
@@ -258,13 +258,13 @@ exports.IoMediator = Montage.create(Component, {
258 for(var i in template.css) { 258 for(var i in template.css) {
259 if (template.css[i].ownerNode) { 259 if (template.css[i].ownerNode) {
260 if (template.css[i].ownerNode.getAttribute) { 260 if (template.css[i].ownerNode.getAttribute) {
261 if (template.css[i].ownerNode.getAttribute('ninjauri') === null) {//TODO: Use querySelectorAll 261 if (template.css[i].ownerNode.getAttribute('data-ninja-uri') === null) {//TODO: Use querySelectorAll
262 //Inseting data from rules array into <style> as string 262 //Inseting data from rules array into <style> as string
263 docStyles[styleCounter].innerHTML = this.getCssFromRules(template.css[i].cssRules); 263 docStyles[styleCounter].innerHTML = this.getCssFromRules(template.css[i].cssRules);
264 styleCounter++; 264 styleCounter++;
265 } else { 265 } else {
266 //Saving data from rules array converted to string into <link> file 266 //Saving data from rules array converted to string into <link> file
267 var save = this.fio.saveFile({uri: template.css[i].ownerNode.getAttribute('ninjauri'), contents: this.getCssFromRules(template.css[i].cssRules)}); 267 var save = this.fio.saveFile({uri: template.css[i].ownerNode.getAttribute('data-ninja-uri'), contents: this.getCssFromRules(template.css[i].cssRules)});
268 } 268 }
269 } 269 }
270 } 270 }