Commit 00dc9bdd authored by Michal Čihař's avatar Michal Čihař

Change check ignoring key to Alt+I <NUMBER>

And document it.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent bd6cf42b
......@@ -94,6 +94,8 @@ While translating you can use following keyboard shortcuts:
Shows machine translation tab.
:kbd:`Alt+M <NUMBER>`
Copy machine translation of given number to current translation.
:kbd:`Alt+I <NUMBER>`
Ignore failing check of given number.
:kbd:`Alt+N`
Shows nearby strings tab.
:kbd:`Alt+S`
......
......@@ -8,6 +8,6 @@
{% if user_can_ignore_check %}
<button type="button" class="close" data-dismiss="alert" title="{% blocktrans with check.get_check_display as check %}Ignore: {{ check }}{% endblocktrans %}">&times;</button>
{% endif %}
<a href="{{ check.get_doc_url }}" class="alert-link">{{ check.get_check_display }}</a>
<a href="{{ check.get_doc_url }}" class="alert-link">{{ check.get_check_display }}</a><span class="check-number"></span>
</div>
{% endfor %}
......@@ -622,6 +622,39 @@ $(function () {
return false;
}
);
/* Check dismiss shortcuts */
Mousetrap.bindGlobal("alt+i", function(e) {});
for (var i = 1; i < 10; i++) {
Mousetrap.bindGlobal("alt+i " + i, function(e) {});
}
if ($(".check").length > 0 && false) {
$($('.check')[0].parentNode).children(".check").each(function(idx){
var $this = $(this);
if (idx < 10) {
var key = getNumericKey(idx);
$(this).find('.check-number').html(
" <span class='badge' title='" +
interpolate(gettext('Alt+I then %s'), [key]) +
"'>" +
key +
"</span>"
);
Mousetrap.bindGlobal(
"alt+i " + key,
function(e) {
console.log('here');
$this.find('.close').click();
return false;
}
);
} else {
$(this).find('.check-number').html('');
}
});
}
}
}
......@@ -635,27 +668,6 @@ $(function () {
$this.tooltip('destroy');
});
/* Check dismiss shortcuts */
for (var icheck=0;icheck<10;icheck++){Mousetrap.bindGlobal("esc "+ icheck, function(e) { });}
if ($(".check").length>0)
{
$($('.check')[0].parentNode).children(".check").each(function(idx){
var $this = $(this);
if (idx <10)
{
if ($this.find(".nchk").length>0) $this.find(".nchk").html("<sup title="+gettext('ESC then ')+idx+"'>"+idx+"</sup>");
else
$this.append("<span class='nchk text-info' ><sup title='"+gettext('ESC then ')+idx+"'>"+idx+"</sup></span>");
Mousetrap.bindGlobal("esc "+ idx, function(e) { $this.find('.close').click(); return false; });
}
else
{
if ($this.find(".nchk")) $this.find(".nchk").html("");
}
});
}
/* Check link clicking */
$document.on('click', '.check [data-toggle="tab"]', function (e) {
var href = $(this).attr('href');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment