Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove onclick #703

Merged
merged 10 commits into from
May 19, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 48 additions & 54 deletions src/static/css/pad.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,42 +64,25 @@ a img {
height: 32px;
}
.toolbar ul li {
background: #fff;
background: -webkit-linear-gradient(#fff, #f0f0f0);
background: -moz-linear-gradient(#fff, #f0f0f0);
background: -o-linear-gradient(#fff, #f0f0f0);
background: -ms-linear-gradient(#fff, #f0f0f0);
background: linear-gradient(#fff, #f0f0f0);
border: 1px solid #ccc;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
cursor: pointer;
float: left;
height: 18px;
margin-left: 2px;
overflow: hidden;
padding: 4px 5px;
width: 18px;
}
.toolbar ul li a {
.toolbar ul li a:hover {
text-decoration: none;
color: #ccc;
position: absolute;
}
.toolbar ul li a span {
position: relative;
top: -2px;
}
.toolbar ul li:hover {
.toolbar ul li a:hover {
background: #fff;
background: -webkit-linear-gradient(#f4f4f4, #e4e4e4);
background: -moz-linear-gradient(#f4f4f4, #e4e4e4);
background: -o-linear-gradient(#f4f4f4, #e4e4e4);
background: -ms-linear-gradient(#f4f4f4, #e4e4e4);
background: linear-gradient(#f4f4f4, #e4e4e4);
}
.toolbar ul li:active {
.toolbar ul li a:active {
background: #eee;
background: -webkit-linear-gradient(#ddd, #fff);
background: -moz-linear-gradient(#ddd, #fff);
Expand All @@ -115,12 +98,30 @@ a img {
background: inherit;
visibility: hidden;
width: 0px;
padding: 5px;
}
.toolbar ul li a {
display: block
background: #fff;
background: -webkit-linear-gradient(#fff, #f0f0f0);
background: -moz-linear-gradient(#fff, #f0f0f0);
background: -o-linear-gradient(#fff, #f0f0f0);
background: -ms-linear-gradient(#fff, #f0f0f0);
background: linear-gradient(#fff, #f0f0f0);
border: 1px solid #ccc;
border-radius: 4px;
color: #ccc;
cursor: pointer;
display: inline-block;
min-height: 18px;
overflow: hidden;
padding: 4px 5px;
text-align: center;
text-decoration: none;
min-width: 18px;
}
.toolbar ul li a img {
padding: 1px
.toolbar ul li a .buttonicon {
position: relative;
top: 1px;
}
.toolbar ul {
float: left
Expand Down Expand Up @@ -428,6 +429,7 @@ a#hidetopmsg {
top: 0;
width: 56px;
z-index: 10;
display: inline-block;
}
.toolbarsavetable {
position: absolute;
Expand Down Expand Up @@ -1235,8 +1237,8 @@ ul#colorpickerswatches li:hover {
height: 16px;
background-image: url('../../static/img/etherpad_lite_icons.png');
background-repeat: no-repeat;
margin-left: 1px;
margin-top: 1px;
display: inline-block;
vertical-align: middle;
}
.buttonicon-bold {
background-position: 0px -116px
Expand Down Expand Up @@ -1285,20 +1287,13 @@ ul#colorpickerswatches li:hover {
}
.buttonicon-chat {
background-position: 0px -102px;
display: inline-block;
vertical-align: middle;
margin: 0 !important;
}
.buttonicon-showusers {
background-position: 0px -183px;
display: inline-block;
}
.buttonicon-savedRevision {
background-position: 0px -493px
}
#usericon {
width: 33px !important
}
#focusprotector {
z-index: 100;
position: absolute;
Expand All @@ -1314,9 +1309,6 @@ ul#colorpickerswatches li:hover {
}
#online_count {
color: #888;
font-size: 11px;
line-height: 18px;
position: fixed;
}
.rtl {
direction: RTL
Expand Down Expand Up @@ -1420,13 +1412,16 @@ input[type=checkbox] {
}
}
@media screen and (max-width: 600px) {
.toolbar ul li {
.toolbar ul li.separator {
padding: 1px;
}
.toolbar ul li a {
padding: 4px 1px
}
}
@media only screen and (min-device-width: 320px) and (max-device-width: 720px) {
.toolbar ul li {
padding: 4px 3px
.toolbar ul li a {
padding: 4px 5px;
}
#users {
right: 0;
Expand Down Expand Up @@ -1457,15 +1452,6 @@ input[type=checkbox] {
bottom: 0;
border-top: 1px solid #ccc;
}
.toolbar ul.menu_right li:last-child {
height: 24px;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
margin-top: 0;
border: 0;
float: right;
}
#chaticon {
bottom: 3px;
right: 55px;
Expand All @@ -1487,19 +1473,27 @@ input[type=checkbox] {
border-top-right-radius: 0;
border-right: none;
}
.toolbar ul li a span {
top: -3px
}
#usericonback {
margin-top: 4px
}
.toolbar ul.menu_right li:not(:last-child) {
display: block
.toolbar ul.menu_right > li:last-child {
float: right;
}
.toolbar ul.menu_right > li:not(:last-child) a {
display: block;
}
.toolbar ul.menu_right > li {
background: none;
padding: 0;
}
.toolbar ul.menu_right > li a {
height: 24px;
line-height: 24px;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
border: none;
margin-top: 4px;
background: none;
margin: 0;
padding: 4px 8px;
}
.selected {
Expand Down
7 changes: 0 additions & 7 deletions src/static/js/pad.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,13 +683,6 @@ var pad = {
paduserlist.removeGuestPrompt(msg.guestId);
}
},
editbarClick: function(cmd)
{
if (padeditbar)
{
padeditbar.toolbarClick(cmd);
}
},
dmesg: function(m)
{
if (pad.getIsDebugEnabled())
Expand Down
7 changes: 7 additions & 0 deletions src/static/js/pad_editbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions src/static/js/pad_userlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,11 +724,11 @@ var paduserlist = (function()
$("#myswatch").css({'background-color': myUserInfo.colorId});

if ($.browser.msie && parseInt($.browser.version) <= 8) {
$("#usericon").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId,'background-color': myUserInfo.colorId});
$("#usericon a").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId,'background-color': myUserInfo.colorId});
}
else
{
$("#usericon").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId});
$("#usericon a").css({'box-shadow': 'inset 0 0 30px ' + myUserInfo.colorId});
}
}
};
Expand Down
104 changes: 69 additions & 35 deletions src/templates/pad.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,65 +21,99 @@
<div id="editbar" class="toolbar">
<ul class="menu_left">
<% e.begin_block("editbarMenuLeft"); %>
<li id="bold" onClick="window.pad&amp;&amp;pad.editbarClick('bold');return false">
<a class="buttonicon buttonicon-bold" title="Bold (ctrl-B)"></a>
<li id="bold" data-key="bold">
<a title="Bold (ctrl-B)">
<span class="buttonicon buttonicon-bold"></span>
</a>
</li>
<li id="italic" onClick="window.pad&amp;&amp;pad.editbarClick('italic'); return false;">
<a class="buttonicon buttonicon-italic" title="Italics (ctrl-I)"></a>
<li id="italic" data-key="italic">
<a title="Italics (ctrl-I)">
<span class="buttonicon buttonicon-italic"></span>
</a>
</li>
<li id="underline" onClick="window.pad&amp;&amp;pad.editbarClick('underline');return false;" >
<a class="buttonicon buttonicon-underline" title="Underline (ctrl-U)"></a>
<li id="underline" data-key="underline">
<a title="Underline (ctrl-U)">
<span class="buttonicon buttonicon-underline"></span>
</a>
</li>
<li id="strikethrough" onClick="window.pad&amp;&amp;pad.editbarClick('strikethrough');return false;">
<a class="buttonicon buttonicon-strikethrough" title="Strikethrough"></a>
<li id="strikethrough" data-key="strikethrough">
<a title="Strikethrough">
<span class="buttonicon buttonicon-strikethrough"></span>
</a>
</li>
<li class="separator"></li>
<li id="oderedlist" onClick="window.pad&amp;&amp;pad.editbarClick('insertorderedlist');return false;">
<a class="buttonicon buttonicon-insertorderedlist" title="Toggle Ordered List"></a>
<li id="oderedlist" data-key="insertorderedlist">
<a title="Toggle Ordered List">
<span class="buttonicon buttonicon-insertorderedlist"></span>
</a>
</li>
<li id="unoderedlist" onClick="window.pad&amp;&amp;pad.editbarClick('insertunorderedlist');return false;">
<a class="buttonicon buttonicon-insertunorderedlist" title="Toggle Bullet List"></a>
<li id="unoderedlist" data-key="insertunorderedlist">
<a title="Toggle Bullet List">
<span class="buttonicon buttonicon-insertunorderedlist"></span>
</a>
</li>
<li id="indent" onClick="window.pad&amp;&amp;pad.editbarClick('indent');return false;">
<a class="buttonicon buttonicon-indent" title="Indent"></a>
<li id="indent" data-key="indent">
<a title="Indent">
<span class="buttonicon buttonicon-indent"></span>
</a>
</li>
<li id="outdent" onClick="window.pad&amp;&amp;pad.editbarClick('outdent');return false;">
<a class="buttonicon buttonicon-outdent" title="Unindent"></a>
<li id="outdent" data-key="outdent">
<a title="Unindent">
<span class="buttonicon buttonicon-outdent"></span>
</a>
</li>
<li class="separator"></li>
<li id="undo" onClick="window.pad&amp;&amp;pad.editbarClick('undo');return false;">
<a class="buttonicon buttonicon-undo" title="Undo (ctrl-Z)"></a>
<li id="undo" data-key="undo">
<a title="Undo (ctrl-Z)">
<span class="buttonicon buttonicon-undo"></span>
</a>
</li>
<li id="redo" onClick="window.pad&amp;&amp;pad.editbarClick('redo');return false;">
<a class="buttonicon buttonicon-redo" title="Redo (ctrl-Y)"></a>
<li id="redo" data-key="redo">
<a title="Redo (ctrl-Y)">
<span class="buttonicon buttonicon-redo"></span>
</a>
</li>
<li class="separator"></li>
<li id="clearAuthorship" onClick="window.pad&amp;&amp;pad.editbarClick('clearauthorship');return false;">
<a class="buttonicon buttonicon-clearauthorship" title="Clear Authorship Colors"></a>
<li id="clearAuthorship" data-key="clearauthorship">
<a title="Clear Authorship Colors">
<span class="buttonicon buttonicon-clearauthorship"></span>
</a>
</li>
<% e.end_block(); %>
</ul>
<ul class="menu_right">
<% e.begin_block("editbarMenuRight"); %>
<li id="settingslink" onClick="window.pad&amp;&amp;pad.editbarClick('settings');return false;">
<a class="buttonicon buttonicon-settings" title="Settings of this pad"></a>
<li data-key="settings">
<a id="settingslink" title="Settings of this pad">
<span class="buttonicon buttonicon-settings"></span>
</a>
</li>
<li id="importexportlink" onClick="window.pad&amp;&amp;pad.editbarClick('import_export');return false;">
<a class="buttonicon buttonicon-import_export" title="Import/Export from/to different document formats"></a>
<li data-key="import_export">
<a id="importexportlink" title="Import/Export from/to different document formats">
<span class="buttonicon buttonicon-import_export"></span>
</a>
</li>
<li id="embedlink" onClick="window.pad&amp;&amp;pad.editbarClick('embed');return false;">
<a class="buttonicon buttonicon-embed" title="Share and Embed this pad"></a>
<li data-key="embed">
<a id="embedlink" title="Share and Embed this pad">
<span class="buttonicon buttonicon-embed"></span>
</a>
</li>
<li id="revisionlink" onClick="window.pad&amp;&amp;pad.editbarClick('savedRevision');return false;">
<a class="buttonicon buttonicon-savedRevision" title="Mark this revision as a saved revision"></a>
<li data-key="savedRevision">
<a id="revisionlink" title="Mark this revision as a saved revision">
<span class="buttonicon buttonicon-savedRevision"></span>
</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 onClick="document.location = document.location.pathname+ '/timeslider'">
<a id="timesliderlink" title="Show the history of this pad">
<span class="buttonicon buttonicon-history"></span>
</a>
</li>
<li id="usericon" onClick="window.pad&amp;&amp;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">
<a title="Show connected users">
<span class="buttonicon buttonicon-showusers" id="usericonback"></span>
<span id="online_count">1</span>
</a>
</li>
<% e.end_block(); %>
</ul>
Expand Down