From 498b17926f3caed38ec64e18c67fd9ed5b85ae23 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 23 Apr 2011 00:46:07 +0200 Subject: [PATCH] images loaded in Ox.UI now --- source/js/Ox.App.js | 46 +++++++++++---------------------------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/source/js/Ox.App.js b/source/js/Ox.App.js index ee9bb7e5..43129a3e 100644 --- a/source/js/Ox.App.js +++ b/source/js/Ox.App.js @@ -86,26 +86,6 @@ Ox.App = (function() { }; } - function loadImages(callback) { - window.OxImageCache = []; - $.getJSON(Ox.UI.PATH + 'json/ox.ui.images.json', function(data) { - // fixme: find a better way to not wait for flags - data = data.filter(function(image) { - return !Ox.startsWith(image, 'svg/ox.map/') - }); - var counter = 0, - length = data.length; - data.forEach(function(src, i) { - var image = new Image(); - image.src = Ox.UI.PATH + src; - image.onload = function() { - (++counter == length) && callback(); - } - window.OxImageCache.push(image); // fixme: global var??? - }); - }); - } - self.change = function(key, value) { }; @@ -165,23 +145,19 @@ Ox.App = (function() { user = result.data.user; // fixme: not generic document.title = config.site.name; - launchCallback(); + $(function() { + var $div = Ox.UI.$body.find('div'); + Ox.UI.$body.find('img').remove(); + $div.animate({ + opacity: 0 + }, 1000, function() { + $div.remove(); + }); + // fixme: not generic enough, just pass data + callback({config: config, user: user}); + }); }); }); - loadImages(launchCallback); - function launchCallback() { - ++counter == 2 && $(function() { - var $div = Ox.UI.$body.find('div'); - Ox.UI.$body.find('img').remove(); - $div.animate({ - opacity: 0 - }, 1000, function() { - $div.remove(); - }); - // fixme: not generic enough, just pass data - callback({config: config, user: user}); - }); - } } function stop() { that.request.send(self.options.init, getUserData(), function() {});