1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Improve message log

This commit is contained in:
Maximilian Mader 2013-09-05 21:59:03 +02:00
parent 74caf2c7ec
commit a2c4a217f1
2 changed files with 27 additions and 39 deletions

View File

@ -2,6 +2,7 @@
<script data-relocate="true" src="{$__wcf->getPath('chat')}acp/js/be.bastelstu.Chat.ACP.Log{if !ENABLE_DEBUG_MODE}.min{/if}.js?version={PACKAGE_VERSION|rawurlencode}"></script>
{if $errorField === ''}
<script data-relocate="true">
//<![CDATA[
$(function() {
@ -10,6 +11,7 @@
});
//]]>
</script>
{/if}
<header class="boxHeadline">
@ -51,11 +53,7 @@
</div>
</form>
{if $messages|count == 0}
{if $errorField === ""}
<p class="info">{lang}wcf.global.noItems{/lang}</p>
{/if}
{else}
{if $errorField === ''}
<div id="messageLogContent" class="tabMenuContainer marginTop" data-active="timeTab-0" data-store="activeTabMenuItem" data-base-time="{$date}" data-room-id="{$room->roomID}">
<nav class="tabMenu">
<ul>

View File

@ -15,26 +15,12 @@ This is the javascript file providing functions related to the message log for [
(($, window) ->
"use strict";
###
# message log content
# @var jQuery
###
_messageLogContent = null
###
# list of containers
# @var object
###
_hasContent = {}
###
# action proxy
# @var WCF.Action.Proxy
###
_proxy = null
init = ->
_messageLogContent = $('#messageLogContent')
_messageLogContent = $ '#messageLogContent'
activeMenuItem = _messageLogContent.data 'active'
enableProxy = false
@ -42,27 +28,32 @@ This is the javascript file providing functions related to the message log for [
_messageLogContent.find('div.tabMenuContent > .subTabMenuContent').each (index, container) ->
containerID = $(container).wcfIdentify()
if (! $("##{containerID}").hasClass 'empty')
unless $("##{containerID}").hasClass 'empty'
_hasContent[containerID] = true
else
_hasContent[containerID] = false
enableProxy = true
if (enableProxy)
if enableProxy
_proxy = new WCF.Action.Proxy
success: _success
_messageLogContent.bind 'wcftabsbeforeactivate',
_loadContent
if not _hasContent[activeMenuItem]
_loadContent {},
newPanel: $("##{activeMenuItem}")
newTab: $("##{activeMenuItem}").parent().find(".menu > ul > li").first()
_loadContent = (event, ui) ->
containerID = $(ui.newPanel).attr 'id'
if ($("##{$(ui.newPanel).attr('id')}").hasClass 'tabMenuContainer')
if $("##{$(ui.newPanel).attr('id')}").hasClass 'tabMenuContainer'
containerID = $("##{containerID} > .subTabMenuContent").first().attr 'id'
tab = $("##{containerID}").parent().find(".menu > ul > li").first()
else
tab = $(ui.newTab)
tab = $ ui.newTab
unless _hasContent[containerID]
start = _messageLogContent.data('baseTime') + (tab.data('hour') * 3600) + (tab.data('minutes') * 60)
@ -74,21 +65,20 @@ This is the javascript file providing functions related to the message log for [
containerID: containerID
start: start
end: start + 1799
roomID: _messageLogContent.data('roomID')
_proxy.sendRequest()
roomID: _messageLogContent.data 'roomID'
do _proxy.sendRequest
_success = (data, textStatus, jqWHR) ->
containerID = data.returnValues.containerID
_hasContent[containerID] = true
content = _messageLogContent.find "##{containerID}"
if(data.returnValues.template != '')
unless data.returnValues.template is ''
$("<div>#{data.returnValues.template}</div>").hide().appendTo content
if(!data.returnValues.noMessages)
unless data.returnValues.noMessages
content.addClass 'tabularBox'
content.children().first().show()
do content.children().first().show
Log =
TabMenu:
init: init