From eebb7de4d19cddec9c763a073d8cf41d76fe70f7 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 6 Mar 2012 17:02:37 -0800 Subject: Adding CDN support for URLs in linked CSS --- js/mediators/io-mediator.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js/mediators') diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 097f5975..f44c182c 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js @@ -335,7 +335,11 @@ exports.IoMediator = Montage.create(Component, { cleanedCss = dirtyCss.replace(/(\b(?:(?:https?|ftp|file|[A-Za-z]+):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gi, parseNinjaUrl.bind(this)); function parseNinjaUrl (url) { - return this.getUrlfromNinjaUrl(url, fileRootUrl, fileUrl); + if (url.indexOf(this.application.ninja.coreIoApi.rootUrl) !== -1) { + return this.getUrlfromNinjaUrl(url, fileRootUrl, fileUrl); + } else { + return url; + } } /////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3