[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.4-413-g87bd8a6

Thomas Sibley trs at bestpractical.com
Mon Nov 8 16:10:05 EST 2010


The branch, 3.9-trunk has been updated
       via  87bd8a635e41535b722d00154614b75dfcb6760a (commit)
       via  4a34d309ae3b9826ff634e33b6c59aab45816cb6 (commit)
       via  e5d457cccbb0187623a71cbe17e5e29051ac1ba5 (commit)
      from  3420109ef51a4d595d620e02667b4685501b98a7 (commit)

Summary of changes:
 etc/RT_Config.pm.in                        |    1 +
 share/html/Elements/Tabs                   |   15 ++--
 share/html/NoAuth/css/aileron/nav.css      |   11 ++-
 share/html/NoAuth/css/web2/InHeader        |    4 -
 share/html/NoAuth/js/jquery.hoverIntent.js |  111 ++++++++++++++++++++++++++++
 5 files changed, 128 insertions(+), 14 deletions(-)
 create mode 100644 share/html/NoAuth/js/jquery.hoverIntent.js

- Log -----------------------------------------------------------------
commit e5d457cccbb0187623a71cbe17e5e29051ac1ba5
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Nov 8 15:58:22 2010 -0500

    Kill the superfluous Settings submenu to decrease the menu levels

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index cbfe625..fba3d2c 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -188,14 +188,13 @@ if ( $request_path !~ qr{^/SelfService/} ) {
 
     if ( $session{'CurrentUser'}->UserObj
          && $session{'CurrentUser'}->HasRight( Right  => 'ModifySelf', Object => $RT::System )) {
-        my $settings = $about_me->child( settings => title => loc('Settings'), path => '/Prefs/Other.html', );
-        $settings->child( options => title => loc('Options'), path     => '/Prefs/Other.html', );
-        $settings->child( about_me => title => loc('About me'), path     => '/User/Prefs.html', );
-        $settings->child( search_options => title => loc('Search options'), path => '/Prefs/SearchOptions.html', );
-        $settings->child( myrt => title => loc('RT at a glance'), path => '/Prefs/MyRT.html', );
-        $settings->child( quicksearch => title => 'Quick search' => title => loc('Quick search'), path => '/Prefs/Quicksearch.html');
-
-        my $search_menu = $settings->child( 'saved-searches' => title => 'Saved Searches' );
+        $about_me->child( options => title => loc('Options'), path     => '/Prefs/Other.html', );
+        $about_me->child( about_me => title => loc('About me'), path     => '/User/Prefs.html', );
+        $about_me->child( search_options => title => loc('Search options'), path => '/Prefs/SearchOptions.html', );
+        $about_me->child( myrt => title => loc('RT at a glance'), path => '/Prefs/MyRT.html', );
+        $about_me->child( quicksearch => title => 'Quick search' => title => loc('Quick search'), path => '/Prefs/Quicksearch.html');
+
+        my $search_menu = $about_me->child( 'saved-searches' => title => 'Saved Searches' );
         my $searches = [ $m->comp( "/Search/Elements/SearchesForObject",
                           Object => RT::System->new( $session{'CurrentUser'} )) ];
         my $i = 0;
diff --git a/share/html/NoAuth/css/web2/InHeader b/share/html/NoAuth/css/web2/InHeader
index e918f0d..4b6157a 100644
--- a/share/html/NoAuth/css/web2/InHeader
+++ b/share/html/NoAuth/css/web2/InHeader
@@ -55,11 +55,7 @@
 <script type="text/javascript">
 jQuery(document).ready(function(){
     jQuery("#quick-personal").append('<ul id="prefs-menu"></ul>');
-
-    jQuery("#li-preferences-settings > ul > li").detach().insertAfter("#li-preferences-settings");
-    jQuery("#li-preferences-settings").remove();
     jQuery("#li-preferences").detach().appendTo("#prefs-menu");
-
     jQuery("#li-tools-config").detach().appendTo("#app-nav");
     jQuery("#li-search-simple").detach().insertBefore("#li-search");
     jQuery("#li-tools-approval").detach().appendTo("#app-nav");

commit 4a34d309ae3b9826ff634e33b6c59aab45816cb6
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Nov 8 16:07:31 2010 -0500

    Make the submenu indicators visible in aileron

diff --git a/share/html/NoAuth/css/aileron/nav.css b/share/html/NoAuth/css/aileron/nav.css
index 1bd5aaa..630b417 100644
--- a/share/html/NoAuth/css/aileron/nav.css
+++ b/share/html/NoAuth/css/aileron/nav.css
@@ -49,15 +49,22 @@
     width: 100%;
 }
 
-
 .sf-menu li:hover {
-    background-color: #fff;
+    background-color: #CFDEFF;
 }
 
 .sf-menu li, .sf-menu li li, .sf-menu li li li {
     background-color: #eaeaea;
 }
 
+.sf-sub-indicator {
+    background-image: url(../images/arrows-grey.png);
+}
+
+.sf-menu li li .sf-sub-indicator {
+    margin-top: -3px;
+}
+
 #main-navigation {
     position: absolute;
     top: 0;

commit 87bd8a635e41535b722d00154614b75dfcb6760a
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Nov 8 16:07:54 2010 -0500

    Use the HoverIntent jQuery plugin
    
    This prevents menus from flying out when you're just zipping by them

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 059fef9..7a14276 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2140,6 +2140,7 @@ Set(@JSFilesInHead, qw/
     titlebox-state.js
     util.js
     userautocomplete.js
+    jquery.hoverIntent.js
     superfish.js
     supersubs.js
     history-folding.js
diff --git a/share/html/NoAuth/js/jquery.hoverIntent.js b/share/html/NoAuth/js/jquery.hoverIntent.js
new file mode 100644
index 0000000..bd11442
--- /dev/null
+++ b/share/html/NoAuth/js/jquery.hoverIntent.js
@@ -0,0 +1,111 @@
+/**
+* hoverIntent is similar to jQuery's built-in "hover" function except that
+* instead of firing the onMouseOver event immediately, hoverIntent checks
+* to see if the user's mouse has slowed down (beneath the sensitivity
+* threshold) before firing the onMouseOver event.
+* 
+* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
+* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
+* 
+* hoverIntent is currently available for use in all personal or commercial 
+* projects under both MIT and GPL licenses. This means that you can choose 
+* the license that best suits your project, and use it accordingly.
+* 
+* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions
+* $("ul li").hoverIntent( showNav , hideNav );
+* 
+* // advanced usage receives configuration object only
+* $("ul li").hoverIntent({
+*	sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)
+*	interval: 100,   // number = milliseconds of polling interval
+*	over: showNav,  // function = onMouseOver callback (required)
+*	timeout: 0,   // number = milliseconds delay before onMouseOut function call
+*	out: hideNav    // function = onMouseOut callback (required)
+* });
+* 
+* @param  f  onMouseOver function || An object with configuration options
+* @param  g  onMouseOut function  || Nothing (use configuration options object)
+* @author    Brian Cherne <brian at cherne.net>
+*/
+(function($) {
+	$.fn.hoverIntent = function(f,g) {
+		// default configuration options
+		var cfg = {
+			sensitivity: 7,
+			interval: 100,
+			timeout: 0
+		};
+		// override configuration options with user supplied object
+		cfg = $.extend(cfg, g ? { over: f, out: g } : f );
+
+		// instantiate variables
+		// cX, cY = current X and Y position of mouse, updated by mousemove event
+		// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
+		var cX, cY, pX, pY;
+
+		// A private function for getting mouse position
+		var track = function(ev) {
+			cX = ev.pageX;
+			cY = ev.pageY;
+		};
+
+		// A private function for comparing current and previous mouse position
+		var compare = function(ev,ob) {
+			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
+			// compare mouse positions to see if they've crossed the threshold
+			if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
+				$(ob).unbind("mousemove",track);
+				// set hoverIntent state to true (so mouseOut can be called)
+				ob.hoverIntent_s = 1;
+				return cfg.over.apply(ob,[ev]);
+			} else {
+				// set previous coordinates for next time
+				pX = cX; pY = cY;
+				// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
+				ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
+			}
+		};
+
+		// A private function for delaying the mouseOut function
+		var delay = function(ev,ob) {
+			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
+			ob.hoverIntent_s = 0;
+			return cfg.out.apply(ob,[ev]);
+		};
+
+		// A private function for handling mouse 'hovering'
+		var handleHover = function(e) {
+			// next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
+			var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
+			while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
+			if ( p == this ) { return false; }
+
+			// copy objects to be passed into t (required for event object to be passed in IE)
+			var ev = jQuery.extend({},e);
+			var ob = this;
+
+			// cancel hoverIntent timer if it exists
+			if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
+
+			// else e.type == "onmouseover"
+			if (e.type == "mouseover") {
+				// set "previous" X and Y position based on initial entry point
+				pX = ev.pageX; pY = ev.pageY;
+				// update "current" X and Y position based on mousemove
+				$(ob).bind("mousemove",track);
+				// start polling interval (self-calling timeout) to compare mouse coordinates over time
+				if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
+
+			// else e.type == "onmouseout"
+			} else {
+				// unbind expensive mousemove event
+				$(ob).unbind("mousemove",track);
+				// if hoverIntent state is true, then call the mouseOut function after the specified delay
+				if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
+			}
+		};
+
+		// bind the function to the two event listeners
+		return this.mouseover(handleHover).mouseout(handleHover);
+	};
+})(jQuery);
\ No newline at end of file

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


More information about the Rt-commit mailing list