cleanup leaflet-include.js

This commit is contained in:
Vladimir Agafonkin 2013-01-31 12:59:23 +02:00
parent 2ecc304687
commit 0d3aa59f9c

View File

@ -1,28 +1,27 @@
(function() {
//TODO replace script list with the one from ../buid/deps.js
function getFiles() {
var memo = {},
comps;
function addFiles(srcs) {
for (var j = 0, len = srcs.length; j < len; j++) {
memo[srcs[j]] = true;
}
}
for (var i in deps) {
addFiles(deps[i].src);
}
var files = [];
for (var src in memo) {
files.push('src/' + src);
}
return files;
}
function getFiles() {
var memo = {},
files = [],
i, src;
function addFiles(srcs) {
for (var j = 0, len = srcs.length; j < len; j++) {
memo[srcs[j]] = true;
}
}
for (i in deps) {
addFiles(deps[i].src);
}
for (src in memo) {
files.push(src);
}
return files;
}
var scripts = getFiles();
function getSrcUrl() {
var scripts = document.getElementsByTagName('script');
for (var i = 0; i < scripts.length; i++) {
@ -30,7 +29,7 @@
if (src) {
var res = src.match(/^(.*)leaflet-include\.js$/);
if (res) {
return res[1] + '../';
return res[1] + '../src/';
}
}
}