From edfc1d40d37b7ec17f615177ded2a34fbbe5f1ca Mon Sep 17 00:00:00 2001 From: Marco Bonetti Date: Thu, 4 Jun 2015 11:04:20 +0200 Subject: [PATCH] adds a fuzzy toggle, fixes Issue #132 --- rosetta/templates/rosetta/js/rosetta.js | 16 +++++++++++++--- rosetta/templates/rosetta/pofile.html | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/rosetta/templates/rosetta/js/rosetta.js b/rosetta/templates/rosetta/js/rosetta.js index ebc8546..52c1f24 100644 --- a/rosetta/templates/rosetta/js/rosetta.js +++ b/rosetta/templates/rosetta/js/rosetta.js @@ -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'); + } + }); + }) + }); diff --git a/rosetta/templates/rosetta/pofile.html b/rosetta/templates/rosetta/pofile.html index 4b4e457..92b0995 100644 --- a/rosetta/templates/rosetta/pofile.html +++ b/rosetta/templates/rosetta/pofile.html @@ -58,7 +58,7 @@
{% trans "Original" %}
{% if main_language %}{{ main_language }}{% endif %} {{ rosetta_i18n_lang_name }} - [-] {% trans "Fuzzy" %} + {% trans "Fuzzy" %} {% trans "Occurrences(s)" %}