1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10/** 11 * ------------------------------------------------------------------------ 12 * JA Newsticker Module for J25 & J32 13 * ------------------------------------------------------------------------ 14 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved. 15 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html 16 * Author: J.O.O.M Solutions Co., Ltd 17 * Websites: http://www.joomlart.com - http://www.joomlancers.com 18 * ------------------------------------------------------------------------ 19 */ 20 21/** 22 * JA News Sticker module allows display of article's title from sections or categories. 23 * You can configure the setttings in the right pane. Mutiple options for animations are also added, choose any one. 24 * If you are using this module on Teline III template, * then the default module position is "headlines". 25 **/ 26 27JANewSticker = new Class( { 28 29 initialize: function(_options){ 30 this.options = Object.append( { 31 modes: {horizontal:['left','width'],horizontal_right:['left','width'], verticald:['top','height'], vertical:['top','height']}, 32 size:240, 33 mode: 'horizontal', 34 buttonEvent:'click', 35 handlerEvent:'click', 36 interval: 5000, 37 autoRun:true, 38 previousIndex:null, 39 nextIndex: null, 40 currentIndex:0, 41 startItem: 0, 42 onRunning:null 43 }, _options || {} ); 44 // list action of button using in the slider. 45 this.fx = new Array(); 46 this.fx2 = new Array(); 47 48 $$(this.options.items).each(function(item){ 49 if(item.getStyle('visibility') == 'hidden'){ 50 item.setStyles({ 51 visibility: 'visible', 52 opacity: 0 53 }); 54 } 55 }); 56 57 // if choose horizontal slider. 58 if( this.options.mode == 'horizontal_stripe' ){ 59 60 }else { 61 62 this.onRunning = this.options.onRunning; 63 if( isNaN(this.options.startItem) 64 || (this.options.startItem > this.options.items.length || this.options.startItem < 0 ) ){ 65 this.options.startItem = 0; 66 } 67 68 var maxWidth = 0; 69 this.options.items.each(function(_item, index){ 70 // set z-index for each item in the list. 71 _item.setStyle('z-index', this.options.items.length - index); 72 73 74 _item.setStyle('width', _item.offsetWidth); 75 if( _item.offsetWidth > maxWidth ){ 76 maxWidth = _item.offsetWidth; 77 } 78 this.fx2[index] = new Fx.Tween( _item, _options.fxOptions ); 79 this.fx2[index].offsetWidth= _item.offsetWidth; 80 81 if( this.options.mode != 'opacity' ) { 82 this.fx[index] = new Fx.Tween( _item, _options.fxOptions||{duration:500,wait:false} ); 83 } 84 }.bind(this)); 85 86 if( this.options.box.offsetWidth <= 0 ){ 87 88 this.options.box.setStyle('width', maxWidth); 89 // this.options.size = maxWidth; 90 } 91 if( this.options.mode == 'vertical' || this.options.mode == 'verticald' ){ 92 this.options.size = this.options.box.offsetHeight; 93 } else { 94 this.options.size = this.options.box.offsetWidth; 95 } 96 // define list buttons drivent. 97 this.buttons = {previous: [], next: [], play: [], playback: [], stop: []}; 98 this.options.autoRun = true; 99 // _options.buttons ={ next:} 100 if( _options.buttons ){ 101 for( var action in _options.buttons ) { 102 this.bindingButtonsEvent( action, typeOf(_options.buttons[action])=='array' ? _options.buttons[action] : [_options.buttons[action]] ); 103 } 104 } 105 // if auto run 106 if( this.options.autoRun ) { 107 this.play( this.options.interval,'next',true ); 108 } 109 // process when mouse over and mouse out. 110 var wrapper2 = this.options.wrapper; 111 wrapper2.addEvent("mouseenter", function(){ 112 this.stop(); 113 }.bind(this)); 114 wrapper2.addEvent("mouseleave", function(){ 115 116 this.play(this.options.interval,'next',true); 117 }.bind(this)); 118 } 119 }, 120 /** 121 * previous 122 */ 123 previous: function(manual) { 124 // 125 // this.fx2[this.options.currentIndex].start(1,0); 126 // this.fx[this.options.currentIndex].start( (this.options.size), 0 ); 127 128 this.options.currentIndex += this.options.currentIndex > 0 ? -1 : this.options.items.length-1; 129 this.running( null, manual, 'previous' ); 130 }, 131 /** 132 * next 133 */ 134 next:function(manual){ 135 // display secord element. 136 this.options.currentIndex += (this.options.currentIndex < this.options.items.length-1) ? 1 : (1 - this.options.items.length); 137 this.running( null, manual, 'next' ); 138 }, 139 /** 140 * play 141 */ 142 play: function( delay, direction, wait ){ 143 this.stop(); 144 if(!wait){ 145 this[direction](false); 146 } 147 this.options.autoRun = this[direction].periodical(delay,this,false); 148 }, 149 /** 150 * stop. 151 */ 152 stop:function(){ 153 clearTimeout(this.options.autoRun); 154 }, 155 156 /** 157 * running 158 */ 159 running: function( item, manual, runningMode ){ 160 this.options.previousIndex = this.options.currentIndex + (this.options.currentIndex>0 ? -1 : this.options.items.length-1); 161 162 this.options.nextIndex = this.options.currentIndex + (this.options.currentIndex < this.options.items.length-1 ? 1 : 1-this.options.items.length); 163 // 164 // if next item then hide previous element 165 // 166 // alert( this.fx2[this.options.currentIndex].offsetWidth ); 167
168 if( this.options.mode != 'opacity' ) { 169 var size1; 170 var size2; 171 172 if( this.options.mode == 'horizontal_right' || this.options.mode == 'verticald' ){ 173 size1 = -(this.options.size); 174 size2 = (this.options.size); 175 } else { 176 size1 = (this.options.size); 177 size2 = -(this.options.size); 178 } 179 180 181 182 if( runningMode == 'next' ) { 183 this.fx2[this.options.previousIndex].start('opacity', 1,0); 184 this.fx[this.options.previousIndex].start( this.options.modes[this.options.mode][0], 0, size1 ); 185 this.fx2[this.options.currentIndex].start('opacity', 0,1); 186 187 this.fx[this.options.currentIndex].start( this.options.modes[this.options.mode][0], +size2, 0 ); 188 189 190 191 } else if( runningMode == 'previous') { 192 193 this.fx2[this.options.nextIndex].start('opacity', 1,0); 194 this.fx[this.options.nextIndex].start(this.options.modes[this.options.mode][0], 0, -(this.options.size) ); 195 this.fx2[this.options.currentIndex].start('opacity', 0,1); 196 this.fx[this.options.currentIndex].start(this.options.modes[this.options.mode][0], +(this.options.size), 0 ); 197 198 } 199 } else { 200 if( runningMode == 'next' ) { 201 this.fx2[this.options.previousIndex].start('opacity', 1,0); 202 this.fx2[this.options.currentIndex].start('opacity', 0,1); 203 this.options.items[this.options.previousIndex].setStyle('zIndex', 1); 204 this.options.items[this.options.currentIndex].setStyle('zIndex', this.options.items.length + 10); 205 } else { 206 this.fx2[this.options.nextIndex].start('opacity', 1,0); 207 this.fx2[this.options.currentIndex].start('opacity', 0,1); 208 this.options.items[this.options.nextIndex].setStyle('zIndex', 1); 209 this.options.items[this.options.currentIndex].setStyle('zIndex', this.options.items.length + 10); 210 } 211 } 212 213 if( manual ){ this.stop(); } 214 // if using callback method. 215 if(this.onRunning){ 216 this.onRunning( this.options.items[this.options.currentIndex],(this.buttons ? this.buttons[this.options.currentIndex]:null) ); 217 } 218 219 if( manual && this.options.autoRun ){ 220 this.play( this.options.interval,'next', true ); 221 } 222 }, 223 224 bindingButtonsEvent:function( action, buttons ){ 225 for(var i=0; i<buttons.length; i++){ 226 switch(action){ 227 case 'previous': 228 buttons[i].addEvent(this.options.buttonEvent,this.previous.bind(this,true)); 229 break; 230 case 'next': 231 buttons[i].addEvent(this.options.buttonEvent,this.next.bind(this,true)); 232 break; 233 case 'play': 234 buttons[i].addEvent(this.options.buttonEvent, this.play.bind( this,[this.options.interval,'next',false]) ); 235 break; 236 case 'playback': 237 buttons[i].addEvent( this.options.buttonEvent, 238 this.play.bind(this,[this.options.interval,'previous',false])); 239 break; 240 case 'stop': 241 buttons[i].addEvent(this.options.buttonEvent, this.stop.bind(this) ); break; 242 } 243 this.buttons[action].push(buttons[i]); 244 } 245 246 } 247 248} ); 249 250 251 252}
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.