Converter demo cleanup.

This commit is contained in:
jzaefferer 2010-10-08 12:34:53 +02:00
parent 7850c16e69
commit 044b54df2f
2 changed files with 2 additions and 3 deletions

View file

@ -14,7 +14,6 @@ $(function() {
$.each(all, function(index, conversion) {
// if last update was less then a minute ago, don't update
if (conversion.type == "currency" && !conversion.rate || conversion.updated && conversion.updated + 60000 < +new Date) {
console.log(conversion.updated)
var self = conversion;
var url = "http://query.yahooapis.com/v1/public/yql?q=select%20rate%2Cname%20from%20csv%20where%20url%3D'http%3A%2F%2Fdownload.finance.yahoo.com%2Fd%2Fquotes%3Fs%3D" + conversion.from + conversion.to + "%253DX%26f%3Dl1n'%20and%20columns%3D'rate%2Cname'&format=json&diagnostics=true&callback=?";
$.getJSON(url, function(result) {

View file

@ -24,15 +24,15 @@
return JSON.parse(localStorage.getItem("conversions"));
}
function set(value) {
console.log("storing conversion: "+ JSON.stringify(value))
window.console && console.log && console.log("storing conversion: "+ JSON.stringify(value))
localStorage.setItem("conversions", JSON.stringify(value));
}
var conversions = get("conversions");
if (!conversions) {
conversions = $.extend([], defaults);
set(conversions);
}
set(conversions);
window.conversions = {
store: function() {
set(conversions);