disabled copy as curl keyboard shortcut. Browsers block it. Snick.

Closes #42
This commit is contained in:
Boaz Leskes 2014-01-22 14:33:40 +01:00
parent 4bf8615d63
commit 23f50dd619
2 changed files with 15 additions and 16 deletions

View file

@ -96,20 +96,21 @@ define([
}
});
input.commands.addCommand({
name: 'copy as cUrl',
bindKey: {win: 'Ctrl-Shift-C', mac: 'Command-Shift-C'},
exec: function () {
input.$actions.find('[data-toggle=dropdown]:not(.open)').click();
setupCopyButton();
var toggles = 5;
(function toggle () {
$copyAsCURL.toggleClass('zeroclipboard-is-hover', toggles % 1);
if (--toggles) setTimeout(toggle, 125);
}());
}
});
})
// sadly this is blocked by browsers. Removed.
// input.commands.addCommand({
// name: 'copy as cUrl',
// bindKey: {win: 'Ctrl-Shift-C', mac: 'Command-Shift-C'},
// exec: function () {
// input.$actions.find('[data-toggle=dropdown]:not(.open)').click();
// setupCopyButton();
// var toggles = 5;
// (function toggle () {
// $copyAsCURL.toggleClass('zeroclipboard-is-hover', toggles % 1);
// if (--toggles) setTimeout(toggle, 125);
// }());
// }
// });
});
zc.on('complete', function () {
$copyAsCURL.click();

View file

@ -88,8 +88,6 @@
<dd>Open Auto complete (even if not typing)</dd>
<dt>Ctrl/Cmd + Enter</dt>
<dd>Submit request</dd>
<dt>Ctrl/Cmd + Shift + C</dt>
<dd>Copy request in cURL format</dd>
<dt>Ctrl/Cmd + Up/Down</dt>
<dd>Jump to the previous/next request start or end.</dd>
<dt>Ctrl/Cmd + Alt + L</dt>