diff options
author | Chad Weider <cweider@oofn.net> | 2012-02-29 14:13:02 -0800 |
---|---|---|
committer | Chad Weider <cweider@oofn.net> | 2012-05-13 15:33:22 -0700 |
commit | dc0fb12b09925bdf408d9b70c33283653a2bbd29 (patch) | |
tree | e85219a2a0370995ac0092b941612033f6bfee63 /src | |
parent | c406d076de3e063d5158f6b8d3cde2d9e78ef174 (diff) | |
download | etherpad-lite-dc0fb12b09925bdf408d9b70c33283653a2bbd29.zip |
Remove onclick attributes from editbar.
Diffstat (limited to 'src')
-rw-r--r-- | src/static/js/pad.js | 7 | ||||
-rw-r--r-- | src/static/js/pad_editbar.js | 7 | ||||
-rw-r--r-- | 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 dbbee43c..99f4a0b9 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 268fb029..51c5a3c6 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 0798f045..0418182b 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -21,65 +21,65 @@ <div id="editbar" class="toolbar"> <ul class="menu_left"> <% e.begin_block("editbarMenuLeft"); %> - <li id="bold" onClick="window.pad&&pad.editbarClick('bold');return false"> + <li id="bold" data-key="bold"> <a class="buttonicon buttonicon-bold" title="Bold (ctrl-B)"></a> </li> - <li id="italic" onClick="window.pad&&pad.editbarClick('italic'); return false;"> + <li id="italic" data-key="italic"> <a class="buttonicon buttonicon-italic" title="Italics (ctrl-I)"></a> </li> - <li id="underline" onClick="window.pad&&pad.editbarClick('underline');return false;" > + <li id="underline" data-key="underline"> <a class="buttonicon buttonicon-underline" title="Underline (ctrl-U)"></a> </li> - <li id="strikethrough" onClick="window.pad&&pad.editbarClick('strikethrough');return false;"> + <li id="strikethrough" data-key="strikethrough"> <a class="buttonicon buttonicon-strikethrough" title="Strikethrough"></a> </li> <li class="separator"></li> - <li id="oderedlist" onClick="window.pad&&pad.editbarClick('insertorderedlist');return false;"> + <li id="oderedlist" data-key="insertorderedlist"> <a class="buttonicon buttonicon-insertorderedlist" title="Toggle Ordered List"></a> </li> - <li id="unoderedlist" onClick="window.pad&&pad.editbarClick('insertunorderedlist');return false;"> + <li id="unoderedlist" data-key="insertunorderedlist"> <a class="buttonicon buttonicon-insertunorderedlist" title="Toggle Bullet List"></a> </li> - <li id="indent" onClick="window.pad&&pad.editbarClick('indent');return false;"> + <li id="indent" data-key="indent"> <a class="buttonicon buttonicon-indent" title="Indent"></a> </li> - <li id="outdent" onClick="window.pad&&pad.editbarClick('outdent');return false;"> + <li id="outdent" data-key="outdent"> <a class="buttonicon buttonicon-outdent" title="Unindent"></a> </li> <li class="separator"></li> - <li id="undo" onClick="window.pad&&pad.editbarClick('undo');return false;"> + <li id="undo" data-key="undo"> <a class="buttonicon buttonicon-undo" title="Undo (ctrl-Z)"></a> </li> - <li id="redo" onClick="window.pad&&pad.editbarClick('redo');return false;"> + <li id="redo" data-key="redo"> <a class="buttonicon buttonicon-redo" title="Redo (ctrl-Y)"></a> </li> <li class="separator"></li> - <li id="clearAuthorship" onClick="window.pad&&pad.editbarClick('clearauthorship');return false;"> + <li id="clearAuthorship" data-key="clearauthorship"> <a class="buttonicon buttonicon-clearauthorship" title="Clear Authorship Colors"></a> </li> <% e.end_block(); %> </ul> <ul class="menu_right"> <% e.begin_block("editbarMenuRight"); %> - <li id="settingslink" onClick="window.pad&&pad.editbarClick('settings');return false;"> + <li id="settingslink" data-key="settings"> <a class="buttonicon buttonicon-settings" title="Settings of this pad"></a> </li> - <li id="importexportlink" onClick="window.pad&&pad.editbarClick('import_export');return false;"> + <li id="importexportlink" data-key="import_export"> <a class="buttonicon buttonicon-import_export" title="Import/Export from/to different document formats"></a> </li> - <li id="embedlink" onClick="window.pad&&pad.editbarClick('embed');return false;"> + <li id="embedlink" data-key="embed"> <a class="buttonicon buttonicon-embed" title="Share and Embed this pad"></a> </li> - <li id="revisionlink" onClick="window.pad&&pad.editbarClick('savedRevision');return false;"> + <li id="revisionlink" data-key="savedRevision"> <a class="buttonicon buttonicon-savedRevision" title="Mark this revision as a saved revision"></a> </li> <li class="separator"></li> <li id="timesliderlink" onClick="document.location = document.location.pathname+ '/timeslider'"> <a class="buttonicon buttonicon-history" title="Show the history of this pad"></a> </li> - <li id="usericon" onClick="window.pad&&pad.editbarClick('showusers');return false;" title="Show connected users"> - <span class="buttonicon buttonicon-showusers" id="usericonback"></span> - <span id="online_count">1</span> + <li id="usericon" data-key="showusers" title="Show connected users"> + <span class="buttonicon buttonicon-showusers" id="usericonback"></span> + <span id="online_count">1</span> </li> <% e.end_block(); %> </ul> |