diff options
author | Jose Antonio Marquez | 2012-03-05 23:19:08 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-03-05 23:19:08 -0800 |
commit | de26ba991c1d6351dfed4a81c246f62d40f075d6 (patch) | |
tree | 7b9bdec0bc062f1b5d9f4699647429f0bf93da42 /js/mediators/io-mediator.js | |
parent | 478c50ee0ce0291c13c4f1e469a234b64946413e (diff) | |
parent | 4f274aa5beff735f63905704e52e6ea938c140d9 (diff) | |
download | ninja-de26ba991c1d6351dfed4a81c246f62d40f075d6.tar.gz |
Merge branch 'refs/heads/FileIO' into FileIO-Build-Candidate
Diffstat (limited to 'js/mediators/io-mediator.js')
-rw-r--r-- | js/mediators/io-mediator.js | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 07a139c0..6c2147c8 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js | |||
@@ -260,17 +260,6 @@ exports.IoMediator = Montage.create(Component, { | |||
260 | } | 260 | } |
261 | } | 261 | } |
262 | } | 262 | } |
263 | |||
264 | |||
265 | ///////////////////////////////////////////////////////////////////////////////////////// | ||
266 | ///////////////////////////////////////////////////////////////////////////////////////// | ||
267 | |||
268 | //TODO: Add logic for parse CSS string correct URLs since referencing is lost | ||
269 | |||
270 | ///////////////////////////////////////////////////////////////////////////////////////// | ||
271 | ///////////////////////////////////////////////////////////////////////////////////////// | ||
272 | |||
273 | |||
274 | //Checking for type of save: styles = <style> only | css = <style> and <link> (all CSS) | 263 | //Checking for type of save: styles = <style> only | css = <style> and <link> (all CSS) |
275 | if (template.styles) { | 264 | if (template.styles) { |
276 | //Getting all style tags | 265 | //Getting all style tags |
@@ -313,7 +302,7 @@ exports.IoMediator = Montage.create(Component, { | |||
313 | if (template.css[i].ownerNode.getAttribute) { | 302 | if (template.css[i].ownerNode.getAttribute) { |
314 | if (template.css[i].ownerNode.getAttribute('data-ninja-uri') === null && !template.css[i].ownerNode.getAttribute('data-ninja-template')) {//TODO: Use querySelectorAll | 303 | if (template.css[i].ownerNode.getAttribute('data-ninja-uri') === null && !template.css[i].ownerNode.getAttribute('data-ninja-template')) {//TODO: Use querySelectorAll |
315 | //Inseting data from rules array into <style> as string | 304 | //Inseting data from rules array into <style> as string |
316 | if (docStyles[styleCounter]) { | 305 | if (docStyles[styleCounter] && !template.css[i].ownerNode.getAttribute('data-ninja-external-url')) { |
317 | docStyles[styleCounter].innerHTML = this.getCssFromRules(template.css[i].cssRules); | 306 | docStyles[styleCounter].innerHTML = this.getCssFromRules(template.css[i].cssRules); |
318 | styleCounter++; | 307 | styleCounter++; |
319 | } | 308 | } |
@@ -349,41 +338,6 @@ exports.IoMediator = Montage.create(Component, { | |||
349 | return this.getUrlfromNinjaUrl(url, fileRootUrl, fileUrl); | 338 | return this.getUrlfromNinjaUrl(url, fileRootUrl, fileUrl); |
350 | } | 339 | } |
351 | 340 | ||
352 | /* | ||
353 | function parseNinjaUrl (url) { | ||
354 | //console.log("Getting: " + url); | ||
355 | // | ||
356 | if (url.indexOf(fileRootUrl) !== -1) { | ||
357 | url = url.replace(new RegExp(fileRootUrl.replace(/\//gi, '\\\/'), 'gi'), ''); | ||
358 | } else { | ||
359 | var assetsDirs = (url.replace(new RegExp((this.application.ninja.coreIoApi.rootUrl).replace(/\//gi, '\\\/'), 'gi'), '')).split('/'); | ||
360 | var fileDirs = (fileUrl.split(fileUrl.split('/')[fileUrl.split('/').length-1])[0]).split('/'); | ||
361 | var counter = 0; | ||
362 | var path = ''; | ||
363 | var newURL = ''; | ||
364 | // | ||
365 | for (var p=0; p < fileDirs.length-1; p++) { | ||
366 | if (fileDirs[p] === assetsDirs[p]) { | ||
367 | counter++; | ||
368 | } | ||
369 | } | ||
370 | // | ||
371 | for (var p=0; p < (fileDirs.length-counter)-1; p++) { | ||
372 | path += '../'; | ||
373 | } | ||
374 | // | ||
375 | for (var p=counter; p < assetsDirs.length; p++) { | ||
376 | newURL += '/'+assetsDirs[p]; | ||
377 | } | ||
378 | // | ||
379 | url = (path+newURL).replace(/\/\//gi, '/'); | ||
380 | } | ||
381 | //console.log("Returning: " + url); | ||
382 | //console.log("-----"); | ||
383 | return url; | ||
384 | } | ||
385 | */ | ||
386 | |||
387 | /////////////////////////////////////////////////////////////////////////////////////////// | 341 | /////////////////////////////////////////////////////////////////////////////////////////// |
388 | /////////////////////////////////////////////////////////////////////////////////////////// | 342 | /////////////////////////////////////////////////////////////////////////////////////////// |
389 | 343 | ||