1/* 2Plugin Name: AO Clubs Members 3Author URI: http://www.alleyoop.be 4Description: A pre-configured Members widget for AO Clubs. 5Author: Simon Arickx 6Version: 1.0 7*/ 8 9jQuery(document).ready(function(){ 10 11 var widget = jQuery('.aoclubs-members-widget'); 12 widget.find('.aoclubs-members-wrap').hide(); 13 widget.find('.aoclubs-members-wrap:first').show(); 14 widget.find('.aoclubs-members-tab-wrap li:first').addClass('aoclubs-members-active-tab'); 15 16 jQuery('.aoclubs-members-tab-wrap li').click(function(){ 17 var id = jQuery(this).attr('data-tab'); 18 var parent = jQuery(this).parent().parent(); 19 20 jQuery(this).parent().children('li').removeClass('aoclubs-members-active-tab'); 21 jQuery(this).addClass('aoclubs-members-active-tab'); 22 23 parent.find('.aoclubs-members-wrap').hide(); 24 parent.find('.aoclubs-members-wrap[data-id=' + id + ']').show(); 25 }); 26 27 // Add the ticker to the required elements 28 jQuery('.aoclubs-members-vticker').each(function(){ 29 var visible = jQuery(this).attr('data-visible'); 30 var interval = jQuery(this).attr('data-speed'); 31 var ticker = jQuery(this).easyTicker({ 32 'visible': visible, 33 'interval': interval 34 }); 35 }); 36}); 37 38/* 39 * jQuery - Easy Ticker plugin - v2.0 40 * http://www.aakashweb.com/ 41 * Copyright 2014, Aakash Chakravarthy 42 * Released under the MIT License. 43 */ 44 45;(function ( $, window, document, undefined ) { 46 47 var name = "easyTicker", 48 defaults = { 49 direction: 'up', 50 easing: 'swing', 51 speed: 'slow', 52 interval: 2000, 53 height: 'auto', 54 visible: 0, 55 mousePause: 1, 56 controls: { 57 up: '', 58 down: '', 59 toggle: '', 60 playText: 'Play', 61 stopText: 'Stop' 62 } 63 }; 64 65 // Constructor 66 function EasyTicker( el, options ) { 67 68 var s = this; 69
70 s.opts = $.extend( {}, defaults, options ); 71 s.elem = $(el); 72 s.targ = $(el).children(':first-child'); 73 s.timer = 0; 74 s.mHover = 0; 75 s.winFocus = 1; 76 77 init(); 78 start(); 79 80 $([window, document]).off('focus.jqet').on('focus.jqet', function(){ 81 s.winFocus = 1; 82 }).off('blur.jqet').on('blur.jqet', function(){ 83 s.winFocus = 0; 84 }); 85 86 if( s.opts.mousePause == 1 ){ 87 s.elem.mouseenter(function(){ 88 s.timerTemp = s.timer; 89 stop(); 90 }).mouseleave(function(){ 91 if( s.timerTemp !== 0 ) 92 start(); 93 }); 94 } 95 96 $(s.opts.controls.up).on('click', function(e){ 97 e.preventDefault(); 98 moveDir('up'); 99 }); 100 101 $(s.opts.controls.down).on('click', function(e){ 102 e.preventDefault(); 103 moveDir('down'); 104 }); 105 106 $(s.opts.controls.toggle).on('click', function(e){ 107 e.preventDefault(); 108 if( s.timer == 0 ) start(); 109 else stop(); 110 }); 111 112 function init(){ 113 114 s.elem.children().css('margin', 0).children().css('margin', 0); 115 116 s.elem.css({ 117 position : 'relative', 118 height: s.opts.height, 119 overflow : 'hidden' 120 }); 121 122 s.targ.css({ 123 'position' : 'absolute', 124 'margin' : 0 125 }); 126 127 setInterval( function(){ 128 adjHeight(); 129 }, 100); 130 131 } // Init Method 132 133 function start(){ 134 s.timer = setInterval(function(){ 135 if( s.winFocus == 1 ){ 136 move( s.opts.direction ); 137 } 138 }, s.opts.interval); 139 140 $(s.opts.controls.toggle).addClass('et-run').html(s.opts.controls.stopText); 141 142 } // Start method 143 144 145 function stop(){ 146 clearInterval( s.timer ); 147 s.timer = 0; 148 $(s.opts.controls.toggle).removeClass('et-run').html(s.opts.controls.playText); 149 }// Stop 150 151 152 function move( dir ){ 153 var sel, eq, appType; 154 155 if( !s.elem.is(':visible') ) return; 156 157 if( dir == 'up' ){ 158 sel = ':first-child'; 159 eq = '-='; 160 appType = 'appendTo'; 161 }else{ 162 sel = ':last-child'; 163 eq = '+='; 164 appType = 'prependTo'; 165 } 166 167 var selChild = s.targ.children(sel); 168 var height = selChild.outerHeight(); 169 170 s.targ.stop(true, true).animate({ 171 'top': eq + height + "px" 172 }, s.opts.speed, s.opts.easing, function(){ 173 174 selChild.hide()[appType]( s.targ ).fadeIn(); 175 s.targ.css('top', 0); 176 177 adjHeight(); 178 179 }); 180 }// Move 181 182 function moveDir( dir ){ 183 stop(); 184 if( dir == 'up' ) move('up'); else move('down'); 185 // start(); 186 } 187 188 function fullHeight(){ 189 var height = 0; 190 var tempDisp = s.elem.css('display'); // Get the current el display value 191 192 s.elem.css('display', 'block'); 193 194 s.targ.children().each(function(){ 195 height += $(this).outerHeight(); 196 }); 197 198 s.elem.css({ 199 'display' : tempDisp, 200 'height' : height 201 }); 202 } 203 204 function visHeight( anim ){ 205 var wrapHeight = 0; 206 s.targ.children(':lt(' + s.opts.visible + ')').each(function(){ 207 wrapHeight += $(this).outerHeight(); 208 }); 209 210 if( anim == 1 ){ 211 s.elem.stop(true, true).animate({height: wrapHeight}, s.opts.speed); 212 }else{ 213 s.elem.css( 'height', wrapHeight); 214 } 215 } 216 217 function adjHeight(){ 218 if( s.opts.height == 'auto' && s.opts.visible != 0 ){ 219 anim = arguments.callee.caller.name == 'init' ? 0 : 1; 220 visHeight( anim ); 221 }else if( s.opts.height == 'auto' ){ 222 fullHeight(); 223 } 224 } 225 226 return { 227 up: function(){ moveDir('up'); }, 228 down: function(){ moveDir('down'); }, 229 start: start, 230 stop: stop, 231 options: s.opts 232 }; 233 234 } 235 236 // Attach the object to the DOM 237 $.fn[name] = function ( options ) { 238 return this.each(function () { 239 if (!$.data(this, name)) { 240 $.data(this, name, new EasyTicker( this, options )); 241 } 242 }); 243 }; 244 245})( jQuery, window, document );
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.