Merge pull request #8690 from nextcloud/feature/8565/make-thunderbird-and-outlook-addons-identifyable

[Part2] Make thunderbird and outlook addons identifyable
This commit is contained in:
Roeland Jago Douma 2018-08-09 09:55:26 +02:00 committed by GitHub
commit a21c93a3cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 9 deletions

View File

@ -44,7 +44,7 @@
var placeholder = 'Mozilla/5.0 User Agent'; var placeholder = 'Mozilla/5.0 User Agent';
if (check['operator'] === 'matches' || check['operator'] === '!matches') { if (check.operator === 'matches' || check.operator === '!matches') {
placeholder = '/^Mozilla\\/5\\.0 (.*)$/i'; placeholder = '/^Mozilla\\/5\\.0 (.*)$/i';
} }
@ -56,8 +56,8 @@
placement: 'bottom' placement: 'bottom'
}); });
if (check['operator'] === 'matches' || check['operator'] === '!matches') { if (check.operator === 'matches' || check.operator === '!matches') {
if (this._validateRegex(check['value'])) { if (this._validateRegex(check.value)) {
$(element).removeClass('invalid-input'); $(element).removeClass('invalid-input');
} else { } else {
$(element).addClass('invalid-input'); $(element).addClass('invalid-input');
@ -70,21 +70,22 @@
children: [ children: [
{id: 'android', text: t('workflowengine', 'Android client')}, {id: 'android', text: t('workflowengine', 'Android client')},
{id: 'ios', text: t('workflowengine', 'iOS client')}, {id: 'ios', text: t('workflowengine', 'iOS client')},
{id: 'desktop', text: t('workflowengine', 'Desktop client')} {id: 'desktop', text: t('workflowengine', 'Desktop client')},
{id: 'mail', text: t('workflowengine', 'Thunderbird & Outlook addons')}
] ]
} }
]; ];
if (this.predefinedValues.indexOf(check['value']) === -1) { if (this.predefinedValues.indexOf(check.value) === -1) {
data.unshift({ data.unshift({
id: check['value'], id: check.value,
text: check['value'] text: check.value
}) });
} }
$(element).select2({ $(element).select2({
data: data, data: data,
createSearchChoice: function(term) { createSearchChoice: function(term) {
if (self.predefinedValues.indexOf(check['value']) === -1) { if (self.predefinedValues.indexOf(check.value) === -1) {
return { return {
id: term, id: term,
text: term text: term