o2on svn commit
o2on-****@lists*****
2008年 8月 2日 (土) 18:28:47 JST
Revision: 114 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=114 Author: osa_p Date: 2008-08-02 18:28:47 +0900 (Sat, 02 Aug 2008) Log Message: ----------- ã¹ã¬ããæ¤ç´¢ç»é¢ã§ããã§ãã¯ããã¯ã¹ã使ã£ã¦è¤æ°ã®ã¹ã¬ããã«å¯¾ãã¦å¦çããã¤ã³ã¿ã¼ãã§ã¤ã¹ã追å ã ä¸æ¸ãæ´æ°å¾ãã©ã¦ã¶ã®ãã£ãã·ã¥ãã¯ãªã¢ããªãã¨ãå¤ão2on.jsãåç §ããã¦ãã¾ãã®ãå¦çã«å¤±æãã¾ããï¼è½ã¡ããã¯ããªãï¼ Modified Paths: -------------- branches/BRANCH_0043/o2on/admin/o2on.js branches/BRANCH_0043/o2on/admin/query.xsl branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h Modified: branches/BRANCH_0043/o2on/admin/o2on.js =================================================================== --- branches/BRANCH_0043/o2on/admin/o2on.js 2008-07-31 04:24:24 UTC (rev 113) +++ branches/BRANCH_0043/o2on/admin/o2on.js 2008-08-02 09:28:47 UTC (rev 114) @@ -355,22 +355,49 @@ // --------------------------------------------------------------------------- function deleteQuery(hash) { + if (hash == "") hash = getCheckThread(); + if (hash == "") return; document.d.act.value = "delete"; - document.d.hash.value = hash; + document.d.hash.value = hash; document.d.submit(); } function activateQuery(hash) { + if (hash == "") hash = getCheckThread(); + if (hash == "") return; document.d.act.value = "activate"; - document.d.hash.value = hash; + document.d.hash.value = hash; document.d.submit(); } function deactivateQuery(hash) { + if (hash == "") hash = getCheckThread(); + if (hash == "") return; document.d.act.value = "deactivate"; - document.d.hash.value = hash; + document.d.hash.value = hash; document.d.submit(); } +function checkAllThread(flag) +{ + elms = document.getElementsByTagName("input"); + for (i = 0; i < elms.length; i++) { + if (elms[i].type == "checkbox" && elms[i].name == "thread") + elms[i].checked = flag; + } +} +function getCheckThread() +{ + var hash = ""; + elms = document.getElementsByTagName("input"); + for (i = 0; i < elms.length; i++) { + if (elms[i].type == "checkbox" && elms[i].name == "thread" && elms[i].checked == true) { + if (hash != '') hash = hash + ','; + hash = hash + elms[i].value; + } + } + if (hash == "") alert("対象ãé¸æãã¦ãã ããã"); + return hash; +} // --------------------------------------------------------------------------- // ã¡ãã»ã³ã¸ã£ã¼ç»é¢ç¨ Modified: branches/BRANCH_0043/o2on/admin/query.xsl =================================================================== --- branches/BRANCH_0043/o2on/admin/query.xsl 2008-07-31 04:24:24 UTC (rev 113) +++ branches/BRANCH_0043/o2on/admin/query.xsl 2008-08-02 09:28:47 UTC (rev 114) @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <xsl:template match="/"> - <xsl:apply-templates select="keys"/> - </xsl:template> - <xsl:template match="keys"> - <div id="body" class="body"> + <xsl:template match="/"> + <xsl:apply-templates select="keys"/> + </xsl:template> + <xsl:template match="keys"> + <div id="body" class="body"> <div class="category"> <form name="d" method="POST" action="/xml/query"> ã¹ã¬ããæ¤ç´¢ @@ -21,76 +21,82 @@ <input type="submit" class="btn" style="width:80px" value="ç»é²"/> <input type="hidden" name="act" value="add"/> <input type="hidden" name="hash"/> - </form> + </form> </div> <div class="infomessage {info/message_type}"> <xsl:value-of select="info/message"/> </div> - <table width="100%"> - <tr> - <td class="layout" valign="bottom" width="40%"> - <span> - <xsl:value-of select="info/count"/> - </span> + <table width="100%"> + <tr> + <td class="layout" valign="bottom" width="40%"> + <span> + <xsl:value-of select="info/count"/>ã¹ã¬ããã + </span> + <input type="button" value="å ¨" onClick="checkAllThread(true)"/> + <input type="button" value="解" onClick="checkAllThread(false)"/> + <input type="button" value="ç¡å¹ã«ãã" onClick="deactivateQuery('')"/> + <input type="button" value="æå¹ã«ãã" onClick="activateQuery('')"/> + <input type="button" value="åé¤" onClick="deleteQuery('')"/> </td> <td class="layout" width="20%"> - <input type="button" class="btn" value="å表示" onClick="Reload()"/> + <input type="button" class="btn" value="å表示" onClick="Reload()"/> </td> <td class="layout" width="40%" align="right"> </td> - </tr> - </table> - <table width="100%"> - <tr> - <th></th> - <th class="sort" onClick="Sort('date','text')">è£å®æ¥æ</th> - <th class="sort" onClick="Sort('size','number')">ææsize</th> - <th class="sort" onClick="Sort('title','text')">ã¿ã¤ãã« / ã¡ã¢</th> - <th class="sort" onClick="Sort('url','text')">URL / Hash</th> - </tr> - <xsl:apply-templates select="key"> + </tr> + </table> + <table width="100%"> + <tr> + <th></th> + <th class="sort" onClick="Sort('date','text')">è£å®æ¥æ</th> + <th class="sort" onClick="Sort('size','number')">ææsize</th> + <th class="sort" onClick="Sort('title','text')">ã¿ã¤ãã« / ã¡ã¢</th> + <th class="sort" onClick="Sort('url','text')">URL / Hash</th> + </tr> + <xsl:apply-templates select="key"> <xsl:sort select="SORTKEY" data-type="SORTTYPE" order="SORTORDER"/> </xsl:apply-templates> - </table> + </table> </div> - </xsl:template> - <xsl:template match="key"> - <xsl:param name="limit" select="LIMIT"/> - <tr> - <td class="{enable}"> + </xsl:template> + <xsl:template match="key"> + <xsl:param name="limit" select="LIMIT"/> + <tr> + <td class="{enable}"> + <input type="checkbox" class="checkbox btn" name="thread" value="{hash}"/> <xsl:if test="enable = 'enable'"> - <input type="button" value="ç¡å¹ã«ãã" onClick="deactivateQuery('{hash}')"/> - </xsl:if> + <input type="button" value="ç¡å¹ã«ãã" onClick="deactivateQuery('{hash}')"/> + </xsl:if> <xsl:if test="enable = 'disable'"> - <input type="button" value="æå¹ã«ãã" onClick="activateQuery('{hash}')"/> - </xsl:if> - <input type="button" value="åé¤" onClick="deleteQuery('{hash}')"/> - </td> - <td class="{enable} C"> - <xsl:value-of select="date"/> - </td> - <td class="{enable} R"> - <xsl:value-of select="format-number(size, '###,###,###,###')"/> - </td> - <td class="{enable}" valign="top"> - <xsl:if test="size and size != 0 and title and title != ''"> + <input type="button" value="æå¹ã«ãã" onClick="activateQuery('{hash}')"/> + </xsl:if> + <input type="button" value="åé¤" onClick="deleteQuery('{hash}')"/> + </td> + <td class="{enable} C"> + <xsl:value-of select="date"/> + </td> + <td class="{enable} R"> + <xsl:value-of select="format-number(size, '###,###,###,###')"/> + </td> + <td class="{enable}" valign="top"> + <xsl:if test="size and size != 0 and title and title != ''"> <a href="javascript:openDat('{hash}')"> - <xsl:value-of select="title"/> - </a> - </xsl:if> - <xsl:if test="not(size) or size = 0 or not(title) or title = ''"> - <xsl:value-of select="title"/> - </xsl:if> - <br/> - <xsl:value-of select="note"/> - </td> - <td class="{enable}"> - <span onClick="selectText(this)"> - <xsl:value-of select="url"/> - </span> - <br/> - <xsl:value-of select="hash"/> - </td> - </tr> - </xsl:template> + <xsl:value-of select="title"/> + </a> + </xsl:if> + <xsl:if test="not(size) or size = 0 or not(title) or title = ''"> + <xsl:value-of select="title"/> + </xsl:if> + <br/> + <xsl:value-of select="note"/> + </td> + <td class="{enable}"> + <span onClick="selectText(this)"> + <xsl:value-of select="url"/> + </span> + <br/> + <xsl:value-of select="hash"/> + </td> + </tr> + </xsl:template> </xsl:stylesheet> Modified: branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h 2008-07-31 04:24:24 UTC (rev 113) +++ branches/BRANCH_0043/o2on/src.o2on/O2Server_HTTP_Admin.h 2008-08-02 09:28:47 UTC (rev 114) @@ -636,12 +636,18 @@ // remove query it = hdr->queries.find("hash"); if (it != hdr->queries.end()) { - if (it->second.size() >= HASHSIZE*2) { - hashT hash; - hash.assign(it->second.c_str(), it->second.size()); - if (QueryDB->DeleteKey(hash)) { - msg = L"íµÜµ½"; - QueryDB->Save(Profile->GetQueryFilePath()); + strarray hasharray; + // comma separate + if (split(it->second.c_str(), ",", hasharray ) > 0) { + for (uint hashidx = 0; hashidx < hasharray.size(); hashidx++) { + if (hasharray[ hashidx ].size() >= HASHSIZE*2) { + hashT hash; + hash.assign( hasharray[ hashidx ].c_str(), hasharray[ hashidx ].size() ); + if (QueryDB->DeleteKey(hash)) { + msg = L"íµÜµ½"; + QueryDB->Save(Profile->GetQueryFilePath()); + } + } } } } @@ -650,12 +656,18 @@ // activate query it = hdr->queries.find("hash"); if (it != hdr->queries.end()) { - if (it->second.size() >= HASHSIZE*2) { - hashT hash; - hash.assign(it->second.c_str(), it->second.size()); - if (QueryDB->SetEnable(hash,true)) { - msg = L"Løɵܵ½"; - QueryDB->Save(Profile->GetQueryFilePath()); + strarray hasharray; + // comma separate + if (split(it->second.c_str(), ",", hasharray ) > 0) { + for (uint hashidx = 0; hashidx < hasharray.size(); hashidx++) { + if (hasharray[ hashidx ].size() >= HASHSIZE * 2) { + hashT hash; + hash.assign( hasharray[ hashidx ].c_str(), hasharray[ hashidx ].size() ); + if (QueryDB->SetEnable(hash,true)) { + msg = L"Løɵܵ½"; + QueryDB->Save(Profile->GetQueryFilePath()); + } + } } } } @@ -664,12 +676,18 @@ // deactivate query it = hdr->queries.find("hash"); if (it != hdr->queries.end()) { - if (it->second.size() >= HASHSIZE*2) { - hashT hash; - hash.assign(it->second.c_str(), it->second.size()); - if (QueryDB->SetEnable(hash,false)) { - msg = L"³øɵܵ½"; - QueryDB->Save(Profile->GetQueryFilePath()); + strarray hasharray; + // comma separate + if (split(it->second.c_str(), ",", hasharray ) > 0) { + for (uint hashidx = 0; hashidx < hasharray.size(); hashidx++) { + if (hasharray[ hashidx ].size() >= HASHSIZE * 2) { + hashT hash; + hash.assign( hasharray[ hashidx ].c_str(), hasharray[ hashidx ].size() ); + if (QueryDB->SetEnable(hash,false)) { + msg = L"³øɵܵ½"; + QueryDB->Save(Profile->GetQueryFilePath()); + } + } } } }