From aaab024a42bf576095d94e069de9f2f17d083bd7 Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 26 Jan 2014 23:17:22 -0500 Subject: autofetch random images --- js/asdf.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/asdf.js') diff --git a/js/asdf.js b/js/asdf.js index 53222e8..6006eea 100644 --- a/js/asdf.js +++ b/js/asdf.js @@ -1,7 +1,7 @@ // // asdf .. asdf.us/im search api -var asdf = { fetching: false } +var asdf = { fetching: false, fetched: false } asdf.random = function (e){ status("fetching random photoblasts") e && e.preventDefault(); @@ -13,7 +13,7 @@ asdf.random = function (e){ asdf.fetch = function (opt){ if (asdf.fetching) return; - asdf.fetching = true; + asdf.fetching = true var params = {random:1}; $.ajax({ 'url': "http://asdf.us/cgi-bin/im/list", @@ -21,6 +21,7 @@ asdf.fetch = function (opt){ 'dataType': "jsonp", 'success': function(urls){ asdf.fetching = false; + asdf.fetched = true opt.success && opt.success(urls) }, 'error': opt.error || function(err){ -- cgit v1.2.3-70-g09d2