====== About the script ====== * Purpose : This script will allow you to set up page bookmarks, which won't scroll but instead fade * Author : F43nd1r * Current Version : 1.1 * Link : https://plus.google.com/110839325256080910341/posts/6ap4YGPEJy3 * Video : https://plus.google.com/115366157037831519359/posts/QjcaoeFJeU3 ====== Changelog ====== * Version 1.0 (13/7/2014): initial release in wiki * Version 1.1 (16/7/2014): fix for startpage is the same as destinationpage and fix for x or y pinned items ====== How to use the script ====== * create a shortcut to the script and tap it * Scroll to the page you want the shortcut to point at * Run the script from menu (you have to enable that in script editor) * Use your nice new fading bookmark by tapping the shortcut ====== Issues and hints ====== * you can reset a shortcut by deleting its tag //please report all bugs in the g+ community// ====== Script code ====== //config var speed=50;//lower is faster, 1 for instant, 255 for slowest //endconfig var e=LL.getEvent(); var c=e.getContainer(); var i=e.getItem()||c.getItemById(parseInt(LL.getScriptTag())); if(e.getSource()!="SHORTCUT") { if(i!=null) { i.setTag(JSON.stringify([Math.round(c.getPositionX()/c.getWidth())*c.getWidth(),Math.round(c.getPositionY()/c.getHeight())*c.getHeight()])); Android.makeNewToast("Page saved.",false).show(); LL.setScriptTag(null); } else Android.makeNewToast("Error: No shortcut selected.\nTap on the shortcut first.",false).show(); return; } if(i.getTag()==null) { LL.setScriptTag(i.getId()); Android.makeNewToast("Shortcut selected.\nNow launch the script from menu where you want the shortcut to point at",false).show(); return; } var goTo=JSON.parse(i.getTag()); var start=[Math.round(c.getPositionX()/c.getWidth())*c.getWidth(),Math.round(c.getPositionY()/c.getHeight())*c.getHeight()]; c.setPosition(start[0],start[1]); if(goTo[0]==start[0]&&goTo[1]==start[1])return; var dwidth=c.getWidth(); var dheight=c.getHeight(); var page0=[]; var page1=[]; var counter=[0,0]; var items=c.getItems(); var zorder=items.length; for(a=0;a=start[0]&&x=start[1]&&y=goTo[0]&&x=goTo[1]&&y=zorder)c.setItemZIndex(item,0); } var diff=0; LL.writeToLogFile(page0+"\n"+page1,false); step(); function step() { diff+=255/speed; if(diff<255) { for(a=0;a