[Commits] r2598 - in sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder: examples lib/GeoExt.ux

commits at geoext.org commits at geoext.org
Fri Feb 4 16:44:07 CET 2011


Author: adube
Date: 2011-02-04 16:44:07 +0100 (Fri, 04 Feb 2011)
New Revision: 2598

Added:
   sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/lib/GeoExt.ux/LayerTreeBuilder.js
Removed:
   sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/lib/GeoExt.ux/SingleFile.js
Modified:
   sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/examples/tree-builder.html
Log:
LayerTreeBuilder - SingleFile renamed

Modified: sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/examples/tree-builder.html
===================================================================
--- sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/examples/tree-builder.html	2011-02-04 15:40:33 UTC (rev 2597)
+++ sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/examples/tree-builder.html	2011-02-04 15:44:07 UTC (rev 2598)
@@ -17,7 +17,7 @@
         <script type="text/javascript" src="../../../../geoext/lib/GeoExt.js"></script>
 
         <link rel="stylesheet" type="text/css" href="../resources/css/LayerTreeBuilder.css" />
-        <script type="text/javascript" src="../lib/GeoExt.ux/SingleFile.js"></script>
+        <script type="text/javascript" src="../lib/GeoExt.ux/LayerTreeBuilder.js"></script>
 
         <script type="text/javascript" src="../resources/lang/fr.js"></script>
         <script type="text/javascript" src="tree-builder.js"></script>

Added: sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/lib/GeoExt.ux/LayerTreeBuilder.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/lib/GeoExt.ux/LayerTreeBuilder.js	                        (rev 0)
+++ sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/lib/GeoExt.ux/LayerTreeBuilder.js	2011-02-04 15:44:07 UTC (rev 2598)
@@ -0,0 +1,81 @@
+/**
+ * Copyright (c) 2008-2010 The Open Source Geospatial Foundation
+ * 
+ * Published under the BSD license.
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
+ * of the license.
+ */
+
+/*
+ * The code in this file is based on code taken from OpenLayers.
+ *
+ * Copyright (c) 2006-2007 MetaCarta, Inc., published under the Clear BSD
+ * license.  See http://svn.openlayers.org/trunk/openlayers/license.txt for the
+ * full text of the license.
+ */
+ 
+(function() {
+
+    /**
+     * The relative path of this script.
+     */
+    var scriptName = "lib/GeoExt.ux/LayerTreeBuilder.js";
+
+    /**
+     * Function returning the path of this script.
+     */
+    var getScriptLocation = function() {
+        var scriptLocation = "";
+        // If we load other scripts right before GeoExt using the same
+        // mechanism to add script resources dynamically (e.g. OpenLayers), 
+        // document.getElementsByTagName will not find the GeoExt script tag
+        // in FF2. Using document.documentElement.getElementsByTagName instead
+        // works around this issue.
+        var scripts = document.documentElement.getElementsByTagName('script');
+        for(var i=0, len=scripts.length; i<len; i++) {
+            var src = scripts[i].getAttribute('src');
+            if(src) {
+                var index = src.lastIndexOf(scriptName); 
+                // set path length for src up to a query string
+                var pathLength = src.lastIndexOf('?');
+                if(pathLength < 0) {
+                    pathLength = src.length;
+                }
+                // is it found, at the end of the URL?
+                if((index > -1) && (index + scriptName.length == pathLength)) {
+                    scriptLocation = src.slice(0, pathLength - scriptName.length);
+                    break;
+                }
+            }
+        }
+        return scriptLocation;
+    };
+
+    var jsfiles = new Array(
+        "plugins/LayerTreeBuilderNodeAgent.js",
+        "widgets/tree/LayerTreeBuilder.js"
+    );
+
+    var agent = navigator.userAgent;
+    var docWrite = (agent.match("MSIE") || agent.match("Safari"));
+    if(docWrite) {
+        var allScriptTags = new Array(jsfiles.length);
+    }
+    var host = getScriptLocation() + "lib/GeoExt.ux/";    
+    for (var i=0, len=jsfiles.length; i<len; i++) {
+        if (docWrite) {
+            allScriptTags[i] = "<script src='" + host + jsfiles[i] +
+                               "'></script>"; 
+        } else {
+            var s = document.createElement("script");
+            s.src = host + jsfiles[i];
+            var h = document.getElementsByTagName("head").length ? 
+                       document.getElementsByTagName("head")[0] : 
+                       document.body;
+            h.appendChild(s);
+        }
+    }
+    if (docWrite) {
+        document.write(allScriptTags.join(""));
+    }
+})();

Deleted: sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/lib/GeoExt.ux/SingleFile.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/lib/GeoExt.ux/SingleFile.js	2011-02-04 15:40:33 UTC (rev 2597)
+++ sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/lib/GeoExt.ux/SingleFile.js	2011-02-04 15:44:07 UTC (rev 2598)
@@ -1,81 +0,0 @@
-/**
- * Copyright (c) 2008-2010 The Open Source Geospatial Foundation
- * 
- * Published under the BSD license.
- * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
- * of the license.
- */
-
-/*
- * The code in this file is based on code taken from OpenLayers.
- *
- * Copyright (c) 2006-2007 MetaCarta, Inc., published under the Clear BSD
- * license.  See http://svn.openlayers.org/trunk/openlayers/license.txt for the
- * full text of the license.
- */
- 
-(function() {
-
-    /**
-     * The relative path of this script.
-     */
-    var scriptName = "lib/GeoExt.ux/SingleFile.js";
-
-    /**
-     * Function returning the path of this script.
-     */
-    var getScriptLocation = function() {
-        var scriptLocation = "";
-        // If we load other scripts right before GeoExt using the same
-        // mechanism to add script resources dynamically (e.g. OpenLayers), 
-        // document.getElementsByTagName will not find the GeoExt script tag
-        // in FF2. Using document.documentElement.getElementsByTagName instead
-        // works around this issue.
-        var scripts = document.documentElement.getElementsByTagName('script');
-        for(var i=0, len=scripts.length; i<len; i++) {
-            var src = scripts[i].getAttribute('src');
-            if(src) {
-                var index = src.lastIndexOf(scriptName); 
-                // set path length for src up to a query string
-                var pathLength = src.lastIndexOf('?');
-                if(pathLength < 0) {
-                    pathLength = src.length;
-                }
-                // is it found, at the end of the URL?
-                if((index > -1) && (index + scriptName.length == pathLength)) {
-                    scriptLocation = src.slice(0, pathLength - scriptName.length);
-                    break;
-                }
-            }
-        }
-        return scriptLocation;
-    };
-
-    var jsfiles = new Array(
-        "plugins/LayerTreeBuilderNodeAgent.js",
-        "widgets/tree/LayerTreeBuilder.js"
-    );
-
-    var agent = navigator.userAgent;
-    var docWrite = (agent.match("MSIE") || agent.match("Safari"));
-    if(docWrite) {
-        var allScriptTags = new Array(jsfiles.length);
-    }
-    var host = getScriptLocation() + "lib/GeoExt.ux/";    
-    for (var i=0, len=jsfiles.length; i<len; i++) {
-        if (docWrite) {
-            allScriptTags[i] = "<script src='" + host + jsfiles[i] +
-                               "'></script>"; 
-        } else {
-            var s = document.createElement("script");
-            s.src = host + jsfiles[i];
-            var h = document.getElementsByTagName("head").length ? 
-                       document.getElementsByTagName("head")[0] : 
-                       document.body;
-            h.appendChild(s);
-        }
-    }
-    if (docWrite) {
-        document.write(allScriptTags.join(""));
-    }
-})();



More information about the Commits mailing list