[Fusionforge-commits] FusionForge branch master updated. 0257fe2bd73ccf15f7bd91f4fe5cb9f74ea2e3b5

Franck Villaume nerville at fusionforge.org
Wed Aug 27 16:16:18 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  0257fe2bd73ccf15f7bd91f4fe5cb9f74ea2e3b5 (commit)
       via  c930931b0583c63acb2a76c07605511a188ff0cb (commit)
      from  67ff27bfbaf15f2f893bc09428301f901ecf4328 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0257fe2bd73ccf15f7bd91f4fe5cb9f74ea2e3b5
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Aug 27 16:13:23 2014 +0200

    implement [#716] upgrade jQuery Auto-height plugin and fix jQuery >= 1.9 compatibility

diff --git a/src/vendor/jquery-auto-height/jquery.browser.js b/src/vendor/jquery-auto-height/jquery.browser.js
new file mode 100644
index 0000000..c1acb86
--- /dev/null
+++ b/src/vendor/jquery-auto-height/jquery.browser.js
@@ -0,0 +1,39 @@
+(function( jQuery ) {
+	var matched,
+		userAgent = navigator.userAgent || "";
+
+	// Use of jQuery.browser is frowned upon.
+	// More details: http://api.jquery.com/jQuery.browser
+	// jQuery.uaMatch maintained for back-compat
+	jQuery.uaMatch = function( ua ) {
+		ua = ua.toLowerCase();
+
+		var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
+			/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
+			/(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
+			/(msie) ([\w.]+)/.exec( ua ) ||
+			ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
+			[];
+
+		return {
+			browser: match[ 1 ] || "",
+			version: match[ 2 ] || "0"
+		};
+	};
+
+	matched = jQuery.uaMatch( userAgent );
+
+	jQuery.browser = {};
+
+	if ( matched.browser ) {
+		jQuery.browser[ matched.browser ] = true;
+		jQuery.browser.version = matched.version;
+	}
+
+	// Deprecated, use jQuery.browser.webkit instead
+	// Maintained for back-compat only
+	if ( jQuery.browser.webkit ) {
+		jQuery.browser.safari = true;
+	}
+
+}( jQuery ));
\ No newline at end of file
diff --git a/src/vendor/jquery-auto-height/jquery.iframe-auto-height.plugin.1.9.3.js b/src/vendor/jquery-auto-height/jquery.iframe-auto-height.plugin.1.9.5.js
similarity index 90%
rename from src/vendor/jquery-auto-height/jquery.iframe-auto-height.plugin.1.9.3.js
rename to src/vendor/jquery-auto-height/jquery.iframe-auto-height.plugin.1.9.5.js
index 974e0af..2c8c2d8 100644
--- a/src/vendor/jquery-auto-height/jquery.iframe-auto-height.plugin.1.9.3.js
+++ b/src/vendor/jquery-auto-height/jquery.iframe-auto-height.plugin.1.9.5.js
@@ -3,7 +3,7 @@
 
 /*
   Plugin: iframe autoheight jQuery Plugin
-  Version: 1.9.3
+  Version: 1.9.5
   Author and Contributors
   ========================================
   NATHAN SMITH (http://sonspring.com/)
@@ -17,6 +17,8 @@
   jcaspian (https://github.com/jcaspian)
   adamjgray (https://github.com/adamjgray)
   Jens Bissinger (https://github.com/dpree)
+  jbreton (https://github.com/jbreton)
+  mindmelting (https://github.com/mindmelting)
 
   File: jquery.iframe-auto-height.plugin.js
   Remarks: original code from http://sonspring.com/journal/jquery-iframe-sizing
@@ -41,6 +43,7 @@
     var options = $.extend({
         heightOffset: 0,
         minHeight: 0,
+        maxHeight: 0,
         callback: function (newHeight) {},
         animate: false,
         debug: false,
@@ -82,7 +85,7 @@
       // ******************************************************
       // http://api.jquery.com/jQuery.browser/
       var strategyKeys = ['webkit', 'mozilla', 'msie', 'opera'];
-      var strategies = [];
+      var strategies = {};
       strategies['default'] = function (iframe, $iframeBody, options, browser) {
         // NOTE: this is how the plugin determines the iframe height, override if you need custom
         return $iframeBody[0].scrollHeight + options.heightOffset;
@@ -119,6 +122,8 @@
       // for use by webkit only
       var loadCounter = 0;
 
+      var iframeDoc = this.contentDocument || this.contentWindow.document;
+
       // resizeHeight
       function resizeHeight(iframe) {
         if (options.diagnostics) {
@@ -138,9 +143,16 @@
 
         if (newHeight < options.minHeight) {
           debug("new height is less than minHeight");
-          newHeight = options.minHeight + options.heightOffset;
+          newHeight = options.minHeight;
+        }
+
+        if (options.maxHeight > 0 && newHeight > options.maxHeight) {
+          debug("new height is greater than maxHeight");
+          newHeight = options.maxHeight;
         }
 
+        newHeight += options.heightOffset;
+
         debug("New Height: " + newHeight);
         if (options.animate) {
           $(iframe).animate({height: newHeight + 'px'}, {duration: 500});
@@ -166,7 +178,7 @@
       }
 
       // Check if browser is Webkit (Safari/Chrome) or Opera
-      if ($.browser.webkit || $.browser.opera) {
+      if ($.browser.webkit || $.browser.opera || $.browser.chrome) {
         debug("browser is webkit or opera");
 
         // Start timer when loaded.
@@ -198,11 +210,15 @@
         $(this).attr('src', source);
       } else {
         // For other browsers.
-        $(this).load(function () {
+        if(iframeDoc.readyState  === 'complete') {
           resizeHeight(this);
-        });
+        } else {
+          $(this).load(function () {
+            resizeHeight(this);
+          });
+        }
       } // if browser
 
     }); // $(this).each(function () {
   }; // $.fn.iframeAutoHeight = function (options) {
-}(jQuery)); // (function ($) {
\ No newline at end of file
+}(jQuery)); // (function ($) {
diff --git a/src/www/include/html.php b/src/www/include/html.php
index 644d0ec..8c571ee 100644
--- a/src/www/include/html.php
+++ b/src/www/include/html.php
@@ -521,7 +521,8 @@ function html_use_jquerysplitter() {
 
 function html_use_jqueryautoheight() {
 	html_use_jquery();
-	use_javascript('/scripts/jquery-auto-height/jquery.iframe-auto-height.plugin.1.9.3.js');
+	use_javascript('/scripts/jquery-auto-height/jquery.iframe-auto-height.plugin.1.9.5.js');
+	use_javascript('/scripts/jquery-auto-height/jquery.browser.js');
 }
 
 /**

commit c930931b0583c63acb2a76c07605511a188ff0cb
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Aug 27 13:15:08 2014 +0200

    use HTML helpers

diff --git a/src/www/admin/index.php b/src/www/admin/index.php
index 9ed5063..d549760 100644
--- a/src/www/admin/index.php
+++ b/src/www/admin/index.php
@@ -40,55 +40,45 @@ site_admin_header(array('title'=>_('Site Admin')));
 
 $abc_array = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9');
 
+echo html_ao('div', array('class' => 'info-box'));
+echo html_e('h2', array(), _('User Maintenance'));
+$lielements = array();
+$forge = new FusionForge();
+$lielements[] = array('content' => sprintf(_('Active site users: <strong>%d</strong>'), $forge->getNumberOfActiveUsers()));
+$lielements[] = array('content' => util_make_link('/admin/userlist.php', _('Display Full User List/Edit Users')));
+$localcontent = _('Display Users Beginning with')._(': ');
+for ($i = 0; $i < count($abc_array); $i++) {
+	$localcontent .= util_make_link('/admin/userlist.php?user_name_search='.$abc_array[$i], $abc_array[$i]).'|';
+}
+$localcontent .= html_e('br');
+$localcontent .= $HTML->openForm(array('name' => 'usersrch', 'action' => util_make_uri('/admin/search.php'), 'method' => 'post'));
+$localcontent .= _('Search <em>(userid, username, realname, email)</em>');
+$localcontent .= html_e('input', array('type' => 'text', 'name' => 'search'));
+$localcontent .= html_e('input', array('type' => 'hidden', 'name' => 'substr', 'value' => 1));
+$localcontent .= html_e('input', array('type' => 'hidden', 'name' => 'usersearch', 'value' => 1));
+$localcontent .= html_e('input', array('type' => 'submit', 'value' => _('Search')));
+$localcontent .= $HTML->closeForm();
+$lielements[] = array('content' => $localcontent);
+$lielements[] = array('content' => util_make_link('/account/register.php', _('Register a New User')));
+$lielements[] = array('content' => util_make_link('/admin/userlist.php?status=P', _('Pending users')));
+echo $HTML->html_list($lielements);
+
+$params = array('result' => '');
+$plugins_site_admin_user_html = '';
+plugin_hook_by_reference("site_admin_user_maintenance_hook", $params);
+if ($params['result']) {
+	$plugins_site_admin_user_html = $params['result'];
+}
+if ($plugins_site_admin_user_html) {
+	echo '<h3>'.  _('Plugins User Maintenance') .'</h3>';
+	echo '<ul>';
+	echo $plugins_site_admin_user_html;
+	echo '</ul>';
+}
+echo html_ac(html_ap() - 1);
 ?>
 
 <div class="info-box">
-<h2><?php echo _('User Maintenance'); ?></h2>
-	<ul>
-	<li><?php
-		$gforge = new FusionForge();
-		printf(_('Active site users: <strong>%d</strong>'),
-		    $gforge->getNumberOfActiveUsers());
-	?></li>
-	<li><?php echo util_make_link('/admin/userlist.php', _('Display Full User List/Edit Users')); ?></li>
-	<li><?php
-	echo _('Display Users Beginning with:').' ';
-	for ($i=0; $i < count($abc_array); $i++) {
-		echo util_make_link('/admin/userlist.php?user_name_search='.$abc_array[$i], $abc_array[$i]).'|';
-	}
-?>
-	<br />
-		<form name="usersrch" action="/admin/search.php" method="post">
-		<?php echo _('Search <em>(userid, username, realname, email)</em>'); ?>:
-		<input type="text" name="search" />
-		<input type="hidden" name="substr" value="1" />
-		<input type="hidden" name="usersearch" value="1" />
-		<input type="submit" value="<?php echo _('Search'); ?>" />
-		</form>
-	</li>
-	<li><?php
-	echo util_make_link('/account/register.php', _('Register a New User'));
-	?>
-	</li>
-	<li><?php
-	echo util_make_link('/admin/userlist.php?status=P', _('Pending users')); ?></li>
-</ul>
-<?php
-	$params = array('result' => '');
-	$plugins_site_admin_user_html = '';
-	plugin_hook_by_reference("site_admin_user_maintenance_hook", $params);
-	if ($params['result']) {
-			$plugins_site_admin_user_html = $params['result'];
-	}
-	if ($plugins_site_admin_user_html) {
-		echo '<h3>'.  _('Plugins User Maintenance') .'</h3>';
-		echo '<ul>';
-		echo $plugins_site_admin_user_html;
-		echo '</ul>';
-	}
-?></div>
-
-<div class="info-box">
 <h2><?php echo _('Global roles and permissions'); ?></h2>
 	<ul>
 	<li><?php

-----------------------------------------------------------------------

Summary of changes:
 src/vendor/jquery-auto-height/jquery.browser.js    |   39 ++++++++++
 ...s => jquery.iframe-auto-height.plugin.1.9.5.js} |   30 +++++--
 src/www/admin/index.php                            |   82 +++++++++-----------
 src/www/include/html.php                           |    3 +-
 4 files changed, 100 insertions(+), 54 deletions(-)
 create mode 100644 src/vendor/jquery-auto-height/jquery.browser.js
 rename src/vendor/jquery-auto-height/{jquery.iframe-auto-height.plugin.1.9.3.js => jquery.iframe-auto-height.plugin.1.9.5.js} (90%)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list