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