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. 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. Clears the chat, by removing every single message.
$('#timsChatClear').click (event) -> $('#timsChatClear').click (event) =>
event.preventDefault() event.preventDefault()
$('.timsChatMessage').remove() $('.timsChatMessage').remove()
@oldScrollTop = null @oldScrollTop = null
@ -243,14 +244,13 @@ Handling toggling when a toggable button is `click`ed.
$('.timsChatToggle').click (event) -> $('.timsChatToggle').click (event) ->
element = $ @ element = $ @
icon = element.find 'span.icon'
if element.data('status') is 1 if element.data('status') is 1
element.data 'status', 0 element.data 'status', 0
icon.removeClass('icon-circle-blank').addClass('icon-off') element.removeClass 'active'
element.attr 'title', element.data 'enableMessage' element.attr 'title', element.data 'enableMessage'
else else
element.data 'status', 1 element.data 'status', 1
icon.removeClass('icon-off').addClass('icon-circle-blank') element.addClass 'active'
element.attr 'title', element.data 'disableMessage' element.attr 'title', element.data 'disableMessage'
$('#timsChatInput').focus() $('#timsChatInput').focus()
@ -265,8 +265,9 @@ Mark smilies as disabled.
Toggle fullscreen mode. Toggle fullscreen mode.
$('#timsChatFullscreen').click (event) -> $('#timsChatFullscreen').click (event) =>
if $(@).data 'status' @oldScrollTop = null if $('#timsChatAutoscroll').data 'status'
if $('#timsChatFullscreen').data 'status'
$('html').addClass 'fullscreen' $('html').addClass 'fullscreen'
else else
$('html').removeClass 'fullscreen' $('html').removeClass 'fullscreen'
@ -278,17 +279,16 @@ Toggle checkboxes
$('.timsChatMessageContainer').toggleClass 'markEnabled' $('.timsChatMessageContainer').toggleClass 'markEnabled'
$(document).on 'click', '.timsChatMessage :checkbox', (event) -> $(document).on 'click', '.timsChatMessage :checkbox', (event) ->
if $(this).is ':checked' if $(@).is ':checked'
$(this).parents('.timsChatMessage').addClass('jsMarked') $(@).parents('.timsChatMessage').addClass('jsMarked')
else else
$(this).parents('.timsChatMessage').removeClass('jsMarked') $(@).parents('.timsChatMessage').removeClass('jsMarked')
Scroll down when autoscroll is being activated. Scroll down when autoscroll is being activated.
$('#timsChatAutoscroll').click (event) -> $('#timsChatAutoscroll').click (event) =>
$(@).removeClass 'active' if $('#timsChatAutoscroll').data 'status'
if $(@).data 'status'
$('#timsChatMessageContainer').scrollTop $('#timsChatMessageContainer ul').height() $('#timsChatMessageContainer').scrollTop $('#timsChatMessageContainer ul').height()
@oldScrollTop = $('.timsChatMessageContainer').scrollTop() @oldScrollTop = $('.timsChatMessageContainer').scrollTop()
@ -447,7 +447,6 @@ Disable autoscroll when the user scrolled up to read old messages
if $('#timsChatMessageContainer').scrollTop() < @oldScrollTop if $('#timsChatMessageContainer').scrollTop() < @oldScrollTop
if $('#timsChatAutoscroll').data('status') is 1 if $('#timsChatAutoscroll').data('status') is 1
$('#timsChatAutoscroll').click() $('#timsChatAutoscroll').click()
$('#timsChatAutoscroll').addClass 'active'
$('#timsChatAutoscroll').parent().fadeOut('slow').fadeIn 'slow' $('#timsChatAutoscroll').parent().fadeOut('slow').fadeIn 'slow'
Insert the new messages. 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 { #timsChatOptions {
top: -1px; top: -1px;
right: 1px; right: 1px;
@ -389,7 +389,7 @@
} }
} }
} }
} }*/
#toggleRooms .ajaxLoad { #toggleRooms .ajaxLoad {
position: absolute; position: absolute;

View File

@ -123,37 +123,13 @@
{/if} {/if}
<nav id="timsChatOptions"> <nav id="timsChatOptions">
<span class="invisible">{lang}chat.general.controls{/lang}</span> <span class="invisible">{lang}chat.general.controls{/lang}</span>
<ul> <ul class="smallButtons buttonGroup">
<li> <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>{*
<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"> *}<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>{*
<span class="icon icon16 icon-circle-blank"></span><span>{lang}chat.general.scroll{/lang}</span> *}<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>{*
</a> *}<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> *}<li><a id="timsChatClear" class="button"><span class="icon icon16 icon-remove"></span><span>{lang}chat.general.clear{/lang}</span></a></li>{*
<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>
<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> </ul>
</nav> </nav>
</div> </div>