From fc0916037ffee1caeb7abef97f52854f405c32d9 Mon Sep 17 00:00:00 2001 From: mrroach9 Date: Sat, 16 Jun 2012 19:55:16 -0700 Subject: [PATCH] v0.2.1 updated. board navigation functions see readme for more details. --- bbs_UI.js | 36 ++++++++++++++++++++++++++++++++++++ bbs_view.js | 14 +++++++------- index.html | 8 ++++++-- readme.md | 20 ++++++++++++++++++-- style.css | 12 ++++++++++++ 5 files changed, 79 insertions(+), 11 deletions(-) diff --git a/bbs_UI.js b/bbs_UI.js index b81efdb..73482fe 100644 --- a/bbs_UI.js +++ b/bbs_UI.js @@ -34,6 +34,15 @@ $('.post-entry').live('click',function() { view_post($(this).attr('post-id'), UI_update, 'click'); }); + + + $('#last-page-button').click(function(){ + view_board(bbs_current_path.board.name, -1, -1, UI_update, 'click'); + }); + + $('#first-page-button').click(function(){ + view_board(bbs_current_path.board.name, 1, -1, UI_update, 'click'); + }); $('#next-page-button').click(function(){ view_board_next_page(UI_update); @@ -42,6 +51,23 @@ $('#prev-page-button').click(function(){ view_board_prev_page(UI_update); }); + + $('#jump-to-post-button').click(function(){ + var post_id = $('#jump-to-post-input').val(); + if (post_id != null && post_id != '') { + view_board(bbs_current_path.board.name, post_id, -1, UI_update, 'next'); + } + }); + + $('#jump-to-post-input').keypress(function(event) { + if ( event.which == 13 ) { + var post_id = $(this).val(); + if (post_id != null && post_id != '') { + view_board(bbs_current_path.board.name, post_id, -1, UI_update, 'next'); + } + } + }); + $('#next-post-button').click(function(){ view_next_post(UI_update); @@ -228,6 +254,16 @@ function UI_maindiv_update(path, content) { var entryStr = UI_generate_post_entry(content[i]); $('#board-table-body').append(entryStr); } + + //Easter Eggs + if (path.board.name == 'e_note') { + $('#jump-to-post-input').attr('value', '23'); + } else if (path.board.name == 'test') { + $('#jump-to-post-input').attr('value', '1481'); + } else { + $('#jump-to-post-input').attr('value', ''); + } + $('#board-table').show(); } else if (path.path_level == 3) { $('#post-view-area').empty(); diff --git a/bbs_view.js b/bbs_view.js index 398f8eb..ea479c0 100644 --- a/bbs_view.js +++ b/bbs_view.js @@ -79,8 +79,10 @@ function view_board(board_name, start, end, callback_func, source){ cache: false }; - if (start <= 0 || end <= 0 || end < start || - end - start > bbs_max_post_count) { + if (start <= 0 || end - start > bbs_max_post_count) { + request_settings.data.count = bbs_post_count; + } else if (end < 0) { + request_settings.data.start = start; request_settings.data.count = bbs_post_count; } else { request_settings.data.start = start; @@ -148,8 +150,7 @@ function view_board_next_page(callback_func){ } var name = bbs_current_path.board.name; var newStart = bbs_current_path.board.end + 1; - var newEnd = newStart + bbs_post_count - 1; - view_board(name, newStart, newEnd, callback_func, 'next'); + view_board(name, newStart, -1, callback_func, 'next'); } function view_board_prev_page(callback_func){ @@ -157,9 +158,8 @@ function view_board_prev_page(callback_func){ return; } var name = bbs_current_path.board.name; - var newEnd = bbs_current_path.board.start - 1; - var newStart = newEnd - bbs_post_count + 1; - view_board(name, newStart, newEnd, callback_func, 'prev'); + var newStart = bbs_current_path.board.start - bbs_post_count; + view_board(name, newStart, -1, callback_func, 'prev'); } /** Source marks the way you come to this function, which diff --git a/index.html b/index.html index db5e648..8465553 100644 --- a/index.html +++ b/index.html @@ -170,10 +170,14 @@

您尚未登录

- + - + + + 跳转至贴 + +
diff --git a/readme.md b/readme.md index 7165b46..525c279 100644 --- a/readme.md +++ b/readme.md @@ -32,9 +32,11 @@ WE WILL NEVER BE RESPONSIBLE FOR IE USERS!!! ##Development Plan -* Displaying posts in monospaced font. +* Displaying posts in monospaced font. (done in v0.2.1) -* "First Page" and "Last Page" buttons in viewing boards. Same topic navigation buttons in viewing posts. +* "First Page" and "Last Page" buttons in viewing boards. (done in v0.2.1) + +* Same topic navigation buttons in viewing posts. * Notification system for info, warning and errors.(done in v0.1.2) @@ -60,6 +62,20 @@ WE WILL NEVER BE RESPONSIBLE FOR IE USERS!!! ##Change Logs +####Version 0.2.1 +Release date: 06/16/2012 +Cumulative update. Various modifications and new functional on UI. + +* Monospaced font is now supported in reading posts. + +* Notification displaying time decreases from 3s to 2s. User can click anywhere on the notif. bar besides the close button to close it immediately. + +* Decreased the width of entire container from >1100px downto 960px, making it looks better under low-resolutional screens. + +* A bug from pybbs is fixed, which used to cause exceptions when reading posts containing 0x80 chars. + +* First page, last page, and jump to certain position in board viewing is now supported. + ####Version 0.2.0 Release date: 06/15/2012 diff --git a/style.css b/style.css index a24b046..fc58b26 100644 --- a/style.css +++ b/style.css @@ -48,6 +48,10 @@ tr.post-entry { text-align: center; } +#board-buttons.bottom-button-bar { + margin-left : 140px; +} + .post-view-area { margin-left: 10px; margin-bottom: 10px; @@ -108,6 +112,14 @@ p#notification-content { width : 30px; } +.bottom-button-bar .short-text { + width : 40px; +} + +.jump-to-post { + margin-left : 20px; +} + .radiobox { display: inline; margin-left : 10px;