1. Doesel's Avatar
    Take a second to read my post above. You are coloring the whole body, which if you haven't defined a width then the body does not have a specific width. Best way is to create a div.
    Ah ok, sorry my bad. Now I understand the coloring. But why are there different widths, why did you make the viewport a little bit smaller? Is this the "working" area?

    You are still using firefox as well and developing for Safari. You will encounter problems by doing this.
    Why is this going to be a problem? I've only got a Windows PC and this is my first time really creating something for/on the iPhone.. sorry!
    2015-01-19 11:16 PM
  2. rasputin007's Avatar
    This is one of the main reasons I created these free Cydgets. To show that it really isn't that difficult, and provide some of the most used info in these examples.
    Knowing/guessing the coding knowledge of most of the themers here, this is an understatement. A lot of themers are struggling with javascript code. How the heck they will cope with cycript/Objective-C is like teaching a cow to play table tennis. LOL

    EDIT
    Yeah, I understand your point, especially looking at one certain post on page 3.
    Just wanted to rule out that the mistake is using wrong keys.

    EDIT II
    You giving me a working code would improve the speed of process, but not helping with understanding what went wrong where and why.
    On the other hand a working code would be good to see why your code works but mine not.
    Remember the code I send you by email, where I said it did not work, but you said it worked. Well, I ran this on the iPad, where it did not work - no GPS data display. But when I ran the same on the iPhone it worked.
    Maybe I should run this one on the iPhone as well instead of just the iPad.
    Last edited by rasputin007; 2015-01-19 at 11:30 PM.
    Nothing is impossible only miracles take a bit longer!
    2015-01-19 11:21 PM
  3. June'sIphone's Avatar
    Ah ok, sorry my bad. Now I understand the coloring. But why are there different widths, why did you make the viewport a little bit smaller? Is this the "working" area?


    Why is this going to be a problem? I've only got a Windows PC and this is my first time really creating something for/on the iPhone.. sorry!
    The smallest device is 320 x 583 which would be the iPhone 5 and 5s. Therefore I use this as my base as I can always scale the viewport. Luckily it's an even scale for the 6 and 6+ devices.

    You will run into issues as Safari syntax is different than Firefox. Meaning you will write some css and expect it to work and it will in Firefox, but when you put it on your device it will not. Each browser decides how it wants to implement specs, therefore giving each browser different syntax.

    Examples are always good.

    If you want to transition opacity
    Safari: -webkit-transition: opacity .3s;
    Firefox: -moz-transition: opacity .3s;

    Move an element on x axis
    Safari: -webkit-transform: translateX(300px);
    Firefox: -moz-transform: translateX(300px);

    Size element to fit box
    Safari: -webkit-box-sizing: border-box;
    Firefox: -moz-box-sizing: border-box;

    Blur an image
    Safari: -webkit-transform:blur(5px);
    Firefox: No clue. lol

    Not saying that Firefox is bad, I just recommend if you do mock something up and you want to see on you pc exactly what it will look like on your device. Safari is the way to go.
    Last edited by June'sIphone; 2015-01-19 at 11:33 PM.
    2015-01-19 11:24 PM
  4. June'sIphone's Avatar
    Knowing/guessing the coding knowledge of most of the themers here, this is an understatement. A lot of themers are struggling with javascript code. How the heck they will cope with cycript/Objective-C is like teaching a cow to play table tennis. LOL

    EDIT
    Yeah, I understand your point, especially looking at one certain post on page 3.
    Just wanted to rule out that the mistake is using wrong keys.
    Try this https://www.dropbox.com/s/u3rqa2axvx8rsjr/test.zip?dl=0 if you want. Sometimes I enjoy chasing bugs, unless they aren't fixed by the time i'm done coding:P

    Edit: Ignore the libraries folder.

    Edit2: No reason why this code shouldn't work on iPad. LB iPad uses the same thing to load themes. Interesting to find out why it isn't working though.
    Last edited by June'sIphone; 2015-01-19 at 11:48 PM.
    2015-01-19 11:27 PM
  5. rasputin007's Avatar
    This is my index.html
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, height= device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    
    <style>
    body {
            background-color: grey;
            margin: 0;
            padding: 0 0 0 0;
            height: 1136px;
            width: 640px;
    }
    
    #myText, #alerts, #astro, #condi, #fore, #foreten, #hour, #hourten, #lang, #wug, #api {
    	font-family: Helvetica, Arial, sans-serif;
    	font-size:20px;
    	font-weight: bold;
    	text-shadow: 0px 2px 1px rgba(0, 100,255, 1.0);
    	-webkit-text-fill-color: rgba(100, 200, 255, 1.0);
    	-webkit-text-stroke:2px rgba(10, 80, 140, 1.0);
    	
    	}
    
    </style>
    </head>
    <body>
    <script type="text/javascript">
    
    var api=getDict().api_key;
    document.getElementById("api").innerHTML=api;
    </script>
    
    <script type="text/cycript">
    getDict = function(){
        return [NSDictionary dictionaryWithContentsOfFile: @"/var/mobile/Library/Preferences/com.myo.wug.plist"];
    };
    </script>
    
    <div id="api" style="position:absolute;top:200px;left:50px"></div>
    
    
    </body>
    </html>
    I have about a 12 or so versions of this.
    Also does not work on iPhone.
    Try your now.
    Nothing is impossible only miracles take a bit longer!
    2015-01-19 11:46 PM
  6. June'sIphone's Avatar
    This is my index.html
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, height= device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    
    <style>
    body {
            background-color: grey;
            margin: 0;
            padding: 0 0 0 0;
            height: 1136px;
            width: 640px;
    }
    
    #myText, #alerts, #astro, #condi, #fore, #foreten, #hour, #hourten, #lang, #wug, #api {
    	font-family: Helvetica, Arial, sans-serif;
    	font-size:20px;
    	font-weight: bold;
    	text-shadow: 0px 2px 1px rgba(0, 100,255, 1.0);
    	-webkit-text-fill-color: rgba(100, 200, 255, 1.0);
    	-webkit-text-stroke:2px rgba(10, 80, 140, 1.0);
    	
    	}
    
    </style>
    </head>
    <body>
    <script type="text/javascript">
    
    var api=getDict().api_key;
    document.getElementById("api").innerHTML=api;
    </script>
    
    <script type="text/cycript">
    getDict = function(){
        return [NSDictionary dictionaryWithContentsOfFile: @"/var/mobile/Library/Preferences/com.myo.wug.plist"];
    };
    </script>
    
    <div id="api" style="position:absolute;top:200px;left:50px"></div>
    
    
    </body>
    </html>
    I have about a 12 or so versions of this.
    Also does not work on iPhone.
    Try your now.
    ahhh simple mistake. The div is called before its created. Move the scripts to the bottom of the page and the div above the scripts. Right now the page is loading, loads the script, but when it gets to the script it cannot find the div "api". This is why document.getElement returns an error.
    Last edited by June'sIphone; 2015-01-19 at 11:55 PM.
    2015-01-19 11:53 PM
  7. rasputin007's Avatar
    Yes, I noticed that this is the difference between yours and mine.
    This is the screenshot with test.cydget on my iPhone.


    Nothing is impossible only miracles take a bit longer!
    2015-01-20 12:02 AM
  8. June'sIphone's Avatar
    Yes, I noticed that this is the difference between yours and mine.
    This is the screenshot with test.cydget on my iPhone.


    oh yea, change your background as I didn't style the text (still default black)
    Last edited by June'sIphone; 2015-01-20 at 12:13 AM.
    2015-01-20 12:04 AM
  9. June'sIphone's Avatar
    2015-01-20 12:05 AM
  10. rasputin007's Avatar
    oh yea, change your background as I didn't style the text (still default black)
    That would have been funny!
    Now with grey background
    Nothing is impossible only miracles take a bit longer!
    2015-01-20 12:19 AM
  11. June'sIphone's Avatar
    That would have been funny!
    Now with grey background
    No clue, both now work fine on my device.
    2015-01-20 12:39 AM
  12. June'sIphone's Avatar
    Yours after fixing the mistake of the div. Free Cydgets-imageuploadedbymodmyi1421710813.514876.jpg
    2015-01-20 12:40 AM
  13. Doesel's Avatar
    The smallest device is 320 x 583 which would be the iPhone 5 and 5s. Therefore I use this as my base as I can always scale the viewport. Luckily it's an even scale for the 6 and 6+ devices.

    You will run into issues as Safari syntax is different than Firefox. Meaning you will write some css and expect it to work and it will in Firefox, but when you put it on your device it will not. Each browser decides how it wants to implement specs, therefore giving each browser different syntax.

    Examples are always good.

    If you want to transition opacity
    Safari: -webkit-transition: opacity .3s;
    Firefox: -moz-transition: opacity .3s;

    Move an element on x axis
    Safari: -webkit-transform: translateX(300px);
    Firefox: -moz-transform: translateX(300px);

    Size element to fit box
    Safari: -webkit-box-sizing: border-box;
    Firefox: -moz-box-sizing: border-box;

    Blur an image
    Safari: -webkit-transform:blur(5px);
    Firefox: No clue. lol

    Not saying that Firefox is bad, I just recommend if you do mock something up and you want to see on you pc exactly what it will look like on your device. Safari is the way to go.
    Thank you very much for clarification!
    This is how I ended up this evening (12:40 am here, time to go to bed now...)

    Free Cydgets-imageuploadedbytapatalk1421710861.607881.jpg

    I used your icons, have to modify them a little further, well at least try to, I'm even more of a noob when it comes to PS skills missing a phone icon..
    Tomorrow I'll add the weather I think ;-)
    Many thanks
    Mark

    PS: buying you some beer tomorrow!
    Last edited by Doesel; 2015-01-20 at 12:48 AM.
    2015-01-20 12:44 AM
  14. June'sIphone's Avatar
    Thank you very much for clarification!
    This is how I ended up this evening (12:40 am here, time to go to bed now...)

    Free Cydgets-imageuploadedbytapatalk1421710861.607881.jpg

    I used your icons, have to modify them a little further, well at least try to, I'm even more of a noob when it comes to PS skills missing a phone icon..
    Tomorrow I'll add the weather I think ;-)
    Many thanks
    Mark

    PS: buying you some beer tonorrow!
    Awesome! Nice to see someone customizing the Cydgets to their liking.
    2015-01-20 12:47 AM
  15. Doesel's Avatar
    Awesome! Nice to see someone customizing the Cydgets to their liking.
    Thank you, but there'd be nothing without your great tutorials and support! Really appreciate it

    Is there kind of documentation on how to access other stuff? In your post above you mentioned that one can display calendar and stuff as well.
    2015-01-20 12:55 AM
  16. rasputin007's Avatar
    Yours after fixing the mistake of the div. Free Cydgets-imageuploadedbymodmyi1421710813.514876.jpg
    Yepp, works now!
    Changed the order
    1.) div
    2.)cycript
    3.)javascript

    This is amazing as I have the GPS cycript working in a cydget with
    1.) cycript
    2.)javascript
    3.) div's
    but then I do not have anything from the cycript displayed in a div.
    Thanks, now i am on my way.
    But still does not explain why yours does not display anything on my side.

    EDIT
    Order of execution of code is a funny thing. Learned that with the old GPS web server for iPhone, where a html page would run the geolocation javascript and save the latitude and longitude in cookies, then call a php file that reads those cookies, assign them to variables and save them in the myLocation.txt file. However you always had to run the html page twice to get your current GPS location saved in myLocation.txt file. Recently, while looking at php again I found out that php code is run before any other code is executed, which explained the use of the previous cookies. After changing the php call to
    Code:
    window.location.href = "test.php?w1=" + lat + "&w2=" + lng;
    it worked first time, as it was "sending" the latitude/longitude variables with the php call.
    Last edited by rasputin007; 2015-01-20 at 01:13 AM.
    Nothing is impossible only miracles take a bit longer!
    2015-01-20 01:00 AM
  17. June'sIphone's Avatar
    Thank you, but there'd be nothing without your great tutorials and support! Really appreciate it

    Is there kind of documentation on how to access other stuff? In your post above you mentioned that one can display calendar and stuff as well.
    That's complicated. It's hard to explain the process. I attempt to here, but it lacks a bunch of details imo LINK. If it's calendar info you want I can do a tutorial on how to achieve it and explain the process I took to get the info.
    2015-01-20 01:12 AM
  18. June'sIphone's Avatar
    Yepp, works now!
    Changed the order
    1.) div
    2.)cycript
    3.)javascript

    This is amazing as I have the GPS cycript working in a cydget with
    1.) cycript
    2.)javascript
    3.) div's
    but then I do not have anything from the cycript displayed in a div.
    Thanks, now i am on my way.
    But still does not explain why yours does not display anything on my side.
    Yea I don't understand why it wouldn't, as it's basically the same thing.
    2015-01-20 01:15 AM
  19. June'sIphone's Avatar
    Here is a way to get Calendar events.
    Cydgets: Getting Calendar Event with Cycript
    2015-01-20 03:27 AM
  20. Doesel's Avatar
    Here is a way to get Calendar events.
    Cydgets: Getting Calendar Event with Cycript
    Thanks a lot. So there's a lot to play around with and everything from iOS Dev Reference can somehow be integrated
    2015-01-20 07:24 AM
193 ... 34567 ...
LINK TO POST COPIED TO CLIPBOARD