Merge pull request #1510 from nextcloud/workflow-fix-handlebar-update

Fix selection of workflowengine rules and operators
This commit is contained in:
Morris Jobke 2016-09-26 17:33:22 +02:00 committed by GitHub
commit 3e4a4cab34
5 changed files with 9 additions and 9 deletions

View File

@ -21,7 +21,7 @@
(function() {
Handlebars.registerHelper('selectItem', function(currentValue, itemValue) {
if(currentValue === itemValue) {
return 'selected=selected';
return 'selected="selected"';
}
return "";

View File

@ -41,9 +41,9 @@
return;
}
var placeholder = t('workflowengine', 'text/plain');
var placeholder = 'text/plain';
if (check['operator'] === 'matches' || check['operator'] === '!matches') {
placeholder = t('workflowengine', '/^text\\/(plain|html)$/i');
placeholder = '/^text\\/(plain|html)$/i';
if (this._validateRegex(check['value'])) {
$(element).removeClass('invalid-input');

View File

@ -42,10 +42,10 @@
return;
}
var placeholder = t('workflowengine', 'https://localhost/index.php');
var placeholder = 'https://localhost/index.php';
if (check['operator'] === 'matches' || check['operator'] === '!matches') {
placeholder = t('workflowengine', '/^https\\:\\/\\/localhost\\/index\\.php$/i');
placeholder = '/^https\\:\\/\\/localhost\\/index\\.php$/i';
}
$(element).css('width', '250px')

View File

@ -42,10 +42,10 @@
return;
}
var placeholder = t('workflowengine', 'Mozilla/5.0 User Agent');
var placeholder = 'Mozilla/5.0 User Agent';
if (check['operator'] === 'matches' || check['operator'] === '!matches') {
placeholder = t('workflowengine', '/^Mozilla\\/5\\.0 (.?)$/i');
placeholder = '/^Mozilla\\/5\\.0 (.?)$/i';
}
$(element).css('width', '250px')

View File

@ -55,12 +55,12 @@
<div class="check" data-id="{{@index}}">
<select class="check-class">
{{#each ../classes}}
<option value="{{class}}" {{selectItem class ../class}}>{{name}}</option>
<option value="{{class}}" {{{selectItem class ../class}}}>{{name}}</option>
{{/each}}
</select>
<select class="check-operator">
{{#each (getOperators class)}}
<option value="{{operator}}" {{selectItem operator ../operator}}>{{name}}</option>
<option value="{{operator}}" {{{selectItem operator ../operator}}}>{{name}}</option>
{{/each}}
</select>
<input type="text" class="check-value" value="{{value}}">