diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2012-08-30 19:31:09 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2012-09-01 00:31:38 +0200 |
commit | be192931ce450ea6c5310bf858517ef391a2a2b3 (patch) | |
tree | 2a2937e9fd72c3d7b1291b3db9bd4e4f4e47993b /js/news.js | |
parent | f19d8f0e1399a7da1beff6df5282a0d8991d1852 (diff) |
merged
Diffstat (limited to 'js/news.js')
-rw-r--r-- | js/news.js | 50 |
1 files changed, 3 insertions, 47 deletions
diff --git a/js/news.js b/js/news.js index f45d9c135..79e33b3ec 100644 --- a/js/news.js +++ b/js/news.js @@ -652,6 +652,7 @@ function bindItemEventListeners(){ } +<<<<<<< HEAD $(document).ready(function(){ News.Feed.activeFeedId = parseInt($('#rightcontent').data('id')); $('#feeds .subscriptions,#feeds .starred').click(function() { @@ -684,54 +685,9 @@ $(document).ready(function(){ alert(e); } }); +======= +>>>>>>> reduced html in menu, restyled it, used new menu.js to bind events on menu and provide methods, made drag and drop work - setupFeedList(); - - News.Feed.updateAll(); - var updateInterval = 200000; //how often the feeds should update (in msec) - setInterval('News.Feed.updateAll()', updateInterval); - - bindItemEventListeners(); - - // filter for newest or all items - $('#view').click(function(){ - var term; - if($(this).hasClass('show_all')){ - term = 'unread'; - $(this).addClass('show_unread').removeClass('show_all'); - } else { - term = 'all'; - $(this).addClass('show_all').removeClass('show_unread'); - } - News.Feed.filter(term); - }); - - // mark items whose title was hid under the top edge as read - // when the bottom is reached, mark all items as read - $('#feed_items').scroll(function(){ - var boxHeight = $(this).height(); - var scrollHeight = $(this).prop('scrollHeight'); - var scrolled = $(this).scrollTop() + boxHeight; - var scrollArea = this; - $(this).children('ul').children('.feed_item:not(.read)').each(function(){ - var item = this; - var itemOffset = $(this).position().top; - if(itemOffset <= 0 || scrolled >= scrollHeight){ - // wait and check if the item is still under the top edge - setTimeout(function(){ markItemAsRead(scrollArea, item);}, 1000); - } - }) - - }); - - $('#feed_items').scrollTop(0); - - $(document).keydown(function(e) { - if ((e.keyCode || e.which) == 74) { // 'j' key shortcut - - } - }); -}); /** * Marks an item as read which is called by the timeout |