minor cleanup
This commit is contained in:
parent
417383724f
commit
57a6013d45
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user