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

Use real buttons again

This commit is contained in:
Tim Düsterhus 2013-04-27 13:04:36 +02:00
parent d3c9880552
commit 55dfd865e5
3 changed files with 23 additions and 48 deletions

View File

@ -229,11 +229,12 @@ Resets autocompleter to default status, when input is `click`ed, as the position
Refreshes the room list when the associated button is `click`ed.
$('#timsChatRoomList button').click $.proxy @refreshRoomList, @
$('#timsChatRoomList button').click =>
@refreshRoomList
Clears the chat, by removing every single message.
$('#timsChatClear').click (event) ->
$('#timsChatClear').click (event) =>
event.preventDefault()
$('.timsChatMessage').remove()
@oldScrollTop = null
@ -243,14 +244,13 @@ Handling toggling when a toggable button is `click`ed.
$('.timsChatToggle').click (event) ->
element = $ @
icon = element.find 'span.icon'
if element.data('status') is 1
element.data 'status', 0
icon.removeClass('icon-circle-blank').addClass('icon-off')
element.removeClass 'active'
element.attr 'title', element.data 'enableMessage'
else
element.data 'status', 1
icon.removeClass('icon-off').addClass('icon-circle-blank')
element.addClass 'active'
element.attr 'title', element.data 'disableMessage'
$('#timsChatInput').focus()
@ -265,8 +265,9 @@ Mark smilies as disabled.
Toggle fullscreen mode.
$('#timsChatFullscreen').click (event) ->
if $(@).data 'status'
$('#timsChatFullscreen').click (event) =>
@oldScrollTop = null if $('#timsChatAutoscroll').data 'status'
if $('#timsChatFullscreen').data 'status'
$('html').addClass 'fullscreen'
else
$('html').removeClass 'fullscreen'
@ -278,17 +279,16 @@ Toggle checkboxes
$('.timsChatMessageContainer').toggleClass 'markEnabled'
$(document).on 'click', '.timsChatMessage :checkbox', (event) ->
if $(this).is ':checked'
$(this).parents('.timsChatMessage').addClass('jsMarked')
if $(@).is ':checked'
$(@).parents('.timsChatMessage').addClass('jsMarked')
else
$(this).parents('.timsChatMessage').removeClass('jsMarked')
$(@).parents('.timsChatMessage').removeClass('jsMarked')
Scroll down when autoscroll is being activated.
$('#timsChatAutoscroll').click (event) ->
$(@).removeClass 'active'
if $(@).data 'status'
$('#timsChatAutoscroll').click (event) =>
if $('#timsChatAutoscroll').data 'status'
$('#timsChatMessageContainer').scrollTop $('#timsChatMessageContainer ul').height()
@oldScrollTop = $('.timsChatMessageContainer').scrollTop()
@ -447,7 +447,6 @@ Disable autoscroll when the user scrolled up to read old messages
if $('#timsChatMessageContainer').scrollTop() < @oldScrollTop
if $('#timsChatAutoscroll').data('status') is 1
$('#timsChatAutoscroll').click()
$('#timsChatAutoscroll').addClass 'active'
$('#timsChatAutoscroll').parent().fadeOut('slow').fadeIn 'slow'
Insert the new messages.

View File

@ -285,7 +285,7 @@
}
}
@media only screen and (min-width: 641px) {
/*@media only screen and (min-width: 641px) {
#timsChatOptions {
top: -1px;
right: 1px;
@ -389,7 +389,7 @@
}
}
}
}
}*/
#toggleRooms .ajaxLoad {
position: absolute;

View File

@ -123,37 +123,13 @@
{/if}
<nav id="timsChatOptions">
<span class="invisible">{lang}chat.general.controls{/lang}</span>
<ul>
<li>
<a id="timsChatAutoscroll" accesskey="d" class="timsChatToggle jsTooltip" title="{lang}wcf.global.button.disable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="1">
<span class="icon icon16 icon-circle-blank"></span><span>{lang}chat.general.scroll{/lang}</span>
</a>
</li>
<li>
<a id="timsChatFullscreen" accesskey="f" class="timsChatToggle jsTooltip" title="{lang}wcf.global.button.disable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="0">
<span class="icon icon16 icon-off"></span><span>{lang}chat.general.fullscreen{/lang}</span>
</a>
</li>
<li>
<a id="timsChatNotify" accesskey="n" class="timsChatToggle jsTooltip" title="{lang}wcf.global.button.enable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="0">
<span class="icon icon16 icon-off"></span><span>{lang}chat.general.notify{/lang}</span>
</a>
</li>
<li{if !MODULE_SMILEY} style="display: none;"{/if}>
<a id="timsChatSmilies" accesskey="e" class="timsChatToggle jsTooltip" title="{lang}wcf.global.button.{if ENABLE_SMILIES_DEFAULT_VALUE}dis{else}en{/if}able{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="{@ENABLE_SMILIES_DEFAULT_VALUE}">
<span class="icon icon16 icon-{if ENABLE_SMILIES_DEFAULT_VALUE}circle-blank{else}off{/if}"></span><span>{lang}chat.general.smilies{/lang}</span>
</a>
</li>
<li>
<a id="timsChatClear">
<span class="icon icon16 icon-remove"></span><span>{lang}chat.general.clear{/lang}</span>
</a>
</li>
<li>
<a id="timsChatMark" class="jsTooltip" title="{lang}chat.general.mark.description{/lang}">
<span class="icon icon16 icon-check"></span><span>{lang}chat.general.mark{/lang}</span>
</a>
</li>
<ul class="smallButtons buttonGroup">
<li><a id="timsChatAutoscroll" accesskey="d" class="button active timsChatToggle jsTooltip" title="{lang}wcf.global.button.disable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="1"><span class="icon icon16 icon-arrow-down"></span><span>{lang}chat.general.scroll{/lang}</span></a></li>{*
*}<li><a id="timsChatFullscreen" accesskey="f" class="button timsChatToggle jsTooltip" title="{lang}wcf.global.button.disable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="0"><span class="icon icon16 icon-fullscreen"></span><span>{lang}chat.general.fullscreen{/lang}</span></a></li>{*
*}<li><a id="timsChatNotify" accesskey="n" class="button timsChatToggle jsTooltip" title="{lang}wcf.global.button.enable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="0"><span class="icon icon16 icon-bell-alt"></span><span>{lang}chat.general.notify{/lang}</span></a></li>{*
*}<li{if !MODULE_SMILEY} style="display: none;"{/if}><a id="timsChatSmilies" accesskey="e" class="button{if ENABLE_SMILIES_DEFAULT_VALUE} active{/if} timsChatToggle jsTooltip" title="{lang}wcf.global.button.{if ENABLE_SMILIES_DEFAULT_VALUE}dis{else}en{/if}able{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="{@ENABLE_SMILIES_DEFAULT_VALUE}"><span class="icon icon16 icon-{if ENABLE_SMILIES_DEFAULT_VALUE}circle-blank{else}off{/if}"></span><span>{lang}chat.general.smilies{/lang}</span></a></li>{*
*}<li><a id="timsChatClear" class="button"><span class="icon icon16 icon-remove"></span><span>{lang}chat.general.clear{/lang}</span></a></li>{*
*}<li><a id="timsChatMark" class="button timsChatToggle jsTooltip" title="{lang}wcf.global.button.disable{/lang}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" data-status="0"><span class="icon icon16 icon-check"></span><span>{lang}chat.general.mark{/lang}</span></a></li>
</ul>
</nav>
</div>