From 0d3aa59f9c81da0b7eead4251230642daabe492e Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Thu, 31 Jan 2013 12:59:23 +0200 Subject: [PATCH] cleanup leaflet-include.js --- debug/leaflet-include.js | 47 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/debug/leaflet-include.js b/debug/leaflet-include.js index 50434071..ab06b3cd 100644 --- a/debug/leaflet-include.js +++ b/debug/leaflet-include.js @@ -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/'; } } }