1/* 2// "Simple Picture Slideshow" Plugin for Joomla 2.5 - Version 1.5.7 3// License: GNU General Public License version 2 or later; see LICENSE.txt 4// Author: Andreas Berger - [email protected] 5// Copyright (C) 2012 Andreas Berger - http://www.bretteleben.de. All rights reserved. 6// Project page and Demo at http://www.bretteleben.de 7// ***Last update: 2012-04-19*** 8*/ 9 10function besps_slideshow(besps_slideid,besps_ftim,besps_stim,besps_steps,besps_startwhen,besps_emax,besps_caps,besps_preload){ 11 12//declarations 13 var self = this; 14 var slideid=besps_slideid; 15 var ftim=besps_ftim; 16 var stim=besps_stim; 17 var steps=besps_steps; 18 var startwhen=besps_startwhen; 19 var emax=besps_emax; 20 var preload=besps_preload; 21 var stopit=1; 22 var startim=1; 23 var u=0; 24 var parr = new Array(); 25 var ptofade,pnext,factor,mytimeout; 26 var caps=besps_caps; 27 28//daisychain onload-events 29this.be_daisychain=function(sl){ 30 if(window.addEventListener){ 31 window.addEventListener('load',sl,false); 32 } 33 else if(window.attachEvent){ 34 window.attachEvent('onload',sl); 35 } 36 else{ 37 if(window.onload){ 38 var ld=window.onload; 39 window.onload=function(){ld();sl();}; 40 } 41 else{ 42 window.onload=sl; 43 } 44 } 45 }; 46 47//push images into array and get things going 48 this.b_myfade = function(){ 49 var a,idakt,paktidakt,ie5exep; 50 for(a=1;a<=emax;a++){ 51 idakt="img_"+slideid+"_"+a;paktidakt=document.getElementById(idakt); 52 ie5exep=new Array(paktidakt);parr=parr.concat(ie5exep); 53 if(preload&&a==emax){ 54 setTimeout(function(){self.b_preload();},10); 55 } 56 } 57 if(startwhen){ 58 stopit=0; 59 mytimeout=setTimeout(function(){self.b_slide();},stim); 60 } 61 } 62 63//prepare current and next and trigger slide 64 this.b_slide = function(){ 65 clearTimeout(mytimeout); 66 u=0; 67 ptofade=parr[startim-1]; 68 if(startim<emax){pnext=parr[startim];} 69 else{pnext=parr[0];} 70 pnext.style.zIndex=1; 71 pnext.style.visibility="visible"; 72 pnext.style.filter="Alpha(Opacity=100)"; 73 try{pnext.style.removeAttribute("filter");} catch(err){} 74 pnext.style.MozOpacity=1; 75 pnext.style.opacity=1; 76 ptofade.style.zIndex=2; 77 ptofade.style.visibility="visible"; 78 ptofade.style.filter="Alpha(Opacity=100)"; 79 ptofade.style.MozOpacity=1; 80 ptofade.style.opacity=1; 81 factor=100/steps; 82 if(stopit=="0"){ 83 this.b_slidenow(); 84 } 85 } 86 87//one step forward 88 this.b_forw = function(){ 89 stopit=1; 90 clearTimeout(mytimeout); 91 ptofade=parr[startim-1]; 92 if(startim<emax){pnext=parr[startim];startim=startim+1;} 93 else{pnext=parr[0];startim=1;} 94 ptofade.style.visibility="hidden"; 95 ptofade.style.zIndex=1; 96 pnext.style.visibility="visible"; 97 pnext.style.zIndex=2; 98 this.b_switchcap(); 99 self.b_slide(); 100 //counter 101 self.setCurrentNumber(); 102 } 103 104//one step back 105 this.b_back = function(){ 106 stopit=1; 107 clearTimeout(mytimeout); 108 if(u==0){ //between two slides 109 ptofade=parr[startim-1]; 110 if(startim<emax){pnext=parr[startim];} 111 else{pnext=parr[0];} 112 pnext.style.visibility="hidden"; 113 ptofade.style.zIndex=1; 114 ptofade.style.visibility="visible"; 115 if(startim>=2){startim=startim-1;} 116 else{startim=emax;} 117 this.b_switchcap(); 118 self.b_slide(); 119 } 120 else{ //whilst sliding 121 this.b_switchcap(); 122 self.b_slide(); 123 } 124 //counter 125 self.setCurrentNumber(); 126 } 127 128//slide as said, then give back 129 this.b_slidenow = function(){ 130 var check1,maxalpha,curralpha; 131 check1=ptofade.style.MozOpacity; 132 maxalpha=(100-factor*u)/100*105; 133 if(check1<=maxalpha/100){u=u+1;} 134 curralpha=100-factor*u; 135 ptofade.style.filter="Alpha(Opacity="+curralpha+")"; 136 ptofade.style.MozOpacity=curralpha/100; 137 ptofade.style.opacity=curralpha/100; 138 if(u<steps){ //slide not finished 139 if(stopit=="0"){mytimeout=setTimeout(function(){self.b_slidenow();},ftim);} 140 else {this.b_slide();} 141 } 142 else{ //slide finished 143 if(startim<emax){ 144 ptofade.style.visibility="hidden"; 145 ptofade.style.zIndex=1; 146 pnext.style.zIndex=2; 147 startim=startim+1;u=0; 148 this.b_switchcap(); 149 mytimeout=setTimeout(function(){self.b_slide();},stim); 150 } 151 else{ 152 ptofade.style.visibility="hidden"; 153 ptofade.style.zIndex=1; 154 pnext.style.zIndex=2; 155 startim=1;u=0; 156 this.b_switchcap(); 157 mytimeout=setTimeout(function(){self.b_slide();},stim); 158 } 159 } 160 //counter 161 self.setCurrentNumber(); 162 } 163 164//manual start 165 this.b_start= function(){ 166 if(stopit==1){ 167 stopit=0; 168 this.b_switchcap(); 169 mytimeout=setTimeout(function(){self.b_slide();},stim); 170 } 171 } 172 173//manual stop 174 this.b_stop= function(){ 175 clearTimeout(mytimeout); 176 stopit=1; 177 this.b_switchcap(); 178 this.b_slide(); 179 } 180 181//preload 182 this.b_preload= function(){ 183 var arrdelta,tempsrc,j; 184 if(preload&&preload.length>=1){ 185 for (j=0;j<preload.length;j++){ 186 arrdelta=(emax-preload.length+j)*1; 187 tempsrc=parr[arrdelta].getElementsByTagName("img")[0].src.toString(); 188 parr[arrdelta].getElementsByTagName("img")[0].src=tempsrc.replace(/\/plugins\/content\/simplepictureslideshow\/files\/besps.png$/g, preload[j]); 189 } 190 } 191 } 192 193//switch captions 194 this.b_switchcap = function(){ 195 if(caps!="NOCAPS"&&caps.length>=1){ 196 document.getElementById("bs_caps_"+besps_slideid).getElementsByTagName("div")[0].innerHTML=(caps[startim-1][0]!=""||caps[startim-1][1]!="")?"<span>"+caps[startim-1][0]+"</span><span>"+caps[startim-1][1]+"</span>":" "; 197 } 198} 199 200//counter 201 this.setCurrentNumber= function(){ 202 if(document.getElementById("besps_counter_"+besps_slideid)){ 203 var actim=startim; 204 var lastim=emax; 205 //capture doubled arrays 206 if(parr.length==4&&parr[1].getElementsByTagName("img")[0].src==parr[3].getElementsByTagName("img")[0].src){ 207 lastim=2; 208 actim-=(actim>=3)?2:0; 209 } 210 if(emax>=10){actim=(actim<=9)?('0'+actim):(actim);} 211 if(emax>=100){actim=(actim<=99)?('0'+actim):(actim);} 212 document.getElementById("besps_counter_"+besps_slideid).innerHTML=actim+"/"+lastim; 213 } 214} 215 216//call autostart-function 217 this.be_daisychain(this.b_myfade); 218 219}
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.