svnno****@sourc*****
svnno****@sourc*****
2008年 2月 1日 (金) 22:55:25 JST
Revision: 346 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=bbs2ch&view=rev&rev=346 Author: flyson Date: 2008-02-01 22:55:25 +0900 (Fri, 01 Feb 2008) Log Message: ----------- スレ一覧デザイン変更第一弾 Modified Paths: -------------- trunk/bbs2chreader/chrome/content/bbs2chreader/board/items.js trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.js trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.xul trunk/bbs2chreader/chrome/skin/classic/bbs2chreader/board-page.css -------------- next part -------------- Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/board/items.js =================================================================== --- trunk/bbs2chreader/chrome/content/bbs2chreader/board/items.js 2008-02-01 12:57:59 UTC (rev 345) +++ trunk/bbs2chreader/chrome/content/bbs2chreader/board/items.js 2008-02-01 13:55:25 UTC (rev 346) @@ -176,7 +176,7 @@ }, - refresh: function(aFilterLimit, aShowDownedLogs){ + refresh: function(aFilterLimit){ const STATUS_NEW = 5; const STATUS_UNREAD = 4; const STATUS_SUBSCRIBE = 3; @@ -215,27 +215,49 @@ var boardID = this._b2rService.threadUtils.getBoardID(this.url); + var database = b2rStorageService.database; + var subscribedOnly = ""; if(aFilterLimit==0){ aFilterLimit = 2000; subscribedOnly = "AND td.line_count > 1"; } - var database = b2rStorageService.database; - var sql = <> - SELECT - bs.ordinal + 1 AS number, - bs.dat_id AS dat_id, - bs.title AS title, - bs.line_count AS line_count, - IFNULL(td.line_count, 0) AS read, - MAX(IFNULL(bs.line_count - td.line_count, 0), 0) AS unread, - STRFTIME(?1, bs.dat_id, 'unixepoch', 'localtime') AS make_date - FROM board_subject AS bs LEFT OUTER JOIN thread_data AS td - ON bs.board_id=td.board_id AND bs.dat_id=td.dat_id - WHERE bs.board_id=?2 {subscribedOnly} - LIMIT ?3; - </>.toString().replace(/\t/g, ""); + var sql; + if(aFilterLimit == -1){ + sql = <> + SELECT + 0 AS number, + td.dat_id AS dat_id, + td.title AS title, + 0 AS line_count, + td.line_count AS read, + 0 AS unread, + STRFTIME(?1, td.dat_id, 'unixepoch', 'localtime') AS make_date + FROM thread_data AS td + WHERE board_id=?2 AND dat_id IN ( + SELECT dat_id FROM thread_data WHERE board_id=?2 + EXCEPT + SELECT dat_id FROM board_subject WHERE board_id=?2 + ) + LIMIT ?3; + </>.toString().replace(/\t/g, ""); + }else{ + sql = <> + SELECT + bs.ordinal + 1 AS number, + bs.dat_id AS dat_id, + bs.title AS title, + bs.line_count AS line_count, + IFNULL(td.line_count, 0) AS read, + MAX(IFNULL(bs.line_count - td.line_count, 0), 0) AS unread, + STRFTIME(?1, bs.dat_id, 'unixepoch', 'localtime') AS make_date + FROM board_subject AS bs LEFT OUTER JOIN thread_data AS td + ON bs.board_id=td.board_id AND bs.dat_id=td.dat_id + WHERE bs.board_id=?2 {subscribedOnly} + LIMIT ?3; + </>.toString().replace(/\t/g, ""); + } var statement = database.createStatement(sql); Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.js =================================================================== --- trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.js 2008-02-01 12:57:59 UTC (rev 345) +++ trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.js 2008-02-01 13:55:25 UTC (rev 346) @@ -76,15 +76,6 @@ gTreeSubject = document.getElementById("treeSubject"); loadPersist(); - var mlstFilterLimit = document.getElementById("mlstFilterLimit"); - var menuItems = mlstFilterLimit.menupopup.getElementsByTagName("menuitem"); - for(var i=0; menuItems.length; i++){ - if(mlstFilterLimit.value == menuItems[i].value){ - mlstFilterLimit.selectedIndex = i; - break; - } - } - // ツリーの偶数行に色をつける if(gBbs2chService.pref.getBoolPref("extensions.bbs2chreader.enable_tree_stripe2")) gTreeSubject.setAttribute("stripe", "true"); @@ -111,8 +102,9 @@ gTreeSubject.view = null; // checked の値を完全に覚えさせる - var chkShowDownedLogs = document.getElementById("chkShowDownedLogs"); - if(!chkShowDownedLogs.checked) chkShowDownedLogs.setAttribute("checked", "false"); + for(let [i, node] in Iterator(document.getElementsByAttribute("group", "boardFilter"))){ + if(!node.checked) node.setAttribute("checked", "false"); + } savePersist(); @@ -189,10 +181,13 @@ gFirstInitTreeSubject = false; } - var aFilterLimit = Number(document.getElementById("mlstFilterLimit").getAttribute("value")); - var showDownedLogs = document.getElementById("chkShowDownedLogs").getAttribute("checked") == "true"; - gBoardItems.refresh(aFilterLimit, showDownedLogs); + var filterLimit = -1; + for(let [i, node] in Iterator(document.getElementsByAttribute("group", "boardFilter"))){ + if(node.getAttribute("checked")=="true") filterLimit = Number(node.getAttribute("value")); + } + gBoardItems.refresh(filterLimit); + // ソート var sortCol = null; var sortProperty = ""; Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.xul =================================================================== --- trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.xul 2008-02-01 12:57:59 UTC (rev 345) +++ trunk/bbs2chreader/chrome/content/bbs2chreader/board/page.xul 2008-02-01 13:55:25 UTC (rev 346) @@ -69,34 +69,31 @@ <label id="lblMoveNewURL" class="text-link" value="移動" onclick="moveNewURL(event)"/> </deck> - - </hbox> </vbox> <toolbox> - <toolbar align="center"> - <label value="検索: "/> - <textbox id="txtSearch" value="" flex="2" type="autocomplete" + <toolbar style="padding:1px;"> + <spacer flex="1"/> + <toolbarbutton id="filterButton0" persist2="checked" class="tabbable" type="radio" label="すべて" + group="boardFilter" oncommand="setTimeout('initTreeSubject()',0)" value="2000"/> + <toolbarbutton id="filterButton1" persist2="checked" class="tabbable" type="radio" label="TOP 200" + group="boardFilter" oncommand="setTimeout('initTreeSubject()',0)" value="200"/> + <toolbarbutton id="filterButton2" persist2="checked" class="tabbable" type="radio" label="購読中" + group="boardFilter" oncommand="setTimeout('initTreeSubject()',0)" value="0"/> + <toolbarbutton id="filterButton3" persist2="checked" class="tabbable" type="radio" label="過去ログ" + group="boardFilter" oncommand="setTimeout('initTreeSubject()',0)" value="-1"/> + + <toolbarseparator/> + + <textbox id="txtSearch" value="" type="autocomplete" autocompletesearch="form-history" autocompletesearchparam="bbs2ch-board-history" onkeypress="searchTitle(event, this.value)"/> - <spacer flex="1"/> + <toolbarbutton id="searchButton" label="検索" + oncommand="searchTitle(event, document.getElementById('txtSearch').value)"/> - <label value="フィルタ: "/> - <menulist id="mlstFilterLimit" value="-1" persist2="value" oncommand="initTreeSubject()"> - <menupopup> - <menuitem label="すべて" value="2000"/> - <menuitem label="トップ 200" value="200"/> - <menuitem label="トップ 400" value="400"/> - <menuitem label="購読中" value="0"/> - </menupopup> - </menulist> - - <checkbox id="chkShowDownedLogs" label="過去ログ表示" - checked="true" persist2="checked" oncommand="initTreeSubject()"/> - <spacer class="small-margin"/> </toolbar> </toolbox> Modified: trunk/bbs2chreader/chrome/skin/classic/bbs2chreader/board-page.css =================================================================== --- trunk/bbs2chreader/chrome/skin/classic/bbs2chreader/board-page.css 2008-02-01 12:57:59 UTC (rev 345) +++ trunk/bbs2chreader/chrome/skin/classic/bbs2chreader/board-page.css 2008-02-01 13:55:25 UTC (rev 346) @@ -37,6 +37,16 @@ color: #BBB; } +#searchButton, +toolbarbutton[group="boardFilter"] { + margin: 1px; +} +#searchButton .toolbarbutton-icon, +toolbarbutton[group="boardFilter"] .toolbarbutton-icon { + -moz-margin-end: 0px; +} + + #treeSubject[stripe="true"] treechildren:-moz-tree-row(odd){ background-image: url("chrome://bbs2chreader/skin/tree-row-odd.png"); }