File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,12 +33,13 @@ def self.unread_since_id(since_id)
3333 end
3434
3535 def self . read ( page = 1 )
36- Story . where ( is_read : true ) . order ( "published desc" ) . page ( page ) . per_page ( 15 )
36+ Story . where ( is_read : true )
37+ . order ( "published desc" ) . page ( page ) . per_page ( 20 )
3738 end
3839
3940 def self . starred ( page = 1 )
4041 Story . where ( is_starred : true )
41- . order ( "published desc" ) . page ( page ) . per_page ( 15 )
42+ . order ( "published desc" ) . page ( page ) . per_page ( 20 )
4243 end
4344
4445 def self . read_count
Original file line number Diff line number Diff line change 1212
1313 < div id ="pagination ">
1414 <% if @read_stories . previous_page %>
15- < a href ="?page= <%= @read_stories . previous_page %> "> <%= t ( 'archive.previous' ) %> </ a >
15+ < a id =" prev_page " href ="?page= <%= @read_stories . previous_page %> "> <%= t ( 'archive.previous' ) %> </ a >
1616 <% end %>
1717
1818 <% if @read_stories . total_pages > 1 %>
1919 <%= @read_stories . current_page %> <%= t ( 'archive.of' ) %> <%= @read_stories . total_pages %>
2020 <% end %>
2121
2222 <% if @read_stories . next_page %>
23- < a href ="?page= <%= @read_stories . next_page %> "> <%= t ( 'archive.next' ) %> </ a >
23+ < a id =" next_page " href ="?page= <%= @read_stories . next_page %> "> <%= t ( 'archive.next' ) %> </ a >
2424 <% end %>
2525 </ div >
26+
27+ < script >
28+ $ ( document ) . ready ( function ( ) {
29+ var stripQuerystring = function ( full_url ) {
30+ return full_url . split ( "?" ) [ 0 ] ;
31+ } ;
32+
33+ Mousetrap . bind ( "left" , function ( ) {
34+ var pageNumber = $ ( "#prev_page" ) . attr ( "href" ) ;
35+
36+ if ( pageNumber )
37+ location . href = stripQuerystring ( location . href ) + pageNumber ;
38+ } ) ;
39+
40+ Mousetrap . bind ( "right" , function ( ) {
41+ var pageNumber = $ ( "#next_page" ) . attr ( "href" ) ;
42+
43+ if ( pageNumber )
44+ location . href = stripQuerystring ( location . href ) + pageNumber ;
45+ } ) ;
46+ } ) ;
47+ </ script >
2648<% else %>
2749 < div id ="sorry ">
2850 < p > <%= t ( 'archive.sorry' ) %> </ p >
Original file line number Diff line number Diff line change 1414 < li class ="blank "> </ li >
1515 < li > < kbd > shift</ kbd > +< kbd > a</ kbd > : <%= t ( 'partials.shortcuts.keys.shifta' ) %> </ li >
1616 < li > < kbd > r</ kbd > : <%= t ( 'partials.shortcuts.keys.r' ) %> </ li >
17+ < li class ="blank "> </ li >
18+ < li > < kbd > ←</ kbd > : <%= t ( 'partials.shortcuts.keys.left' ) %> </ li >
19+ < li > < kbd > →</ kbd > : <%= t ( 'partials.shortcuts.keys.right' ) %> </ li >
1720 </ ul >
1821 </ div >
1922</ div >
Original file line number Diff line number Diff line change 1212
1313 < div id ="pagination ">
1414 <% if @starred_stories . previous_page %>
15- < a href ="?page= <%= @starred_stories . previous_page %> "> <%= t ( 'starred.previous' ) %> </ a >
15+ < a id =" prev_page " href ="?page= <%= @starred_stories . previous_page %> "> <%= t ( 'starred.previous' ) %> </ a >
1616 <% end %>
1717
1818 <% if @starred_stories . total_pages > 1 %>
1919 <%= @starred_stories . current_page %> <%= t ( 'starred.of' ) %> <%= @starred_stories . total_pages %>
2020 <% end %>
2121
2222 <% if @starred_stories . next_page %>
23- < a href ="?page= <%= @starred_stories . next_page %> "> <%= t ( 'starred.next' ) %> </ a >
23+ < a id =" next_page " href ="?page= <%= @starred_stories . next_page %> "> <%= t ( 'starred.next' ) %> </ a >
2424 <% end %>
2525 </ div >
26+
27+ < script >
28+ $ ( document ) . ready ( function ( ) {
29+ var stripQuerystring = function ( full_url ) {
30+ return full_url . split ( "?" ) [ 0 ] ;
31+ } ;
32+
33+ Mousetrap . bind ( "left" , function ( ) {
34+ var pageNumber = $ ( "#prev_page" ) . attr ( "href" ) ;
35+
36+ if ( pageNumber )
37+ location . href = stripQuerystring ( location . href ) + pageNumber ;
38+ } ) ;
39+
40+ Mousetrap . bind ( "right" , function ( ) {
41+ var pageNumber = $ ( "#next_page" ) . attr ( "href" ) ;
42+
43+ if ( pageNumber )
44+ location . href = stripQuerystring ( location . href ) + pageNumber ;
45+ } ) ;
46+ } ) ;
47+ </ script >
48+
2649<% else %>
2750 < div id ="sorry ">
2851 < p > <%= t ( 'starred.sorry' ) %> </ p >
Original file line number Diff line number Diff line change 101101 r : Refresh
102102 shifta : Mark all as read
103103 v : Go to story URL
104+ left : Previous page
105+ right : Next page
104106 title : Keyboard shortcuts
105107 zen :
106108 archive : view all items
You can’t perform that action at this time.
0 commit comments