From a61f89860bdc5205320d143e54e1bed7dbdb930f Mon Sep 17 00:00:00 2001 From: mourner Date: Thu, 16 Sep 2010 19:38:58 +0300 Subject: [PATCH] ROOT_URL for future use --- src/Leaflet.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Leaflet.js b/src/Leaflet.js index c1676b87..af9da3e7 100644 --- a/src/Leaflet.js +++ b/src/Leaflet.js @@ -3,12 +3,22 @@ */ L = { - version: '0.0.1', + VERSION: '0.0.1', - _originalL: window.L, + ROOT_URL: (function() { + var scripts = document.getElementsByTagName('script'); + for (var i = 0, len = scripts.length; i < len; i++) { + var src = scripts[i].src, + res = src && src.match(/^(.*\/)leaflet-*\w*\.js.*$/); + if (res && res[1]) { return res[1]; } + } + return '../dist/'; + })(), noConflict: function() { window.L = this._originalL; return this; - } + }, + + _originalL: window.L }; \ No newline at end of file