From: <ir...@us...> - 2012-09-16 04:37:59
|
Revision: 10177 http://xoops.svn.sourceforge.net/xoops/?rev=10177&view=rev Author: irmtfan Date: 2012-09-16 04:37:52 +0000 (Sun, 16 Sep 2012) Log Message: ----------- improve js scroll to current post/topic Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-15 10:51:08 UTC (rev 10176) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-16 04:37:52 UTC (rev 10177) @@ -1,3 +1,8 @@ +date 2012-09-16 +=================================== +1- improve: Add forum_post_prefix smarty variable to have unique Ids for posts. Add js function to scroll to current post in viewtopic.php links. +in newbb/templates/newbb_thread.html , newbb/templates/newbb_viewtopic.html + date 2012-09-11 =============================== 1- bug fix: viewtopic admin mode action incorrectly on the topic instead of selected posts of the topic.(important) Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-09-15 10:51:08 UTC (rev 10176) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-09-16 04:37:52 UTC (rev 10177) @@ -1,4 +1,14 @@ +<!-- START irmtfan assign forum_post_prefix smarty --> +<{if $forum_post_prefix === null }> + <!-- change the value to what you prefer. even value="" (no prefix) is acceptable --> + <{assign var=forum_post_prefix value="forumpost"}> + <!-- it is the first time then add id=0 for recognizoing top of the topic to scroll when $post_id=0 (just $topic_id in the URL) --> + <div id="<{$forum_post_prefix}>0"></div> +<{/if}> +<!-- END irmtfan assign forum_post_prefix smarty --> +<!-- irmtfan removed <{if $post_id == $topic_post.post_id}><div id="aktuell"></div><{/if}> +--> <table class="outer" cellpadding="0" cellspacing="0" border="0" width="100%" align="center" style="border-bottom-width: 0px;"> <tr> <!-- irmtfan hardcode removed align="left" --> @@ -12,7 +22,8 @@ <!-- irmtfan hardcode removed style="float: right;" --> <div class="ThreadTitle"> <{if $topic_post.post_id > 0}> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$topic_post.post_id}>">#<{$topic_post.post_no}></a> + <!-- irmtfan add id for each post --> + <a id="<{$forum_post_prefix}><{$topic_post.post_id}>" href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$topic_post.post_id}>">#<{$topic_post.post_no}></a> <{/if}> </div> </th> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-15 10:51:08 UTC (rev 10176) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-16 04:37:52 UTC (rev 10177) @@ -162,7 +162,9 @@ <div class="resultMsg"><{$smarty.const._MD_TOPICLOCK}></div> <br /> <{/if}> +<!-- irmtfan remove here and move to the newbb_thread.html <{if $post_id == 0}><div id="aktuell"></div><{/if}> +--> <{foreachq item=topic_post from=$topic_posts}> <{includeq file="db:newbb_thread.html" topic_post=$topic_post mode=$mode}> <br /> @@ -262,4 +264,14 @@ <script type="text/javascript"> <!--xoopsGetElementById('aktuell').scrollIntoView(true); </script> ---> \ No newline at end of file +--> +<!-- START irmtfan add scroll js function to scroll down to current post or top of the topic --> +<script type="text/javascript"> +if (document.body.scrollIntoView && window.location.href.indexOf('#') == -1){ + var el = xoopsGetElementById('<{$forum_post_prefix}><{$post_id}>'); + if (el){ + el.scrollIntoView(true); + } +} +</script> +<!-- END irmtfan add scroll js function to scroll down to current post or top of the topic --> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |