From e7311e0e5e5c5177d3bb746026cbde94f1589e1e Mon Sep 17 00:00:00 2001 From: PhilW Date: Sat, 18 Nov 2017 13:17:14 +0000 Subject: [PATCH] more consistent function names --- plugins/acl/acl.js | 6 ++--- plugins/enigma/enigma.js | 10 +++---- plugins/managesieve/managesieve.js | 10 +++---- plugins/password/password.js | 8 +++--- program/js/app.js | 42 +++++++++++++++--------------- program/js/googiespell.js | 6 ++--- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/plugins/acl/acl.js b/plugins/acl/acl.js index ab46c0ae1..ee0bd267a 100644 --- a/plugins/acl/acl.js +++ b/plugins/acl/acl.js @@ -55,7 +55,7 @@ rcube_webmail.prototype.acl_delete = function() var users = this.acl_get_usernames(); if (users && users.length) { - this.show_confirm(this.get_label('acl.deleteconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('acl.deleteconfirm'), 'delete', function() { rcmail.http_post('settings/plugin.acl', { _act: 'delete', _user: users.join(','), @@ -84,11 +84,11 @@ rcube_webmail.prototype.acl_save = function() } if (!user) { - this.show_alert(this.get_label('acl.nouser')); + this.alert_dialog(this.get_label('acl.nouser')); return; } if (!rights) { - this.show_alert(this.get_label('acl.norights')); + this.alert_dialog(this.get_label('acl.norights')); return; } diff --git a/plugins/enigma/enigma.js b/plugins/enigma/enigma.js index fbf8e2898..b70429d37 100644 --- a/plugins/enigma/enigma.js +++ b/plugins/enigma/enigma.js @@ -135,17 +135,17 @@ rcube_webmail.prototype.enigma_key_create_save = function() // validate the form if (!password || !confirm) { - this.show_alert(this.get_label('enigma.formerror')); + this.alert_dialog(this.get_label('enigma.formerror')); return; } if (password != confirm) { - this.show_alert(this.get_label('enigma.passwordsdiffer')); + this.alert_dialog(this.get_label('enigma.passwordsdiffer')); return; } if (!users.length) { - this.show_alert(this.get_label('enigma.noidentselected')); + this.alert_dialog(this.get_label('enigma.noidentselected')); return; } @@ -191,7 +191,7 @@ rcube_webmail.prototype.enigma_delete = function() if (!keys.length) return; - this.show_confirm(this.get_label('enigma.keyremoveconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('enigma.keyremoveconfirm'), 'delete', function() { var lock = rcmail.display_message(rcmail.get_label('enigma.keyremoving'), 'loading'), post = {_a: 'delete', _keys: keys}; @@ -276,7 +276,7 @@ rcube_webmail.prototype.enigma_import = function() if (form = this.gui_objects.importform) { file = document.getElementById('rcmimportfile'); if (file && !file.value) { - this.show_alert(this.get_label('selectimportfile')); + this.alert_dialog(this.get_label('selectimportfile')); return; } diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js index b031c545d..921e400a3 100644 --- a/plugins/managesieve/managesieve.js +++ b/plugins/managesieve/managesieve.js @@ -122,7 +122,7 @@ rcube_webmail.prototype.managesieve_del = function() { var id = this.filters_list.get_single_selection(); - this.show_confirm(this.get_label('managesieve.filterdeleteconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('managesieve.filterdeleteconfirm'), 'delete', function() { var lock = rcmail.set_busy(true, 'loading'); rcmail.http_post('plugin.managesieve-action', '_act=delete&_fid='+rcmail.filters_list.rows[id].uid, lock); @@ -223,7 +223,7 @@ rcube_webmail.prototype.managesieve_setdel = function() var id = this.filtersets_list.get_single_selection(), script = this.env.filtersets[id]; - this.show_confirm(this.get_label('managesieve.setdeleteconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('managesieve.setdeleteconfirm'), 'delete', function() { lock = rcmail.set_busy(true, 'loading'), rcmail.http_post('plugin.managesieve-action', '_act=setdel&_set='+urlencode(script), lock); return true; @@ -540,7 +540,7 @@ rcube_webmail.prototype.managesieve_ruledel = function(id) if ($('#ruledel'+id).hasClass('disabled')) return; - this.show_confirm(this.get_label('managesieve.ruledeleteconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('managesieve.ruledeleteconfirm'), 'delete', function() { var row = document.getElementById('rulerow'+id); row.parentNode.removeChild(row); rcmail.managesieve_formbuttons(document.getElementById('rules')); @@ -576,7 +576,7 @@ rcube_webmail.prototype.managesieve_actiondel = function(id) if ($('#actiondel'+id).hasClass('disabled')) return; - this.show_confirm(this.get_label('managesieve.actiondeleteconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('managesieve.actiondeleteconfirm'), 'delete', function() { var row = document.getElementById('actionrow'+id); row.parentNode.removeChild(row); rcmail.managesieve_formbuttons(document.getElementById('actions')); @@ -1117,7 +1117,7 @@ rcube_webmail.prototype.managesieve_create = function(force) // check if there's at least one checkbox checked var hdrs = $('input[name="headers[]"]:checked', dialog); if (!hdrs.length) { - rcmail.show_alert(rcmail.get_label('managesieve.nodata')); + rcmail.alert_dialog(rcmail.get_label('managesieve.nodata')); return; } diff --git a/plugins/password/password.js b/plugins/password/password.js index d8a3186bb..f5080e9af 100644 --- a/plugins/password/password.js +++ b/plugins/password/password.js @@ -30,25 +30,25 @@ window.rcmail && rcmail.addEventListener('init', function(evt) { input_confpasswd = rcube_find_object('_confpasswd'); if (input_curpasswd && input_curpasswd.value == '') { - rcmail.show_alert(rcmail.get_label('nocurpassword', 'password'), function() { + rcmail.alert_dialog(rcmail.get_label('nocurpassword', 'password'), function() { input_curpasswd.focus(); return true; }); } else if (input_newpasswd && input_newpasswd.value == '') { - rcmail.show_alert(rcmail.get_label('nopassword', 'password'), function() { + rcmail.alert_dialog(rcmail.get_label('nopassword', 'password'), function() { input_newpasswd.focus(); return true; }); } else if (input_confpasswd && input_confpasswd.value == '') { - rcmail.show_alert(rcmail.get_label('nopassword', 'password'), function() { + rcmail.alert_dialog(rcmail.get_label('nopassword', 'password'), function() { input_confpasswd.focus(); return true; }); } else if (input_newpasswd && input_confpasswd && input_newpasswd.value != input_confpasswd.value) { - rcmail.show_alert(rcmail.get_label('passwordinconsistency', 'password'), function() { + rcmail.alert_dialog(rcmail.get_label('passwordinconsistency', 'password'), function() { input_newpasswd.focus(); return true; }); diff --git a/program/js/app.js b/program/js/app.js index 57379af51..42c8bdcba 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -723,7 +723,7 @@ function rcube_webmail() && $.inArray(command, this.env.compose_commands) < 0 && !this.compose_skip_unsavedcheck ) { if (!this.env.is_sent && this.cmp_hash != this.compose_field_hash()) { - this.show_confirm(this.get_label('notsentwarning'), 'discard', function() { + this.confirm_dialog(this.get_label('notsentwarning'), 'discard', function() { // remove copy from local storage if compose screen is left intentionally ref.remove_compose_data(ref.env.compose_id); ref.compose_skip_unsavedcheck = true; @@ -948,7 +948,7 @@ function rcube_webmail() if (form) { // user prefs if ((input = $("[name='_pagesize']", form)) && input.length && isNaN(parseInt(input.val()))) { - this.show_alert(this.get_label('nopagesizewarning'), function() { + this.alert_dialog(this.get_label('nopagesizewarning'), function() { input.focus(); return true; }); @@ -963,7 +963,7 @@ function rcube_webmail() else if (this.task == 'settings' && (this.env.identities_level % 2) == 0 && (input = $("[name='_email']", form)) && input.length && !rcube_check_email(input.val()) ) { - this.show_alert(this.get_label('noemailwarning'), function() { + this.alert_dialog(this.get_label('noemailwarning'), function() { input.focus(); return true; }); @@ -1207,7 +1207,7 @@ function rcube_webmail() if (!(flag = this.upload_file(props || this.gui_objects.uploadform, 'upload'))) { if (flag !== false) - this.show_alert(this.get_label('selectimportfile')); + this.alert_dialog(this.get_label('selectimportfile')); aborted = true; } break; @@ -1359,7 +1359,7 @@ function rcube_webmail() if (!(flag = this.upload_file(form, 'import', importlock))) { this.set_busy(false, null, importlock); if (flag !== false) - this.show_alert(this.get_label('selectimportfile')); + this.alert_dialog(this.get_label('selectimportfile')); aborted = true; } break; @@ -1374,7 +1374,7 @@ function rcube_webmail() if (form) { var lock, file = win.$('#rcmimportfile')[0]; if (file && !file.value) { - win.rcmail.show_alert(win.rcmail.get_label('selectimportfile')); + win.rcmail.alert_dialog(win.rcmail.get_label('selectimportfile')); return; } @@ -3163,7 +3163,7 @@ function rcube_webmail() else { // if shift was pressed delete it immediately if ((list && list.modkey == SHIFT_KEY) || (event && rcube_event.get_modifier(event) == SHIFT_KEY)) { - this.show_confirm(this.get_label('deletemessagesconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('deletemessagesconfirm'), 'delete', function() { ref.permanently_remove_messages(); return true; }); @@ -3714,7 +3714,7 @@ function rcube_webmail() // notify user about loosing attachments if (ref.env.attachments && !$.isEmptyObject(ref.env.attachments)) { - ref.show_alert(ref.get_label('encryptnoattachments')); + ref.alert_dialog(ref.get_label('encryptnoattachments')); $.each(ref.env.attachments, function(name, attach) { ref.remove_from_attachment_list(name); @@ -3771,7 +3771,7 @@ function rcube_webmail() if (!isvalid) { if (!recipients.length) { - ref.show_alert(ref.get_label('norecipientwarning'), function() { + ref.alert_dialog(ref.get_label('norecipientwarning'), function() { $("[name='_to']").focus(); return true; }); @@ -4008,7 +4008,7 @@ function rcube_webmail() // import to keyring ref.mailvelope_keyring.importPublicKey(armored).then(function(status) { if (status === 'REJECTED') { - // ref.show_alert(ref.get_label('Key import was rejected')); + // ref.alert_dialog(ref.get_label('Key import was rejected')); } else { var $key = keyid.substr(-8).toUpperCase(); @@ -4048,7 +4048,7 @@ function rcube_webmail() { var lock, post_data = {_mbox: mbox}; - this.show_confirm(this.get_label('purgefolderconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('purgefolderconfirm'), 'delete', function() { // lock interface if it's the active mailbox if (mbox == ref.env.mailbox) { lock = ref.set_busy(true, 'loading'); @@ -4529,7 +4529,7 @@ function rcube_webmail() // check if all files has been uploaded for (key in this.env.attachments) { if (typeof this.env.attachments[key] === 'object' && !this.env.attachments[key].complete) { - this.show_alert(this.get_label('notuploadedwarning')); + this.alert_dialog(this.get_label('notuploadedwarning')); return false; } } @@ -4611,7 +4611,7 @@ function rcube_webmail() // check sender (if have no identities) if (input_from.prop('type') == 'text' && !rcube_check_email(input_from.val(), true)) { - this.show_alert(this.get_label('nosenderwarning'), function() { + this.alert_dialog(this.get_label('nosenderwarning'), function() { input_from.focus(); return true; }); @@ -4620,7 +4620,7 @@ function rcube_webmail() // check for empty recipient if (!rcube_check_email(get_recipients([input_to, input_cc, input_bcc]), true)) { - this.show_alert(this.get_label('norecipientwarning'), function() { + this.alert_dialog(this.get_label('norecipientwarning'), function() { input_to.focus(); return true; }); @@ -4781,7 +4781,7 @@ function rcube_webmail() // submit delete request if (key) { - this.show_confirm(this.get_label('deleteresponseconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('deleteresponseconfirm'), 'delete', function() { ref.http_post('settings/delete-response', { _key: key }, false); return true; }); @@ -6226,7 +6226,7 @@ function rcube_webmail() var undelete = this.env.source && this.env.address_sources[this.env.source].undelete; if (!undelete) { - this.show_confirm(this.get_label('deletecontactconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('deletecontactconfirm'), 'delete', function() { ref._with_selected_contacts('delete'); return true; }); @@ -6413,7 +6413,7 @@ function rcube_webmail() this.group_delete = function() { if (this.env.group) { - this.show_confirm(this.get_label('deletegroupconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('deletegroupconfirm'), 'delete', function() { var lock = ref.set_busy(true, 'groupdeleting'); ref.http_post('group-delete', {_source: ref.env.source, _gid: ref.env.group}, lock); return true; @@ -6951,7 +6951,7 @@ function rcube_webmail() // submit request with appended token if (id) { - this.show_confirm(this.get_label('deleteidentityconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('deleteidentityconfirm'), 'delete', function() { ref.http_post('settings/delete-identity', { _iid: id }, true); return true; }); @@ -7119,7 +7119,7 @@ function rcube_webmail() name = this.env.mailbox; if (name) { - this.show_confirm(this.get_label('deletefolderconfirm'), 'delete', function() { + this.confirm_dialog(this.get_label('deletefolderconfirm'), 'delete', function() { ref.http_post('delete-folder', {_mbox: name}, ref.set_busy(true, 'folderdeleting')); return true; }); @@ -7918,7 +7918,7 @@ function rcube_webmail() }; // show_popup_dialog() wrapper for alert() type dialogs - this.show_alert = function(content, action_func) + this.alert_dialog = function(content, action_func) { var close_func = function(e, ui, dialog) { (ref.is_framed() ? parent.$ : $)(dialog || this).dialog('close'); }, buttons = [{ @@ -7932,7 +7932,7 @@ function rcube_webmail() }; // simple_dialog() wrapper for confirm() type dialogs - this.show_confirm = function(content, button_label, action_func) + this.confirm_dialog = function(content, button_label, action_func) { var options = { button: button_label || 'continue' }; return this.simple_dialog(content, this.get_label('confirmationtitle'), action_func, options); diff --git a/program/js/googiespell.js b/program/js/googiespell.js index ab3314dd7..daa7698a0 100644 --- a/program/js/googiespell.js +++ b/program/js/googiespell.js @@ -140,7 +140,7 @@ this.decorateTextarea = function(id) this.checkSpellingState(); } else if (this.report_ta_not_found) { - rcmail.show_alert('Text area not found'); + rcmail.alert_dialog('Text area not found'); } }; @@ -257,7 +257,7 @@ this.spellCheck = function(ignore) ref.custom_ajax_error(ref); } else { - rcmail.show_alert('An error was encountered on the server. Please try again later.'); + rcmail.alert_dialog('An error was encountered on the server. Please try again later.'); } if (ref.main_controller) { $(ref.spell_span).remove(); @@ -291,7 +291,7 @@ this.learnWord = function(word, id) ref.custom_ajax_error(ref); } else { - rcmail.show_alert('An error was encountered on the server. Please try again later.'); + rcmail.alert_dialog('An error was encountered on the server. Please try again later.'); } }, success: function(data) {