User Tools

Site Tools


script_slideshow

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== About the script ====== * Purpose : This script will make your Panel scroll automatically, like a slideshow * Author : [[https://plus.google.com/+LukasMorawietz|LM13]] * Idea : Pierre Hébert * Current Version : 2.0 * Link : https://plus.google.com/115366157037831519359/posts/84DvszxGQXA * Video : https://plus.google.com/115366157037831519359/posts/9eUTw8cCCpi ====== Changelog ====== * Version 1.0 (1/4/2014): initial release in wiki * Version 2.0 (27/7/2014): complete new coded, only one Script ====== How to use the script ====== * set up the configuration at the beginning of the script. * if you want the slideshow to start automatically, set the script in the resumed and the paused event of the container * if you want to start and stop it manually create a shortcut to the spcript or set it to other events * every time you perform that action, the slideshow will be toggled * watch it sliding! ====== Issues and hints ====== * if something goes wrong, first to try is restart launcher //please report all bugs in the g+ community// ====== Script code ====== <sxh javascript;>//config var waitingTime=3000;//time between page switches, in ms, not exact var panelID=0x040001;//if you take the ID from hierachy, put a '0x' in front of it var notify=true;//mainly for debug, creates toasts with status //endconfig //start if((typeof running==='undefined'||!running)) { var c=LL.getItemById(panelID).getContainer(); if(c==null) { if(notify)Android.makeNewToast("Failed to load panel",true).show(); return; } running=true; start(); } //stop else { running=false; } function start() { w=c.getWidth(); if(w==0) { setTimeout(start,50); return; } b=c.getBoundingBox(); l=b.getLeft(); d=b.getRight()-l; y=c.getPositionY(); if(notify)Android.makeNewToast("Slideshow started",true).show(); step(); } function step() { if(!running) { if(notify)Android.makeNewToast("Slideshow stopped",true).show(); return; } if(typeof a==='undefined')a=0; a+=2; if(a>=waitingTime) { var goTo=(Math.floor(c.getPositionX()/w)*w-l+w)%d+l; c.setPosition(goTo,y); a=0; } setTimeout(step,1); } </sxh>

script_slideshow.1406457182.txt.gz · Last modified: 2014/07/27 10:33 by lm13