Changeset 31723
- Timestamp:
- 03/11/2015 05:14:34 PM (10 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/admin-bar.js
r31111 r31723 4 4 if ( typeof(jQuery.fn.hoverIntent) == 'undefined' ) { 5 5 /* jshint ignore:start */ 6 // hoverIntent r6- Copy of wp-includes/js/hoverIntent.min.js7 (function(a){a.fn.hoverIntent=function(m,d,h){var j={interval:100,sensitivity:7,timeout:0};if(typeof m==="object"){j=a.extend(j,m)}else{if(a.isFunction(d)){j=a.extend(j,{over:m,out:d,selector:h})}else{j=a.extend(j,{over:m,out:m,selector:d})}}var l,k,g,f;var e=function(n){l=n.pageX;k=n.pageY};var c=function(o,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if((Math.abs(g-l)+Math.abs(f-k))<j.sensitivity){a(n).off("mousemove.hoverIntent",e);n.hoverIntent_s=1;return j.over.apply(n,[o])}else{g=l;f=k;n.hoverIntent_t=setTimeout(function(){c(o,n)},j.interval)}};var i=function(o,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);n.hoverIntent_s=0;return j.out.apply(n,[o])};var b=function(p){var o=jQuery.extend({},p);var n=this;if(n.hoverIntent_t){n.hoverIntent_t=clearTimeout(n.hoverIntent_t)}if(p.type=="mouseenter"){g=o.pageX;f=o.pageY;a(n).on("mousemove.hoverIntent",e);if(n.hoverIntent_s!=1){n.hoverIntent_t=setTimeout(function(){c(o,n)},j.interval)}}else{a(n).off("mousemove.hoverIntent",e);if(n.hoverIntent_s==1){n.hoverIntent_t=setTimeout(function(){i(o,n)},j.timeout)}}};return this.on({"mouseenter.hoverIntent":b,"mouseleave.hoverIntent":b},j.selector)}})(jQuery);6 // hoverIntent v1.8.1 - Copy of wp-includes/js/hoverIntent.min.js 7 !function(a){a.fn.hoverIntent=function(b,c,d){var e={interval:100,sensitivity:6,timeout:0};e="object"==typeof b?a.extend(e,b):a.isFunction(c)?a.extend(e,{over:b,out:c,selector:d}):a.extend(e,{over:b,out:b,selector:c});var f,g,h,i,j=function(a){f=a.pageX,g=a.pageY},k=function(b,c){return c.hoverIntent_t=clearTimeout(c.hoverIntent_t),Math.sqrt((h-f)*(h-f)+(i-g)*(i-g))<e.sensitivity?(a(c).off("mousemove.hoverIntent",j),c.hoverIntent_s=!0,e.over.apply(c,[b])):(h=f,i=g,c.hoverIntent_t=setTimeout(function(){k(b,c)},e.interval),void 0)},l=function(a,b){return b.hoverIntent_t=clearTimeout(b.hoverIntent_t),b.hoverIntent_s=!1,e.out.apply(b,[a])},m=function(b){var c=a.extend({},b),d=this;d.hoverIntent_t&&(d.hoverIntent_t=clearTimeout(d.hoverIntent_t)),"mouseenter"===b.type?(h=c.pageX,i=c.pageY,a(d).on("mousemove.hoverIntent",j),d.hoverIntent_s||(d.hoverIntent_t=setTimeout(function(){k(c,d)},e.interval))):(a(d).off("mousemove.hoverIntent",j),d.hoverIntent_s&&(d.hoverIntent_t=setTimeout(function(){l(c,d)},e.timeout)))};return this.on({"mouseenter.hoverIntent":m,"mouseleave.hoverIntent":m},e.selector)}}(jQuery); 8 8 /* jshint ignore:end */ 9 9 } -
trunk/src/wp-includes/js/hoverIntent.js
r24259 r31723 1 1 /*! 2 * hoverIntent r7 // 2013.03.11 // jQuery1.9.1+2 * hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+ 3 3 * http://cherne.net/brian/resources/jquery.hoverIntent.html 4 4 * 5 5 * You may use hoverIntent under the terms of the MIT license. Basically that 6 6 * means you are free to use hoverIntent as long as this header is left intact. 7 * Copyright 2007, 201 3Brian Cherne7 * Copyright 2007, 2014 Brian Cherne 8 8 */ 9 9 … … 36 36 var cfg = { 37 37 interval: 100, 38 sensitivity: 7,38 sensitivity: 6, 39 39 timeout: 0 40 40 }; … … 63 63 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 64 64 // compare mouse positions to see if they've crossed the threshold 65 if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {65 if ( Math.sqrt( (pX-cX)*(pX-cX) + (pY-cY)*(pY-cY) ) < cfg.sensitivity ) { 66 66 $(ob).off("mousemove.hoverIntent",track); 67 67 // set hoverIntent state to true (so mouseOut can be called) 68 ob.hoverIntent_s = 1;68 ob.hoverIntent_s = true; 69 69 return cfg.over.apply(ob,[ev]); 70 70 } else { … … 79 79 var delay = function(ev,ob) { 80 80 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 81 ob.hoverIntent_s = 0;81 ob.hoverIntent_s = false; 82 82 return cfg.out.apply(ob,[ev]); 83 83 }; … … 86 86 var handleHover = function(e) { 87 87 // copy objects to be passed into t (required for event object to be passed in IE) 88 var ev = jQuery.extend({},e);88 var ev = $.extend({},e); 89 89 var ob = this; 90 90 … … 92 92 if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } 93 93 94 // if e.type == "mouseenter"95 if (e.type == "mouseenter") {94 // if e.type === "mouseenter" 95 if (e.type === "mouseenter") { 96 96 // set "previous" X and Y position based on initial entry point 97 97 pX = ev.pageX; pY = ev.pageY; … … 99 99 $(ob).on("mousemove.hoverIntent",track); 100 100 // start polling interval (self-calling timeout) to compare mouse coordinates over time 101 if ( ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}101 if (!ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} 102 102 103 103 // else e.type == "mouseleave" … … 106 106 $(ob).off("mousemove.hoverIntent",track); 107 107 // if hoverIntent state is true, then call the mouseOut function after the specified delay 108 if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}108 if (ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} 109 109 } 110 110 }; -
trunk/src/wp-includes/script-loader.php
r31716 r31723 381 381 $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'shortcode' ), false, 1 ); 382 382 383 $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), ' r7', 1 );383 $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '1.8.1', 1 ); 384 384 385 385 $scripts->add( 'customize-base', "/wp-includes/js/customize-base$suffix.js", array( 'jquery', 'json2', 'underscore', 'wp-a11y' ), false, 1 );
Note: See TracChangeset
for help on using the changeset viewer.