diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/ui.html | 5 | ||||
-rw-r--r-- | static/ui.js | 14 |
2 files changed, 16 insertions, 3 deletions
diff --git a/static/ui.html b/static/ui.html index 89283a4..cae2c56 100644 --- a/static/ui.html +++ b/static/ui.html @@ -38,11 +38,12 @@ <script id="item_template" type="text/jqtmp"> <h2><a target="_blank" class="i" id="i_${item_id}" href="${item.url}">${item.title }</a> <span class={{if item.starred}}"unstar"{{else}}"star"{{/if}}>★</span> - <span class="full">{{if item.full}}▼{{else}}►{{/if}}</span> </h2> <p class="dateline" style="clear: both;"> <a href="${item.feed_url}">${item.feed_title}</a> | <a href="${item.url}">${item.p_url}</a> - | ${item.feed_category} + | ${item.feed_category} | + <span class="full">{{if item.full}}hide{{else}}scrape{{/if}} full text</span> + </p> {{if item.header_image}} <div class="img"><img src="${item.header_image}" /></div> diff --git a/static/ui.js b/static/ui.js index 0c60630..4e6d7e0 100644 --- a/static/ui.js +++ b/static/ui.js @@ -208,7 +208,7 @@ var ControlsView = Backbone.View.extend({ var Item = Backbone.Model.extend({ idAttribute: "_id", - url: '/item/', + url: '/item', initialize: function() { var p_url = this.get('url'); @@ -252,6 +252,16 @@ var Item = Backbone.Model.extend({ full: function() { this.set({'full': !(this.get('full'))} ); + // this should just use this.fetch() but + // it kept GETing from /item instead of /item/id + // so just hacking this in for now + + if(this.get('full_content') == "") { + $.getJSON('/item/' + this.get('_id'), function(data) { + var i = App.items.get(data['_id']) + i.set('full_content', data['full_content']); + }); + } } }); @@ -259,6 +269,8 @@ var Item = Backbone.Model.extend({ var ItemCollection = Backbone.Collection.extend({ model: Item, + url: '/item', + initialize: function() { _.bindAll(this, 'boot', 'reboot'); }, |