From: <ir...@us...> - 2012-08-30 07:57:51
|
Revision: 10136 http://xoops.svn.sourceforge.net/xoops/?rev=10136&view=rev Author: irmtfan Date: 2012-08-30 07:57:41 +0000 (Thu, 30 Aug 2012) Log Message: ----------- ToggleBlockCategory improved, onclick improved, hardcode removed Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt XoopsModules/newbb/branches/irmtfan/newbb/include/display.php XoopsModules/newbb/branches/irmtfan/newbb/include/images.php XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js XoopsModules/newbb/branches/irmtfan/newbb/index.php XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/t_qr_expand.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_qr_expand.png Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-30 07:57:41 UTC (rev 10136) @@ -1,3 +1,20 @@ +date 2012-08-30 +================================================ +1- add more and less icons - add t_qr_expand.png image and add show see definitions +newbb/include/display.php, newbb/include/images.php +newbb/templates/images/language/english/t_qr_expand.png +newbb/language/english/main.php, newbb/docs/lang_diff.txt + +2- improve ToggleBlockCategory js to recognize a IMG tag +newbb/include/js/newbb_toggle.js + +3- change all toggles in newbb to use ToggleBlockCategory - use newbb_displayImage function for all toggles - alt and title and text links supported +newbb/viewtopic.php, newbb/templates/newbb_viewtopic.html, newbb/templates/newbb_thread.html +newbb/index.php, newbb/templates/newbb_index.html + +4- some hardcodes removed (<small><{$topic_post.post_edit}></small> and signature line +newbb/templates/newbb_thread.html, newbb/templates/images/language/english/style.css + date 2012-08-28 ================================================ 1- improve text link instead of buttons feature. Ability to set the display setting for each link in newbb/include/display.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-08-30 07:57:41 UTC (rev 10136) @@ -44,3 +44,5 @@ define('_MD_NEWBB_SEEUSERDATA','See User information'); added: define('_MD_NEWBB_HIDEUSERDATA','Hide User information'); +define('_MD_NEWBB_HIDE','Hide'); +define('_MD_NEWBB_SEE','See'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/display.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/display.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/display.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -125,6 +125,8 @@ //$displayText['technorati'] = //$displayText['wong'] = //$displayText['anonym'] = +//$displayText['more'] = +//$displayText['less'] = $displayText['p_delete'] = $displayText['p_reply'] = @@ -135,6 +137,7 @@ $displayText['t_new'] = $displayText['t_poll'] = $displayText['t_qr'] = +$displayText['t_qr_expand'] = $displayText['t_reply'] = //$displayText['online'] = @@ -208,6 +211,8 @@ //$displayText['technorati'] = //$displayText['wong'] = //$displayText['anonym'] = +//$displayText['more'] = +//$displayText['less'] = //$displayText['p_delete'] = //$displayText['p_reply'] = @@ -217,7 +222,8 @@ //$displayText['t_new'] = //$displayText['t_poll'] = -//$displayText['t_qr'] = +//$displayText['t_qr'] = +//$displayText['t_qr_expand'] = //$displayText['t_reply'] = //$displayText['online'] = Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/images.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/images.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/images.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -25,7 +25,7 @@ */ // Forum image type -// irmtfan add anonym.png icon +// irmtfan add anonym.png more.png and less.png icon $forumImage[''] = $forumImage['blank'] = $forumImage['attachment'] = @@ -82,6 +82,8 @@ $forumImage['technorati'] = $forumImage['wong'] = $forumImage['anonym'] = +$forumImage['more'] = +$forumImage['less'] = "icon"; for($i = 1; $i <= 5; $i++ ) { @@ -97,7 +99,8 @@ $forumImage['t_new'] = $forumImage['t_poll'] = -$forumImage['t_qr'] = +$forumImage['t_qr'] = +$forumImage['t_qr_expand'] = $forumImage['t_reply'] = $forumImage['online'] = Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js 2012-08-30 07:57:41 UTC (rev 10136) @@ -64,24 +64,25 @@ function ToggleBlockCategory(block, icon, src_expand, src_collapse, alt_expand, alt_collapse) { + var Img_tag='IMG'; if (document.getElementById) { if (document.getElementById(block).style.display == 'block') { document.getElementById(block).style.display = 'none'; - icon.src = src_collapse; + if (icon.nodeName == Img_tag) { + icon.src = src_collapse; + } icon.alt= alt_collapse; - icon.title= alt_collapse; - SaveCollapsed(block, true); } else { document.getElementById(block).style.display = 'block'; - icon.src = src_expand; + if (icon.nodeName == Img_tag) { + icon.src = src_expand; + } icon.alt= alt_expand; - icon.title= alt_expand; - SaveCollapsed(block, false); } } @@ -90,22 +91,24 @@ if (document.all[block].style.display == 'block') { document.all[block].style.display = 'none'; - icon.src = src_collapse; + if (icon.nodeName == Img_tag) { + icon.src = src_collapse; + } icon.alt= alt_collapse; - icon.title= alt_collapse; - SaveCollapsed(block, true); } else { document.all[block].style.display = 'block'; - icon.src = src_expand; + if (icon.nodeName == Img_tag) { + icon.src = src_expand; + } icon.alt= alt_expand; - icon.title= alt_expand; - SaveCollapsed(block, false); } } + icon.title = icon.alt; + icon.textContent=icon.title; } Modified: XoopsModules/newbb/branches/irmtfan/newbb/index.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/index.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/index.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -153,8 +153,17 @@ $cat_element_id = "cat_".$onecat['cat_id']; $expand = (count($toggles) > 0) ? ( (in_array($cat_element_id, $toggles)) ? false : true ) : true; - $cat_display = ($expand) ? 'block;' : 'none;'; - $cat_icon_display = ($expand) ? $category_icon["expand"] : $category_icon["collapse"]; + // START irmtfan to improve newbb_displayImage + if ($expand) { + $cat_display = 'block;'; + $cat_icon_display = "minus"; + $cat_alt = _MD_NEWBB_HIDE; + } else { + $cat_display = 'none;'; + $cat_icon_display = "plus"; + $cat_alt = _MD_NEWBB_SEE; + } + $cat_displayImage = newbb_displayImage($cat_icon_display, $cat_alt); if (isset($forumsByCat[$onecat['cat_id']])) { $forums = $forumsByCat[$onecat['cat_id']]; @@ -179,7 +188,7 @@ 'cat_description' => $myts->displayTarea($onecat['cat_description'],1), 'cat_element_id' => $cat_element_id, 'cat_display' => $cat_display, - 'cat_icon_display' => $cat_icon_display, + 'cat_displayImage' => $cat_displayImage, 'forums' => $forums ); } Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -486,4 +486,6 @@ define('_MD_NEWBB_MAXPIC','Images at the max. Size %s X %s pixels.'); define('_MD_NEWBB_SEARCHDISABLED','The search is disabled and can not be used.'); define('_MD_NEWBB_HIDEUSERDATA','Hide User information'); +define('_MD_NEWBB_HIDE','Hide'); +define('_MD_NEWBB_SEE','See'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -486,4 +486,6 @@ define('_MD_NEWBB_MAXPIC','تصاویر در حداکثر اندازه خود میتوانند %s X %s پیکسل داشته باشند.'); define('_MD_NEWBB_SEARCHDISABLED','امکان جستجو در سایت غیر فعال شده است. برای فعال کردن آن به مدیریت سیستم مراجعه کنید.'); define('_MD_NEWBB_HIDEUSERDATA','مخفی کردن اطلاعات کاربر'); +define('_MD_NEWBB_HIDE','مخفی کردن'); +define('_MD_NEWBB_SEE','نمایش'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-08-30 07:57:41 UTC (rev 10136) @@ -107,6 +107,8 @@ div.signature { bottom: 10px; + border-top-width:1px; + border-top-style: inherit; } div#index_welcome{ @@ -293,6 +295,7 @@ padding: 5px; margin-top: 10px; border:1px solid #000; + font-size: small; } .post_ip { float: right; Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/t_qr_expand.png =================================================================== (Binary files differ) Property changes on: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/t_qr_expand.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-08-30 07:57:41 UTC (rev 10136) @@ -107,6 +107,8 @@ div.signature { bottom: 10px; + border-top-width:1px; + border-top-style: inherit; } div#index_welcome{ @@ -293,6 +295,7 @@ padding: 5px; margin-top: 10px; border:1px solid #000; + font-size: small; } .post_ip { float: /*irmtfan right*/ left; Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_qr_expand.png =================================================================== (Binary files differ) Property changes on: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_qr_expand.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html 2012-08-30 07:57:41 UTC (rev 10136) @@ -44,7 +44,10 @@ <table class="index_category" cellspacing="0" width="100%"> <tr class="head"> <td width="3%" valign="middle" align="center"> - <img onclick="ToggleBlockCategory('<{$category.cat_element_id}>', this, '<{$category_icon.expand}>', '<{$category_icon.collapse}>')" src="<{$category.cat_icon_display}>" alt="" /> +<!-- irmtfan simplify onclick method and use newbb_displayImage(this.children[0] for IE7&8) - add alt and title"--> + <div class="pointer" onclick="ToggleBlockCategory('<{$category.cat_element_id}>',(this.firstElementChild || this.children[0]) , '<{$category_icon.expand}>', '<{$category_icon.collapse}>','<{$smarty.const._MD_NEWBB_HIDE}>','<{$smarty.const._MD_NEWBB_SEE}>')"> + <{$category.cat_displayImage}> + </div> </td> <{if $category.cat_image}> <td width="8%"><img src="<{$category.cat_image}>" alt="<{$category.cat_title}>" /></td> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-08-30 07:57:41 UTC (rev 10136) @@ -32,23 +32,13 @@ <br /><{$anonym_avatar}> <{/if}> <br /> - <{if $infobox gt 0}> - <!-- irmtfan simplify onclick method remove hardcode style="padding:2px;"--> - <div class="pointer"> - <img onclick="ToggleBlockCategory('<{$topic_post.post_id}>', this, '<{$xoops_url}><{$icon_path}>/less.png', '<{$xoops_url}><{$icon_path}>/more.png','<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>','<{$smarty.const._MD_NEWBB_SEEUSERDATA}>')" - <{if $infobox == 1}> - src="<{$xoops_url}><{$icon_path}>/more.png" alt="<{$smarty.const._MD_NEWBB_SEEUSERDATA}>" title="<{$smarty.const._MD_NEWBB_SEEUSERDATA}>" - <{else}> - src="<{$xoops_url}><{$icon_path}>/less.png" alt="<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>" title="<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>" - <{/if}> - /> - </div> - <div id="<{$topic_post.post_id}>" - <{if $infobox == 1}> style="display: none;" - <{else}> style="display:block;" - <{/if}> - > - <div class="comUserStat"><span class="comUserStatCaption"><{$smarty.const._MD_JOINED}>:</span><br /><{$topic_post.poster.regdate}></div> + <{if $infobox.show}> + <!-- irmtfan simplify onclick method (this.children[0] for IE7&8) - remove hardcode style="padding:2px;"--> + <span class="pointer" onclick="ToggleBlockCategory('<{$topic_post.post_id}>',(this.firstElementChild || this.children[0]) , '<{$infobox.icon.expand}>', '<{$infobox.icon.collapse}>','<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>','<{$smarty.const._MD_NEWBB_SEEUSERDATA}>')"> + <{$infobox.displayImage}> + </span> + <div id="<{$topic_post.post_id}>" style="display: <{$infobox.style}>" > + <div class="comUserStat"><span class="comUserStatCaption"><{$smarty.const._MD_JOINED}>:</span><br /><{$topic_post.poster.regdate}></div> <{if $topic_post.poster.from}> <div class="comUserStat"><span class="comUserStatCaption"><{$smarty.const._MD_FROM}></span> <{$topic_post.poster.from}></div> <{/if}> @@ -104,7 +94,8 @@ <br /> <!-- irmtfan hardcode removed style="float: right; padding: 5px; margin-top: 10px; border:1px solid #000;" --> <div class="post_edit"> - <small><{$topic_post.post_edit}></small> + <!-- irmtfan hardcode removed --> + <{$topic_post.post_edit}> </div> <{/if}> </td> @@ -118,8 +109,8 @@ <{/if}> <{if $topic_post.post_signature}> <div class="signature"> - ____________________<br /> - <{$topic_post.post_signature}> + <!-- irmtfan hardcode removed hardcode ____________________<br /> --> + <{$topic_post.post_signature}> </div> <{/if}> </td> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-08-30 07:57:41 UTC (rev 10136) @@ -212,10 +212,13 @@ <{if $quickreply.show}> <div> - <a href="#threadbottom" onclick="ToggleBlock('qr', this)"> <{$quickreply.icon}></a> + <!-- irmtfan improve toggle method to ToggleBlockCategory (this.children[0] for IE7&8) change display to style and icon to displayImage for more comprehension --> + <a href="#threadbottom" onclick="ToggleBlockCategory('qr', (this.firstElementChild || this.children[0]), '<{$quickreply.icon.expand}>', '<{$quickreply.icon.collapse}>','<{$smarty.const._MD_NEWBB_HIDE}> <{$smarty.const._MD_QUICKREPLY}>','<{$smarty.const._MD_NEWBB_SEE}> <{$smarty.const._MD_QUICKREPLY}>')" > + <{$quickreply.displayImage}> + </a> </div> <br /> - <div id="qr" style="display: <{$quickreply.display}>"> + <div id="qr" style="display: <{$quickreply.style}>"> <div><{$quickreply.form}></div> </div> <br /> @@ -248,9 +251,9 @@ <br /> <{includeq file='db:newbb_notification_select.html'}> +<!-- irmtfan remove <script type="text/javascript"> -<!-- -xoopsGetElementById('aktuell').scrollIntoView(true); ---> -</script> \ No newline at end of file +<!--xoopsGetElementById('aktuell').scrollIntoView(true); +</script> +--> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -127,16 +127,37 @@ $online_handler->init($forum_obj, $topic_obj); $xoopsTpl->assign('online', $online_handler->show_online()); } - -$infobox = intval($xoopsModuleConfig['show_infobox']); //4.05 -$xoopsTpl->assign('infobox', $infobox); //4.05 $xoopsTpl->assign("parentforum", $forum_handler->getParents($forum_obj)); // irmtfan - remove icon_path and use newbb_displayImage $xoopsTpl->assign("anonym_avatar", newbb_displayImage('anonym')); -// icon_path use for infobox onclick image more/less -$icon_handler = newbb_getIconHandler(); -$xoopsTpl->assign("icon_path", $icon_handler->getPath("icon")); +// START irmtfan improve infobox +$infobox= array(); +$infobox['show'] = intval($xoopsModuleConfig['show_infobox']); //4.05 +// irmtfan removed then define after array +//$xoopsTpl->assign('infobox', $infobox); //4.05 +$icon_handler = newbb_getIconHandler(); // can be use in the follwing codes in this file + +if ($infobox['show'] > 0) { + // irmtfan - remove icon_path and use newbb_displayImage + $infobox['icon'] = array( + "expand" => $icon_handler->getImageSource("less"), + "collapse" => $icon_handler->getImageSource("more")) + ; + if($infobox['show'] == 1){ + $infobox['style']='none;'; + $infobox['alt'] = _MD_NEWBB_SEEUSERDATA; + $infobox['src']="more"; + } else { + $infobox['style']='block;'; + $infobox['alt'] = _MD_NEWBB_HIDEUSERDATA; + $infobox['src']="less"; + } + $infobox['displayImage'] = newbb_displayImage($infobox['src'],$infobox['alt']); +} +$xoopsTpl->assign('infobox',$infobox); +// END irmtfan improve infobox + $xoopsTpl->assign(array( 'topic_title' => '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname", "n").'/viewtopic.php?topic_id='.$topic_id.'">'. $topic_obj->getFullTitle().'</a>', 'forum_name' => $forum_obj->getVar('forum_name'), @@ -622,8 +643,21 @@ $forum_form->addElement($submit_button); $toggles = newbb_getcookie('G', true); - $display = (in_array('qr', $toggles)) ? 'none;' : 'block;'; - $xoopsTpl->assign('quickreply', array( 'show' => 1, 'display' => $display, 'icon' => newbb_displayImage('t_qr',_MD_QUICKREPLY), 'form' => $forum_form->render())); + // START irmtfan improve quickreply smarty variable - add alt key to quick reply button - change $display to $style for more comprehension + $quickreply= array(); + $qr_collapse = "t_qr"; + $qr_expand = "t_qr_expand"; // change this + $quickreply['show']= 1; // could be improved to default = hide = 2 in the future + $quickreply['style'] = (in_array('qr', $toggles)) ? 'none;' : 'block;'; + $quickreply['icon'] = array( + "expand" => $icon_handler->getImageSource($qr_expand), + "collapse" => $icon_handler->getImageSource($qr_collapse)) + ; + // $quickreply['show'] =1 => + $quickreply['displayImage'] = newbb_displayImage($qr_expand,_MD_NEWBB_HIDE.' '._MD_QUICKREPLY); + $quickreply['form'] = $forum_form->render(); + $xoopsTpl->assign('quickreply', $quickreply); + // END irmtfan improve quickreply smarty variable unset($forum_form); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |