diff options
| -rwxr-xr-x | includes/view_board_inc.php | 2 | ||||
| -rwxr-xr-x | includes/view_topic_inc.php | 3 | ||||
| -rwxr-xr-x | templates/html_head_inc.tpl | 15 | ||||
| -rwxr-xr-x | templates/post_display.tpl | 34 |
4 files changed, 11 insertions, 43 deletions
diff --git a/includes/view_board_inc.php b/includes/view_board_inc.php index 035fae0..90fdd11 100755 --- a/includes/view_board_inc.php +++ b/includes/view_board_inc.php @@ -112,7 +112,5 @@ $gBitSmarty->assign( 'listInfo', $threadsListHash['listInfo'] ); $gBitSmarty->assign( 'board', $gContent ); $gBitSmarty->assign( 'cat_url', BOARDS_PKG_URL."index.php"); //?ct=".urlencode($gContent->mInfo['content_type_guid'])); -$gBitThemes->loadAjax( 'mochikit' ); - // Display the template $gBitSystem->display( 'bitpackage:boards/list_topics.tpl', KernelTools::tra( 'Message Board Threads: ' . $gContent->getField('title') ) , [ 'display_mode' => 'display' ]);
\ No newline at end of file diff --git a/includes/view_topic_inc.php b/includes/view_topic_inc.php index 8c76fea..226a4c3 100755 --- a/includes/view_topic_inc.php +++ b/includes/view_topic_inc.php @@ -123,7 +123,4 @@ if (!empty($_REQUEST['warning'])) { } $gBitSmarty->assign('warnings',$warnings); -// ajax support -$gBitThemes->loadAjax( 'mochikit' ); - $gBitSystem->display('bitpackage:boards/list_posts.tpl', "Show Thread: " . $thread->getField('title') , [ 'display_mode' => 'display' ]); diff --git a/templates/html_head_inc.tpl b/templates/html_head_inc.tpl index 1cac695..3ff90f4 100755 --- a/templates/html_head_inc.tpl +++ b/templates/html_head_inc.tpl @@ -1,7 +1,6 @@ {if $gBitSystem->getActivePackage() == 'boards'} <script>/* <![CDATA[ */ {literal} - /* DEPENDENCIES: MochiKit Base Async, BitAjax */ BitBoards = { /* this is called from flipswitch.tpl */ "flipName": function( url, elm ){ @@ -11,14 +10,14 @@ }, /* this is called from post_display.tpl */ - "warn":function( elmid, caller ){ - var oldonclick = caller.onclick; - document.getElementById( elmid ).style['display']='inline'; - caller.onclick = function() { - document.getElementById( elmid ).style['display']='none'; - caller.onclick = oldonclick; - return false; + "warn": function( elmid, url, caller ) { + var $elm = $( '#' + elmid ); + if( !$.trim( $elm.html() ) ) { + $.get( url ).done( function( html ) { $elm.html( html ); } ); } + $elm.show(); + var prev = caller.onclick; + caller.onclick = function() { $elm.hide(); caller.onclick = prev; return false; }; return false; }, diff --git a/templates/post_display.tpl b/templates/post_display.tpl index a5b95aa..a62cebd 100755 --- a/templates/post_display.tpl +++ b/templates/post_display.tpl @@ -91,40 +91,14 @@ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='comment' serviceHash=$comment} {if $gBitUser->isRegistered() and $comment.is_warned} + {assign var=comment_id value=$comment.comment_id} <div class="warning"> - {assign var=comment_id value=$comment.comment_id} - <a onclick=" - var e = document.getElementById('warned_message_{$comment.comment_id|escape:"url"}'); - var url = '{$smarty.const.BOARDS_PKG_URL}ajax.php?req=10&comment_id={$comment_id}&seq=' + new Date().getTime(); - var element = 'warned_message_{$comment.comment_id|escape:"url"}'; - var params = null; - {literal} - var ajax = new Ajax.Updater( - {success: element}, - url, {method: 'get', parameters: params, onFailure: reportError} - ); - {/literal} - e.style.display='block'; - this.oldonclick=this.onclick; - this.onclick=new Function(' - document.getElementById(\'warned_message_{$comment.comment_id|escape:"url"}\').style.display=\'none\'; - this.onclick=this.oldonclick; - return false; - '); - return false; - " href="{$thread_mInfo.display_url}&warning[{$comment_id}]={if empty($warnings.$comment_id)}show{else}hide{/if}" + <a onclick="return BitBoards.warn('warned_message_{$comment.comment_id|escape:"url"}', '{$smarty.const.BOARDS_PKG_URL}ajax.php?req=10&comment_id={$comment_id}', this)" + href="{$thread_mInfo.display_url}&warning[{$comment_id}]={if empty($warnings.$comment_id)}show{else}hide{/if}" >{booticon ipackage="icons" iname="icon-warning-sign" iexplain="Warned Post"}</a> - - <div id="warned_message_{$comment.comment_id|escape:"url"}"> + <div id="warned_message_{$comment.comment_id|escape:"url"}" style="{if empty($warnings.$comment_id)}display:none{/if}"> {if !empty($warnings.$comment_id)}{$comment.warned_message}{/if} </div> - - {if empty($warnings.$comment_id)} - <script>/*<![CDATA[*/ - var warned_message_{$comment.comment_id|escape:"url"} = document.getElementById('warned_message_{$comment.comment_id|escape:"url"}'); - warned_message_{$comment.comment_id|escape:"url"}.style.display='none'; - /*]]>*/</script> - {/if} </div> {/if} |
