summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-09-17 21:26:52 -0400
committerJules Laplace <jules@okfoc.us>2015-09-17 21:26:52 -0400
commit5d68db92b37545fb03332a46b01d0f1aad8ce64b (patch)
tree28aea3c304ab5adc01236f60b719dbaff834c375 /StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
parent58bf27362c0b3d1d41e135aa8bdbd38297a4d0f9 (diff)
populate selector
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js')
-rw-r--r--StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
new file mode 100644
index 00000000..70fc910a
--- /dev/null
+++ b/StoneIsland/platforms/ios/www/js/lib/blogs/BlogView.js
@@ -0,0 +1,33 @@
+var BlogView = View.extend({
+
+ data: null,
+ loaded: false,
+ initialize: function(){
+ this.loader = new Loader ()
+ this.fetch()
+ },
+
+ fetch: function(){
+ $.ajax({
+ method: "GET",
+ url: "http://stone.sup.land/db.json",
+ success: this.success.bind(this),
+ cache: true,
+ })
+ },
+
+ success: function(data){
+ this.loaded = true
+ this.data = data
+ this.loader.preloadImage(data.archive[0].image.url, function(img){
+ app.archive.populate(data.archive)
+ })
+ this.loader.preloadImage(data.hub[0].image.url, function(img){
+ app.hub.populate(data.hub)
+ })
+ this.loader.preloadImage(data.story[0].image.url, function(img){
+ app.story.populate(data.story)
+ })
+ },
+
+}) \ No newline at end of file