User Tools

Site Tools


script_template

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
script_template [2015/01/21 08:40]
ajasei [How to use the script]
script_template [2015/05/05 20:27] (current)
trianguloy
Line 1: Line 1:
 ====== About the script ====== ====== About the script ======
-  * Purpose : show battery "​charging"​ or "​discharging"​ state +  * Purpose : explain what the script does 
-  * Author : Abednego JS ( https://​plus.google.com/​u/​0/​118095355037125433304 ) +  * Author : who wrote this script 
-  * Link: https://​plus.google.com/​u/​0/​118095355037125433304/​posts/​UXfaG9YQyqX+  * Link: if needed, you may add a link here
  
 ====== How to use the script ====== ====== How to use the script ======
  
-Create shortcut ​to run this script, ​it'​ll ​be dynamic label where the script ​show battery state. Give it name "​batv"​.+Explain everything needed ​to use the script, ​whether some item configuration need to be done before, on which event to trigger ​the script, and so on
  
-Also assign script to running when displaying the page where "​batv"​ placed (follow this step if user want to see battery state updated/​checked when access spesific page instad of checking the state everytime). +====== Script code ====== 
-How to assign: Lightning Setting ​>> Current desktop >> Event & Actions >> Resumed >> Run a script [choose this script].+<sxh javascript>
  
-Dictionary:+//New tag, line completion and colors.  
 +//The previous one was <​code>​ script(); </​code>​ 
 +//remove those lines and write here your script 
 +yourJavaScriptCodeHere();​
  
-var: +</sxh>
- +
-item (get LLX item), batcon (get LLX context), batstat ( String value to edit the "​batv"​ label), curd (get current page), curi (get "​batv"​),​ +
-ifilter (filtering android intent), batterystatus (intent where activity to change batstat'​s value executed), text (temporary place used as bridge between batstat value to "​batv"​ label), +
-etc (status, isCharging, chargePlug, usbCharge, acCharge they'​re variable used to change batstat'​s value) +
- +
-function: +
- +
-onReceive(context,​ intent) = function to change batstat'​s value; +
-manref () = function to manual update "​batv"​ label; +
- +
-====== Script code ====== +
-<​code>​ +
-yourJavaScriptCodeHere();​ +
-</code>+
script_template.1421829618.txt.gz · Last modified: 2015/01/21 08:40 by ajasei