1/** 2 * Auto Amazon Links 3 * 4 * Generates links of Amazon products just coming out today. You just pick categories and they appear even in JavaScript disabled browsers. 5 * 6 * http://en.michaeluno.jp/amazon-auto-links/ 7 * Copyright (c) 2013-2021 Michael Uno 8 * @name Pointer Tooltip 9 * @version 1.0.1 10 */ 11(function($){ 12 13 $( document ).ready( function() { 14 initialize( '.amazon-disclaimer-tooltip' ); 15 } ); 16 $( 'body' ).on( 'aal_ajax_loaded_unit', function( event ) { 17 initialize( $( event.target ).find( '.amazon-disclaimer-tooltip' ) ); 18 } ); 19 20 function initialize( target ) { 21 22 var _this = $( target ) 23 24 // Disable the CSS default tooltip 25 $( _this ).find( '.amazon-disclaimer-tooltip-content-text' ).css( 'display', 'none' ); 26 27 var _pointerTooltip = $( _this ); 28 // _pointerTooltip.on( 'click', function() { 29 // return false; // disable click 30 // }); 31 _pointerTooltip.on( 'mouseover', function() { 32 33 // Open the tooltip 34 $( this ).aalPointer({ 35 pointerClass: 'aal-tooltip', 36 pointerWidth: 340, 37 content: function() { 38 return $( this ).find( '.amazon-disclaimer-tooltip-content-text' ).html(); 39 }, 40 // position: 'right', 41 position: { 42 edge: 'bottom', 43 align: 'center', 44 within: $( this ).closest( '.amazon-product-container, .amazon-auto-links' ), // <-- this is added 45 collision: 'fit none', 46 }, 47 buttons: function() {}, 48 close: function() {}, 49 }).aalPointer( 'open' ); 50 51 // Handle toolitip closing 52 var _self = this; 53 $( this ).add( '.aal-tooltip' ).on( 'mouseleave', function(){ 54 55 var _selfMouseLeave = this; 56 // Set a timeout for the tooltip to close, allowing us to clear this trigger if the mouse comes back over 57 var _timeoutId = setTimeout(function(){ 58 $( _self ).aalPointer( 'close' ); 59 $( _self ).off( 'mouseleave' ); 60 $( _selfMouseLeave ).off( 'mouseleave' ); 61 $( _self ).off( 'mouseenter' ); 62 $( _selfMouseLeave ).off( 'mouseenter' ); 63 }, 650 ); 64 $( _self ).data( 'timeoutId', _timeoutId ); 65 66 } ); 67 $( this ).add( '.aal-tooltip' ).on( 'mouseenter', function(){ 68 clearTimeout( $( _self ).data('timeoutId' ) ); 69 }); 70 71 } ); 72 73 } 74 75}(jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.