summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/blogs/BlogView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-09-17 08:12:18 -0400
committerJules Laplace <jules@okfoc.us>2015-09-17 08:12:18 -0400
commit18eecb2faa34cbdfe558e3941c9ec0f5019a3ff9 (patch)
treec476e5ab9ccb2d799df19b21c70d6f9d15382f87 /StoneIsland/www/js/lib/blogs/BlogView.js
parent7eb327b13bd9ee241f47f22ba1c3db3c90e8e942 (diff)
fetch blogviews from cms database and populate based on presumed schema
Diffstat (limited to 'StoneIsland/www/js/lib/blogs/BlogView.js')
-rw-r--r--StoneIsland/www/js/lib/blogs/BlogView.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/StoneIsland/www/js/lib/blogs/BlogView.js b/StoneIsland/www/js/lib/blogs/BlogView.js
new file mode 100644
index 00000000..bd43c6aa
--- /dev/null
+++ b/StoneIsland/www/js/lib/blogs/BlogView.js
@@ -0,0 +1,34 @@
+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
+ // preload images
+ 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