diff --git a/check_text.php b/check_text.php index 28c43d6b..1613f8f2 100644 --- a/check_text.php +++ b/check_text.php @@ -78,7 +78,7 @@ function change_textboxes_language() { $('#TxText').attr('lang', language_data[lid]); } - $(document).ready(lwt_form_check.askBeforeExit); + $(document).ready(lwtFormCheck.askBeforeExit); $(document).ready(change_textboxes_language);
No translations found ('+data.from+'-'+data.dest+').
');if(data.dest!='en'&&data.from!='en'){$('#translations').attr('id','no_trans').after('
'+data.tuc.length+' translation'+(data.tuc.length==1?'':'s')+' retrieved via '+'Glosbe API.
+ onclick="{lwtFormCheck.resetDirty(); location.href='index.php';}" /> + onclick="{lwtFormCheck.resetDirty(); location.href='settings.php?op=reset';}" /> | diff --git a/src/js/jq_pgm.js b/src/js/jq_pgm.js index 934088d2..ea444b12 100644 --- a/src/js/jq_pgm.js +++ b/src/js/jq_pgm.js @@ -83,7 +83,7 @@ function setTransRoman (tra, rom) { $('input[name="WoRomanization"]').val(rom); form_changed |= true; } - if (form_changed) { lwt_form_check.makeDirty(); } + if (form_changed) { lwtFormCheck.makeDirty(); } } /** @@ -770,7 +770,7 @@ function display_example_sentences (sentences, click_target) { clickable.setAttribute( 'onclick', '{' + click_target + ".value = '" + sentences[i][1].replaceAll("'", "\\'") + - "';lwt_form_check.makeDirty();}" + "';lwtFormCheck.makeDirty();}" ); clickable.appendChild(img); // Create parent diff --git a/src/js/translation_api.js b/src/js/translation_api.js index 40994655..0a017537 100644 --- a/src/js/translation_api.js +++ b/src/js/translation_api.js @@ -11,7 +11,7 @@ function deleteTranslation () { if (frame === undefined) { frame = window.opener; } if ($('[name="WoTranslation"]', frame.document).val().trim().length) { $('[name="WoTranslation"]', frame.document).val(''); - frame.lwt_form_check.makeDirty(); + frame.lwtFormCheck.makeDirty(); } } @@ -30,18 +30,18 @@ function addTranslation (s) { const oldValue = word_trans.value; if (oldValue.trim() == '') { word_trans.value = s; - frame.lwt_form_check.makeDirty(); + frame.lwtFormCheck.makeDirty(); } else { if (oldValue.indexOf(s) == -1) { word_trans.value = oldValue + ' / ' + s; - frame.lwt_form_check.makeDirty(); + frame.lwtFormCheck.makeDirty(); } else { if (confirm( '"' + s + '" seems already to exist as a translation.\n' + 'Insert anyway?' )) { word_trans.value = oldValue + ' / ' + s; - frame.lwt_form_check.makeDirty(); + frame.lwtFormCheck.makeDirty(); } } } diff --git a/src/js/unloadformcheck.js b/src/js/unloadformcheck.js index b25ed4a7..a18f59df 100644 --- a/src/js/unloadformcheck.js +++ b/src/js/unloadformcheck.js @@ -13,14 +13,14 @@ * Set to 1 if a form was altered (set "dirty"), * ask for confirmation before leaving. * - * @deprecated Since 2.10.0, use lwt_form_check instead + * @deprecated Since 2.10.0, use lwtFormCheck instead */ let DIRTY = 0; /** * Keeps track of a modified form. */ -const lwt_form_check = { +const lwtFormCheck = { dirty: false, @@ -30,7 +30,7 @@ const lwt_form_check = { * @returns {string} Confirmation string */ isDirtyMessage: function () { - if (lwt_form_check.dirty) { + if (lwtFormCheck.dirty) { return '** You have unsaved changes! **'; } }, @@ -39,14 +39,14 @@ const lwt_form_check = { * Set the DIRTY variable to 1. */ makeDirty: function () { - lwt_form_check.dirty = true; + lwtFormCheck.dirty = true; }, /** * Set the DIRTY variable to 0. */ resetDirty: function () { - lwt_form_check.dirty = false; + lwtFormCheck.dirty = false; }, /** @@ -58,7 +58,7 @@ const lwt_form_check = { */ tagChanged: function (_, ui) { if (!ui.duringInitialization) { - lwt_form_check.dirty = true; + lwtFormCheck.dirty = true; } return true; }, @@ -71,17 +71,17 @@ const lwt_form_check = { */ askBeforeExit: function () { $('#termtags').tagit({ - afterTagAdded: lwt_form_check.tagChanged, - afterTagRemoved: lwt_form_check.tagChanged + afterTagAdded: lwtFormCheck.tagChanged, + afterTagRemoved: lwtFormCheck.tagChanged }); $('#texttags').tagit({ - afterTagAdded: lwt_form_check.tagChanged, - afterTagRemoved: lwt_form_check.tagChanged + afterTagAdded: lwtFormCheck.tagChanged, + afterTagRemoved: lwtFormCheck.tagChanged }); $('input,checkbox,textarea,radio,select') - .not('#quickmenu').on('change', lwt_form_check.makeDirty); - $(':reset,:submit').on('click', lwt_form_check.resetDirty); - $(window).on('beforeunload', lwt_form_check.isDirtyMessage); + .not('#quickmenu').on('change', lwtFormCheck.makeDirty); + $(':reset,:submit').on('click', lwtFormCheck.resetDirty); + $(window).on('beforeunload', lwtFormCheck.isDirtyMessage); } }; @@ -89,26 +89,26 @@ const lwt_form_check = { * Check the DIRTY status and ask before leaving. * * @returns {string} Confirmation string - * @deprecated Since 2.10.0, use return lwt_form_check.isDirtyMessage instead + * @deprecated Since 2.10.0, use return lwtFormCheck.isDirtyMessage instead */ function askConfirmIfDirty () { - return lwt_form_check.askConfirmIfDirty(); + return lwtFormCheck.askConfirmIfDirty(); } /** * Set the DIRTY variable to 1. - * @deprecated Since 2.10.0, use return lwt_form_check.makeDirty instead + * @deprecated Since 2.10.0, use return lwtFormCheck.makeDirty instead */ function makeDirty () { - return lwt_form_check.makeDirty(); + return lwtFormCheck.makeDirty(); } /** * Set the DIRTY variable to 0. - * @deprecated Since 2.10.0, use return lwt_form_check.resetDirty instead + * @deprecated Since 2.10.0, use return lwtFormCheck.resetDirty instead */ function resetDirty () { - return lwt_form_check.resetDirty(); + return lwtFormCheck.resetDirty(); } /** @@ -117,10 +117,10 @@ function resetDirty () { * @param {*} _ An event, unused * @param {object} ui UI object * @returns {true} Always return true - * @deprecated Since 2.10.0, use return lwt_form_check.tagChanged instead + * @deprecated Since 2.10.0, use return lwtFormCheck.tagChanged instead */ function tagChanged (_, ui) { - return lwt_form_check.tagChanged(_, ui); + return lwtFormCheck.tagChanged(_, ui); } /** @@ -128,8 +128,8 @@ function tagChanged (_, ui) { * before exiting the form. * * @returns {undefined} - * @deprecated Since 2.10.0, use return lwt_form_check.askBeforeExit instead + * @deprecated Since 2.10.0, use return lwtFormCheck.askBeforeExit instead */ function ask_before_exiting () { - return lwt_form_check.askBeforeExit(); + return lwtFormCheck.askBeforeExit(); } diff --git a/text_to_speech_settings.php b/text_to_speech_settings.php index b6547833..bced3f70 100644 --- a/text_to_speech_settings.php +++ b/text_to_speech_settings.php @@ -259,7 +259,7 @@ function tts_js() }, clickCancel: function() { - lwt_form_check.resetDirty(); + lwtFormCheck.resetDirty(); location.href = 'text_to_speech_settings.php'; } };