+ Reply
Page 137 of 162 FirstFirst ... 37 87 127135136137138139 147 ... LastLast
Results 2,721 to 2,740 of 3236

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


Thread: UniAW5.0

is a discussion within the

iPhone 4|4S New Skins / Themes Launches

forums, a part of the

New Skins / Themes Launches

section;
Hi Dacal, I just did 2 or 3 changes to my main. js and location. js files and YEP, it now works fine, well done (again). Problem is... now your
...
  1. #2721
    Modder & Coder Ian Nicoll's Avatar
    Join Date
    Oct 2008
    Location
    From Scotland, live in the Philippines.
    Posts
    4,955
    Thanks
    7,608
    Thanked 19,218 Times in 3,920 Posts

    Hi Dacal,

    I just did 2 or 3 changes to my main.js and location.js files and YEP, it now works fine, well done (again).

    Problem is... now your LS is updating everything perfect now too!!!!

    One thing I notice on the LS when previously testing was it had a very hard time getting it to use the GPS (it kept going to your home town), I thought it was my internet connection but the UniAW on my SB was fine. Now though it is all working great.

    Will keep an eye on it for the next couple of days but so far now all looks great.

    EDIT.

    I found out why I couldn't get the gps working first time, for some reason your LS doesn't like my home location coordinates, I now remember making some changes to the UniAW so it used my correct home location name so that's probably the difference.

    I just did my edits real quick, I will have a deeper look to see ALL the changes you made.

    Thanks again Dacal.

    Incase you are interested here is my home coordinates your LS doesn't like.

    Lat=10.168627
    Long=124.758750
    Last edited by Ian Nicoll; 03-12-2013 at 07:11 PM.

    "If it's not broken, I'll fix it till it is"

  2. The Following 5 Users Say Thank You to Ian Nicoll For This Useful Post:

    cuzin (03-12-2013), Dacal (03-12-2013), Kazuyoshi (03-13-2013), King_O_Hill (03-12-2013), The_Durben (03-13-2013)

  3. #2722
    Addicted to Code Dacal's Avatar
    Join Date
    Nov 2010
    Posts
    1,891
    Thanks
    2,903
    Thanked 8,488 Times in 1,500 Posts

    Quote Originally Posted by Ian Nicoll View Post
    Hi Dacal,

    I just did 2 or 3 changes to my main.js and location.js files and YEP, it now works fine, well done (again).

    Problem is... now your LS is updating everything perfect now too!!!!

    One thing I notice on the LS when previously testing was it had a very hard time getting it to use the GPS (it kept going to your home town), I thought it was my internet connection but the UniAW on my SB was fine. Now though it is all working great.

    Will keep an eye on it for the next couple of days but so far now all looks great.

    EDIT.

    I found out why I couldn't get the gps working first time, for some reason your LS doesn't like my home location coordinates, I now remember making some changes to the UniAW so it used my correct home location name so that's probably the difference.

    I just did my edits real quick, I will have a deeper look to see ALL the changes you made.

    Thanks again Dacal.

    Incase you are interested here is my home coordinates your LS doesn't like.

    Lat=10.168627
    Long=124.758750
    Thx !! Maybe we got it !

    For these coordinates, the WOEID is 1199195. When i try to use it to retrieve weather information, no city found :

    Yahoo! Weather - Error


    My themes : Jade HD, Silex HD, BaSalt HD,ToPaz
    All are on Cydia and/or Theme It.

  4. The Following 3 Users Say Thank You to Dacal For This Useful Post:

    cuzin (03-12-2013), Kazuyoshi (03-13-2013), King_O_Hill (03-12-2013)

  5. #2723
    My iPhone is a Part of Me cuzin's Avatar
    Join Date
    Aug 2011
    Location
    The Desert
    Posts
    520
    Thanks
    1,501
    Thanked 1,343 Times in 379 Posts

    Dacal

    LS has updated quite a few times for me now...I will keep an eye on it the next few days too. Thank you for your efforts! Would you state what you changed, was it anything more than checking for a time interval? I won't be able to really look at the code for a few hours.

    Thank you too Ian, King, Matux & NewDestiny.
    Twitter - @brokenmind09
    20GB of free cloud storage - https://copy.com/?r=WzHJu8

  6. The Following 3 Users Say Thank You to cuzin For This Useful Post:

    Dacal (03-12-2013), Ian Nicoll (03-12-2013), King_O_Hill (03-12-2013)

  7. #2724
    Modder & Coder Ian Nicoll's Avatar
    Join Date
    Oct 2008
    Location
    From Scotland, live in the Philippines.
    Posts
    4,955
    Thanks
    7,608
    Thanked 19,218 Times in 3,920 Posts

    Quote Originally Posted by Dacal View Post
    Thx !! Maybe we got it !

    For these coordinates, the WOEID is 1199195. When i try to use it to retrieve weather information, no city found :

    Yahoo! Weather - Error
    Yeah M8, YOUOOOOOO got it. I don't use the city, I use neighborhood or it doesn't work in my location. Strange how it works with gps but not with WOEID. The nearest WOEID that works for me is 1199409

    Code:
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    // Author : Vivek Thakur
    // Date : 25 Feb 2012
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    // Modified by Dacal.
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    
    var prevlatitude = "";
    var prevlongitude = "";
    var zipCode="";
    var woeid;
    var city;
    var textLat;
    var textLong;
    var neighborhood;
    //var refreshWeatherTimer;
    var state;
    var county;
    
    function UpdateLocation() {
    refreshLocationTimer = setTimeout(UpdateLocation, 20*1000);
    jQuery.get('file:///private/var/mobile/Documents/myLocation.txt', function(appdata) {
    //jQuery.get('myLocation.txt', function(appdata) {
    var myvar = appdata;
    var substr = appdata.split('\n');
    var templatitude=(substr[0]).split('=');
    var templongitude=(substr[1]).split('=');
    var latitude = $.trim(templatitude[1]);
    var longitude = $.trim(templongitude[1]);
    
    if (prevlatitude != latitude || prevlongitude != longitude) {
    
    //clearTimeout(refreshWeatherTimer);
    //clearTimeout(refreshWeatherTimerNormal);
    
    if (latitude < 0) { textLat = Math.round(latitude*100)/100 + "\u00B0" + "S"; }
    else if (latitude > 0){ textLat = Math.round(latitude*100)/100 + "\u00B0" + "N"; }
    else { textLat = Math.round(latitude*100)/100 + "\u00B0"; }
    
    if (longitude < 0) { textLong = Math.round(longitude*100)/100 + "\u00B0" + "W"; }
    else if (longitude > 0) { textLong = Math.round(longitude*100)/100 + "\u00B0" + "E"; }
    else { textLong = Math.round(longitude*100)/100 + "\u00B0"; }
    
    prevlatitude = latitude;
    prevlongitude = longitude;
    
    // Get the woeid for new location
    var url = "http://where.yahooapis.com/geocode?location=" + latitude + "+" + longitude + "&gflags=R&flags=J";
    $.getJSON(url, function(data) {
    woeid = data.ResultSet.Results[0].woeid;
    city = data.ResultSet.Results[0].city;
    
    neighborhood = data.ResultSet.Results[0].neighborhood;
    state = data.ResultSet.Results[0].state;
    if (neighborhood != "") { neigh_lat_long = neighborhood; }
    else { neigh_lat_long = state; }
    
    $("#neighborhood").text(neigh_lat_long);
    
    if (city != "") {
    $("#city0").text(neighborhood);}
    else {
    $("#city0").text(neighborhood);}
    
    // Get the old locale from woeid
    var url = "http://weather.yahooapis.com/forecastrss?w="+woeid+"&u=f";
    $.get(url, function(data) {
    title = $(data).find('title').text();
    if (title != "Yahoo! Weather - ErrorCity not found") {
    zipCode = $(data).find('guid').text().split('_')[0];
    city = $(data).find('location').attr('city'); //Add "//" at the start of this line to get City from geocode
    document.getElementById("city0").innerHTML = city;
    document.getElementById("city").style.display='none';
    fetchWeatherData(dealWithWeather, zipCode);
    //var refreshWeatherTimer = setInterval('fetchWeatherData(dealWithWeather, zipCode)', updateWeatherEvery); // Refresh weather as specified in config.js
    } else {
    	if (zipCode == "") { validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal); } // Back to locale, but keep the 20s refresh for GPS localization 
    	else { document.getElementById("city0").innerHTML = city; }
    }
    
    });
    
    });
    } 
    }).error(function() {
    clearTimeout(refrechLocationTimer);
    validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal);
    }); 
    
    }

    "If it's not broken, I'll fix it till it is"

  8. The Following 3 Users Say Thank You to Ian Nicoll For This Useful Post:

    Dacal (03-12-2013), Kazuyoshi (03-13-2013), King_O_Hill (03-12-2013)

  9. #2725
    Addicted to Code Dacal's Avatar
    Join Date
    Nov 2010
    Posts
    1,891
    Thanks
    2,903
    Thanked 8,488 Times in 1,500 Posts

    Quote Originally Posted by cuzin View Post
    Dacal

    LS has updated quite a few times for me now...I will keep an eye on it the next few days too. Thank you for your efforts! Would you state what you changed, was it anything more than checking for a time interval? I won't be able to really look at the code for a few hours.

    Thank you too Ian, King, Matux & NewDestiny.
    The main thing is the update interval in updateClock function (at the end). Other things are some small corrections/changes.


    My themes : Jade HD, Silex HD, BaSalt HD,ToPaz
    All are on Cydia and/or Theme It.

  10. The Following 3 Users Say Thank You to Dacal For This Useful Post:

    cuzin (03-12-2013), Ian Nicoll (03-12-2013), King_O_Hill (03-12-2013)

  11. #2726
    King Kong ain't got nothing on me! King_O_Hill's Avatar
    Join Date
    Apr 2011
    Location
    USA
    Posts
    9,325
    Thanks
    41,331
    Thanked 17,446 Times in 6,378 Posts

    Quote Originally Posted by Dacal View Post
    Thx King. The question : your widget updates perfectly ? Specify a small update interval (one or two minutes). Unplugged your phone from computer, respring and go in sleep mode. After 5 minutes, look at your lockscreen and the last update information. If all is fine, the latest update information will be in the specified update interval (the difference between the current time and this information should not be more than the update interval specified).
    Ok, I set interval to 1 min. Let set for about 8 mins hit home button to wake and it was 5 mins behind. I let the LS auto sleep and then woke it again and right in front of me it updated. The animated weather changed from rain to snow also.

    So I hit the sleep button and waited about 5 mins and then woke again. Same thing, the update was behind. This time I hit the home button right away and bang updated instantly.

    So it looks like its working as long as I hit the home button twice to wake. Obviously I'm kidding here. I'm interested in what solution you have found that I can test. I'm supposed to release this beast that I've been massaging for 2 weeks, but want it to be as complete as possible.
    Widget-Weather App Now Available! Also with MyLocation Support!
    Check out the thread here - Widget-Weather
    To install the Widget-Weather app, just go to Cydia and install. This will also remove MyLocation, as it is built in!
    Want to protect your JailBreak! Add this repo http://cydia.myrepospace.com/iLEXiNFO/ & Install "iLEX R.A.T."
    It will allow you to bring your phone back to a fresh jailbroken state!

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

    cuzin (03-12-2013)

  13. #2727
    Modder & Coder Ian Nicoll's Avatar
    Join Date
    Oct 2008
    Location
    From Scotland, live in the Philippines.
    Posts
    4,955
    Thanks
    7,608
    Thanked 19,218 Times in 3,920 Posts

    Quote Originally Posted by cuzin View Post
    Dacal

    LS has updated quite a few times for me now...I will keep an eye on it the next few days too. Thank you for your efforts! Would you state what you changed, was it anything more than checking for a time interval? I won't be able to really look at the code for a few hours.

    Thank you too Ian, King, Matux & NewDestiny.
    Hi pal,

    There isn't an easy way to describe what he has done, but if you just compare his Location.js & main.js (maybe config.js & the .html file) with the one your trying to fix you will see it, he didn't remove anything, just disabled some code with "//" and added a few new lines, so it's easy to spot, look / search for "refreshWeatherTimer" and "refreshLocationTimer".

    "If it's not broken, I'll fix it till it is"

  14. The Following 5 Users Say Thank You to Ian Nicoll For This Useful Post:

    cuzin (03-12-2013), Dacal (03-12-2013), Kazuyoshi (03-13-2013), King_O_Hill (03-12-2013), The_Durben (03-13-2013)

  15. #2728
    King Kong ain't got nothing on me! King_O_Hill's Avatar
    Join Date
    Apr 2011
    Location
    USA
    Posts
    9,325
    Thanks
    41,331
    Thanked 17,446 Times in 6,378 Posts

    Quote Originally Posted by Ian Nicoll View Post
    Code:
    } 
    }).error(function() {
    clearTimeout(refrechLocationTimer);
    validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal);
    }); 
    
    }
    I'm wondering what "refrechLocationTimer" does?

    Damn, I feel like I'm about 10 mins behind here.
    Last edited by King_O_Hill; 03-12-2013 at 07:41 PM.
    Widget-Weather App Now Available! Also with MyLocation Support!
    Check out the thread here - Widget-Weather
    To install the Widget-Weather app, just go to Cydia and install. This will also remove MyLocation, as it is built in!
    Want to protect your JailBreak! Add this repo http://cydia.myrepospace.com/iLEXiNFO/ & Install "iLEX R.A.T."
    It will allow you to bring your phone back to a fresh jailbroken state!

  16. The Following 2 Users Say Thank You to King_O_Hill For This Useful Post:

    cuzin (03-12-2013), Dacal (03-12-2013)

  17. #2729
    Modder & Coder Ian Nicoll's Avatar
    Join Date
    Oct 2008
    Location
    From Scotland, live in the Philippines.
    Posts
    4,955
    Thanks
    7,608
    Thanked 19,218 Times in 3,920 Posts

    Quote Originally Posted by Dacal View Post
    The main thing is the update interval in updateClock function (at the end). Other things are some small corrections/changes.
    OOoo, I didn't notice that one, but it still worked LOL... Will change it now.

    Quote Originally Posted by King_O_Hill View Post
    I'm wondering what "refrechLocationTimer" does?

    Damn, I feel like I'm about 10 mins behind here.
    The code looks for changes (refreshes if you like) to the "MyLocation.txt" file every 20 seconds.

    refreshLocationTimer = setTimeout(UpdateLocation, 20*1000);

    If it doesn't find the MyLocation.txt file it reverts to using the "locale" inputed code.

    }).error(function() {
    clearTimeout(refrechLocationTimer);
    validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal);

    What u workin on matey?
    Last edited by Ian Nicoll; 03-12-2013 at 07:57 PM.

    "If it's not broken, I'll fix it till it is"

  18. The Following 2 Users Say Thank You to Ian Nicoll For This Useful Post:

    cuzin (03-12-2013), The_Durben (03-13-2013)

  19. #2730
    Addicted to Code Dacal's Avatar
    Join Date
    Nov 2010
    Posts
    1,891
    Thanks
    2,903
    Thanked 8,488 Times in 1,500 Posts

    Quote Originally Posted by King_O_Hill View Post
    Ok, I set interval to 1 min. Let set for about 8 mins hit home button to wake and it was 5 mins behind. I let the LS auto sleep and then woke it again and right in front of me it updated. The animated weather changed from rain to snow also.

    So I hit the sleep button and waited about 5 mins and then woke again. Same thing, the update was behind. This time I hit the home button right away and bang updated instantly.

    So it looks like its working as long as I hit the home button twice to wake. Obviously I'm kidding here. I'm interested in what solution you have found that I can test. I'm supposed to release this beast that I've been massaging for 2 weeks, but want it to be as complete as possible.
    Look the latest link i posted .

    In fact, i think (not sure) that with iOS6, all timers are in pause when the phone is in sleep mode. They restart when you wake-up the phone (not completly true, cause i think the phone goes in deep sleep mode after few seconds of black screen).

    For a 10 minutes interval/timer :

    iOS 5 :

    <----wake : 5 min----><--------sleep : 10 min---------><------wake : 5 min---------->
    <------------Timer : 10 min---------->Upd<--------------Timer : 10 min-------------->

    When you wake up your phone after the first 10 minutes, the update have been done.

    iOS 6 :

    <----wake : 5 min----><--------sleep : 10 min---------><------wake : 5 min---------->
    <---------------Timer : 10 min, but pause during 10 min (sleep)------------------------>Upd

    The update interval specified is 10 minutes, but the weather update only occurs after 20 minutes... And i let you imagine if you return in sleep mode (auto/manual) more often and/or reduce the wake-up time.

    It could be like this... Or i miss something.

    For now, we have a workaround (not perfect), but i must look to see exactly what happen.

    Dacal
    Last edited by Dacal; 03-12-2013 at 08:04 PM.


    My themes : Jade HD, Silex HD, BaSalt HD,ToPaz
    All are on Cydia and/or Theme It.

  20. The Following 5 Users Say Thank You to Dacal For This Useful Post:

    cuzin (03-12-2013), Ian Nicoll (03-12-2013), Kazuyoshi (03-13-2013), King_O_Hill (03-12-2013), The_Durben (03-13-2013)

  21. #2731
    King Kong ain't got nothing on me! King_O_Hill's Avatar
    Join Date
    Apr 2011
    Location
    USA
    Posts
    9,325
    Thanks
    41,331
    Thanked 17,446 Times in 6,378 Posts

    Quote Originally Posted by Ian Nicoll View Post
    OOoo, I didn't notice that one, but it still worked LOL... Will change it now.



    The code looks for changes (refreshes if you like) to the "MyLocation.txt" file every 20 seconds.

    refreshLocationTimer = setTimeout(UpdateLocation, 20*1000);

    If it doesn't find the MyLocation.txt file it reverts to using the "locale" inputed code.

    }).error(function() {
    clearTimeout(refrechLocationTimer);
    validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal);

    What u workin on matey?
    I'll send it to you and you can check it out. I need another tester anyway.

    Check PM
    Last edited by King_O_Hill; 03-12-2013 at 08:40 PM.
    Widget-Weather App Now Available! Also with MyLocation Support!
    Check out the thread here - Widget-Weather
    To install the Widget-Weather app, just go to Cydia and install. This will also remove MyLocation, as it is built in!
    Want to protect your JailBreak! Add this repo http://cydia.myrepospace.com/iLEXiNFO/ & Install "iLEX R.A.T."
    It will allow you to bring your phone back to a fresh jailbroken state!

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

    Ian Nicoll (03-12-2013)

  23. #2732
    Modder & Coder Ian Nicoll's Avatar
    Join Date
    Oct 2008
    Location
    From Scotland, live in the Philippines.
    Posts
    4,955
    Thanks
    7,608
    Thanked 19,218 Times in 3,920 Posts

    My Uniaw is not updating at all now (1hr & 15 minutes) Update interval set to 15 minutes, will look at it later, I have obviously missed something, so please don't use my location.js file for now.

    @ KOH, downloading now, thanks M8.

    "If it's not broken, I'll fix it till it is"

  24. The Following 2 Users Say Thank You to Ian Nicoll For This Useful Post:

    Kazuyoshi (03-13-2013), King_O_Hill (03-12-2013)

  25. #2733
    Modder & Coder Ian Nicoll's Avatar
    Join Date
    Oct 2008
    Location
    From Scotland, live in the Philippines.
    Posts
    4,955
    Thanks
    7,608
    Thanked 19,218 Times in 3,920 Posts

    So after many tests I have finally discovered why we have conflicting reports regarding the update of weather info.

    I will try to explain clearly!

    I was testing this with KOH's beta (which has not been altered with the recent changes from Dacal), and Dacal's recent LS posted earlier, here is what I found.

    If you start in a location that can get a city name from the gps coordinates all is good.
    If you change to another city where you can again get your city name from the gps coordinates then all is good.
    If you change to another city where the city name comes up an error from the gps coordinates, the widget then updates your city name from the "locale" code BUT it doesn't update the other weather info.

    So, because the way the widget is coded many people will be blind as to what is happening, if all their locations get the city names ok from the gps location everything will work perfect, but, hidden to the user, if their city name cannot be found with gps it gets the city name from the "locale" code and it will look like the widget updated ok, but in fact it was only the city name that was updated, not the weather, this would be hard to find in locations close to each other as the weather would probably be about the same, but testing it with locations from different countries proves this point.

    I really got to go out now, but at least we now know why many people say "it works for me" and others have issues.

    If your reading this Dacal I hope it makes it easier to fault find, I now know why I reported your code was still not working then all of a sudden it seemed to work, it was just the gps coordinates I was using the 2nd time happened to all be good for getting a city name with the gps coordinates, I am sorry M8 but it is still not working correctly.

    So you can test this, here is a gps location that has no city name:
    Lat=10.168627
    Long=124.758750
    If you test your widget with this you will see the city change to whatever you have in your "locale" code but the weather info & conditions will not change.

    Hope this fault finding helps you out a bit, at least we now know why all the conflicting reports, I think it is not that hard to fix now.

    All the best (and sorry again for the looong post)

    @ KOH,

    I like your widget bud, haven't had a lot of time to play yet but I would love to see the high temp on the top and the low temp on the bottom, but this is just a personal choice.
    Your widget works fine if all is good as per above, but has the same problem (again as above) but now we now the issue It will be a lot easier to fix.

    Will have a good look through your widget later but, would also love to get rid of that initial downpour of snow drops in the snow condition, I posted a fix for this a few pages back.

    Ian.
    Last edited by Ian Nicoll; 03-12-2013 at 11:27 PM.

    "If it's not broken, I'll fix it till it is"

  26. The Following 6 Users Say Thank You to Ian Nicoll For This Useful Post:

    cuzin (03-13-2013), Kazuyoshi (03-13-2013), King_O_Hill (03-13-2013), lostinthemes (03-15-2013), pnunez1310 (03-13-2013), The_Durben (03-13-2013)

  27. #2734
    My iPhone is a Part of Me cuzin's Avatar
    Join Date
    Aug 2011
    Location
    The Desert
    Posts
    520
    Thanks
    1,501
    Thanked 1,343 Times in 379 Posts

    Ian, thank you for the great explanation...I wish I knew more about coding to help you guys out. I will be taking programming classes in college to earn my degree but for now I've been learning a lot from everyone's work here.
    Twitter - @brokenmind09
    20GB of free cloud storage - https://copy.com/?r=WzHJu8

  28. The Following 3 Users Say Thank You to cuzin For This Useful Post:

    Ian Nicoll (03-13-2013), Kazuyoshi (03-13-2013), King_O_Hill (03-13-2013)

  29. #2735
    Addicted to Code Dacal's Avatar
    Join Date
    Nov 2010
    Posts
    1,891
    Thanks
    2,903
    Thanked 8,488 Times in 1,500 Posts

    Quote Originally Posted by Ian Nicoll View Post
    So after many tests I have finally discovered why we have conflicting reports regarding the update of weather info.

    I will try to explain clearly!

    I was testing this with KOH's beta (which has not been altered with the recent changes from Dacal), and Dacal's recent LS posted earlier, here is what I found.

    If you start in a location that can get a city name from the gps coordinates all is good.
    If you change to another city where you can again get your city name from the gps coordinates then all is good.
    If you change to another city where the city name comes up an error from the gps coordinates, the widget then updates your city name from the "locale" code BUT it doesn't update the other weather info.

    So, because the way the widget is coded many people will be blind as to what is happening, if all their locations get the city names ok from the gps location everything will work perfect, but, hidden to the user, if their city name cannot be found with gps it gets the city name from the "locale" code and it will look like the widget updated ok, but in fact it was only the city name that was updated, not the weather, this would be hard to find in locations close to each other as the weather would probably be about the same, but testing it with locations from different countries proves this point.

    I really got to go out now, but at least we now know why many people say "it works for me" and others have issues.

    If your reading this Dacal I hope it makes it easier to fault find, I now know why I reported your code was still not working then all of a sudden it seemed to work, it was just the gps coordinates I was using the 2nd time happened to all be good for getting a city name with the gps coordinates, I am sorry M8 but it is still not working correctly.

    So you can test this, here is a gps location that has no city name:
    Lat=10.168627
    Long=124.758750
    If you test your widget with this you will see the city change to whatever you have in your "locale" code but the weather info & conditions will not change.

    Hope this fault finding helps you out a bit, at least we now know why all the conflicting reports, I think it is not that hard to fix now.

    All the best (and sorry again for the looong post)

    @ KOH,

    I like your widget bud, haven't had a lot of time to play yet but I would love to see the high temp on the top and the low temp on the bottom, but this is just a personal choice.
    Your widget works fine if all is good as per above, but has the same problem (again as above) but now we now the issue It will be a lot easier to fix.

    Will have a good look through your widget later but, would also love to get rid of that initial downpour of snow drops in the snow condition, I posted a fix for this a few pages back.

    Ian.

    Hi Ian, it's the way i had chosen when i had coded it. . It's controled by this code :

    // GET OLD LOCALE FROM WOEID
    var url = "http://weather.yahooapis.com/forecastrss?w="+woeid+"&u=f";
    $.get(url, function(data) {
    title = $(data).find('title').text(); // Check if a city is found.
    if (title != "Yahoo! Weather - ErrorCity not found") {
    gps = true;
    zip = $(data).find('guid').text().split('_')[0];
    city = $(data).find('location').attr('city');
    weatherRefresherTemp(zip); // Refresh weather as specified in Config.js.
    } else {
    if ( xmldata == false ) { // Back to locale, but keep the 20s refresh for GPS localization.
    gps = false;
    validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal);
    } else {
    document.getElementById("cityname").innerHTML = city; // Refresh the city name and keep the last weather info.
    document.getElementById("coordinates").style.color ="#DCDCDC";
    document.getElementById("coordinates").innerHTML = " [" + textLat + " " + textLong + "]";
    }
    }
    }).error(function() {
    if (xmldata == false) {
    dealWithWeather ({error:true});
    } else {
    document.getElementById("coordinates").style.color = "red";
    document.getElementById("coordinates").innerHTML = "[Offline]";
    }
    });

    We have too choice in this case :

    1) Only update the city name (like te code above).
    2) Report an error (in coodinates, put for exemple un [Bad Woeid] and :
    a) Revert back to the locale specified in the Config.js (but annoying if you travel a lot and you re far from the fixed locale).
    b) Update all the weather with the latest valid location (if we have one) BUT keep the new city name (presume the weather condition is closed).

    I think choice 2-b is not bad... I don't remember why i didn't think about it. What do you think ?


    Just need to replace code above with that :

    // GET OLD LOCALE FROM WOEID
    var url = "http://weather.yahooapis.com/forecastrss?w="+woeid+"&u=f";
    $.get(url, function(data) {
    title = $(data).find('title').text(); // Check if a city is found.
    if (title != "Yahoo! Weather - ErrorCity not found") {
    gps = true;
    zip = $(data).find('guid').text().split('_')[0];
    city = $(data).find('location').attr('city');
    weatherRefresherTemp(zip); // Refresh weather as specified in Config.js.
    } else {
    if ( xmldata == false ) { // Back to locale, but keep the 20s refresh for GPS localization.
    gps = false;
    validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal);
    } else {
    weatherRefresherTemp(zip); // Keep the latest valid zip to update the weather.
    document.getElementById("coordinates").innerHTML = " [BAD WOEID | " + textLat + " " + textLong + "]";
    }
    }
    }).error(function() {
    if (xmldata == false) {
    dealWithWeather ({error:true});
    } else {
    document.getElementById("coordinates").style.color = "red";
    document.getElementById("coordinates").innerHTML = "[Offline]";
    }
    });
    Last edited by Dacal; 03-13-2013 at 02:05 AM.


    My themes : Jade HD, Silex HD, BaSalt HD,ToPaz
    All are on Cydia and/or Theme It.

  30. The Following 3 Users Say Thank You to Dacal For This Useful Post:

    cuzin (03-13-2013), Ian Nicoll (03-13-2013), The_Durben (03-13-2013)

  31. #2736
    Modder & Coder Ian Nicoll's Avatar
    Join Date
    Oct 2008
    Location
    From Scotland, live in the Philippines.
    Posts
    4,955
    Thanks
    7,608
    Thanked 19,218 Times in 3,920 Posts

    Hi Dacal,

    Yes M8, I remember we were passing numerous emails about this a long time ago, I think it was because I couldn't get a gps location name at my home, and this well over a year ago!

    For me Dacal, I think it's ok the way it is but some king of small error message or even style the city name in red so the user knows the city name is from locale inputed code, this way the weather will not be far off (assuming the user doesn't drive through 10 cities that has no name from the gps coordinates, but the chances of this in very slim LOL)

    I geuss it's very similar to choice 2b, with a red city name, is it possible to have the locale name red only if it is reverted from the gps code?

    Thanks again Dacal for everything.

    "If it's not broken, I'll fix it till it is"

  32. The Following 3 Users Say Thank You to Ian Nicoll For This Useful Post:

    cuzin (03-13-2013), King_O_Hill (03-13-2013), The_Durben (03-13-2013)

  33. #2737
    Addicted to Code Dacal's Avatar
    Join Date
    Nov 2010
    Posts
    1,891
    Thanks
    2,903
    Thanked 8,488 Times in 1,500 Posts

    Quote Originally Posted by Ian Nicoll View Post
    Hi Dacal,

    Yes M8, I remember we were passing numerous emails about this a long time ago, I think it was because I couldn't get a gps location name at my home, and this well over a year ago!

    For me Dacal, I think it's ok the way it is but some king of small error message or even style the city name in red so the user knows the city name is from locale inputed code, this way the weather will not be far off (assuming the user doesn't drive through 10 cities that has no name from the gps coordinates, but the chances of this in very slim LOL)

    I geuss it's very similar to choice 2b, with a red city name, is it possible to have the locale name red only if it is reverted from the gps code?

    Thanks again Dacal for everything.
    Look above. I added something i don't have the time to test. Very simple modification.
    I have included a "BAD WOEID" in the coordinates variable.


    My themes : Jade HD, Silex HD, BaSalt HD,ToPaz
    All are on Cydia and/or Theme It.

  34. The Following 3 Users Say Thank You to Dacal For This Useful Post:

    cuzin (03-13-2013), Ian Nicoll (03-13-2013), King_O_Hill (03-13-2013)

  35. #2738
    Modder & Coder Ian Nicoll's Avatar
    Join Date
    Oct 2008
    Location
    From Scotland, live in the Philippines.
    Posts
    4,955
    Thanks
    7,608
    Thanked 19,218 Times in 3,920 Posts

    Ok, cheers, I'll try it soon.

    Edit:

    Can't get this to work with mine, it stops the widget working altogether, I think it's the subtle differences in the rest of the code, will try & figure it out tomorrow when the kids are in school (no peace now LOL)

    Dacal, is this code to be added along with the other changes you made earlier to the .js files or just to the original locationjs file? Thanks.

    I'm getting all confused not working with KOH's widget, your LS and the UniAW LOL, got different versions all over the place!

    Edit2:

    Ok, this is meant for your LS location.js file, it is quite a bit different from my location.js (posted above) it's not playing nice with mine.
    Last edited by Ian Nicoll; 03-13-2013 at 05:50 AM.

    "If it's not broken, I'll fix it till it is"

  36. The Following 5 Users Say Thank You to Ian Nicoll For This Useful Post:

    cuzin (03-13-2013), Dacal (03-13-2013), Kazuyoshi (03-13-2013), King_O_Hill (03-13-2013), The_Durben (03-13-2013)

  37. #2739
    iPhone? More like MyPhone Kazuyoshi's Avatar
    Join Date
    Sep 2011
    Location
    near Nürnberg, Germany
    Posts
    336
    Thanks
    1,231
    Thanked 436 Times in 197 Posts

    Same here for mine baSalt LS Works Fine my own stays everything back in black
    Matux is past ... Kazuyoshi is back (thx Simon )

    Dropbox
    : exxOS -- Shine --

  38. The Following User Says Thank You to Kazuyoshi For This Useful Post:

    cuzin (03-13-2013)

  39. #2740
    Addicted to Code Dacal's Avatar
    Join Date
    Nov 2010
    Posts
    1,891
    Thanks
    2,903
    Thanked 8,488 Times in 1,500 Posts

    Quote Originally Posted by Matux View Post
    Same here for mine baSalt LS Works Fine my own stays everything back in black
    Hi ! I have changed a lot of minor things, guys. You cannot only replace your location.js by mine .


    My themes : Jade HD, Silex HD, BaSalt HD,ToPaz
    All are on Cydia and/or Theme It.

  40. The Following User Says Thank You to Dacal For This Useful Post:

    cuzin (03-13-2013)

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts