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 container scroll automatically, like a slideshow * Author : Lukas Morawietz alias LM13 * Concept : Pierre Hébert * Current Version : 1.0 * Link : https://plus.google.com/115366157037831519359/posts/84DvszxGQXA ====== Changelog ====== * Version 1.0 (1/4/2014): initial release in wiki ====== How to use the script ====== * set up the configuration at the beginning of both scripts. * if you want the slideshow to start automatically, set the main script in the load event of the container * set the toggle script somewhere easy accessible, like swipe down on the container * every time you perform that action, the slideshow will be turned on/off * watch it sliding! ====== Issues and hints ====== * be aware, that only pages right from the start page will be reached! Pages on the other sides may break the script. //please report all bugs in the g+ community// ====== Main Script code ====== <code>//config var panel_label="Slideshow"; var this_scripts_name="AutoScroll"; //endconfig var d=LL.getHomeDesktop(); var p=d.getItemByLabel(panel_label); var c=p.getContainer(); var w=p.getWidth(); c.setTag(0); var b=c.getBoundingBox(); if(b.getRight()==0) { setTimeout(LL.runScript(this_scripts_name,null),100); return; } var num_pages=(b.getRight()-b.getLeft())/c.getWidth(); var rotate = function() { var i=parseInt(c.getTag()); if(i==-1)return; c.setPosition(i*w, 0); if(i==num_pages-1) i=0; else i=i+1; c.setTag(i); setTimeout(rotate, 5000); } rotate(); </code> ====== Toggle Script code ====== <code>//config var panel_label="Slideshow"; var main_scripts_name="AutoScroll"; //endconfig var c=LL.getHomeDesktop().getItemByLabel(panel_label).getContainer(); var i=parseInt(c.getTag()); if(i==-1){ Android.makeNewToast("Autoscroll enabled",true).show(); LL.runScript(main_scripts_name,null); } else { Android.makeNewToast("Autoscroll disabled",true).show(); c.setTag(-1); } </code>

script_slideshow.1396432096.txt.gz · Last modified: 2014/04/02 09:48 by lm13