[evolvis-commits] r17667: really switch jQuery into noConflict mode

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Oct 31 13:24:17 CET 2011


Author: mirabilos
Date: 2011-10-31 13:24:17 +0100 (Mon, 31 Oct 2011)
New Revision: 17667

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
   trunk/gforge_base/evolvisforge-5.1/src/www/include/Layout.class.php
   trunk/gforge_base/evolvisforge-5.1/src/www/include/html.php
Log:
really switch jQuery into noConflict mode


Modified: trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2011-10-31 12:10:09 UTC (rev 17666)
+++ trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2011-10-31 12:24:17 UTC (rev 17667)
@@ -24,12 +24,13 @@
   * Fix and sanitise ECMAscript handling
   * [#2030] [#2158] New Evolvis theme look
   * Supply libjs-jquery-ui in gforge-web-apache2
+  * Use jQuery in noConflict mode in all themes (if used at all)
 
   [ Mike Esser ]
   * [#1850] Fix merge glitch
   * [#1859] [#1906] Port code from Evolvis 4.8 to 5.1
 
- -- Thorsten Glaser <t.glaser at tarent.de>  Mon, 31 Oct 2011 13:09:38 +0100
+ -- Thorsten Glaser <t.glaser at tarent.de>  Mon, 31 Oct 2011 13:23:27 +0100
 
 fusionforge (5.1.1-1+) UNRELEASED; urgency=low
 

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-10-31 12:10:09 UTC (rev 17666)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/include/Layout.class.php	2011-10-31 12:24:17 UTC (rev 17667)
@@ -152,6 +152,7 @@
 			$this->jsdir = $this->themedir;
 			$this->jsbaseurl = $this->themeurl;
 		}
+		$this->has_jquery = false;
 
 		$this->addStylesheet('/themes/css/fusionforge.css');
 
@@ -333,13 +334,33 @@
 		$this->addJavascript("/scripts/codendi/validate.js");
 		$this->addJavascript('/js/common.js');
 
-		echo "\n\t\t\t" .
-		    '<script language="JavaScript" type="text/javascript">' .
-		    "//<![CDATA[\n";
+?>
+			<script language="JavaScript" type="text/javascript">//<![CDATA[
+<?php
+		/* this hook comes before the files (why?) */
 		plugin_hook ("javascript",false);
-		echo "\n\t\t\t//]]></script>\n";
+?>
+			//]]></script>
+<?php
+		/* this hook comes before the main files (why?) */
 		plugin_hook ("javascript_file",false);
+
+		/* now emit all those from addJavascript() et al. */
 		echo $this->getJavascripts();
+
+		/*
+		 * switch jQuery into no conflict mode, i.e. do not let
+		 * it possess the dollar sign function; according to the
+		 * docs, this must come after both jQuery and Prototype
+		 * have been loaded, not before (why?)
+		 */
+		if ($this->has_jquery) {
+?>
+			<script language="JavaScript" type="text/javascript">//<![CDATA[
+				jQuery.noConflict();
+			//]]></script>
+<?php
+		}
 	}
 
 	function headerForgepluckerMeta() {

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/include/html.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/include/html.php	2011-10-31 12:10:09 UTC (rev 17666)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/include/html.php	2011-10-31 12:24:17 UTC (rev 17667)
@@ -359,6 +359,7 @@
 
 function html_use_jquery() {
 	use_javascript('/scripts/jquery/jquery.min.js');
+	$GLOBALS['HTML']->has_jquery = true;
 }
 
 function html_use_tooltips() {



More information about the evolvis-commits mailing list