svnno****@sourc*****
svnno****@sourc*****
2010年 1月 27日 (水) 20:20:41 JST
Revision: 819 http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=819 Author: akid Date: 2010-01-27 20:20:41 +0900 (Wed, 27 Jan 2010) Log Message: ----------- ã¹ã¬ã®åé¤ãªã³ã¯ã®JavaScriptåä½ãéåæã«å¤æ´ããã Modified Paths: -------------- p2/trunk/js/basic.js p2/trunk/js/delelog.js p2/trunk/lib/read_header.inc.php p2/trunk/lib/sb_header.inc.php p2/trunk/lib/sb_print.inc.php p2/trunk/read_new.php p2/trunk/read_new_i.php -------------- next part -------------- Modified: p2/trunk/js/basic.js =================================================================== --- p2/trunk/js/basic.js 2010-01-27 08:56:29 UTC (rev 818) +++ p2/trunk/js/basic.js 2010-01-27 11:20:41 UTC (rev 819) @@ -62,23 +62,39 @@ return xmlHttpObj; } -// xmlHttpObj ÆurlðnµÄAÊeLXgðæ¾·éB¯úB -// @param nc string|false wè·éƱêðL[Ƶ½LbV ñð̽ßÌ_~[NG[ªÇÁ³êé -function getResponseTextHttp(xmlHttpObj, url, nc) +// xmlHttpObj ÆurlðnµÄAÊeLXgðæ¾·éB +// @param nc string|false|void wè·éƱêðL[Ƶ½LbV ñð̽ßÌ_~[NG[ªÇÁ³êé +function getResponseTextHttp(xmlHttpObj, url, nc, async, func) { if (nc) { var now = new Date(); url = url + '&' + nc + '=' + now.getTime(); // LbV ñðp } - xmlHttpObj.open('GET', url, false); + xmlHttpObj.open('GET', url, async); xmlHttpObj.send(null); - if (xmlHttpObj.readyState == 4) { - if (xmlHttpObj.status == 200) { - return xmlHttpObj.responseText.replace(/^<\?xml .+?\?>\n?/, ''); - } else { - // rt = '<em>HTTP Error:<br />' + req.status + ' ' + req.statusText + '</em>'; + if (async) { + if (func) { + if (isSafari()) { + xmlHttpObj.onload = function(){ func(xmlHttpObj); } + } else { + xmlHttpObj.onreadystatechange = function() { + if (xmlHttpObj.readyState == 4 && xmlHttpObj.status == 200) { + func(xmlHttpObj); + } + } + } + return; } + return; + } else { + if (xmlHttpObj.readyState == 4) { + if (xmlHttpObj.status == 200) { + return xmlHttpObj.responseText.replace(/^<\?xml .+?\?>\n?/, ''); + } else { + // rt = '<em>HTTP Error:<br />' + req.status + ' ' + req.statusText + '</em>'; + } + } } return false; } Modified: p2/trunk/js/delelog.js =================================================================== --- p2/trunk/js/delelog.js 2010-01-27 08:56:29 UTC (rev 818) +++ p2/trunk/js/delelog.js 2010-01-27 11:20:41 UTC (rev 819) @@ -7,44 +7,41 @@ // read.phpÅÍAy[WÌÇÝݪ®¹µÄ¢È¯êÎAÈÉàµÈ¢ // iread.php ÍÇÝÝ®¹ÉidxL^ª¶¬³êé½ßj if ((page == 'read') && !gIsPageLoaded) { - return false; + return true; } - + var xmlHttpObj = getXmlHttp(); - + if (!xmlHttpObj) { // alert("Error: XMLHTTP ÊMIuWFNgÌì¬É¸sµÜµ½B") ; // XMLHTTPiÆ obj.parentNode.innerHTMLj É¢ÎÈç¬Å infourl = 'info.php?' + tquery + '&popup=2&dele=true'; - return !openSubWin(infourl,info_pop_width,info_pop_height,0,0); + return openSubWin(infourl,info_pop_width,info_pop_height,0,0); } var url = 'httpcmd.php?' + tquery + '&cmd=delelog'; // XNvgÆAR}hwè - var res = getResponseTextHttp(xmlHttpObj, url, 'nc'); - var rmsg = ""; - if (res) { + var func = function(xobj){ + var rmsg = ''; + var res = xmlHttpObj.responseText.replace(/^<\?xml .+?\?>\n?/, '');; if (res == '1') { - if (page == 'subject') { - rmsg = 'í'; - } else { - rmsg = '®¹'; - } + rmsg = (page == 'subject') ? 'í' : '®¹'; } else if (res == '2') { - if (page == 'subject') { - rmsg = '³'; - } else { - rmsg = '®¹'; - } + rmsg = (page == 'subject') ? '³' : '®¹'; } if (rmsg) { + // Gray() Í IE ActiveXp if (page == 'read_new') { - obj.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.filter = 'Gray()'; // IE ActiveXp + obj.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.filter = 'Gray()'; } else if (page == 'read') { - document.body.style.filter = 'Gray()'; // IE ActiveXp + document.body.style.filter = 'Gray()'; } obj.parentNode.innerHTML = rmsg; } - } - return false; + }; + + obj.style.color = 'gray'; + getResponseTextHttp(xmlHttpObj, url, 'nc', true, func); + + return true; } Modified: p2/trunk/lib/read_header.inc.php =================================================================== --- p2/trunk/lib/read_header.inc.php 2010-01-27 08:56:29 UTC (rev 818) +++ p2/trunk/lib/read_header.inc.php 2010-01-27 11:20:41 UTC (rev 819) @@ -225,7 +225,7 @@ $_conf['pc_accesskey']['dele'] ), 'target' => 'info', - 'onclick' => "return deleLog('{$deleLogJs_query_es}', {$STYLE['info_pop_size']}, 'read', this);" + 'onclick' => "return !deleLog('{$deleLogJs_query_es}', {$STYLE['info_pop_size']}, 'read', this);" ) ); @@ -294,11 +294,11 @@ ?> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> - <script type="text/javascript" src="js/basic.js?v=20090502"></script> + <script type="text/javascript" src="js/basic.js?v=20100127"></script> <script type="text/javascript" src="js/respopup.js?v=20061206"></script> <script type="text/javascript" src="js/htmlpopup.js?v=20061206"></script> <script type="text/javascript" src="js/setfavjs.js?v=20090428"></script> - <script type="text/javascript" src="js/delelog.js?v=20061206"></script> + <script type="text/javascript" src="js/delelog.js?v=20100127"></script> <script type="text/javascript" src="js/showhide.js?v=20090416"></script> <?php if (!UA::isIPhoneGroup()) { Modified: p2/trunk/lib/sb_header.inc.php =================================================================== --- p2/trunk/lib/sb_header.inc.php 2010-01-27 08:56:29 UTC (rev 818) +++ p2/trunk/lib/sb_header.inc.php 2010-01-27 11:20:41 UTC (rev 819) @@ -175,9 +175,9 @@ ?> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> - <script type="text/javascript" src="js/basic.js?v=20090429"></script> + <script type="text/javascript" src="js/basic.js?v=20100127"></script> <script type="text/javascript" src="js/setfavjs.js?v=20090428"></script> - <script type="text/javascript" src="js/delelog.js?v=20061206"></script> + <script type="text/javascript" src="js/delelog.js?v=20100127"></script> <script language="JavaScript"> <!-- function setWinTitle(){ Modified: p2/trunk/lib/sb_print.inc.php =================================================================== --- p2/trunk/lib/sb_print.inc.php 2010-01-27 08:56:29 UTC (rev 818) +++ p2/trunk/lib/sb_print.inc.php 2010-01-27 11:20:41 UTC (rev 819) @@ -197,7 +197,7 @@ if ($aThread->isKitoku()) { // $ttitle_en_q Í߸Ȫ - $onclick_at = " onClick=\"return deleLog('host={$aThread->host}{$bbs_q}{$key_q}{$sid_q}', {$STYLE['info_pop_size']}, 'subject', this);\""; + $onclick_at = " onClick=\"return !deleLog('host={$aThread->host}{$bbs_q}{$key_q}{$sid_q}', {$STYLE['info_pop_size']}, 'subject', this);\""; $title_at = ' title="NbN·éÆOí"'; $unum_ht_c = "<a class=\"un\" href=\"{$_conf['subject_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$spmode_q}&dele=1\" target=\"_self\"{$onclick_at}{$title_at}>{$aThread->unum}</a>"; @@ -235,7 +235,7 @@ array( 'id' => "un{$i}", 'class' => 'un_a', 'target' => '_self', 'title' => 'NbN·éÆOí', 'onClick' => sprintf( - "return deleLog('%s', %s, 'subject', this);", + "return !deleLog('%s', %s, 'subject', this);", str_replace("'", "\\'", $dele_log_q), $STYLE['info_pop_size'] ) ) @@ -247,7 +247,7 @@ // subject.txtÉÈ¢ if (!$aThread->isonline) { // JavaScriptÅÌmF_CAO è - $unum_ht_c = "<a class=\"un_n\" href=\"{$_conf['subject_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$spmode_q}&dele=true\" target=\"_self\" onClick=\"if (!window.confirm('OðíµÜ·©H')) {return false;} return deleLog('host={$aThread->host}{$bbs_q}{$key_q}{$sid_q}', {$STYLE['info_pop_size']}, 'subject', this)\"{$title_at}>-</a>"; + $unum_ht_c = "<a class=\"un_n\" href=\"{$_conf['subject_php']}?host={$aThread->host}{$bbs_q}{$key_q}{$spmode_q}&dele=true\" target=\"_self\" onClick=\"if (!window.confirm('OðíµÜ·©H')) {return false;} return !deleLog('host={$aThread->host}{$bbs_q}{$key_q}{$sid_q}', {$STYLE['info_pop_size']}, 'subject', this)\"{$title_at}>-</a>"; } } Modified: p2/trunk/read_new.php =================================================================== --- p2/trunk/read_new.php 2010-01-27 08:56:29 UTC (rev 818) +++ p2/trunk/read_new.php 2010-01-27 11:20:41 UTC (rev 819) @@ -123,11 +123,11 @@ P2View::printIncludeCssHtml('style'); P2View::printIncludeCssHtml('read'); ?> - <script type="text/javascript" src="js/basic.js?v=20090429"></script> + <script type="text/javascript" src="js/basic.js?v=20100127"></script> <script type="text/javascript" src="js/respopup.js?v=20061206"></script> <script type="text/javascript" src="js/htmlpopup.js?v=20061206"></script> <script type="text/javascript" src="js/setfavjs.js?v=20090428"></script> - <script type="text/javascript" src="js/delelog.js?v=20061206"></script> + <script type="text/javascript" src="js/delelog.js?v=20100127"></script> <script type="text/javascript" src="js/showhide.js?v=20090416"></script> <script type="text/javascript" src="./js/yui-ext/yui.js"></script> @@ -506,7 +506,7 @@ <span class="setfav" style="white-space: nowrap;"><a href="{$info_url_hs}{$setfav_q}{$sid_q}" target="info" onClick="return setFavJs('{$js_q_hs}', '{$favvalue}', {$STYLE['info_pop_size']}, 'read_new', this);" title="{$favtitle}">¨CÉ{$favmark}</a></span> - <span style="white-space: nowrap;"><a href="{$info_url_hs}&dele=1" target="info" onClick="return deleLog('{$js_q_hs}', {$STYLE['info_pop_size']}, 'read_new', this);" title="Oðí·éB©®Åu¨CÉXvua°v©çàOêÜ·B">{$dele_st}</a></span> + <span style="white-space: nowrap;"><a href="{$info_url_hs}&dele=1" target="info" onClick="return !deleLog('{$js_q_hs}', {$STYLE['info_pop_size']}, 'read_new', this);" title="Oðí·éB©®Åu¨CÉXvua°v©çàOêÜ·B">{$dele_st}</a></span> <!-- <a style="white-space: nowrap;" href="{$info_url_hs}&taborn=2" target="info" onClick="return !openSubWin('{$info_url_hs}&popup=2&taborn=2{$sid_q}',{$STYLE['info_pop_size']},0,0)" title="XbhÌ Ú[ñóÔðgO·é"> Úñ</a> --> Modified: p2/trunk/read_new_i.php =================================================================== --- p2/trunk/read_new_i.php 2010-01-27 08:56:29 UTC (rev 818) +++ p2/trunk/read_new_i.php 2010-01-27 11:20:41 UTC (rev 819) @@ -148,10 +148,10 @@ EOHEADER; /* - <script type="text/javascript" src="js/basic.js?v=20090429"></script> + <script type="text/javascript" src="js/basic.js?v=20100127"></script> <script type="text/javascript" src="js/respopup.js?v=20061206"></script> <script type="text/javascript" src="js/setfavjs.js?v=20090428"></script> - <script type="text/javascript" src="js/delelog.js?v=20061206"></script> + <script type="text/javascript" src="js/delelog.js?v=20100127"></script> */ $onload_script = '';