1. June'sIphone's Avatar
    Of course it didn't. And won't. Uses other Cydia apps.

    Just by looking over that code. I bet it won't work. Option values don't even work on the lock screen. I will attempt and probably waste more time.

    And I'm not saying your code doesn't work. I just know it doesn't work on the lock screen.
    2013-02-08 10:53 PM
  2. rasputin007's Avatar
    You don't need the Option values part at all, I only need it for the graphical setup.
    All you need are the database function.
    2013-02-08 10:59 PM
  3. June'sIphone's Avatar
    I'll give it a shot
    2013-02-08 11:00 PM
  4. vikemosabe's Avatar
    I would wager that it won't persist through respring, just like HTML5 localstorage and cookies don't.
    But may be worth a shot.
    Rasputin: have you had this work on a lockscreen theme?
    If so, then I reckon maybe it will work
    2013-02-08 11:04 PM
  5. rasputin007's Avatar
    I don't know exactly what data you want to save, but from that example you will get an idea how to use javascript to create a database, enter values into it, save it and change the values.
    All done from within LockBackground.html, the user will not see anything of this and there is no need to have any additional icon or something like this.
    2013-02-08 11:10 PM
  6. June'sIphone's Avatar
    If the values change in the .txt then it will work. If it handles these in the HTML then no it will not. I have yet to see just an HTML write to file. So I'm am very interested.

    Oh bro. Watch my video or give me your Cydia #. All these items I've done are saved. Even after lock/unlock. But not after a respring.

    I am fighting the respring issue only. Just because I cannot make HTML and JavaScript write to a file locally. (Without a server)
    Last edited by June'sIphone; 2013-02-08 at 11:16 PM.
    2013-02-08 11:10 PM
  7. rasputin007's Avatar
    I used this in the same way Buuf Theme did. Simple 3 step process. Springboard icon opens html page where you set whatever, that gets saved into database, then LockBackground.html or Wallpaper.html reads that database and uses those values. Same principle as a config.js file, only without code editing for the end user.
    Anyway June does not need the graphical setup for the user input, he gets all the data already, including ZIP code and/or WOEID, only he can use a database to store these. Database will be still there after respring or reboot, cookies won't.
    2013-02-08 11:16 PM
  8. June'sIphone's Avatar
    I used this in the same way Buuf Theme did. Simple 3 step process. Springboard icon opens html page where you set whatever, that gets saved into database, then LockBackground.html or Wallpaper.html reads that database and uses those values. Same principle as a config.js file, only without code editing for the end user.
    Anyway June does not need the graphical setup for the user input, he gets all the data already, including ZIP code and/or WOEID, only he can use a database to store these. Database will be still there after respring or reboot, cookies won't.
    Thank you

    This isn't possible then without a server.

    The springboard icon HTML is on a server yea?
    2013-02-08 11:17 PM
  9. rasputin007's Avatar
    Yes is a deliberate limitation that html/javascript can not write to file or create them, for security reason.
    But html/javascript can read and write to database.

    iOS has database capability already, otherwise I would not be able to do this.
    iOS is actually full of databases it created itself, your camera roll is saved in a database.
    You just use what is already there.
    When using database you do not need web server at all.
    Last edited by rasputin007; 2013-02-08 at 11:23 PM.
    2013-02-08 11:19 PM
  10. June'sIphone's Avatar
    So if .txt already exists, the html can write to .txt

    But it can not create a .txt?
    2013-02-08 11:22 PM
  11. rasputin007's Avatar
    No, not as far as I know. It can read txt files, but not change them.
    I can understand the reason why they limited this. Imagine html/javascript could create/write files, then every website you go to could put whatever on your computer.
    2013-02-08 11:26 PM
  12. June'sIphone's Avatar
    No, not as far as I know. It can read txt files, but not change them.
    I can understand the reason why they limited this. Imagine html/javascript could create/write files, then every website you go to could put whatever on your computer.
    Yes security reasons. This was patched a long time ago.

    There's still a work around. I know there is.

    Database does not seem to be the Solution. At least not in this problem.

    Or I'm just totally missing the idea.
    Last edited by June'sIphone; 2013-02-08 at 11:29 PM.
    2013-02-08 11:27 PM
  13. rasputin007's Avatar
    This is the way I would try.
    You have a certain set of data you want to save, like ZIP code/WOEID, weather data, fonts, font colors, positions whatever, right?
    Create a standard database with a set of default values for each item you want to save, put that database in /var/mobile/Library/WebKit/Databases/file_0/ and let LockBackground.html read the database and save changed values (other then default values).
    Should work.
    2013-02-08 11:35 PM
  14. June'sIphone's Avatar
    Ooooh!!!! I was missing the point all together. Genius. Using apples database, you said that. my apologies.

    Your own database, but there database directory
    2013-02-08 11:46 PM
  15. vikemosabe's Avatar
    So I just checked this out and the HTML5 localstorage I was messing with seems to actually save and create files in the db directory.
    However, the values were never pulled back in or read when revisiting the page.
    If I'm doing something wrong in reading and it's simple to fix then that method is uber simple and as easy as setting cookies.
    May be worth looking into more.
    2013-02-08 11:50 PM
  16. June'sIphone's Avatar
    I didn't know that existed. Should have thought about it. Thank you!

    So I just checked this out and the HTML5 localstorage I was messing with seems to actually save and create files in the db directory.
    However, the values were never pulled back in or read when revisiting the page.
    If I'm doing something wrong in reading and it's simple to fix then that method is uber simple and as easy as setting cookies.
    May be worth looking into more.
    Right but since your in db. The phone will probably save to that directory above. Big piece of the puzzle here. I need my Mac 😖
    Last edited by June'sIphone; 2013-02-08 at 11:54 PM.
    2013-02-08 11:51 PM
  17. vikemosabe's Avatar
    If the browser supports it, which mobile safari does, setting and reading values is supposed to be as simple as:
    localStorage["varName"] = "test";
    &
    alert(localStorage["varName"]);
    I'm gonna look and see if maybe it needs initialized before reading or if I'm doing something else simple wrong.
    2013-02-08 11:55 PM
  18. June'sIphone's Avatar
    You need getItem

    localStorage.setItem('test', '12');

    alert(localStorage.getItem('test'));
    Last edited by June'sIphone; 2013-02-09 at 12:08 AM.
    2013-02-09 12:04 AM
  19. King_O_Hill's Avatar
    Damn guys, I drove home and missed this whole conversation. Thanks for stopping by Ras, I figured if it could be done, you would have a direction!

    Check out WW3 for iOS 9/10 - Widget-Weather 3.0
    2013-02-09 12:18 AM
  20. vikemosabe's Avatar
    You need getItem

    localStorage.setItem('test', '12');

    alert(localStorage.getItem('test'));
    It's supposed to work either way.
    And it does save and read saved values.
    They just don't last through a respring.
    2013-02-09 12:20 AM
560 ... 2101112131422 ...
LINK TO POST COPIED TO CLIPBOARD