• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Simple RSS Reader inspired by Gxxgle Reader


Commit MetaInfo

修订版1f157356bfed231585ca0255bfe5640cd654d3d6 (tree)
时间2013-07-04 01:16:30
作者hylom <hylom@hylo...>
Commiterhylom

Log Message

implement contents preview

更改概述

差异

--- a/client/public/css/style.css
+++ b/client/public/css/style.css
@@ -3,6 +3,31 @@ body {
33 font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
44 }
55
6+#contents-body {
7+ padding: 0 10px;
8+}
9+
610 a {
711 color: #00B7FF;
812 }
13+
14+#contentsPane .contentHeader {
15+ background: #f9f9f9;
16+}
17+#contentsPane .contentTitle h4 {
18+ margin: 0;
19+ font-size: 100%;
20+}
21+#contentsPane .contentTitle h4 a {
22+ color: #111;
23+}
24+
25+#contentsPane .contentTimestamp {
26+ color: #999;
27+}
28+
29+#contentsPane .contentBody {
30+ color: #333;
31+ padding: 0 10px 0 20px;
32+ display: none;
33+}
\ No newline at end of file
--- a/client/public/js/grdc.js
+++ b/client/public/js/grdc.js
@@ -1,18 +1,23 @@
11 // grdc.js
22
33 (function () {
4-
54 function updateContentsPane(data) {
65 var pane = $('#contentsPane');
76 pane.empty();
87 for (var i = 0; i < data.length; i++) {
98 var item = data[i];
10- var elem = '<tr>'
11- + '<td>' + item.title + '</td>'
12- + '<td>' + item.formatedTimestamp + '</td>'
13- + '<td><a target="_blank" href="' + item.url + '">'
14- + '<i class="icon-chevron-right"></i></a></td>'
15- + '</tr>';
9+ var elem = '<tr class="contentHeader" id="chead' + item.content_id + '">'
10+ + '<td class="contentTitle"><h4><a href="#" class="contentTitleString" cid="' + item.content_id + '">' + item.title + '</a></h4></td>'
11+ + '<td class="contentTimestamp">' + item.formatedTimestamp + '</td>'
12+ + '<td class="contentLink"><a target="_blank" href="' + item.url + '">'
13+ + '<i class="icon-chevron-right"></i></a></td>'
14+ + '</tr>'
15+ + '<tr class="contentBody" id="cbody' + item.content_id + '">'
16+ + '<td colspan="3">'
17+ + item.body
18+ + '</td>'
19+ + '</tr>'
20+ ;
1621 pane.append(elem);
1722 }
1823 }
@@ -26,7 +31,17 @@
2631 return false;
2732 }
2833
34+ function toggleContentBody(event) {
35+ var contentId = $(event.target).attr('cid');
36+ console.log('click header ' + contentId);
37+ if (contentId !== undefined) {
38+ $('#cbody' + contentId).toggle();
39+ }
40+ return false;
41+ }
42+
2943 $(document).on('click', ".feedItem", loadFeed);
44+ $(document).on('click', ".contentTitleString", toggleContentBody);
3045 }).apply();
3146
3247
--- a/client/views/index.jade
+++ b/client/views/index.jade
@@ -1,12 +1,11 @@
11 extends layout
22
33 block content
4- .row
5- p grdc - RSS reader
6- .row
7- .span3
8- ul.unstyled
9- each feed in feeds
10- li: a.feedItem(href='#', feed-id=feed.feed_id) #{feed.title}
11- .span9
12- table.table.table-striped#contentsPane
4+ #contents-body
5+ .row
6+ .span3
7+ ul.unstyled
8+ each feed in feeds
9+ li: a.feedItem(href='#', feed-id=feed.feed_id) #{feed.title}
10+ .span9
11+ table.table#contentsPane
--- a/client/views/layout.jade
+++ b/client/views/layout.jade
@@ -9,4 +9,6 @@ html
99 script(src="http://code.jquery.com/jquery.js")
1010 script(src="/js/bootstrap.min.js")
1111 script(src="/js/grdc.js")
12+ #header
13+ p grdc - RSS reader
1214 block content
\ No newline at end of file