User Tools

Site Tools


script_fading_page_bookmark

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
script_fading_page_bookmark [2014/07/13 15:33]
lm13 created
script_fading_page_bookmark [2016/06/28 12:20] (current)
f43nd1r
Line 1: Line 1:
 ====== About the script ====== ====== About the script ======
-  * Purpose : This script will allow you to set up page bookmarks, which won't scroll but instead fade +  * Purpose : This script will allow you to set up page bookmarks, which won't scroll but instead fade 
-  * Author : [[https://​plus.google.com/​+LukasMorawietz|LM13]] +  * Author : F43nd1r 
-  * Current Version ​1.0 +  * Current Version : 1.1 
-  * Link +  * Link : https://​plus.google.com/​110839325256080910341/​posts/​6ap4YGPEJy3 
 +  * Video https://​plus.google.com/​115366157037831519359/​posts/​QjcaoeFJeU3
  
 ====== Changelog ====== ​ ====== Changelog ====== ​
   * Version 1.0 (13/​7/​2014):​ initial release in wiki   * 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 ====== ====== How to use the script ======
Line 20: Line 22:
  
 ====== Script code ====== ====== Script code ======
-<code>//​config+<sxh javascript;>//​config
 var speed=50;//​lower is faster, 1 for instant, 255 for slowest var speed=50;//​lower is faster, 1 for instant, 255 for slowest
 //endconfig //endconfig
Line 34: Line 36:
 i.setTag(JSON.stringify([Math.round(c.getPositionX()/​c.getWidth())*c.getWidth(),​Math.round(c.getPositionY()/​c.getHeight())*c.getHeight()]));​ 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();​ Android.makeNewToast("​Page saved.",​false).show();​
 +LL.setScriptTag(null);​
 } }
 else Android.makeNewToast("​Error:​ No shortcut selected.\nTap on the shortcut first.",​false).show();​ else Android.makeNewToast("​Error:​ No shortcut selected.\nTap on the shortcut first.",​false).show();​
Line 48: Line 51:
 var start=[Math.round(c.getPositionX()/​c.getWidth())*c.getWidth(),​Math.round(c.getPositionY()/​c.getHeight())*c.getHeight()];​ var start=[Math.round(c.getPositionX()/​c.getWidth())*c.getWidth(),​Math.round(c.getPositionY()/​c.getHeight())*c.getHeight()];​
 c.setPosition(start[0],​start[1]);​ c.setPosition(start[0],​start[1]);​
-if(goTo==start)return;​+if(goTo[0]==start[0]&&​goTo[1]==start[1])return;
 var dwidth=c.getWidth();​ var dwidth=c.getWidth();​
 var dheight=c.getHeight();​ var dheight=c.getHeight();​
Line 59: Line 62:
 { {
 var item=items.getAt(a);​ var item=items.getAt(a);​
-if(item.getProperties().getString("​i.pinMode"​)=="​NONE"​)+var pin=item.getProperties() .getString("​i.pinMode"​)
 +if(pin=="​NONE"​||(goTo[0]!=start[0]&&​pin=="​Y"​)||(goTo[1]!=start[1]&&​pin=="​X"​))
 { {
 var x=item.getPositionX();​ var x=item.getPositionX();​
Line 137: Line 141:
 } }
 } }
-</code>+ 
 +</sxh>
script_fading_page_bookmark.1405265629.txt.gz · Last modified: 2014/07/13 15:33 by lm13