From f4e454123567b7807797dc18f13bc093e6e0cbdf Mon Sep 17 00:00:00 2001 From: crschmidt Date: Thu, 1 Jun 2006 02:10:08 +0000 Subject: [PATCH] Fixed version of r488, my bad. git-svn-id: http://svn.openlayers.org/trunk/openlayers@489 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- build/OpenLayers.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/build/OpenLayers.js b/build/OpenLayers.js index 5a75b9800c..f4da25aa22 100644 --- a/build/OpenLayers.js +++ b/build/OpenLayers.js @@ -1,3 +1,27 @@ +//// +/// This blob sucks in all the files in uncompressed form for ease of use +/// + +OpenLayers = new Object(); +OpenLayers._scriptName = "lib/OpenLayers.js"; +OpenLayers._getScriptLocation = function () { + var scriptLocation = ""; + var SCRIPT_NAME = OpenLayers._scriptName; + + var scripts = document.getElementsByTagName('script'); + for (var i = 0; i < scripts.length; i++) { + var src = scripts[i].getAttribute('src'); + if (src) { + var index = src.lastIndexOf(SCRIPT_NAME); + // is it found, at the end of the URL? + if ((index > -1) && (index + SCRIPT_NAME.length == src.length)) { + scriptLocation = src.slice(0, -SCRIPT_NAME.length); + break; + } + } + } + return scriptLocation; +} /* Prototype JavaScript framework, version 1.4.0 * (c) 2005 Sam Stephenson *