Page 64 of 68 FirstFirst ... 14546263646566 ... LastLast
Results 1,261 to 1,280 of 1343

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: GroovyLock (HTML LockScreen Platform)

  1. #1261
    Process of elimination. Where does it stop. Javascript runs top to bottom so you can test it top to bottom to see where it stops. When javascript encounters an error it will stop immediately. If someone says a script doesn't work that doesn't mean that the entire script is broke, it means that a line in the script is.

    To humor you.

    Code:
    var level = Math.round(groovyAPI.getBatteryLevel()*100);
    break down.

    Code:
    var level = groovyAPI.getBatteryLevel();
    console.log(level);
    If it logs level you know groovy api is giving you battery. Next check multiplication.

    Code:
    var level = groovyAPI.getBatteryLevel()*100;
    console.log(level);
    If it logs level you know groovy api is giving you battery and you can multiply it (meaning it is a number and not a string). Next check if Math.round is rounding the number.

    Code:
    var level = Math.round(groovyAPI.getBatteryLevel()*100);
    console.log(level);
    If it logs level you know groovy api is giving you battery and you can multiply it (meaning it is a number and not a string). Also you can round the number. The next part is where you add the variable to an element.

    Code:
    document.getElementById("battery").innerHTML = level + "%";
    Since you already know that level returns a number with no problem, if this fails then you didn't make a div with the id of battery or you misspelled something in this line.

    What this really breaks down to.

    Code:
    var level = groovyAPI.getBatteryLevel();
    console.log("Didn't stop here");
    level = level * 100;
    console.log("Didn't stop here either");
    level = Math.round(level);
    console.log("Almost there");
    document.getElementById("battery").innerHTML = level + "%";
    console.log("Well look there, your script works!!!");
    I don't know how much easier it could be tbh. If you don't know how to diagnose issues with Javascript, I would stop trying to write Javascript. You will encounter many issues, you need to learn how to isolate your issues.

    Only thing that may throw you off "but not really in this case" is when you are adding operators, you have operator precedence with things inside the parens so they get executed first. Example

    Code:
    var number = 5 + (5 * 2) / (3 + 2);
    
    No the answer isnt 10.33
    No the answer isn't 3 either.
    
    Then answer is 7.
    
    () are done first, then multiplication and division, then addition and subtraction
    
    5 * 2 gets multiplied first, then 3 + 2 then 10 / 5 then 5 + 2.
    That's sums up Todays installment of Basic Javascript 101 with June. Now what I really came here for is to share this.

    http://junesiphone.com/actions/ or Activator Listeners

    Yes, a link to my website:P Seriously though it's activators new listeners. I bring it here because you can use them in your GroovyLocks or iWidgets to give it more functionality. Example CC toggles. If a user has this Activator (beta) installed then they can tap an icon in groovylock and turn on/off a cc toggle (Example: Flashlight). As well as open apps, respring device, lock device, power down, play ipod, open settings, etc etc. You can get the whole list from terminal by typing activator listeners, but everyone is afraid of it so I decided to put them in html format, even added the full link you can use and examples. Enjoy.
    Last edited by June'sIphone; 2015-03-17 at 03:45 AM.

  2. The Following 11 Users Say Thank You to June'sIphone For This Useful Post:

    Boots (2015-03-17), burrzoo (2015-10-06), catalyst7 (2015-03-17), Krima (2015-03-17), lostinthemes (2015-03-17), Marty McFly (2015-03-17), NewD (2015-03-17), oldskoolsk8r (2015-03-17), RKO1195 (2015-03-17), Simon (2015-03-17), undersea (2015-03-17)

  3. #1262
    Livin' the Dream Krima's Avatar
    Join Date
    Jul 2011
    Location
    Nashville, Tn
    Posts
    3,825
    Thanks
    4,960
    Thanked 9,817 Times in 2,987 Posts

    Who called it?

  4. The Following 2 Users Say Thank You to Krima For This Useful Post:

    King_O_Hill (2015-03-17), RKO1195 (2015-03-17)

  5. #1263
    Quote Originally Posted by June'sIphone View Post
    Where does it stop?
    Edit fiddle - JSFiddle
    When I try using your code, or even Math.floor
    I don't know if something is wrong with the API or if it is device-sided,
    but the area on screen where battery % should appear gets empty

    If someone wants to test, it's one of the themes on the first page of this thread that I modified
    working: https://www.dropbox.com/s/ol62hqdt53...20Old.rar?dl=0
    not working: https://www.dropbox.com/s/3ck6nfk055...20New.rar?dl=0

    scan:
    https://www.virustotal.com/en/file/b...is/1426568152/
    https://www.virustotal.com/en/file/7...is/1426568208/
    Is there a GLock theme posted here that displays the battery % like I propose?
    Last edited by cbrm; 2015-03-17 at 06:58 AM.

  6. #1264
    Superbad Modder-ator Simon's Avatar
    Join Date
    Nov 2007
    Location
    Bermuda
    Posts
    48,875
    Thanks
    8,108
    Thanked 17,645 Times in 8,025 Posts

    Quote Originally Posted by cbrm View Post
    When I try using your code, or even Math.floor
    I don't know if something is wrong with the API or if it is device-sided,
    but the area on screen where battery % should appear gets empty

    If someone wants to test, it's one of the themes on the first page of this thread that I modified
    working: https://www.dropbox.com/s/ol62hqdt53...20Old.rar?dl=0
    not working: https://www.dropbox.com/s/3ck6nfk055...20New.rar?dl=0

    scan:
    https://www.virustotal.com/en/file/b...is/1426568152/
    https://www.virustotal.com/en/file/7...is/1426568208/
    Is there a GLock theme posted here that displays the battery % like I propose?
    What firmware are you on? iOS 7 or 8?

  7. #1265
    Quote Originally Posted by cbrm View Post
    When I try using your code, or even Math.floor
    I don't know if something is wrong with the API or if it is device-sided,
    but the area on screen where battery % should appear gets empty

    If someone wants to test, it's one of the themes on the first page of this thread that I modified
    working: https://www.dropbox.com/s/ol62hqdt53...20Old.rar?dl=0
    not working: https://www.dropbox.com/s/3ck6nfk055...20New.rar?dl=0

    scan:
    https://www.virustotal.com/en/file/b...is/1426568152/
    https://www.virustotal.com/en/file/7...is/1426568208/
    Is there a GLock theme posted here that displays the battery % like I propose?
    I downloaded GroovyLock, applied them and neither showed the battery on a iPhone 6. Went into the css and adjusted

    Code:
    #battery{
           position:absolute; top:35px; left:300px; width:320px; height:50px; text-align:right; z-index:50;
           font-size:40px;
           font-family: bold;
    }
    
    to
    
    #battery{
           position:absolute; top:35px; left:0px; width:320px; height:50px; text-align:right; z-index:50;
           font-size:40px;
           font-family: bold;
    }
    If you would of looked at the update battery function and added a simple alert "alert(level); you would have noticed that the script worked. This would have told you to look at the div or the css. In this case the css. It is set to width of 320px and then text-align:right. This means that the battery percent will be on the far right when on a 320px width device. Since it had left:300px then it moved it right another another 300 pixels. That means that the battery was text-align right at 620 pixels. Meaning in most cases off the screen.

    Here is a post where I attempted to help someone figure out the battery instead of using objects. There is code inside for groovylock.

    http://modmyi.com/forums/iphone-5-ne...ml#post7217478

    Code:
    if(window.groovyAPI) {
      var glbatt = Math.round(groovyAPI.getBatteryLevel()*100);
      setBattery(glbatt,1,3,'inside',320);
    }
    It also pulls this away from the mess that is a weather widget, so if you really are interested in modding then It will show you an example without it being a full blown lockscreen. This is why it is best "when learning" to start from scratch. At least once, then when you know how everything works start modding. You will then get a better grasp at everything needed. In this case you should know the div is the element, css is where you style the element, and javascript is where you can alter the element.

    Quote Originally Posted by cbrm View Post
    Is there a GLock theme posted here that displays the battery % like I propose?
    Code:
    <html>
    <head>
    	<title></title>
    </head>
    <body>
    <div id="battery"></div>
    <script>
    if(window.groovyAPI) {
      var glbatt = Math.round(groovyAPI.getBatteryLevel()*100);
      document.getElementById('battery').innerHTML = glbatt + "%";
    }
    </script>
    </body>
    </html>
    Last edited by June'sIphone; 2015-03-17 at 02:14 PM.

  8. The Following 2 Users Say Thank You to June'sIphone For This Useful Post:

    cbrm (2015-03-17), kristatos (2015-03-17)

  9. #1266
    Code Dependent NewD's Avatar
    Join Date
    Jan 2012
    Location
    Northeast US
    Posts
    5,710
    Thanks
    8,337
    Thanked 16,465 Times in 7,696 Posts

    Thanks for the excellent explanation to your original post, June! It was by no means 'obvious' what you meant by "where does it stop" as my esteemed colleague, KOH implied.. And now were all more educated on console log - and that's good!

  10. #1267
    It made sense to me.

    Check out WW3 for iOS 9/10 - Widget-Weather 3.0

  11. The Following User Says Thank You to King_O_Hill For This Useful Post:

    NewD (2015-03-17)

  12. #1268
    Quote Originally Posted by Krima View Post
    Who called it?
    I think I did!

    Check out WW3 for iOS 9/10 - Widget-Weather 3.0

  13. #1269
    Quote Originally Posted by King_O_Hill View Post
    Well, we can't help you without seeing the code.
    https://www.dropbox.com/s/8bs5g342jo...84s%29.7z?dl=0

    Here's my package check and tell

  14. #1270
    Quote Originally Posted by June'sIphone View Post
    I downloaded GroovyLock, applied them and neither showed the battery on a iPhone 6. Went into the css and adjusted
    Thank you I had a suspect it was offscreen but didn't mind it
    I'll consider your tips, once I get time to polish my web-dev skills

    My LS Ultron
    Last edited by cbrm; 2015-03-17 at 04:56 PM.

  15. The Following 2 Users Say Thank You to cbrm For This Useful Post:

    kristatos (2015-03-17), Marty McFly (2015-03-29)

  16. #1271
    Livin' the Dream Krima's Avatar
    Join Date
    Jul 2011
    Location
    Nashville, Tn
    Posts
    3,825
    Thanks
    4,960
    Thanked 9,817 Times in 2,987 Posts

    Quote Originally Posted by King_O_Hill View Post
    I think I did!
    Get off this thread King. This place is only for those of us who currently have their Iphone jail broken.

  17. The Following 4 Users Say Thank You to Krima For This Useful Post:

    Boots (2015-03-18), chevymusclecar (2015-03-18), kristatos (2015-03-17), Simon (2015-03-17)

  18. #1272
    Quote Originally Posted by cbrm View Post
    Thank you I had a suspect it was offscreen but didn't mind it
    I'll consider your tips, once I get time to polish my web-dev skills

    My LS Ultron
    Sometimes it's the simplest things that are the hardest to find. If you want to polish those skills check out the 3 videos on this thread. HTML, CSS, and JS. They are very short and probably will help tremendously. http://modmyi.com/forums/iphone-5-ne...e-cydgets.html

  19. The Following 6 Users Say Thank You to June'sIphone For This Useful Post:

    cbrm (2015-03-17), chevymusclecar (2015-03-18), jawonder (2015-03-18), kristatos (2015-03-17), NewD (2015-03-17), Simon (2015-03-17)

  20. #1273
    How to completely remove Groovylock including cache folder or saved items because my time in lockscreen is showing wrong.

  21. #1274
    Quote Originally Posted by bansi View Post
    How to completely remove Groovylock including cache folder or saved items because my time in lockscreen is showing wrong.
    Did you configure it well?

  22. #1275
    Awesome jelly lock. Mind sharing please?


    Sent from my iPhone using Tapatalk

  23. #1276
    Quote Originally Posted by Ossie View Post
    Awesome jelly lock. Mind sharing please?
    Thanks, here: https://www.dropbox.com/s/9o2ttmpggp...ltron.rar?dl=0

    The steam effect is the overlay Smoke from Cydia tweak WeatherBoard (iOS 8 & 7).

    Wallpaper is from Avengers website:
    Attached Thumbnails Attached Thumbnails -ageofultron_logo_mobile.jpg  

  24. The Following 3 Users Say Thank You to cbrm For This Useful Post:

    kristatos (2015-03-30), Marty McFly (2015-03-30), menard_00 (2015-04-02)

  25. #1277
    sorry if this is posted but i can't seem to get my weather to show. I'm using gl+ & gb+. any help or direction to help would be appreciated. tia!

  26. #1278
    Superbad Modder-ator Simon's Avatar
    Join Date
    Nov 2007
    Location
    Bermuda
    Posts
    48,875
    Thanks
    8,108
    Thanked 17,645 Times in 8,025 Posts

    Quote Originally Posted by DaddyMatty View Post
    sorry if this is posted but i can't seem to get my weather to show. I'm using gl+ & gb+. any help or direction to help would be appreciated. tia!
    Probably have more luck finding your answer to that here: http://modmyi.com/forums/file-mods/8...groovyapi.html

    Gonna have to be more specific with your issue though, like what widget you are trying to use.

  27. The Following 4 Users Say Thank You to Simon For This Useful Post:

    Boots (2015-03-30), DaddyMatty (2015-03-31), kristatos (2015-03-30), NewD (2015-03-30)

  28. #1279
    Quote Originally Posted by Simon View Post
    Probably have more luck finding your answer to that here: http://modmyi.com/forums/file-mods/8...groovyapi.html

    Gonna have to be more specific with your issue though, like what widget you are trying to use.
    i'm using lockscreens and sbhtmls from the old and new zoobhoy themes. i'm gonna try and post some shots in a few so you can see what i mean. thanks for the direction and help bro.

  29. #1280
    Here's those shots...




    Not concerned with the placement I know how to mess with those parts of the code. My problem is the weather and apparently battery.

Page 64 of 68 FirstFirst ... 14546263646566 ... LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •