[Commits] r1566 - in sandbox/ahocevar/playground/ux/Printing: . build examples ux ux/widgets/form

commits at geoext.org commits at geoext.org
Mon Dec 7 18:52:42 CET 2009


Author: ahocevar
Date: 2009-12-07 18:52:42 +0100 (Mon, 07 Dec 2009)
New Revision: 1566

Added:
   sandbox/ahocevar/playground/ux/Printing/build/
   sandbox/ahocevar/playground/ux/Printing/build/Makefile
   sandbox/ahocevar/playground/ux/Printing/build/ext-license.js
   sandbox/ahocevar/playground/ux/Printing/build/full.cfg
   sandbox/ahocevar/playground/ux/Printing/build/geoext-license.js
   sandbox/ahocevar/playground/ux/Printing/build/readme.txt
   sandbox/ahocevar/playground/ux/Printing/license.txt
   sandbox/ahocevar/playground/ux/Printing/ux/Printing.js
Modified:
   sandbox/ahocevar/playground/ux/Printing/examples/Printing.html
   sandbox/ahocevar/playground/ux/Printing/ux/widgets/form/SimplePrint.js
Log:
added build script, loader script and license.

Added: sandbox/ahocevar/playground/ux/Printing/build/Makefile
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/build/Makefile	                        (rev 0)
+++ sandbox/ahocevar/playground/ux/Printing/build/Makefile	2009-12-07 17:52:42 UTC (rev 1566)
@@ -0,0 +1,47 @@
+# Makefile for GeoExt
+
+VERSION = r$(shell echo '$$Revision: 1434 $$' | tr -d "[:alpha:]$$ :")
+LIB_NAME = Printing
+ZIP_NAME = $(LIB_NAME)-$(VERSION).zip
+
+.PHONEY: help clean ext examples lib zip dist
+
+help:
+	@echo "Please use 'make <target>' where <target> is one or more of"
+	@echo "  clean    to clean up after building"
+	@echo "  examples to make the examples dir"
+	@echo "  lib      to make a standalone dir of lib resources"
+	@echo "  zip      to make a zip archive of a standalone lib"
+	@echo "  dist     to make a zip archive of a standalone lib with examples"
+	@echo
+	@echo "Example use:"
+	@echo "  make lib"
+	@echo "  make lib LIB_NAME=MyLib"
+	@echo "  make zip"
+	@echo "  make zip ZIP_NAME=MyZip.zip"
+	@echo "  make dist VERSION=0.5-rc1"
+
+clean:
+	-rm -rf $(LIB_NAME)
+	-rm -f $(ZIP_NAME)
+
+examples:
+	mkdir -p $(LIB_NAME)/examples 
+	rsync -au --exclude=.svn `pwd`/../examples `pwd`/$(LIB_NAME)
+	for file in `find $(LIB_NAME)/examples/ -name "*.html"`; do \
+	    sed -i "s/\.\.\/ux\/Printing\.js/\.\.\/script\/Printing\.js/g" $${file} ; \
+	done ; 	
+
+lib:
+	@echo "Building the library."
+	mkdir -p $(LIB_NAME)/script
+	jsbuild full.cfg -v -o $(LIB_NAME)/script/
+	
+	cp ../license.txt $(LIB_NAME)
+
+zip: lib
+	@echo "Archiving the library."
+	-rm -f $(ZIP_NAME)
+	zip $(ZIP_NAME) -r $(LIB_NAME)
+
+dist: examples zip

Added: sandbox/ahocevar/playground/ux/Printing/build/ext-license.js
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/build/ext-license.js	                        (rev 0)
+++ sandbox/ahocevar/playground/ux/Printing/build/ext-license.js	2009-12-07 17:52:42 UTC (rev 1566)
@@ -0,0 +1,8 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ * licensing at extjs.com
+ * 
+ * http://extjs.com/products/license.php
+ */
+

Added: sandbox/ahocevar/playground/ux/Printing/build/full.cfg
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/build/full.cfg	                        (rev 0)
+++ sandbox/ahocevar/playground/ux/Printing/build/full.cfg	2009-12-07 17:52:42 UTC (rev 1566)
@@ -0,0 +1,5 @@
+[Printing.js]
+root = ../ux
+license = geoext-license.js
+exclude =
+    Printing.js

Added: sandbox/ahocevar/playground/ux/Printing/build/geoext-license.js
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/build/geoext-license.js	                        (rev 0)
+++ sandbox/ahocevar/playground/ux/Printing/build/geoext-license.js	2009-12-07 17:52:42 UTC (rev 1566)
@@ -0,0 +1,30 @@
+/*
+
+Copyright (c) 2008-2009, The Open Source Geospatial Foundation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of the Open Source Geospatial Foundation nor the names
+      of its contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+*/

Added: sandbox/ahocevar/playground/ux/Printing/build/readme.txt
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/build/readme.txt	                        (rev 0)
+++ sandbox/ahocevar/playground/ux/Printing/build/readme.txt	2009-12-07 17:52:42 UTC (rev 1566)
@@ -0,0 +1,39 @@
+Building GeoExt.ux
+==================
+
+This directory contains configuration files necessary for building GeoExt.ux.
+The build configuration is intended for use with the jsbuild
+utility included in JSTools (http://projects.opengeo.org/jstools).
+
+Brief instructions
+------------------
+
+This build dir contains a Makefile, which can be used to build the ux. The
+build process requires a bash-like shell, make, sed, find and rsync. All this
+should be available on well equipped development *nix and OS X boxes. In
+addition, JSTools is required.
+
+To install JSTools, python-setuptools is required. This is available as
+python-setuptools package on debian-style linux systems.
+
+    $ sudo aptitude install python-setuptools
+    
+Now you can easily install JSTools.
+
+    $ sudo easy_install http://svn.opengeo.org/jstools/trunk/
+
+Change into the build directory (the one containing the readme.txt
+file you are reading right now), if you are not already here.
+
+    $ cd build
+
+From here, you can build the library.
+
+    $ make zip
+    
+Now you can take the resulting zip file and unpack it on your web
+server. The library itself resides in the script folder.
+    
+The Makefile has more targets. Invoke make help to see them all.
+
+    $ make help

Modified: sandbox/ahocevar/playground/ux/Printing/examples/Printing.html
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/examples/Printing.html	2009-12-07 12:57:11 UTC (rev 1565)
+++ sandbox/ahocevar/playground/ux/Printing/examples/Printing.html	2009-12-07 17:52:42 UTC (rev 1566)
@@ -2,19 +2,13 @@
     <head>
         <title>Printing ux Example</title>
 
-        <script type="text/javascript" src="../../../trunk/ext/adapter/ext/ext-base.js"></script>
-        <script type="text/javascript" src="../../../trunk/ext/ext-all-debug.js"></script>
-        <link rel="stylesheet" type="text/css" href="../../../trunk/ext/resources/css/ext-all.css" />
-        <link rel="stylesheet" type="text/css" href="../../../trunk/ext/examples/shared/examples.css" />
-        <script src="../../../trunk/openlayers/lib/OpenLayers.js"></script>
-        <script type="text/javascript" src="../../../trunk/geoext/lib/GeoExt.js"></script>
+        <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>
+        <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" />
+        <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css" />
+        <script src="http://openlayers.org/api/2.8/OpenLayers.js"></script>
+        <script type="text/javascript" src="http://api.geoext.org/0.6/script/GeoExt.js"></script>
         
-        <script type="text/javascript" src="../ux/data/PrintPage.js"></script>
-        <script type="text/javascript" src="../ux/data/PrintProvider.js"></script>
-        <script type="text/javascript" src="../ux/plugins/PrintProviderField.js"></script>
-        <script type="text/javascript" src="../ux/plugins/PrintPageField.js"></script>
-        <script type="text/javascript" src="../ux/widgets/form/PrintForm.js"></script>
-        <script type="text/javascript" src="../ux/widgets/form/SimplePrint.js"></script>
+        <script type="text/javascript" src="../ux/Printing.js"></script>
         
         <script type="text/javascript" src="Printing.js"></script>
 

Added: sandbox/ahocevar/playground/ux/Printing/license.txt
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/license.txt	                        (rev 0)
+++ sandbox/ahocevar/playground/ux/Printing/license.txt	2009-12-07 17:52:42 UTC (rev 1566)
@@ -0,0 +1,44 @@
+This license applies to all code and content hosted in the "core" directory of
+this repository (http://svn.geoext.org/core/) - including the "trunk",
+"branches", and "tags" subdirectories. This license does not apply to external
+code and content which may be checked out in working copies (due to
+svn:externals properties on subdirectories).
+
+License
+=======
+
+Copyright (c) 2008-2009, The Open Source Geospatial Foundation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of the Open Source Geospatial Foundation nor the names
+      of its contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+
+Notice about ExtJS
+==================
+
+The GeoExt library is for use with the ExtJS library.  ExtJS is distributed
+under the terms of the GPL v3.  See http://extjs.com/products/license.php for
+details on ExtJS licensing.

Added: sandbox/ahocevar/playground/ux/Printing/ux/Printing.js
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/ux/Printing.js	                        (rev 0)
+++ sandbox/ahocevar/playground/ux/Printing/ux/Printing.js	2009-12-07 17:52:42 UTC (rev 1566)
@@ -0,0 +1,85 @@
+/**
+ * Copyright (c) 2008-2009 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 = "ux/Printing.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(
+        "data/PrintPage.js",
+        "data/PrintProvider.js",
+        "plugins/PrintPageField.js",
+        "plugins/PrintProviderField.js",
+        "widgets/form/PrintForm.js",
+        "widgets/form/SimplePrint.js"
+    );
+
+    var agent = navigator.userAgent;
+    var docWrite = (agent.match("MSIE") || agent.match("Safari"));
+    if(docWrite) {
+        var allScriptTags = new Array(jsfiles.length);
+    }
+    var host = getScriptLocation() + "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(""));
+    }
+})();

Modified: sandbox/ahocevar/playground/ux/Printing/ux/widgets/form/SimplePrint.js
===================================================================
--- sandbox/ahocevar/playground/ux/Printing/ux/widgets/form/SimplePrint.js	2009-12-07 12:57:11 UTC (rev 1565)
+++ sandbox/ahocevar/playground/ux/Printing/ux/widgets/form/SimplePrint.js	2009-12-07 17:52:42 UTC (rev 1566)
@@ -7,7 +7,7 @@
  */
 
 /**
- * @requires ux/widgets/form/PrintForm.js
+ * @requires widgets/form/PrintForm.js
  */
 Ext.namespace("GeoExt.ux.form")
 



More information about the Commits mailing list