aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2017-11-20 10:21:05 -0700
committerAdam Mathes <adam@trenchant.org>2017-11-20 10:21:05 -0700
commiteffcafcb7d2010c4d182b296ff2cf5b55cc91cf5 (patch)
tree8154c4cd6e7ad1167aafade5277f212aeee3b97a
parent1a6516cffc33403b51a8f38af4a574ae94ab2999 (diff)
downloadneko-effcafcb7d2010c4d182b296ff2cf5b55cc91cf5.tar.gz
neko-effcafcb7d2010c4d182b296ff2cf5b55cc91cf5.tar.bz2
neko-effcafcb7d2010c4d182b296ff2cf5b55cc91cf5.zip
wip img
-rw-r--r--static/style.css4
-rw-r--r--static/ui.html14
-rw-r--r--static/ui.js10
3 files changed, 23 insertions, 5 deletions
diff --git a/static/style.css b/static/style.css
index 488a602..1006a85 100644
--- a/static/style.css
+++ b/static/style.css
@@ -158,6 +158,10 @@ pre {
color: black;
}
+.full {
+ cursor: pointer;
+}
+
.star {
color: black;
cursor: pointer;
diff --git a/static/ui.html b/static/ui.html
index b977dad..4f7e297 100644
--- a/static/ui.html
+++ b/static/ui.html
@@ -37,14 +37,18 @@
<span class={{if item.starred}}"unstar"{{else}}"star"{{/if}}>★</span></h2>
<p class="dateline" style="clear: both;">
${ item.publish_date } from <a href="${item.feed_url}">${item.feed_title}</a>
- </p>
- <div class="description">{{html item.description}}</div>
+ </p>
- <h3>full content</h3>
+ {{if item.header_image}}
<div class="img"><img src="${item.header_image}" /></div>
+ {{/if}}
+ <div class="description">{{html item.description}}
+ <p class="full">⫸</p>
+ </div>
+ {{if item.full}}
<div class="description">{{html item.full_content}}</div>
-
- </script>
+ {{/if}}
+ </script>
<script id="tag_template" type="text/jqtmp">
${tag.name} ${tag.unread}
diff --git a/static/ui.js b/static/ui.js
index 6f44db0..4f9305c 100644
--- a/static/ui.js
+++ b/static/ui.js
@@ -203,6 +203,10 @@ var Item = Backbone.Model.extend({
unstar: function() {
this.set({'starred': false});
+ },
+
+ full: function() {
+ this.set({'full': true});
}
});
@@ -291,6 +295,7 @@ var ItemView = Backbone.View.extend({
events: {
"click .star": "star",
"click .unstar": "unstar",
+ "click .full": "full",
},
initialize: function() {
@@ -308,6 +313,11 @@ var ItemView = Backbone.View.extend({
this.render();
},
+ full: function() {
+ this.model.full();
+ this.render();
+ },
+
render: function() {
var h = $.tmpl(templates.item_template, { 'item': this.model.toJSON() });
$(this.el).html(h);