1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Made every button functional

This commit is contained in:
Tim Düsterhus 2011-12-15 22:54:49 +01:00
parent 9a8663155b
commit 94870c557e
2 changed files with 20 additions and 5 deletions

View File

@ -58,11 +58,26 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
this.submit($(event.target));
}, this));
$('#chatClear').click(function () {
$('#chatClear').click(function (event) {
event.preventDefault();
$('.chatMessage').remove();
$('#chatInput').focus();
});
$('.chatToggle').click(function (event) {
var element = $(event.target).parent();
var icon = $('img', element);
if (element.data('status') == '1') {
element.data('status', 0);
icon.attr('src', icon.attr('src').replace(/enabled(\d?).([a-z]{3})$/, 'disabled$1.$2'));
element.attr('title', element.data('enableMessage'));
}
else {
element.data('status', 1);
icon.attr('src', icon.attr('src').replace(/disabled(\d?).([a-z]{3})$/, 'enabled$1.$2'));
element.attr('title', element.data('disableMessage'));
}
});
},
/**
* Changes the chat-room.

View File

@ -201,22 +201,22 @@
<div class="smallButtons">
<ul>
<li>
<a class="chatToggle" data-status="1" href="javascript:;">
<a id="chatAutoscroll" href="javascript:;" class="chatToggle balloonTooltip" 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">
<img alt="" src="{icon}enabled1{/icon}" /> <span>Scroll</span>
</a>
</li>
<li>
<a class="chatToggle" data-status="0" href="javascript:;">
<a id="chatNotify" href="javascript:;" class="chatToggle balloonTooltip" 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">
<img alt="" src="{icon}disabled1{/icon}" /> <span>Notify</span>
</a>
</li>
<li>
<a id="chatClear" href="javascript:;">
<a id="chatClear" href="javascript:;" class="balloonTooltip" title="Clear the chat">
<img alt="" src="{icon}delete1{/icon}" /> <span>Clear</span>
</a>
</li>
<li>
<a id="chatMark" href="javascript:;">
<a id="chatMark" href="javascript:;" class="balloonTooltip" title="Show checkboxes">
<img alt="" src="{icon}check1{/icon}" /> <span>Mark</span>
</a>
</li>