[evolvis-commits] r17684: theme-evolvis pending merges:↵ Thorsten Glaser 2011-11-02 standard *.js must come before custom ones↵ Thorsten Glaser 2011-11-02 preliminary ECMAscript test stuff↵ Thorsten Glaser 2011-11-02 make the collapsible-item cookie persistent

mirabilos at evolvis.org mirabilos at evolvis.org
Wed Nov 2 15:07:36 CET 2011


Author: mirabilos
Date: 2011-11-02 15:07:36 +0100 (Wed, 02 Nov 2011)
New Revision: 17684

Added:
   trunk/gforge_base/evolvisforge-5.1/src/www/themes/tests/
   trunk/gforge_base/evolvisforge-5.1/src/www/themes/tests/jstest.php
Modified:
   trunk/gforge_base/evolvisforge-5.1/src/www/include/Layout.class.php
   trunk/gforge_base/evolvisforge-5.1/src/www/js/common.js
Log:
theme-evolvis pending merges:
  Thorsten Glaser 2011-11-02 standard *.js must come before custom ones
    Thorsten Glaser 2011-11-02 preliminary ECMAscript test stuff
    Thorsten Glaser 2011-11-02 make the collapsible-item cookie persistent


Modified: trunk/gforge_base/evolvisforge-5.1/src/www/include/Layout.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/include/Layout.class.php	2011-11-02 14:07:32 UTC (rev 17683)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/include/Layout.class.php	2011-11-02 14:07:36 UTC (rev 17684)
@@ -156,6 +156,14 @@
 
 		$this->addStylesheet('/themes/css/fusionforge.css');
 
+		$this->addJavascript("/scripts/prototype/prototype.js");
+		$this->addJavascript("/scripts/scriptaculous/scriptaculous.js");
+		$this->addJavascript("/scripts/codendi/Tooltip.js");
+		$this->addJavascript("/scripts/codendi/LayoutManager.js");
+		$this->addJavascript("/scripts/codendi/ReorderColumns.js");
+		$this->addJavascript("/scripts/codendi/codendi-1236793993.js");
+		$this->addJavascript("/scripts/codendi/validate.js");
+		$this->addJavascript('/js/common.js');
 	}
 
 	function addJavascript($js) {
@@ -325,22 +333,13 @@
 	 * @todo generalize this
 	 */
 	function headerJS() {
-		$this->addJavascript("/scripts/prototype/prototype.js");
-		$this->addJavascript("/scripts/scriptaculous/scriptaculous.js");
-		$this->addJavascript("/scripts/codendi/Tooltip.js");
-		$this->addJavascript("/scripts/codendi/LayoutManager.js");
-		$this->addJavascript("/scripts/codendi/ReorderColumns.js");
-		$this->addJavascript("/scripts/codendi/codendi-1236793993.js");
-		$this->addJavascript("/scripts/codendi/validate.js");
-		$this->addJavascript('/js/common.js');
-
 ?>
-			<script language="JavaScript" type="text/javascript">//<![CDATA[
+	<script language="JavaScript" type="text/javascript">//<![CDATA[
 <?php
 		/* this hook comes before the files (why?) */
 		plugin_hook ("javascript",false);
 ?>
-			//]]></script>
+	//]]></script>
 <?php
 		/* this hook comes before the main files (why?) */
 		plugin_hook ("javascript_file",false);
@@ -356,9 +355,9 @@
 		 */
 		if ($this->has_jquery) {
 ?>
-			<script language="JavaScript" type="text/javascript">//<![CDATA[
-				jQuery.noConflict();
-			//]]></script>
+	<script language="JavaScript" type="text/javascript">//<![CDATA[
+		jQuery.noConflict();
+	//]]></script>
 <?php
 		}
 	}

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/js/common.js
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/js/common.js	2011-11-02 14:07:32 UTC (rev 17683)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/js/common.js	2011-11-02 14:07:36 UTC (rev 17684)
@@ -227,7 +227,11 @@
 		eicon.getElementsByTagName("img")[0].getAttributeNode("src").nodeValue = icon_maximise;
 		eelem.style.display = "none";
 		if (cid) {
-			setCookie("evcol_" + cid, 1);
+			/* to make cookies persistent, set an expiry */
+			var expdate = new Date();
+			expdate.setYear(expdate.getFullYear() + 1);
+
+			setCookie("evcol_" + cid, 1, expdate);
 		}
 	}
 }

Added: trunk/gforge_base/evolvisforge-5.1/src/www/themes/tests/jstest.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/themes/tests/jstest.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/themes/tests/jstest.php	2011-11-02 14:07:36 UTC (rev 17684)
@@ -0,0 +1,135 @@
+<?php
+/*-
+ * FusionForge ECMAscript Library test
+ *
+ * Copyright © 2011
+ *	Thorsten “mirabilos” Glaser <t.glaser at tarent.de>
+ * All rights reserved.
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *-
+ * Test embedding ECMAscript libraries in FusionForge
+ */
+
+require_once('../../env.inc.php');
+require_once $gfcommon.'include/pre.php';
+
+/* test jQuery */
+html_use_jquery();
+
+/* test jQuery-Tipsy */
+html_use_tooltips();
+
+/* test jQuery-UI */
+html_use_jqueryui();
+
+/* test Prototype */
+use_stylesheet('/themes/css/datepicker.css');
+use_javascript('/js/prototype-base-extensions.js');
+use_javascript('/js/prototype-date-extensions.js');
+use_javascript('/js/datepicker.js');
+/* and script.aculo.us and Lightbox2 */
+//html_use_lightbox();
+
+/* display site header */
+site_header(array('title' => 'ECMAscript Test'));
+
+/* provide basic DOM for ECMAscript to manipulate */
+?>
+
+<h1>JavaScript Library Test Page</h1>
+
+<h2>jQuery</h2>
+<ul id="orderedlist">
+ <li>one</li>
+ <li>two</li>
+</ul>
+<p>The above list should be manipulated using jQuery.noConflict</p>
+<script language="JavaScript" type="text/javascript">//<![CDATA[
+jQuery(document).ready(function() {
+	jQuery("#orderedlist").find("li").each(function(i) {
+		jQuery(this).append(" BAM! " + i);
+	});
+});
+//]]></script>
+
+<h2>jQuery-Tipsy</h2>
+<p id="tipsytest" title="Hello, ECMA 262 World!">You should see some
+ kind of fancy tooltip when hovering here. If you see the standard
+ webbrowser one, jQuery-Tipsy is not working properly.</p>
+<script language="JavaScript" type="text/javascript">//<![CDATA[
+jQuery(function() {
+	if (typeof(jQuery(window).tipsy) == 'function') {
+		jQuery('#tipsytest').tipsy({
+			"gravity": "n",
+			"html": true,
+			"delayIn": 1000,
+			"delayOut": 500,
+			"fade": true
+		});
+	} else {
+		jQuery('#tipsytest').append(" In fact, it is not working.");
+	}
+});
+//]]></script>
+
+<h2>jQuery UI</h2>
+<div id="patentmyll"></div>
+<p>You should see a progress bar above.</p>
+
+<script language="JavaScript" type="text/javascript">//<![CDATA[
+jQuery(function() {
+	jQuery('#patentmyll').progressbar({ "value": 37 });
+});
+//]]></script>
+
+<h2>Prototype</h2>
+<p style="display:none;">You should not see this; if you do, CSS
+ hiding is broken for you.</p>
+<p id="protoon" style="display:none;">You should see this. If
+ you don’t, Prototype failed to unhide.</p>
+<p id="protooff">You should not see this. If you do, Prototype
+ failed to hide.</p>
+<p>You should see this. There are three paragraphs above, but
+ you should <em>not</em> see all of them.</p>
+
+<h3>DatePicker</h3>
+<form action="/" method="get">
+<input type="text" name="dptest" value="2011-10-31" class="date_ymd_de" />
+</form>
+<p>Click on the above field to see a DatePicker pop in.</p>
+<script language="JavaScript" type="text/javascript">//<![CDATA[
+function createTestPicker() {
+	$(document.body).select('input.date_ymd_de').each(function(e) {
+		new Control.DatePicker(e, {
+			"locale": "ymd_de",
+			"icon": "/images/office-calendar.png"
+		});
+	});
+}
+Event.observe(window, "load", createTestPicker);
+//]]></script>
+
+<h3>Lightbox2</h3>
+<p>Show the <a href="/themes/evolvis/images/logo_internal_repo.png"
+ rel="lightbox" title="Unser tolles Logo">Evolvis Repository logo</a>
+ image in a lightbox.</p>
+
+
+<?php
+
+/* finish the XHTML and output */
+site_footer(array());



More information about the evolvis-commits mailing list