Changed to not use inline JavaScript

pull/2014/head
Grant Woodford 2013-12-15 12:02:43 +02:00
parent d1367484e3
commit 17666eaef7
2 changed files with 13 additions and 18 deletions

View File

@ -54,11 +54,18 @@ var chat = (function()
},
hide: function ()
{
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
$.gritter.removeAll();
$("#gritter-notice-wrapper").show();
// decide on hide logic based on chat window being maximized or not
if ($('#options-stickychat').prop('checked')) {
chat.stickToScreen();
$('#options-stickychat').prop('checked', false);
}
else {
$("#chatcounter").text("0");
$("#chaticon").show();
$("#chatbox").hide();
$.gritter.removeAll();
$("#gritter-notice-wrapper").show();
}
},
scrollDown: function()
{

View File

@ -390,7 +390,7 @@
<div id="chatbox">
<div id="titlebar"><span id ="titlelabel" data-l10n-id="pad.chat"></span>
<a id="titlecross" onClick="minimizeChatbox();">-&nbsp;</a>
<a id="titlecross" onClick="chat.hide();return false;">-&nbsp;</a>
<a id="titlesticky" onClick="chat.stickToScreen(true);$('#options-stickychat').prop('checked', true);return false;" title="Stick chat to screen">&nbsp;&nbsp;</a>
</div>
<div id="chattext" class="authorColors">
@ -476,18 +476,6 @@
padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar;
padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp;
}());
function minimizeChatbox()
{
if ($('#options-stickychat').prop('checked')) {
chat.stickToScreen();
$('#options-stickychat').prop('checked', false);
} else {
chat.hide();
}
return false;
}
</script>
<% e.end_block(); %>
</html>