Use .get_label() consistently (instead of .gettext())
| | |
| | | |
| | | var buttons = {}, me = this, body = document.body; |
| | | |
| | | buttons[this.gettext('save')] = function(e) { me.command('acl-save'); }; |
| | | buttons[this.gettext('cancel')] = function(e) { me.command('acl-cancel'); }; |
| | | buttons[this.get_label('save')] = function(e) { me.command('acl-save'); }; |
| | | buttons[this.get_label('cancel')] = function(e) { me.command('acl-cancel'); }; |
| | | |
| | | // display it as popup |
| | | this.acl_popup = this.show_popup_dialog( |
| | | this.acl_form.show(), |
| | | id ? this.gettext('acl.editperms') : this.gettext('acl.newuser'), |
| | | id ? this.get_label('acl.editperms') : this.get_label('acl.newuser'), |
| | | buttons, |
| | | { |
| | | button_classes: ['mainaction'], |
| | |
| | | |
| | | function rcmail_check_message(msg) |
| | | { |
| | | var i, rx, keywords = rcmail.gettext('keywords', 'attachment_reminder').split(",").concat([".doc", ".pdf"]); |
| | | var i, rx, keywords = rcmail.get_label('keywords', 'attachment_reminder').split(",").concat([".doc", ".pdf"]); |
| | | |
| | | keywords = $.map(keywords, function(n) { return RegExp.escape(n); }); |
| | | rx = new RegExp('(' + keywords.join('|') + ')', 'i'); |
| | |
| | | { |
| | | var buttons = {}; |
| | | |
| | | buttons[rcmail.gettext('addattachment')] = function() { |
| | | buttons[rcmail.get_label('addattachment')] = function() { |
| | | $(this).remove(); |
| | | if (window.UI && UI.show_uploadform) // Larry skin |
| | | UI.show_uploadform(); |
| | | else if (window.rcmail_ui && rcmail_ui.show_popup) // classic skin |
| | | rcmail_ui.show_popup('uploadmenu', true); |
| | | }; |
| | | buttons[rcmail.gettext('send')] = function(e) { |
| | | buttons[rcmail.get_label('send')] = function(e) { |
| | | $(this).remove(); |
| | | rcmail.env.attachment_reminder = true; |
| | | rcmail.command('send', '', e); |
| | | }; |
| | | |
| | | rcmail.env.attachment_reminder = false; |
| | | rcmail.show_popup_dialog(rcmail.gettext('attachment_reminder.forgotattachment'), '', buttons); |
| | | rcmail.show_popup_dialog(rcmail.get_label('attachment_reminder.forgotattachment'), '', buttons); |
| | | }; |
| | | |
| | | |
| | |
| | | |
| | | // validate the form |
| | | if (!password || !confirm) |
| | | return alert(this.gettext('enigma.formerror')); |
| | | return alert(this.get_label('enigma.formerror')); |
| | | |
| | | if (password != confirm) |
| | | return alert(this.gettext('enigma.passwordsdiffer')); |
| | | return alert(this.get_label('enigma.passwordsdiffer')); |
| | | |
| | | if (user.match(/^<[^>]+>$/)) |
| | | return alert(this.gettext('enigma.nonameident')); |
| | | return alert(this.get_label('enigma.nonameident')); |
| | | |
| | | // generate keys |
| | | // use OpenPGP.js if browser supports required features |
| | |
| | | }).catch(function(error) { |
| | | // failure |
| | | rcmail.set_busy(false, null, lock); |
| | | rcmail.display_message(rcmail.gettext('enigma.keygenerateerror'), 'error'); |
| | | rcmail.display_message(rcmail.get_label('enigma.keygenerateerror'), 'error'); |
| | | }); |
| | | } |
| | | // generate keys on the server |
| | |
| | | rcmail.http_post('plugin.enigmakeys', options, lock); |
| | | } |
| | | else { |
| | | rcmail.display_message(rcmail.gettext('enigma.keygennosupport'), 'error'); |
| | | rcmail.display_message(rcmail.get_label('enigma.keygennosupport'), 'error'); |
| | | } |
| | | }; |
| | | |
| | |
| | | |
| | | link = $('<span class="blockquote-link"></span>') |
| | | .css({position: 'absolute', 'z-Index': 2}) |
| | | .text(rcmail.gettext('hide_blockquote.show')) |
| | | .text(rcmail.get_label('hide_blockquote.show')) |
| | | .data('parent', div) |
| | | .click(function() { |
| | | var t = $(this), parent = t.data('parent'), visible = parent.is(':visible'); |
| | | |
| | | t.text(rcmail.gettext(visible ? 'hide' : 'show', 'hide_blockquote')) |
| | | t.text(rcmail.get_label(visible ? 'hide' : 'show', 'hide_blockquote')) |
| | | .detach().appendTo(visible ? q : parent); |
| | | |
| | | parent[visible ? 'hide' : 'show'](); |
| | |
| | | } |
| | | |
| | | // build dialog window content |
| | | html = '<fieldset><legend>'+this.gettext('managesieve.usedata')+'</legend><ul>'; |
| | | html = '<fieldset><legend>'+this.get_label('managesieve.usedata')+'</legend><ul>'; |
| | | for (i in this.env.sieve_headers) |
| | | html += '<li><input type="checkbox" name="headers[]" id="sievehdr'+i+'" value="'+i+'" checked="checked" />' |
| | | +'<label for="sievehdr'+i+'">'+this.env.sieve_headers[i][0]+':</label> '+this.env.sieve_headers[i][1]+'</li>'; |
| | |
| | | dialog.html(html); |
| | | |
| | | // [Next Step] button action |
| | | buttons[this.gettext('managesieve.nextstep')] = function () { |
| | | buttons[this.get_label('managesieve.nextstep')] = function () { |
| | | // check if there's at least one checkbox checked |
| | | var hdrs = $('input[name="headers[]"]:checked', dialog); |
| | | if (!hdrs.length) { |
| | | alert(rcmail.gettext('managesieve.nodata')); |
| | | alert(rcmail.get_label('managesieve.nodata')); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | // Change [Next Step] button with [Save] button |
| | | buttons = {}; |
| | | buttons[rcmail.gettext('save')] = function() { |
| | | buttons[rcmail.get_label('save')] = function() { |
| | | var win = $('iframe', dialog).get(0).contentWindow; |
| | | win.rcmail.managesieve_save(); |
| | | }; |
| | |
| | | modal: false, |
| | | resizable: true, |
| | | closeOnEscape: !bw.ie7, // disable for performance reasons |
| | | title: this.gettext('managesieve.newfilter'), |
| | | title: this.get_label('managesieve.newfilter'), |
| | | close: function() { rcmail.managesieve_dialog_close(); }, |
| | | buttons: buttons, |
| | | minWidth: 600, |
| | |
| | | */ |
| | | |
| | | if (window.rcmail && rcmail.env.task == 'mail') { |
| | | rcmail.addEventListener('plugin.newmail_notifier', newmail_notifier_run); |
| | | rcmail.addEventListener('actionbefore', newmail_notifier_stop); |
| | | rcmail.addEventListener('init', function() { |
| | | rcmail.addEventListener('plugin.newmail_notifier', newmail_notifier_run) |
| | | .addEventListener('actionbefore', newmail_notifier_stop) |
| | | .addEventListener('init', function() { |
| | | // bind to messages list select event, so favicon will be reverted on message preview too |
| | | if (rcmail.message_list) |
| | | rcmail.message_list.addEventListener('select', newmail_notifier_stop); |
| | |
| | | if (prop.sound) |
| | | newmail_notifier_sound(); |
| | | if (prop.desktop) |
| | | newmail_notifier_desktop(rcmail.gettext('body', 'newmail_notifier')); |
| | | newmail_notifier_desktop(rcmail.get_label('body', 'newmail_notifier')); |
| | | } |
| | | |
| | | // Stops notification |
| | |
| | | // Add IE icon overlay if we're pinned to Taskbar |
| | | try { |
| | | if (window.external.msIsSiteMode()) { |
| | | window.external.msSiteModeSetIconOverlay(path + '/overlay.ico', rcmail.gettext('title', 'newmail_notifier')); |
| | | window.external.msSiteModeSetIconOverlay(path + '/overlay.ico', rcmail.get_label('title', 'newmail_notifier')); |
| | | } |
| | | } catch(e) {} |
| | | } |
| | |
| | | // https://code.google.com/p/chromium/issues/detail?id=163226 |
| | | try { |
| | | if (Notification.permission == 'granted' || Notification.permission == undefined) { |
| | | var popup = new Notification(rcmail.gettext('title', 'newmail_notifier'), { |
| | | var popup = new Notification(rcmail.get_label('title', 'newmail_notifier'), { |
| | | dir: "auto", |
| | | lang: "", |
| | | body: body, |
| | |
| | | if (rcmail.newmail_popup) |
| | | rcmail.newmail_popup.cancel(); |
| | | var popup = window.webkitNotifications.createNotification(icon, |
| | | rcmail.gettext('title', 'newmail_notifier'), body); |
| | | rcmail.get_label('title', 'newmail_notifier'), body); |
| | | popup.onclick = function() { |
| | | this.cancel(); |
| | | } |
| | |
| | | |
| | | function newmail_notifier_test_desktop() |
| | | { |
| | | var txt = rcmail.gettext('testbody', 'newmail_notifier'); |
| | | var txt = rcmail.get_label('testbody', 'newmail_notifier'); |
| | | |
| | | // W3C draft implementation (with fix for Chrome/Chromium) |
| | | try { |
| | |
| | | else |
| | | dn.requestPermission(function() { |
| | | if (!newmail_notifier_desktop(txt)) |
| | | rcmail.display_message(rcmail.gettext('desktopdisabled', 'newmail_notifier'), 'error'); |
| | | rcmail.display_message(rcmail.get_label('desktopdisabled', 'newmail_notifier'), 'error'); |
| | | }); |
| | | } |
| | | else |
| | | // Everything fails, means the browser has no support |
| | | rcmail.display_message(rcmail.gettext('desktopunsupported', 'newmail_notifier'), 'error'); |
| | | rcmail.display_message(rcmail.get_label('desktopunsupported', 'newmail_notifier'), 'error'); |
| | | } |
| | | } |
| | | |
| | |
| | | function newmail_notifier_desktop_authorize() { |
| | | Notification.requestPermission(function(perm) { |
| | | if (perm == 'denied') |
| | | rcmail.display_message(rcmail.gettext('desktopdisabled', 'newmail_notifier'), 'error'); |
| | | rcmail.display_message(rcmail.get_label('desktopdisabled', 'newmail_notifier'), 'error'); |
| | | if (perm == 'granted') |
| | | newmail_notifier_test_desktop(); // Test again, which should show test message |
| | | }); |
| | |
| | | input_confpasswd = rcube_find_object('_confpasswd'); |
| | | |
| | | if (input_curpasswd && input_curpasswd.value == '') { |
| | | alert(rcmail.gettext('nocurpassword', 'password')); |
| | | alert(rcmail.get_label('nocurpassword', 'password')); |
| | | input_curpasswd.focus(); |
| | | } |
| | | else if (input_newpasswd && input_newpasswd.value == '') { |
| | | alert(rcmail.gettext('nopassword', 'password')); |
| | | alert(rcmail.get_label('nopassword', 'password')); |
| | | input_newpasswd.focus(); |
| | | } |
| | | else if (input_confpasswd && input_confpasswd.value == '') { |
| | | alert(rcmail.gettext('nopassword', 'password')); |
| | | alert(rcmail.get_label('nopassword', 'password')); |
| | | input_confpasswd.focus(); |
| | | } |
| | | else if (input_newpasswd && input_confpasswd && input_newpasswd.value != input_confpasswd.value) { |
| | | alert(rcmail.gettext('passwordinconsistency', 'password')); |
| | | alert(rcmail.get_label('passwordinconsistency', 'password')); |
| | | input_newpasswd.focus(); |
| | | } |
| | | else { |
| | |
| | | /* Show user-info plugin script */ |
| | | |
| | | if (window.rcmail) { |
| | | rcmail.addEventListener('init', function(evt) { |
| | | rcmail.addEventListener('init', function() { |
| | | // <span id="settingstabdefault" class="tablink"><roundcube:button command="preferences" type="link" label="preferences" title="editpreferences" /></span> |
| | | var tab = $('<span>').attr('id', 'settingstabpluginuserinfo').addClass('tablink'); |
| | | |
| | | var button = $('<a>').attr('href', rcmail.env.comm_path+'&_action=plugin.userinfo').html(rcmail.gettext('userinfo', 'userinfo')).appendTo(tab); |
| | | button.click(function(e) { return rcmail.command('plugin.userinfo', this); }); |
| | | $('<a>').attr('href', rcmail.env.comm_path + '&_action=plugin.userinfo') |
| | | .text(rcmail.get_label('userinfo', 'userinfo')) |
| | | .click(function(e) { return rcmail.command('plugin.userinfo', '', this, e); }) |
| | | .appendTo(tab); |
| | | |
| | | // add button and register command |
| | | rcmail.add_element(tab, 'tabs'); |
| | |
| | | link.html('').append(span); |
| | | } |
| | | |
| | | span.text(rcmail.gettext('zipdownload.download')); |
| | | span.text(rcmail.get_label('zipdownload.download')); |
| | | rcmail.env.download_link = link; |
| | | }); |
| | | }); |
| | |
| | | '<textarea name="text" id="ffresponsetext" cols="40" rows="8"></textarea></div>' + |
| | | '</form>'; |
| | | |
| | | buttons[this.gettext('save')] = function(e) { |
| | | buttons[this.get_label('save')] = function(e) { |
| | | var name = $('#ffresponsename').val(), |
| | | text = $('#ffresponsetext').val(); |
| | | |
| | |
| | | $(this).dialog('close'); |
| | | }; |
| | | |
| | | buttons[this.gettext('cancel')] = function() { |
| | | buttons[this.get_label('cancel')] = function() { |
| | | $(this).dialog('close'); |
| | | }; |
| | | |
| | | this.show_popup_dialog(html, this.gettext('newresponse'), buttons, {button_classes: ['mainaction']}); |
| | | this.show_popup_dialog(html, this.get_label('newresponse'), buttons, {button_classes: ['mainaction']}); |
| | | |
| | | $('#ffresponsetext').val(text); |
| | | $('#ffresponsename').select(); |
| | |
| | | // add link to pop back to parent group |
| | | if (this.env.address_group_stack.length > 1) { |
| | | $('<a href="#list">...</a>') |
| | | .attr('title', this.gettext('uponelevel')) |
| | | .attr('title', this.get_label('uponelevel')) |
| | | .addClass('poplink') |
| | | .appendTo(boxtitle) |
| | | .click(function(e){ return ref.command('popgroup','',this); }); |
| | |
| | | if (uri = e.dataTransfer.getData('roundcube-uri')) { |
| | | var ts = new Date().getTime(), |
| | | // jQuery way to escape filename (#1490530) |
| | | content = $('<span>').text(e.dataTransfer.getData('roundcube-name') || this.gettext('attaching')).html(); |
| | | content = $('<span>').text(e.dataTransfer.getData('roundcube-name') || this.get_label('attaching')).html(); |
| | | |
| | | args._uri = uri; |
| | | args._uploadid = ts; |
| | |
| | | |
| | | // open image selector dialog |
| | | dialog = this.editor.windowManager.open({ |
| | | title: rcmail.gettext('select' + type), |
| | | title: rcmail.get_label('select' + type), |
| | | width: 500, |
| | | height: 300, |
| | | html: '<div id="image-selector-list"><ul></ul></div>' |
| | |
| | | .text($('div.hint', rcmail.gui_objects.uploadform).text())); |
| | | |
| | | // init upload button |
| | | elem = $('#image-upload-button').append($('<span>').text(rcmail.gettext('add' + type))); |
| | | elem = $('#image-upload-button').append($('<span>').text(rcmail.get_label('add' + type))); |
| | | cancel = elem.parents('.mce-panel').find('button:last').parent(); |
| | | |
| | | // we need custom Tab key handlers, until we find out why |