minor cleanup

This commit is contained in:
Mourner 2011-09-08 12:00:40 +03:00
parent 417383724f
commit 57a6013d45

View File

@ -4,32 +4,35 @@
* See http://leaflet.cloudmade.com for more information.
*/
(function(root) {
(function (root) {
var L = {
VERSION: '0.3',
ROOT_URL: (function() {
ROOT_URL: (function () {
var scripts = document.getElementsByTagName('script'),
leafletRe = /^(.*\/)leaflet-?([\w-]*)\.js.*$/;
for (var i = 0, len = scripts.length; i < len; i++) {
var src = scripts[i].src,
res = src && src.match(leafletRe);
if (res) {
if (res[2] == 'include') break;
return res[1];
leafletRe = /^(.*\/)leaflet\-?([\w\-]*)\.js.*$/;
var i, len, src, matches;
for (i = 0, len = scripts.length; i < len; i++) {
src = scripts[i].src;
matches = src.match(leafletRe);
if (matches) {
if (matches[2] === 'include') { break; }
return matches[1];
}
}
return '../../dist/';
})(),
noConflict: function() {
}()),
noConflict: function () {
root.L = this._originalL;
return this;
},
_originalL: root.L
};
window.L = L;
root.L = L;
}(this));