Go to snipt user and delete snipt kb shortcuts.

master
Nick Sergeant 2012-05-11 23:09:59 -04:00
parent 4571efe9b1
commit 2c5ad9a020
4 changed files with 56 additions and 17 deletions

View File

@ -793,14 +793,6 @@ div.modal .modal-header h4 {
margin-top: 1px;
}
div#keyboard-shortcuts {
max-height: 617px;
top: 43%;
}
div#keyboard-shortcuts table {
margin-bottom: 0;
}
div#disqus_thread {
margin-bottom: 0;
margin-left: 15px;
@ -833,6 +825,18 @@ div.modal div.modal-body {
max-height: 514px;
}
div#keyboard-shortcuts {
height: 95%;
margin-top: 0;
top: 20px;
}
div#keyboard-shortcuts table {
margin-bottom: 0;
}
div#keyboard-shortcuts div.modal-body {
max-height: inherit;
}
div.profile {
background: rgba(128, 128, 128, 0.08);
margin: 0 0 30px 15px;

View File

@ -914,14 +914,6 @@ div.modal {
}
}
}
div#keyboard-shortcuts {
max-height: 617px;
top: 43%;
table {
margin-bottom: 0;
}
}
div#disqus_thread {
margin-bottom: 0;
margin-left: 15px;
@ -956,6 +948,18 @@ div.modal {
max-height: 514px;
}
}
div#keyboard-shortcuts {
height: 95%;
margin-top: 0;
top: 20px;
table {
margin-bottom: 0;
}
div.modal-body {
max-height: inherit;
}
}
div.profile {
background: rgba(128, 128, 128, .08);
margin: 0 0 30px 15px;

View File

@ -40,11 +40,13 @@
'copyRaw': 'copy',
'detail': 'detail',
'deselect': 'deselect',
'destroy': 'destroy',
'edit': 'edit',
'embed': 'embed',
'embedClose': 'embedClose',
'expand': 'expand',
'fadeAndRemove': 'fadeAndRemove',
'goToAuthor': 'goToAuthor',
'next': 'next',
'prev': 'prev',
'selectSnipt': 'select'
@ -75,6 +77,9 @@
detail: function() {
window.location = this.model.get('absolute_url');
},
destroy: function() {
this.model.destroy();
},
edit: function() {
window.editing = true;
@ -180,6 +185,9 @@
});
return false;
},
goToAuthor: function() {
window.location = this.model.get('user').absolute_url;
},
favoriteToggle: function() {
var that = this;
@ -436,7 +444,7 @@
return false;
},
escapeUI: function(destroyed) {
if (window.editing) {
if (window.editing || destroyed) {
if (!window.site.$html.hasClass('detail')) {
window.site.$body.removeClass('detail');
}
@ -508,6 +516,18 @@
}
}
});
$document.bind('keydown', 'Ctrl+d', function() {
if (!window.ui_halted) {
if ($selected) {
if ($selected.hasClass('editable')) {
if (confirm('Are you sure you want to delete this snipt?')) {
$selected.trigger('destroy');
window.site.snipt_list.escapeUI(true);
}
}
}
}
});
$document.bind('keydown', 'esc', function() {
that.escapeUI();
});
@ -546,6 +566,13 @@
}
}
});
$document.bind('keydown', 'u', function() {
if (!window.ui_halted) {
if ($selected) {
$selected.trigger('goToAuthor');
}
}
});
$document.bind('keydown', 'p', function() {
if (!window.ui_halted) {
var $anc = $('li.prev a');

View File

@ -221,6 +221,10 @@
<td>o / return</td>
<td>Go to snipt</td>
</tr>
<tr>
<td>u</td>
<td>Go to snipt's author</td>
</tr>
<tr>
<td>e</td>
<td>Expand / collapse snipt</td>