adds a fuzzy toggle, fixes Issue #132

This commit is contained in:
Marco Bonetti 2015-06-04 11:04:20 +02:00
parent 6623601878
commit edfc1d40d3
2 changed files with 14 additions and 4 deletions

View file

@ -25,7 +25,7 @@ google.setOnLoadCallback(function() {
from: sourceLang,
to: destLang,
text: orig
},
},
function(data) {
if (data.success){
trans.val(unescape(data.translation).replace(/'/g,'\'').replace(/"/g,'"').replace(/%\s+(\([^\)]+\))\s*s/g,' %$1s '));
@ -85,7 +85,7 @@ google.setOnLoadCallback(function() {
$($('.part',td).get(j)).css('top',textareaY + 'px');
});
});
$('.translation textarea').blur(function() {
if($(this).val()) {
$('.alert', $(this).parents('tr')).remove();
@ -113,5 +113,15 @@ google.setOnLoadCallback(function() {
});
$('.translation textarea').eq(0).focus();
$('#action-toggle').change(function(){
jQuery('tbody td.c input[type="checkbox"]').each(function(i, e) {
if($('#action-toggle').is(':checked')) {
$(e).attr('checked', 'checked');
} else {
$(e).removeAttr('checked');
}
});
})
});

View file

@ -58,7 +58,7 @@
<th><div class="text">{% trans "Original" %}</div></th>
{% if main_language %}<th>{{ main_language }}</th>{% endif %}
<th>{{ rosetta_i18n_lang_name }}</th>
<th class="c"><span class="checkall">[-]</span> {% trans "Fuzzy" %}</th>
<th class="c"><input style="display: inline;" id="action-toggle" type="checkbox"> {% trans "Fuzzy" %}</th>
<th>{% trans "Occurrences(s)" %}</th>
</tr>
</thead>