diff options
Diffstat (limited to 'StoneIsland/www/js/lib/blogs')
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/ArchiveView.js | 5 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/BlogView.js | 6 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/HubView.js | 5 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/StoryView.js | 9 |
4 files changed, 16 insertions, 9 deletions
diff --git a/StoneIsland/www/js/lib/blogs/ArchiveView.js b/StoneIsland/www/js/lib/blogs/ArchiveView.js index 13bacb22..783254cc 100644 --- a/StoneIsland/www/js/lib/blogs/ArchiveView.js +++ b/StoneIsland/www/js/lib/blogs/ArchiveView.js @@ -20,11 +20,12 @@ var ArchiveView = View.extend({ this.data = data this.$loader.hide() this.$content.empty() + + // id title images[ uri label code caption ] this.data.forEach(function(row){ - var t = this.template.replace(/{{image}}/, row.image.url) + var t = this.template.replace(/{{image}}/, row.images[0].uri) .replace(/{{code}}/, row.code) .replace(/{{title}}/, row.title) - .replace(/{{body}}/, row.body) this.$content.append(t) }.bind(this)) }, diff --git a/StoneIsland/www/js/lib/blogs/BlogView.js b/StoneIsland/www/js/lib/blogs/BlogView.js index 70fc910a..573fe3c3 100644 --- a/StoneIsland/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/www/js/lib/blogs/BlogView.js @@ -19,13 +19,13 @@ var BlogView = View.extend({ success: function(data){ this.loaded = true this.data = data - this.loader.preloadImage(data.archive[0].image.url, function(img){ + this.loader.preloadImage(data.archive[0].images[0].uri, function(img){ app.archive.populate(data.archive) }) - this.loader.preloadImage(data.hub[0].image.url, function(img){ + this.loader.preloadImage(data.hub[0].image.uri, function(img){ app.hub.populate(data.hub) }) - this.loader.preloadImage(data.story[0].image.url, function(img){ + this.loader.preloadImage(data.story[0].image.uri, function(img){ app.story.populate(data.story) }) }, diff --git a/StoneIsland/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js index 95cdef3f..62e8d10f 100644 --- a/StoneIsland/www/js/lib/blogs/HubView.js +++ b/StoneIsland/www/js/lib/blogs/HubView.js @@ -20,14 +20,15 @@ var HubView = View.extend({ this.data = data this.$loader.hide() this.$content.empty() + // id date subtitle body link image[uri caption] this.data.forEach(function(row){ - var t = this.template.replace(/{{image}}/, row.image.url) + var t = this.template.replace(/{{image}}/, row.images[0].uri) .replace(/{{date}}/, row.date) .replace(/{{code}}/, row.code) .replace(/{{title}}/, row.title) .replace(/{{subtitle}}/, row.subtitle) .replace(/{{link}}/, row.link) - .replace(/{{body}}/, row.body) + .replace(/{{body}}/, row.body.replace(/\n/g, "<br>")) this.$content.append(t) }.bind(this)) }, diff --git a/StoneIsland/www/js/lib/blogs/StoryView.js b/StoneIsland/www/js/lib/blogs/StoryView.js index b47b0488..efdd65a7 100644 --- a/StoneIsland/www/js/lib/blogs/StoryView.js +++ b/StoneIsland/www/js/lib/blogs/StoryView.js @@ -4,6 +4,7 @@ var StoryView = View.extend({ template: $("#story .template").html(), events: { + "load img": "image_loaded" }, initialize: function(){ @@ -20,13 +21,17 @@ var StoryView = View.extend({ this.data = data this.$loader.hide() this.$content.empty() + // id title image[uri caption] body this.data.forEach(function(row){ - var t = this.template.replace(/{{image}}/, row.image.url) + var t = this.template.replace(/{{image}}/, row.image.uri) .replace(/{{date}}/, row.date) .replace(/{{title}}/, row.title) - .replace(/{{body}}/, row.body) + .replace(/{{body}}/, row.body.replace(/\n/g, "<br>")) this.$content.append(t) }.bind(this)) }, + + image_loaded: function(){ + }, })
\ No newline at end of file |
