From dc0fb12b09925bdf408d9b70c33283653a2bbd29 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Wed, 29 Feb 2012 14:13:02 -0800 Subject: [PATCH] Remove onclick attributes from editbar. --- src/static/js/pad.js | 7 ------- src/static/js/pad_editbar.js | 7 +++++++ src/templates/pad.html | 36 ++++++++++++++++++------------------ 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/static/js/pad.js b/src/static/js/pad.js index dbbee43c6..99f4a0b9c 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -683,13 +683,6 @@ var pad = { paduserlist.removeGuestPrompt(msg.guestId); } }, - editbarClick: function(cmd) - { - if (padeditbar) - { - padeditbar.toolbarClick(cmd); - } - }, dmesg: function(m) { if (pad.getIsDebugEnabled()) diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 268fb0297..51c5a3c6a 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -97,8 +97,15 @@ var padeditbar = (function() var self = { init: function() { + var self = this; $("#editbar .editbarbutton").attr("unselectable", "on"); // for IE $("#editbar").removeClass("disabledtoolbar").addClass("enabledtoolbar"); + $("#editbar [data-key]").each(function (i, e) { + $(e).click(function (event) { + self.toolbarClick($(e).attr('data-key')); + event.preventDefault(); + }); + }); }, isEnabled: function() { diff --git a/src/templates/pad.html b/src/templates/pad.html index 0798f045e..0418182bf 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -21,65 +21,65 @@