summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitattributes2
-rw-r--r--apps/workflowengine/.l10nignore1
-rw-r--r--apps/workflowengine/js/workflowengine.js22
-rw-r--r--apps/workflowengine/js/workflowengine.js.map1
-rw-r--r--apps/workflowengine/lib/AppInfo/Application.php14
-rw-r--r--apps/workflowengine/src/admin.js (renamed from apps/workflowengine/js/admin.js)0
-rw-r--r--apps/workflowengine/src/filemimetypeplugin.js (renamed from apps/workflowengine/js/filemimetypeplugin.js)0
-rw-r--r--apps/workflowengine/src/filenameplugin.js (renamed from apps/workflowengine/js/filenameplugin.js)0
-rw-r--r--apps/workflowengine/src/filesizeplugin.js (renamed from apps/workflowengine/js/filesizeplugin.js)0
-rw-r--r--apps/workflowengine/src/filesystemtagsplugin.js (renamed from apps/workflowengine/js/filesystemtagsplugin.js)0
-rw-r--r--apps/workflowengine/src/requestremoteaddressplugin.js (renamed from apps/workflowengine/js/requestremoteaddressplugin.js)0
-rw-r--r--apps/workflowengine/src/requesttimeplugin.js (renamed from apps/workflowengine/js/requesttimeplugin.js)0
-rw-r--r--apps/workflowengine/src/requesturlplugin.js (renamed from apps/workflowengine/js/requesturlplugin.js)0
-rw-r--r--apps/workflowengine/src/requestuseragentplugin.js (renamed from apps/workflowengine/js/requestuseragentplugin.js)0
-rw-r--r--apps/workflowengine/src/templates.js (renamed from apps/workflowengine/js/templates.js)0
-rw-r--r--apps/workflowengine/src/templates/operation.handlebars (renamed from apps/workflowengine/js/templates/operation.handlebars)0
-rw-r--r--apps/workflowengine/src/templates/operations.handlebars (renamed from apps/workflowengine/js/templates/operations.handlebars)0
-rw-r--r--apps/workflowengine/src/usergroupmembershipplugin.js (renamed from apps/workflowengine/js/usergroupmembershipplugin.js)0
-rw-r--r--apps/workflowengine/src/workflowengine.js13
-rw-r--r--apps/workflowengine/webpack.js37
-rw-r--r--webpack.common.js4
21 files changed, 80 insertions, 14 deletions
diff --git a/.gitattributes b/.gitattributes
index c4da00ac354..1e809562fb6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -17,5 +17,7 @@
/apps/twofactor_backupcodes/js/*.js.map binary
/apps/updatenotification/js/updatenotification.js binary
/apps/updatenotification/js/updatenotification.js.map binary
+/apps/workflowengine/js/*.js binary
+/apps/workflowengine/js/*.js.map binary
/settings/js/vue* binary
diff --git a/apps/workflowengine/.l10nignore b/apps/workflowengine/.l10nignore
new file mode 100644
index 00000000000..1062abf23d6
--- /dev/null
+++ b/apps/workflowengine/.l10nignore
@@ -0,0 +1 @@
+js/checkPlugins.js
diff --git a/apps/workflowengine/js/workflowengine.js b/apps/workflowengine/js/workflowengine.js
new file mode 100644
index 00000000000..5555c0f3886
--- /dev/null
+++ b/apps/workflowengine/js/workflowengine.js
@@ -0,0 +1,22 @@
+!function(e){var n={};function t(o){if(n[o])return n[o].exports;var l=n[o]={i:o,l:!1,exports:{}};return e[o].call(l.exports,l,l.exports,t),l.l=!0,l.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var l in e)t.d(o,l,function(n){return e[n]}.bind(null,l));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/js/",t(t.s=0)}([function(e,n,t){"use strict";t.r(n);t(1),t(2),t(3),t(4),t(5),t(6),t(7),t(8),t(9),t(10),t(11);window.OCA.WorkflowEngine=OCA.WorkflowEngine},function(e,n){
+/**
+ * @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+Handlebars.registerHelper("selectItem",function(e,n){return e===n?'selected="selected"':""}),Handlebars.registerHelper("getOperators",function(e){var n=OCA.WorkflowEngine.getCheckByClass(e);return _.isUndefined(n)?[]:n.operators}),OCA.WorkflowEngine=_.extend(OCA.WorkflowEngine||{},{availablePlugins:[],availableChecks:[],getCheckByClass:function(e){for(var n=OCA.WorkflowEngine.availableChecks.length,t=0;t<n;t++)if(OCA.WorkflowEngine.availableChecks[t].class===e)return OCA.WorkflowEngine.availableChecks[t]}}),OCA.WorkflowEngine.Operation=OC.Backbone.Model.extend({defaults:{class:"OCA\\WorkflowEngine\\Operation",name:"",checks:[],operation:""}}),OCA.WorkflowEngine.OperationsCollection=OC.Backbone.Collection.extend({model:OCA.WorkflowEngine.Operation,url:OC.generateUrl("apps/workflowengine/operations")}),OCA.WorkflowEngine.OperationView=OC.Backbone.View.extend({templateId:"#operation-template",events:{"change .check-class":"checkChanged","change .check-operator":"checkChanged","change .check-value":"checkChanged","change .operation-name":"operationChanged","change .operation-operation":"operationChanged","click .button-reset":"reset","click .button-save":"save","click .button-add":"add","click .button-delete":"delete","click .button-delete-check":"deleteCheck"},originalModel:null,hasChanged:!1,message:"",errorMessage:"",saving:!1,groups:[],template:function(e){return OCA.WorkflowEngine.Templates.operation(_.extend({shortRuleDescTXT:t("workflowengine","Short rule description"),addRuleTXT:t("workflowengine","Add rule"),resetTXT:t("workflowengine","Reset"),saveTXT:t("workflowengine","Save"),savingTXT:t("workflowengine","Saving…")},e))},initialize:function(){this.originalModel=JSON.parse(JSON.stringify(this.model)),this.model.on("change",function(){console.log("model changed"),this.hasChanged=!0,this.render()},this),void 0===this.model.get("id")&&(this.hasChanged=!0);var e=this;$.ajax({url:OC.linkToOCS("cloud/groups",2)+"details",dataType:"json",quietMillis:100}).success(function(n){n.ocs.data.groups&&n.ocs.data.groups.length>0?(n.ocs.data.groups.forEach(function(n){e.groups.push({id:n.id,displayname:n.displayname})}),e.render()):(OC.Notification.error(t("workflowengine","Group list is empty"),{type:"error"}),console.log(n))}).error(function(e){OC.Notification.error(t("workflowengine","Unable to retrieve the group list"),{type:"error"}),console.log(e)})},delete:function(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.delete,this)):(this.model.destroy(),this.remove())},reset:function(){this.hasChanged=!1,this.model.set(this.originalModel,{silent:!0}),this.render()},save:function(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.save,this)):(this.hasChanged=!1,this.saving=!0,this.render(),this.model.save(null,{success:function(e,n,o){this.saving=!1,this.originalModel=JSON.parse(JSON.stringify(this.model)),this.message=t("workflowengine","Saved"),this.errorMessage="",this.render()},error:function(e,n,o){this.saving=!1,this.hasChanged=!0,this.message=t("workflowengine","Saving failed:"),this.errorMessage=n.responseText,this.render()},context:this}))},add:function(){var e=_.clone(this.model.get("checks")),n=OCA.WorkflowEngine.availableChecks[0].class,t=OCA.WorkflowEngine.availableChecks[0].operators;e.push({class:n,operator:t[0].operator,value:""}),this.model.set({checks:e})},checkChanged:function(e){for(var n=e.target.value,t=$(e.target.parentElement).data("id"),o=JSON.parse(JSON.stringify(this.model.get("checks"))),l=null,a=0;a<e.target.classList.length;a++){var i=e.target.classList[a];if("check-"===i.substr(0,"check-".length)){l=i.substr("check-".length);break}}if(null!==l)if(_.has(o[t],l)){if(o[t][l]=n,"class"===l){var r=OCA.WorkflowEngine.getCheckByClass(n);_.isUndefined(r)||(o[t].operator=r.operators[0].operator,o[t].value="")}this.model.set({checks:o})}else console.warn('key "'+l+'" is not available in check',r);else console.warn('checkChanged triggered but element doesn\'t have any "check-" class')},deleteCheck:function(e){console.log(arguments);var n=$(e.target.parentElement).data("id"),t=JSON.parse(JSON.stringify(this.model.get("checks")));t.splice(n,1),this.model.set({checks:t})},operationChanged:function(e){for(var n=e.target.value,t=null,o=0;o<e.target.classList.length;o++){var l=e.target.classList[o];if("operation-"===l.substr(0,"operation-".length)){t=l.substr("operation-".length);break}}null!==t?"name"===t||"operation"===t?this.model.set(t,n):console.warn('key "'+t+'" is no valid attribute'):console.warn('operationChanged triggered but element doesn\'t have any "operation-" class')},render:function(){this.$el.html(this.template({operation:this.model.toJSON(),classes:OCA.WorkflowEngine.availableChecks,hasChanged:this.hasChanged,message:this.message,errorMessage:this.errorMessage,saving:this.saving}));var e=this.model.get("checks");return _.each(this.$el.find(".check"),function(n){var t=$(n),o=t.data("id"),l=e[o],a=t.find(".check-value").first(),i=this;_.each(OCA.WorkflowEngine.availablePlugins,function(e){_.isFunction(e.render)&&e.render(a,l,i.groups)})},this),""!==this.message&&(_.delay(function(e){$(e).css("opacity",0)},7e3,this.$el.find(".msg.success")),this.message=""),this.$el}}),OCA.WorkflowEngine.OperationsView=OC.Backbone.View.extend({templateId:"#operations-template",collection:null,$el:null,events:{"click .button-add-operation":"add"},template:function(e){return OCA.WorkflowEngine.Templates.operations(_.extend({addRuleGroupTXT:t("workflowengine","Add rule group")},e))},initialize:function(e){OCA.WorkflowEngine.availablePlugins.length||(OCA.WorkflowEngine.availablePlugins=OC.Plugins.getPlugins("OCA.WorkflowEngine.CheckPlugins"),_.each(OCA.WorkflowEngine.availablePlugins,function(n){_.isFunction(n.getCheck)&&OCA.WorkflowEngine.availableChecks.push(n.getCheck(e))})),this.collection.fetch({data:{class:e}}),this.collection.once("sync",this.render,this)},add:function(){var e=this.collection.create();this.renderOperation(e)},renderOperation:function(e){this.$el.find(".operations").append(e.$el),e.render()},render:function(){this.$el.html(this.template()),this.collection.each(this.renderOperation,this)}})},function(e,n){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o,l;o=Handlebars.template,(l=OCA.WorkflowEngine.Templates=OCA.WorkflowEngine.Templates||{}).operation=o({1:function(e,n,t,o,l){return" modified"},3:function(e,n,t,o,l){return'\t\t\t<span class="button-delete icon-delete"></span>\n'},5:function(e,n,o,l,a,i,r){var s,c,u=null!=n?n:e.nullContext||{},g=o.helperMissing,f=e.escapeExpression;return'\t\t\t<div class="check" data-id="'+f("function"===t(c=null!=(c=o.index||a&&a.index)?c:g)?c.call(u,{name:"index",hash:{},data:a}):c)+'">\n\t\t\t\t<select class="check-class">\n'+(null!=(s=o.each.call(u,null!=r[1]?r[1].classes:r[1],{name:"each",hash:{},fn:e.program(6,a,0,i,r),inverse:e.noop,data:a}))?s:"")+'\t\t\t\t</select>\n\t\t\t\t<select class="check-operator">\n'+(null!=(s=o.each.call(u,(o.getOperators||n&&n.getOperators||g).call(u,null!=n?n.class:n,{name:"getOperators",hash:{},data:a}),{name:"each",hash:{},fn:e.program(8,a,0,i,r),inverse:e.noop,data:a}))?s:"")+'\t\t\t\t</select>\n\t\t\t\t<input type="text" class="check-value" value="'+f("function"===t(c=null!=(c=o.value||(null!=n?n.value:n))?c:g)?c.call(u,{name:"value",hash:{},data:a}):c)+'">\n\t\t\t\t<span class="button-delete-check icon-delete"></span>\n\t\t\t</div>\n'},6:function(e,n,o,l,a,i,r){var s,c,u=null!=n?n:e.nullContext||{},g=o.helperMissing,f=e.escapeExpression;return'\t\t\t\t\t\t<option value="'+f("function"===t(c=null!=(c=o.class||(null!=n?n.class:n))?c:g)?c.call(u,{name:"class",hash:{},data:a}):c)+'" '+(null!=(s=(o.selectItem||n&&n.selectItem||g).call(u,null!=n?n.class:n,null!=r[1]?r[1].class:r[1],{name:"selectItem",hash:{},data:a}))?s:"")+">"+f("function"===t(c=null!=(c=o.name||(null!=n?n.name:n))?c:g)?c.call(u,{name:"name",hash:{},data:a}):c)+"</option>\n"},8:function(e,n,o,l,a,i,r){var s,c,u=null!=n?n:e.nullContext||{},g=o.helperMissing,f=e.escapeExpression;return'\t\t\t\t\t\t<option value="'+f("function"===t(c=null!=(c=o.operator||(null!=n?n.operator:n))?c:g)?c.call(u,{name:"operator",hash:{},data:a}):c)+'" '+(null!=(s=(o.selectItem||n&&n.selectItem||g).call(u,null!=n?n.operator:n,null!=r[1]?r[1].operator:r[1],{name:"selectItem",hash:{},data:a}))?s:"")+">"+f("function"===t(c=null!=(c=o.name||(null!=n?n.name:n))?c:g)?c.call(u,{name:"name",hash:{},data:a}):c)+"</option>\n"},10:function(e,n,t,o,l){var a,i,r=null!=n?n:e.nullContext||{};return(null!=(a=t.if.call(r,null!=(a=null!=n?n.operation:n)?a.id:a,{name:"if",hash:{},fn:e.program(11,l,0),inverse:e.noop,data:l}))?a:"")+'\t\t<button class="button-save pull-right">'+e.escapeExpression("function"==typeof(i=null!=(i=t.saveTXT||(null!=n?n.saveTXT:n))?i:t.helperMissing)?i.call(r,{name:"saveTXT",hash:{},data:l}):i)+"</button>\n"},11:function(e,n,t,o,l){var a;return'\t\t\t<button class="button-reset pull-right">'+e.escapeExpression("function"==typeof(a=null!=(a=t.resetTXT||(null!=n?n.resetTXT:n))?a:t.helperMissing)?a.call(null!=n?n:e.nullContext||{},{name:"resetTXT",hash:{},data:l}):a)+"</button>\n"},13:function(e,n,t,o,l){var a;return'\t\t<span class="icon-loading-small pull-right"></span>\n\t\t<span class="pull-right">'+e.escapeExpression("function"==typeof(a=null!=(a=t.savingTXT||(null!=n?n.savingTXT:n))?a:t.helperMissing)?a.call(null!=n?n:e.nullContext||{},{name:"savingTXT",hash:{},data:l}):a)+"</span>\n\t"},15:function(e,n,t,o,l){var a;return null!=(a=t.if.call(null!=n?n:e.nullContext||{},null!=n?n.message:n,{name:"if",hash:{},fn:e.program(16,l,0),inverse:e.noop,data:l}))?a:""},16:function(e,n,t,o,l){var a,i,r=null!=n?n:e.nullContext||{};return'\n\t\t<span class="msg pull-right '+(null!=(a=t.if.call(r,null!=n?n.errorMessage:n,{name:"if",hash:{},fn:e.program(17,l,0),inverse:e.program(19,l,0),data:l}))?a:"")+'">\n\t\t\t\t\t'+e.escapeExpression("function"==typeof(i=null!=(i=t.message||(null!=n?n.message:n))?i:t.helperMissing)?i.call(r,{name:"message",hash:{},data:l}):i)+(null!=(a=t.if.call(r,null!=n?n.errorMessage:n,{name:"if",hash:{},fn:e.program(21,l,0),inverse:e.noop,data:l}))?a:"")+"\n\t\t\t\t</span>\n\t"},17:function(e,n,t,o,l){return"error"},19:function(e,n,t,o,l){return"success"},21:function(e,n,t,o,l){var a;return" "+e.escapeExpression("function"==typeof(a=null!=(a=t.errorMessage||(null!=n?n.errorMessage:n))?a:t.helperMissing)?a.call(null!=n?n:e.nullContext||{},{name:"errorMessage",hash:{},data:l}):a)},compiler:[7,">= 4.0.0"],main:function(e,n,o,l,a,i,r){var s,c,u=null!=n?n:e.nullContext||{},g=o.helperMissing,f=e.escapeExpression,d=e.lambda;return'<div class="operation'+(null!=(s=o.if.call(u,null!=n?n.hasChanged:n,{name:"if",hash:{},fn:e.program(1,a,0,i,r),inverse:e.noop,data:a}))?s:"")+'">\n\t<div class="operation-header">\n\t\t<input type="text" class="operation-name" placeholder="'+f("function"===t(c=null!=(c=o.shortRuleDescTXT||(null!=n?n.shortRuleDescTXT:n))?c:g)?c.call(u,{name:"shortRuleDescTXT",hash:{},data:a}):c)+'" value="'+f(d(null!=(s=null!=n?n.operation:n)?s.name:s,n))+'" />\n\t\t<input type="text" class="operation-operation" value="'+f(d(null!=(s=null!=n?n.operation:n)?s.operation:s,n))+'" />\n'+(null!=(s=o.if.call(u,null!=(s=null!=n?n.operation:n)?s.id:s,{name:"if",hash:{},fn:e.program(3,a,0,i,r),inverse:e.noop,data:a}))?s:"")+'\t</div>\n\n\t<div class="checks">\n'+(null!=(s=o.each.call(u,null!=(s=null!=n?n.operation:n)?s.checks:s,{name:"each",hash:{},fn:e.program(5,a,0,i,r),inverse:e.noop,data:a}))?s:"")+'\t</div>\n\t<button class="button-add">'+f("function"===t(c=null!=(c=o.addRuleTXT||(null!=n?n.addRuleTXT:n))?c:g)?c.call(u,{name:"addRuleTXT",hash:{},data:a}):c)+"</button>\n"+(null!=(s=o.if.call(u,null!=n?n.hasChanged:n,{name:"if",hash:{},fn:e.program(10,a,0,i,r),inverse:e.noop,data:a}))?s:"")+(null!=(s=o.if.call(u,null!=n?n.saving:n,{name:"if",hash:{},fn:e.program(13,a,0,i,r),inverse:e.program(15,a,0,i,r),data:a}))?s:"")+"\n</div>\n"},useData:!0,useDepths:!0}),l.operations=o({compiler:[7,">= 4.0.0"],main:function(e,n,t,o,l){var a;return'<div class="operations"></div>\n<button class="button-add-operation">'+e.escapeExpression("function"==typeof(a=null!=(a=t.addRuleGroupTXT||(null!=n?n.addRuleGroupTXT:n))?a:t.helperMissing)?a.call(null!=n?n:e.nullContext||{},{name:"addRuleGroupTXT",hash:{},data:l}):a)+"</button>\n"},useData:!0})},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileMimeTypePlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\FileMimeType",name:t("workflowengine","File MIME type"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\FileMimeType"===n.class){var o="text/plain";"matches"!==n.operator&&"!matches"!==n.operator||(o="/^text\\/(plain|html)$/i",this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input")),$(e).css("width","250px").attr("placeholder",o).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:o})).addClass("has-tooltip").tooltip({placement:"bottom"})}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileMimeTypePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileNamePlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\FileName",name:t("workflowengine","File name"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\FileName"===n.class){var o="dummy.jpg";"matches"!==n.operator&&"!matches"!==n.operator||(o="/^dummy-.+$/i",this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input")),$(e).css("width","250px").attr("placeholder",o).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:o})).addClass("has-tooltip").tooltip({placement:"bottom"})}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileNamePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileSizePlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\FileSize",name:t("workflowengine","File size (upload)"),operators:[{operator:"less",name:t("workflowengine","less")},{operator:"!greater",name:t("workflowengine","less or equals")},{operator:"!less",name:t("workflowengine","greater or equals")},{operator:"greater",name:t("workflowengine","greater")}]}},render:function(e,n){"OCA\\WorkflowEngine\\Check\\FileSize"===n.class&&$(e).css("width","250px").attr("placeholder","12 MB").attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"12 MB"})).addClass("has-tooltip").tooltip({placement:"bottom"})}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileSizePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin={getCheck:function(){return this.collection=OC.SystemTags.collection,{class:"OCA\\WorkflowEngine\\Check\\FileSystemTags",name:t("workflowengine","File system tag"),operators:[{operator:"is",name:t("workflowengine","is tagged with")},{operator:"!is",name:t("workflowengine","is not tagged with")}]}},render:function(e,n){"OCA\\WorkflowEngine\\Check\\FileSystemTags"===n.class&&($(e).css("width","400px"),$(e).select2({allowClear:!1,multiple:!1,placeholder:t("workflowengine","Select tag…"),query:_.debounce(function(e){e.callback({results:OC.SystemTags.collection.filterByName(e.term)})},100,!0),id:function(e){return e.get("id")},initSelection:function(e,n){n($(e).val())},formatResult:function(e){return OC.SystemTags.getDescriptiveTag(e)},formatSelection:function(e){var n=OC.SystemTags.collection.get(e);if(!_.isUndefined(n))return OC.SystemTags.getDescriptiveTag(n)},escapeMarkup:function(e){return e}}))}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestRemoteAddressPlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestRemoteAddress",name:t("workflowengine","Request remote address"),operators:[{operator:"matchesIPv4",name:t("workflowengine","matches IPv4")},{operator:"!matchesIPv4",name:t("workflowengine","does not match IPv4")},{operator:"matchesIPv6",name:t("workflowengine","matches IPv6")},{operator:"!matchesIPv6",name:t("workflowengine","does not match IPv6")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestRemoteAddress"===n.class){var o="127.0.0.1/32";"matchesIPv6"===n.operator||"!matchesIPv6"===n.operator?(o="::1/128",this._validateIPv6(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input")):this._validateIPv4(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input"),$(e).css("width","300px").attr("placeholder",o).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:o})).addClass("has-tooltip").tooltip({placement:"bottom"})}},_validateIPv4:function(e){return null!==/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2][0-9]|[1-9])$/.exec(e)},_validateIPv6:function(e){return null!==/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(1([01][0-9]|2[0-8])|[1-9][0-9]|[0-9])$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestRemoteAddressPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestTimePlugin={timezones:["Europe/Berlin","Europe/London"],_$element:null,getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestTime",name:t("workflowengine","Request time"),operators:[{operator:"in",name:t("workflowengine","between")},{operator:"!in",name:t("workflowengine","not between")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestTime"===n.class){var o="09:00",l="18:00",a=jstz.determine().name(),i=$(e);if(_.isString(n.value)&&""!==n.value){var r=JSON.parse(n.value),s=r[0].split(" ",2),c=r[1].split(" ",2);o=s[0],l=c[0],a=s[1]}var u=JSON.stringify([o+" "+a,l+" "+a]);n.value!==u&&(n.value=u,i.val(u)),i.css("display","none"),$("<input>").attr("type","text").attr("placeholder",t("workflowengine","Start")).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"16:00"})).addClass("has-tooltip").tooltip({placement:"bottom"}).addClass("start").val(o).insertBefore(i),$("<input>").attr("type","text").attr("placeholder",t("workflowengine","End")).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"16:00"})).addClass("has-tooltip").tooltip({placement:"bottom"}).addClass("end").val(l).insertBefore(i);var g=$("<input>").attr("type","hidden").css("width","250px").insertBefore(i).val(a);g.select2({allowClear:!1,multiple:!1,placeholder:t("workflowengine","Select timezone…"),ajax:{url:OC.generateUrl("apps/workflowengine/timezones"),dataType:"json",quietMillis:100,data:function(e){return""===e&&(e=(e=jstz.determine().name().split("/"))[0]),{search:e}},results:function(e){var n=[];return $.each(e,function(e){n.push({id:e})}),{results:n,more:!1}}},initSelection:function(e,n){n(e.val())},formatResult:function(e){return"<span>"+e.id+"</span>"},formatSelection:function(e){return _.isUndefined(e.id)||(e=e.id),"<span>"+e+"</span>"}}),g.addClass("timezone"),i.parent().on("change",".start",_.bind(this.update,this)).on("change",".end",_.bind(this.update,this)).on("change",".timezone",_.bind(this.update,this)),this._$element=i}},update:function(e){for(var n=e.target.value,t=null,o=0;o<e.target.classList.length;o++)t=e.target.classList[o];if(null!==t){var l=JSON.parse(this._$element.val()),a=moment(l[0].split(" ",2)[0],"H:m Z"),i=moment(l[1].split(" ",2)[0],"H:m Z"),r=l[0].split(" ",2)[1];if("start"===t||"end"===t){var s=moment(n,["H:m","h:m a"],!0).format("HH:mm");if("Invalid date"===s)return;var c=0;"end"===t&&(c=1),l[c]=s+" "+r}"timezone"===t&&(l[0]=a.format("HH:mm")+" "+n,l[1]=i.format("HH:mm")+" "+n),this._$element.val(JSON.stringify(l)),this._$element.trigger("change")}else console.warn("update triggered but element doesn't have any class")}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestTimePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestURLPlugin={predefinedValues:["webdav"],getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestURL",name:t("workflowengine","Request URL"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestURL"===n.class){var o="https://localhost/index.php";if("matches"!==n.operator&&"!matches"!==n.operator||(o="/^https\\:\\/\\/localhost\\/index\\.php$/i"),$(e).css("width","250px").attr("placeholder",o).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:o})).addClass("has-tooltip").tooltip({placement:"bottom"}),"matches"===n.operator||"!matches"===n.operator)this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input");else{var l=this,a=[{text:t("workflowengine","Predefined URLs"),children:[{id:"webdav",text:t("workflowengine","Files WebDAV")}]}];-1===this.predefinedValues.indexOf(n.value)&&a.unshift({id:n.value,text:n.value}),$(e).select2({data:a,createSearchChoice:function(e){if(-1===l.predefinedValues.indexOf(n.value))return{id:e,text:e}},id:function(e){return e.id},formatResult:function(e){return e.text},formatSelection:function(e){return e.text},escapeMarkup:function(e){return e}})}}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestURLPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestUserAgentPlugin={predefinedValues:["android","ios","desktop"],getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestUserAgent",name:t("workflowengine","Request user agent"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestUserAgent"===n.class){var o="Mozilla/5.0 User Agent";if("matches"!==n.operator&&"!matches"!==n.operator||(o="/^Mozilla\\/5\\.0 (.*)$/i"),$(e).css("width","250px").attr("placeholder",o).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:o})).addClass("has-tooltip").tooltip({placement:"bottom"}),"matches"===n.operator||"!matches"===n.operator)this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input");else{var l=this,a=[{text:t("workflowengine","Sync clients"),children:[{id:"android",text:t("workflowengine","Android client")},{id:"ios",text:t("workflowengine","iOS client")},{id:"desktop",text:t("workflowengine","Desktop client")},{id:"mail",text:t("workflowengine","Thunderbird & Outlook addons")}]}];-1===this.predefinedValues.indexOf(n.value)&&a.unshift({id:n.value,text:n.value}),$(e).select2({data:a,createSearchChoice:function(e){if(-1===l.predefinedValues.indexOf(n.value))return{id:e,text:e}},id:function(e){return e.id},formatResult:function(e){return e.text},formatSelection:function(e){return e.text},escapeMarkup:function(e){return e}})}}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestUserAgentPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\UserGroupMembership",name:t("workflowengine","User group membership"),operators:[{operator:"is",name:t("workflowengine","is member of")},{operator:"!is",name:t("workflowengine","is not member of")}]}},render:function(e,n,t){"OCA\\WorkflowEngine\\Check\\UserGroupMembership"===n.class&&($(e).css("width","400px"),$(e).select2({data:{results:t,text:"displayname"},initSelection:function(e,n){var o=e.val();o&&t.length>0?n({id:o,displayname:t.find(function(e){return e.id===o}).displayname}):o?n({id:o,displayname:o}):n()},formatResult:function(e){return"<span>"+escapeHTML(e.displayname)+"</span>"},formatSelection:function(e){return'<span title="'+escapeHTML(e.id)+'">'+escapeHTML(e.displayname)+"</span>"}}))}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin)}]);
+//# sourceMappingURL=workflowengine.js.map \ No newline at end of file
diff --git a/apps/workflowengine/js/workflowengine.js.map b/apps/workflowengine/js/workflowengine.js.map
new file mode 100644
index 00000000000..cbdbafd4bb3
--- /dev/null
+++ b/apps/workflowengine/js/workflowengine.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./apps/workflowengine/src/workflowengine.js","webpack:///./apps/workflowengine/src/admin.js","webpack:///./apps/workflowengine/src/templates.js","webpack:///./apps/workflowengine/src/filemimetypeplugin.js","webpack:///./apps/workflowengine/src/filenameplugin.js","webpack:///./apps/workflowengine/src/filesizeplugin.js","webpack:///./apps/workflowengine/src/filesystemtagsplugin.js","webpack:///./apps/workflowengine/src/requestremoteaddressplugin.js","webpack:///./apps/workflowengine/src/requesttimeplugin.js","webpack:///./apps/workflowengine/src/requesturlplugin.js","webpack:///./apps/workflowengine/src/requestuseragentplugin.js","webpack:///./apps/workflowengine/src/usergroupmembershipplugin.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","window","OCA","WorkflowEngine","Handlebars","registerHelper","currentValue","itemValue","classname","check","getCheckByClass","_","isUndefined","extend","availablePlugins","availableChecks","className","length","Operation","OC","Backbone","Model","defaults","class","checks","operation","OperationsCollection","Collection","model","url","generateUrl","OperationView","View","templateId","events","change .check-class","change .check-operator","change .check-value","change .operation-name","change .operation-operation","click .button-reset","click .button-save","click .button-add","click .button-delete","click .button-delete-check","originalModel","hasChanged","message","errorMessage","saving","groups","template","vars","Templates","shortRuleDescTXT","addRuleTXT","resetTXT","saveTXT","savingTXT","initialize","this","JSON","parse","stringify","on","console","log","render","undefined","self","$","ajax","linkToOCS","dataType","quietMillis","success","data","ocs","forEach","group","push","id","displayname","Notification","error","type","delete","PasswordConfirmation","requiresPasswordConfirmation","requirePasswordConfirmation","destroy","remove","reset","set","silent","save","response","options","responseText","context","add","clone","operators","operator","checkChanged","event","target","parentElement","classList","substr","has","warn","deleteCheck","arguments","splice","operationChanged","$el","html","toJSON","classes","each","find","element","$element","valueElement","first","plugin","isFunction","delay","elements","css","OperationsView","collection","click .button-add-operation","addRuleGroupTXT","Plugins","getPlugins","getCheck","fetch","once","renderOperation","subView","append","templates","1","container","depth0","helpers","partials","3","5","blockParams","depths","stack1","helper","alias1","nullContext","alias2","helperMissing","alias4","escapeExpression","_typeof","index","hash","fn","program","inverse","noop","getOperators","6","selectItem","8","10","11","13","15","16","17","19","21","compiler","main","alias5","lambda","useData","useDepths","FileMimeTypePlugin","placeholder","_validateRegex","removeClass","addClass","attr","tooltip","placement","string","exec","register","FileNamePlugin","FileSizePlugin","FileSystemTagsPlugin","SystemTags","select2","allowClear","multiple","query","debounce","callback","results","filterByName","term","initSelection","val","formatResult","tag","getDescriptiveTag","formatSelection","tagId","escapeMarkup","RequestRemoteAddressPlugin","_validateIPv6","_validateIPv4","RequestTimePlugin","timezones","_$element","startTime","endTime","timezone","jstz","determine","isString","splittedStart","split","splittedEnd","valueJSON","insertBefore","timezoneInput","search","more","parent","update","moment","parsedDate","format","indexValue","trigger","RequestURLPlugin","predefinedValues","text","children","indexOf","unshift","createSearchChoice","RequestUserAgentPlugin","UserGroupMembershipPlugin","groupId","escapeHTML"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OA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I6K,EACJ5K,YAAahC,EAAOuE,KAAK,SAAU1C,GAClC,OAAOA,EAAME,KAAO6K,IAClB5K,cAEM4K,EACVhD,EAAS,CACR7H,GAAI6K,EACJ5K,YAAa4K,IAGdhD,KAGFM,aAAc,SAAU1F,GACvB,MAAO,SAAWqI,WAAWrI,EAAQxC,aAAe,WAErDqI,gBAAiB,SAAU7F,GAC1B,MAAO,gBAAgBqI,WAAWrI,EAAQzC,IAAI,KAAK8K,WAAWrI,EAAQxC,aAAa,gBAOxF/D,GAAGoH,QAAQ6D,SAAS,kCAAmClM,IAAIC,eAAeoI,QAAQsH","file":"workflowengine.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/js/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import './admin'\nimport './templates'\nimport './filemimetypeplugin'\nimport './filenameplugin'\nimport './filesizeplugin'\nimport './filesystemtagsplugin'\nimport './requestremoteaddressplugin'\nimport './requesttimeplugin'\nimport './requesturlplugin'\nimport './requestuseragentplugin'\nimport './usergroupmembershipplugin'\n\nwindow.OCA.WorkflowEngine = OCA.WorkflowEngine\n","/**\n * @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\tHandlebars.registerHelper('selectItem', function(currentValue, itemValue) {\n\t\tif (currentValue === itemValue) {\n\t\t\treturn 'selected=\"selected\"';\n\t\t}\n\n\t\treturn \"\";\n\t});\n\n\tHandlebars.registerHelper('getOperators', function(classname) {\n\t\tvar check = OCA.WorkflowEngine.getCheckByClass(classname);\n\t\tif (!_.isUndefined(check)) {\n\t\t\treturn check['operators'];\n\t\t}\n\t\treturn [];\n\t});\n\n\tOCA.WorkflowEngine = _.extend(OCA.WorkflowEngine || {}, {\n\t\tavailablePlugins: [],\n\t\tavailableChecks: [],\n\n\t\tgetCheckByClass: function(className) {\n\t\t\tvar length = OCA.WorkflowEngine.availableChecks.length;\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\tif (OCA.WorkflowEngine.availableChecks[i]['class'] === className) {\n\t\t\t\t\treturn OCA.WorkflowEngine.availableChecks[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t});\n\n\t/**\n\t * 888b d888 888 888\n\t * 8888b d8888 888 888\n\t * 88888b.d88888 888 888\n\t * 888Y88888P888 .d88b. .d88888 .d88b. 888 .d8888b\n\t * 888 Y888P 888 d88\"\"88b d88\" 888 d8P Y8b 888 88K\n\t * 888 Y8P 888 888 888 888 888 88888888 888 \"Y8888b.\n\t * 888 \" 888 Y88..88P Y88b 888 Y8b. 888 X88\n\t * 888 888 \"Y88P\" \"Y88888 \"Y8888 888 88888P'\n\t */\n\n\t/**\n\t * @class OCA.WorkflowEngine.Operation\n\t */\n\tOCA.WorkflowEngine.Operation =\n\t\tOC.Backbone.Model.extend({\n\t\t\tdefaults: {\n\t\t\t\t'class': 'OCA\\\\WorkflowEngine\\\\Operation',\n\t\t\t\t'name': '',\n\t\t\t\t'checks': [],\n\t\t\t\t'operation': ''\n\t\t\t}\n\t\t});\n\n\t/**\n\t * .d8888b. 888 888 888 d8b\n\t * d88P Y88b 888 888 888 Y8P\n\t * 888 888 888 888 888\n\t * 888 .d88b. 888 888 .d88b. .d8888b 888888 888 .d88b. 88888b. .d8888b\n\t * 888 d88\"\"88b 888 888 d8P Y8b d88P\" 888 888 d88\"\"88b 888 \"88b 88K\n\t * 888 888 888 888 888 888 88888888 888 888 888 888 888 888 888 \"Y8888b.\n\t * Y88b d88P Y88..88P 888 888 Y8b. Y88b. Y88b. 888 Y88..88P 888 888 X88\n\t * \"Y8888P\" \"Y88P\" 888 888 \"Y8888 \"Y8888P \"Y888 888 \"Y88P\" 888 888 88888P'\n\t */\n\n\t/**\n\t * @class OCA.WorkflowEngine.OperationsCollection\n\t *\n\t * collection for all configurated operations\n\t */\n\tOCA.WorkflowEngine.OperationsCollection =\n\t\tOC.Backbone.Collection.extend({\n\t\t\tmodel: OCA.WorkflowEngine.Operation,\n\t\t\turl: OC.generateUrl('apps/workflowengine/operations')\n\t\t});\n\n\t/**\n\t * 888 888 d8b\n\t * 888 888 Y8P\n\t * 888 888\n\t * Y88b d88P 888 .d88b. 888 888 888 .d8888b\n\t * Y88b d88P 888 d8P Y8b 888 888 888 88K\n\t * Y88o88P 888 88888888 888 888 888 \"Y8888b.\n\t * Y888P 888 Y8b. Y88b 888 d88P X88\n\t * Y8P 888 \"Y8888 \"Y8888888P\" 88888P'\n\t */\n\n\t/**\n\t * @class OCA.WorkflowEngine.OperationView\n\t *\n\t * this creates the view for a single operation\n\t */\n\tOCA.WorkflowEngine.OperationView =\n\t\tOC.Backbone.View.extend({\n\t\t\ttemplateId: '#operation-template',\n\t\t\tevents: {\n\t\t\t\t'change .check-class': 'checkChanged',\n\t\t\t\t'change .check-operator': 'checkChanged',\n\t\t\t\t'change .check-value': 'checkChanged',\n\t\t\t\t'change .operation-name': 'operationChanged',\n\t\t\t\t'change .operation-operation': 'operationChanged',\n\t\t\t\t'click .button-reset': 'reset',\n\t\t\t\t'click .button-save': 'save',\n\t\t\t\t'click .button-add': 'add',\n\t\t\t\t'click .button-delete': 'delete',\n\t\t\t\t'click .button-delete-check': 'deleteCheck'\n\t\t\t},\n\t\t\toriginalModel: null,\n\t\t\thasChanged: false,\n\t\t\tmessage: '',\n\t\t\terrorMessage: '',\n\t\t\tsaving: false,\n\t\t\tgroups: [],\n\t\t\ttemplate: function(vars) {\n\t\t\t\treturn OCA.WorkflowEngine.Templates['operation'](_.extend(\n\t\t\t\t\t{\n\t\t\t\t\t\tshortRuleDescTXT: t('workflowengine', 'Short rule description'),\n\t\t\t\t\t\taddRuleTXT: t('workflowengine', 'Add rule'),\n\t\t\t\t\t\tresetTXT: t('workflowengine', 'Reset'),\n\t\t\t\t\t\tsaveTXT: t('workflowengine', 'Save'),\n\t\t\t\t\t\tsavingTXT: t('workflowengine', 'Saving…')\n\t\t\t\t\t},\n\t\t\t\t\tvars\n\t\t\t\t));\n\t\t\t},\n\t\t\tinitialize: function() {\n\t\t\t\t// this creates a new copy of the object to definitely have a new reference and being able to reset the model\n\t\t\t\tthis.originalModel = JSON.parse(JSON.stringify(this.model));\n\t\t\t\tthis.model.on('change', function() {\n\t\t\t\t\tconsole.log('model changed');\n\t\t\t\t\tthis.hasChanged = true;\n\t\t\t\t\tthis.render();\n\t\t\t\t}, this);\n\n\t\t\t\tif (this.model.get('id') === undefined) {\n\t\t\t\t\tthis.hasChanged = true;\n\t\t\t\t}\n\t\t\t\tvar self = this;\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: OC.linkToOCS('cloud/groups', 2) + 'details',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tquietMillis: 100,\n\t\t\t\t}).success(function(data) {\n\t\t\t\t\tif (data.ocs.data.groups && data.ocs.data.groups.length > 0) {\n\n\t\t\t\t\t\tdata.ocs.data.groups.forEach(function(group) {\n\t\t\t\t\t\t\tself.groups.push({ id: group.id, displayname: group.displayname });\n\t\t\t\t\t\t});\n\t\t\t\t\t\tself.render();\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tOC.Notification.error(t('workflowengine', 'Group list is empty'), { type: 'error' });\n\t\t\t\t\t\tconsole.log(data);\n\t\t\t\t\t}\n\t\t\t\t}).error(function(data) {\n\t\t\t\t\tOC.Notification.error(t('workflowengine', 'Unable to retrieve the group list'), { type: 'error' });\n\t\t\t\t\tconsole.log(data);\n\t\t\t\t});\n\t\t\t},\n\t\t\tdelete: function() {\n\t\t\t\tif (OC.PasswordConfirmation.requiresPasswordConfirmation()) {\n\t\t\t\t\tOC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.delete, this));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.model.destroy();\n\t\t\t\tthis.remove();\n\t\t\t},\n\t\t\treset: function() {\n\t\t\t\tthis.hasChanged = false;\n\t\t\t\t// silent is need to not trigger the change event which resets the hasChanged attribute\n\t\t\t\tthis.model.set(this.originalModel, { silent: true });\n\t\t\t\tthis.render();\n\t\t\t},\n\t\t\tsave: function() {\n\t\t\t\tif (OC.PasswordConfirmation.requiresPasswordConfirmation()) {\n\t\t\t\t\tOC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.save, this));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar success = function(model, response, options) {\n\t\t\t\t\tthis.saving = false;\n\t\t\t\t\tthis.originalModel = JSON.parse(JSON.stringify(this.model));\n\n\t\t\t\t\tthis.message = t('workflowengine', 'Saved');\n\t\t\t\t\tthis.errorMessage = '';\n\t\t\t\t\tthis.render();\n\t\t\t\t};\n\t\t\t\tvar error = function(model, response, options) {\n\t\t\t\t\tthis.saving = false;\n\t\t\t\t\tthis.hasChanged = true;\n\n\t\t\t\t\tthis.message = t('workflowengine', 'Saving failed:');\n\t\t\t\t\tthis.errorMessage = response.responseText;\n\t\t\t\t\tthis.render();\n\t\t\t\t};\n\t\t\t\tthis.hasChanged = false;\n\t\t\t\tthis.saving = true;\n\t\t\t\tthis.render();\n\t\t\t\tthis.model.save(null, { success: success, error: error, context: this });\n\t\t\t},\n\t\t\tadd: function() {\n\t\t\t\tvar checks = _.clone(this.model.get('checks')),\n\t\t\t\t\tclassname = OCA.WorkflowEngine.availableChecks[0]['class'],\n\t\t\t\t\toperators = OCA.WorkflowEngine.availableChecks[0]['operators'];\n\n\t\t\t\tchecks.push({\n\t\t\t\t\t'class': classname,\n\t\t\t\t\t'operator': operators[0]['operator'],\n\t\t\t\t\t'value': ''\n\t\t\t\t});\n\t\t\t\tthis.model.set({ 'checks': checks });\n\t\t\t},\n\t\t\tcheckChanged: function(event) {\n\t\t\t\tvar value = event.target.value,\n\t\t\t\t\tid = $(event.target.parentElement).data('id'),\n\t\t\t\t\t// this creates a new copy of the object to definitely have a new reference\n\t\t\t\t\tchecks = JSON.parse(JSON.stringify(this.model.get('checks'))),\n\t\t\t\t\tkey = null;\n\n\t\t\t\tfor (var i = 0; i < event.target.classList.length; i++) {\n\t\t\t\t\tvar className = event.target.classList[i];\n\t\t\t\t\tif (className.substr(0, 'check-'.length) === 'check-') {\n\t\t\t\t\t\tkey = className.substr('check-'.length);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (key === null) {\n\t\t\t\t\tconsole.warn('checkChanged triggered but element doesn\\'t have any \"check-\" class');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!_.has(checks[id], key)) {\n\t\t\t\t\tconsole.warn('key \"' + key + '\" is not available in check', check);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tchecks[id][key] = value;\n\t\t\t\t// if the class is changed most likely also the operators have changed\n\t\t\t\t// with this we set the operator to the first possible operator\n\t\t\t\tif (key === 'class') {\n\t\t\t\t\tvar check = OCA.WorkflowEngine.getCheckByClass(value);\n\t\t\t\t\tif (!_.isUndefined(check)) {\n\t\t\t\t\t\tchecks[id]['operator'] = check['operators'][0]['operator'];\n\t\t\t\t\t\tchecks[id]['value'] = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// model change will trigger render\n\t\t\t\tthis.model.set({ 'checks': checks });\n\t\t\t},\n\t\t\tdeleteCheck: function(event) {\n\t\t\t\tconsole.log(arguments);\n\t\t\t\tvar id = $(event.target.parentElement).data('id'),\n\t\t\t\t\tchecks = JSON.parse(JSON.stringify(this.model.get('checks')));\n\n\t\t\t\t// splice removes 1 element at index `id`\n\t\t\t\tchecks.splice(id, 1);\n\t\t\t\t// model change will trigger render\n\t\t\t\tthis.model.set({ 'checks': checks });\n\t\t\t},\n\t\t\toperationChanged: function(event) {\n\t\t\t\tvar value = event.target.value,\n\t\t\t\t\tkey = null;\n\n\t\t\t\tfor (var i = 0; i < event.target.classList.length; i++) {\n\t\t\t\t\tvar className = event.target.classList[i];\n\t\t\t\t\tif (className.substr(0, 'operation-'.length) === 'operation-') {\n\t\t\t\t\t\tkey = className.substr('operation-'.length);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (key === null) {\n\t\t\t\t\tconsole.warn('operationChanged triggered but element doesn\\'t have any \"operation-\" class');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (key !== 'name' && key !== 'operation') {\n\t\t\t\t\tconsole.warn('key \"' + key + '\" is no valid attribute');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// model change will trigger render\n\t\t\t\tthis.model.set(key, value);\n\t\t\t},\n\t\t\trender: function() {\n\t\t\t\tthis.$el.html(this.template({\n\t\t\t\t\toperation: this.model.toJSON(),\n\t\t\t\t\tclasses: OCA.WorkflowEngine.availableChecks,\n\t\t\t\t\thasChanged: this.hasChanged,\n\t\t\t\t\tmessage: this.message,\n\t\t\t\t\terrorMessage: this.errorMessage,\n\t\t\t\t\tsaving: this.saving\n\t\t\t\t}));\n\n\t\t\t\tvar checks = this.model.get('checks');\n\t\t\t\t_.each(this.$el.find('.check'), function(element) {\n\t\t\t\t\tvar $element = $(element),\n\t\t\t\t\t\tid = $element.data('id'),\n\t\t\t\t\t\tcheck = checks[id],\n\t\t\t\t\t\tvalueElement = $element.find('.check-value').first();\n\t\t\t\t\tvar self = this;\n\n\t\t\t\t\t_.each(OCA.WorkflowEngine.availablePlugins, function(plugin) {\n\t\t\t\t\t\tif (_.isFunction(plugin.render)) {\n\t\t\t\t\t\t\tplugin.render(valueElement, check, self.groups);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, this);\n\n\t\t\t\tif (this.message !== '') {\n\t\t\t\t\t// hide success messages after some time\n\t\t\t\t\t_.delay(function(elements) {\n\t\t\t\t\t\t$(elements).css('opacity', 0);\n\t\t\t\t\t}, 7000, this.$el.find('.msg.success'));\n\t\t\t\t\tthis.message = '';\n\t\t\t\t}\n\n\t\t\t\treturn this.$el;\n\t\t\t}\n\t\t});\n\n\t/**\n\t * @class OCA.WorkflowEngine.OperationsView\n\t *\n\t * this creates the view for configured operations\n\t */\n\tOCA.WorkflowEngine.OperationsView =\n\t\tOC.Backbone.View.extend({\n\t\t\ttemplateId: '#operations-template',\n\t\t\tcollection: null,\n\t\t\t$el: null,\n\t\t\tevents: {\n\t\t\t\t'click .button-add-operation': 'add'\n\t\t\t},\n\t\t\ttemplate: function(vars) {\n\t\t\t\treturn OCA.WorkflowEngine.Templates['operations'](_.extend(\n\t\t\t\t\t{\n\t\t\t\t\t\taddRuleGroupTXT: t('workflowengine', 'Add rule group')\n\t\t\t\t\t},\n\t\t\t\t\tvars\n\t\t\t\t));\n\t\t\t},\n\t\t\tinitialize: function(classname) {\n\t\t\t\tif (!OCA.WorkflowEngine.availablePlugins.length) {\n\t\t\t\t\tOCA.WorkflowEngine.availablePlugins = OC.Plugins.getPlugins('OCA.WorkflowEngine.CheckPlugins');\n\t\t\t\t\t_.each(OCA.WorkflowEngine.availablePlugins, function(plugin) {\n\t\t\t\t\t\tif (_.isFunction(plugin.getCheck)) {\n\t\t\t\t\t\t\tOCA.WorkflowEngine.availableChecks.push(plugin.getCheck(classname));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.collection.fetch({\n\t\t\t\t\tdata: {\n\t\t\t\t\t\t'class': classname\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis.collection.once('sync', this.render, this);\n\t\t\t},\n\t\t\tadd: function() {\n\t\t\t\tvar operation = this.collection.create();\n\t\t\t\tthis.renderOperation(operation);\n\t\t\t},\n\t\t\trenderOperation: function(subView) {\n\t\t\t\tvar operationsElement = this.$el.find('.operations');\n\t\t\t\toperationsElement.append(subView.$el);\n\t\t\t\tsubView.render();\n\t\t\t},\n\t\t\trender: function() {\n\t\t\t\tthis.$el.html(this.template());\n\t\t\t\tthis.collection.each(this.renderOperation, this);\n\t\t\t}\n\t\t});\n})();\n","(function() {\n var template = Handlebars.template, templates = OCA.WorkflowEngine.Templates = OCA.WorkflowEngine.Templates || {};\ntemplates['operation'] = template({\"1\":function(container,depth0,helpers,partials,data) {\n return \" modified\";\n},\"3\":function(container,depth0,helpers,partials,data) {\n return \"\t\t\t<span class=\\\"button-delete icon-delete\\\"></span>\\n\";\n},\"5\":function(container,depth0,helpers,partials,data,blockParams,depths) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t<div class=\\\"check\\\" data-id=\\\"\"\n + alias4(((helper = (helper = helpers.index || (data && data.index)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"index\",\"hash\":{},\"data\":data}) : helper)))\n + \"\\\">\\n\t\t\t\t<select class=\\\"check-class\\\">\\n\"\n + ((stack1 = helpers.each.call(alias1,(depths[1] != null ? depths[1].classes : depths[1]),{\"name\":\"each\",\"hash\":{},\"fn\":container.program(6, data, 0, blockParams, depths),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\t\t\t\t</select>\\n\t\t\t\t<select class=\\\"check-operator\\\">\\n\"\n + ((stack1 = helpers.each.call(alias1,(helpers.getOperators || (depth0 && depth0.getOperators) || alias2).call(alias1,(depth0 != null ? depth0[\"class\"] : depth0),{\"name\":\"getOperators\",\"hash\":{},\"data\":data}),{\"name\":\"each\",\"hash\":{},\"fn\":container.program(8, data, 0, blockParams, depths),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\t\t\t\t</select>\\n\t\t\t\t<input type=\\\"text\\\" class=\\\"check-value\\\" value=\\\"\"\n + alias4(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"value\",\"hash\":{},\"data\":data}) : helper)))\n + \"\\\">\\n\t\t\t\t<span class=\\\"button-delete-check icon-delete\\\"></span>\\n\t\t\t</div>\\n\";\n},\"6\":function(container,depth0,helpers,partials,data,blockParams,depths) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\t\t\t<option value=\\\"\"\n + alias4(((helper = (helper = helpers[\"class\"] || (depth0 != null ? depth0[\"class\"] : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"class\",\"hash\":{},\"data\":data}) : helper)))\n + \"\\\" \"\n + ((stack1 = (helpers.selectItem || (depth0 && depth0.selectItem) || alias2).call(alias1,(depth0 != null ? depth0[\"class\"] : depth0),(depths[1] != null ? depths[1][\"class\"] : depths[1]),{\"name\":\"selectItem\",\"hash\":{},\"data\":data})) != null ? stack1 : \"\")\n + \">\"\n + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"name\",\"hash\":{},\"data\":data}) : helper)))\n + \"</option>\\n\";\n},\"8\":function(container,depth0,helpers,partials,data,blockParams,depths) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression;\n\n return \"\t\t\t\t\t\t<option value=\\\"\"\n + alias4(((helper = (helper = helpers.operator || (depth0 != null ? depth0.operator : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"operator\",\"hash\":{},\"data\":data}) : helper)))\n + \"\\\" \"\n + ((stack1 = (helpers.selectItem || (depth0 && depth0.selectItem) || alias2).call(alias1,(depth0 != null ? depth0.operator : depth0),(depths[1] != null ? depths[1].operator : depths[1]),{\"name\":\"selectItem\",\"hash\":{},\"data\":data})) != null ? stack1 : \"\")\n + \">\"\n + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"name\",\"hash\":{},\"data\":data}) : helper)))\n + \"</option>\\n\";\n},\"10\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});\n\n return ((stack1 = helpers[\"if\"].call(alias1,((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.id : stack1),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(11, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\t\t<button class=\\\"button-save pull-right\\\">\"\n + container.escapeExpression(((helper = (helper = helpers.saveTXT || (depth0 != null ? depth0.saveTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(alias1,{\"name\":\"saveTXT\",\"hash\":{},\"data\":data}) : helper)))\n + \"</button>\\n\";\n},\"11\":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return \"\t\t\t<button class=\\\"button-reset pull-right\\\">\"\n + container.escapeExpression(((helper = (helper = helpers.resetTXT || (depth0 != null ? depth0.resetTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"resetTXT\",\"hash\":{},\"data\":data}) : helper)))\n + \"</button>\\n\";\n},\"13\":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return \"\t\t<span class=\\\"icon-loading-small pull-right\\\"></span>\\n\t\t<span class=\\\"pull-right\\\">\"\n + container.escapeExpression(((helper = (helper = helpers.savingTXT || (depth0 != null ? depth0.savingTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"savingTXT\",\"hash\":{},\"data\":data}) : helper)))\n + \"</span>\\n\t\";\n},\"15\":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return ((stack1 = helpers[\"if\"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.message : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(16, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\");\n},\"16\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});\n\n return \"\\n\t\t<span class=\\\"msg pull-right \"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.errorMessage : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(17, data, 0),\"inverse\":container.program(19, data, 0),\"data\":data})) != null ? stack1 : \"\")\n + \"\\\">\\n\t\t\t\t\t\"\n + container.escapeExpression(((helper = (helper = helpers.message || (depth0 != null ? depth0.message : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(alias1,{\"name\":\"message\",\"hash\":{},\"data\":data}) : helper)))\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.errorMessage : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(21, data, 0),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\\n\t\t\t\t</span>\\n\t\";\n},\"17\":function(container,depth0,helpers,partials,data) {\n return \"error\";\n},\"19\":function(container,depth0,helpers,partials,data) {\n return \"success\";\n},\"21\":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return \" \"\n + container.escapeExpression(((helper = (helper = helpers.errorMessage || (depth0 != null ? depth0.errorMessage : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"errorMessage\",\"hash\":{},\"data\":data}) : helper)));\n},\"compiler\":[7,\">= 4.0.0\"],\"main\":function(container,depth0,helpers,partials,data,blockParams,depths) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=\"function\", alias4=container.escapeExpression, alias5=container.lambda;\n\n return \"<div class=\\\"operation\"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.hasChanged : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0, blockParams, depths),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\\\">\\n\t<div class=\\\"operation-header\\\">\\n\t\t<input type=\\\"text\\\" class=\\\"operation-name\\\" placeholder=\\\"\"\n + alias4(((helper = (helper = helpers.shortRuleDescTXT || (depth0 != null ? depth0.shortRuleDescTXT : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"shortRuleDescTXT\",\"hash\":{},\"data\":data}) : helper)))\n + \"\\\" value=\\\"\"\n + alias4(alias5(((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.name : stack1), depth0))\n + \"\\\" />\\n\t\t<input type=\\\"text\\\" class=\\\"operation-operation\\\" value=\\\"\"\n + alias4(alias5(((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.operation : stack1), depth0))\n + \"\\\" />\\n\"\n + ((stack1 = helpers[\"if\"].call(alias1,((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.id : stack1),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(3, data, 0, blockParams, depths),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\t</div>\\n\\n\t<div class=\\\"checks\\\">\\n\"\n + ((stack1 = helpers.each.call(alias1,((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.checks : stack1),{\"name\":\"each\",\"hash\":{},\"fn\":container.program(5, data, 0, blockParams, depths),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + \"\t</div>\\n\t<button class=\\\"button-add\\\">\"\n + alias4(((helper = (helper = helpers.addRuleTXT || (depth0 != null ? depth0.addRuleTXT : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"addRuleTXT\",\"hash\":{},\"data\":data}) : helper)))\n + \"</button>\\n\"\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.hasChanged : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(10, data, 0, blockParams, depths),\"inverse\":container.noop,\"data\":data})) != null ? stack1 : \"\")\n + ((stack1 = helpers[\"if\"].call(alias1,(depth0 != null ? depth0.saving : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(13, data, 0, blockParams, depths),\"inverse\":container.program(15, data, 0, blockParams, depths),\"data\":data})) != null ? stack1 : \"\")\n + \"\\n</div>\\n\";\n},\"useData\":true,\"useDepths\":true});\ntemplates['operations'] = template({\"compiler\":[7,\">= 4.0.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return \"<div class=\\\"operations\\\"></div>\\n<button class=\\\"button-add-operation\\\">\"\n + container.escapeExpression(((helper = (helper = helpers.addRuleGroupTXT || (depth0 != null ? depth0.addRuleGroupTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === \"function\" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{\"name\":\"addRuleGroupTXT\",\"hash\":{},\"data\":data}) : helper)))\n + \"</button>\\n\";\n},\"useData\":true});\n})();","/**\n * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\n\tOCA.WorkflowEngine = OCA.WorkflowEngine || {};\n\tOCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {};\n\n\tOCA.WorkflowEngine.Plugins.FileMimeTypePlugin = {\n\t\tgetCheck: function() {\n\t\t\treturn {\n\t\t\t\t'class': 'OCA\\\\WorkflowEngine\\\\Check\\\\FileMimeType',\n\t\t\t\t'name': t('workflowengine', 'File MIME type'),\n\t\t\t\t'operators': [\n\t\t\t\t\t{'operator': 'is', 'name': t('workflowengine', 'is')},\n\t\t\t\t\t{'operator': '!is', 'name': t('workflowengine', 'is not')},\n\t\t\t\t\t{'operator': 'matches', 'name': t('workflowengine', 'matches')},\n\t\t\t\t\t{'operator': '!matches', 'name': t('workflowengine', 'does not match')}\n\t\t\t\t]\n\t\t\t};\n\t\t},\n\t\trender: function(element, check) {\n\t\t\tif (check['class'] !== 'OCA\\\\WorkflowEngine\\\\Check\\\\FileMimeType') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar placeholder = 'text/plain';\n\t\t\tif (check['operator'] === 'matches' || check['operator'] === '!matches') {\n\t\t\t\tplaceholder = '/^text\\\\/(plain|html)$/i';\n\n\t\t\t\tif (this._validateRegex(check['value'])) {\n\t\t\t\t\t$(element).removeClass('invalid-input');\n\t\t\t\t} else {\n\t\t\t\t\t$(element).addClass('invalid-input');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$(element).css('width', '250px')\n\t\t\t\t.attr('placeholder', placeholder)\n\t\t\t\t.attr('title', t('workflowengine', 'Example: {placeholder}', {placeholder: placeholder}))\n\t\t\t\t.addClass('has-tooltip')\n\t\t\t\t.tooltip({\n\t\t\t\t\tplacement: 'bottom'\n\t\t\t\t});\n\t\t},\n\n\t\t_validateRegex: function(string) {\n\t\t\tvar regexRegex = /^\\/(.*)\\/([gui]{0,3})$/,\n\t\t\t\tresult = regexRegex.exec(string);\n\t\t\treturn result !== null;\n\t\t}\n\t};\n})();\n\nOC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.FileMimeTypePlugin);\n","/**\n * @copyright Copyright (c) 2018 Daniel Kesselberg <mail@danielkesselberg.de>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function () {\n\n\tOCA.WorkflowEngine = OCA.WorkflowEngine || {};\n\tOCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {};\n\n\tOCA.WorkflowEngine.Plugins.FileNamePlugin = {\n\t\tgetCheck: function () {\n\t\t\treturn {\n\t\t\t\t'class': 'OCA\\\\WorkflowEngine\\\\Check\\\\FileName',\n\t\t\t\t'name': t('workflowengine', 'File name'),\n\t\t\t\t'operators': [\n\t\t\t\t\t{'operator': 'is', 'name': t('workflowengine', 'is')},\n\t\t\t\t\t{'operator': '!is', 'name': t('workflowengine', 'is not')},\n\t\t\t\t\t{\n\t\t\t\t\t\t'operator': 'matches',\n\t\t\t\t\t\t'name': t('workflowengine', 'matches')\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t'operator': '!matches',\n\t\t\t\t\t\t'name': t('workflowengine', 'does not match')\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t};\n\t\t},\n\t\trender: function (element, check) {\n\t\t\tif (check['class'] !== 'OCA\\\\WorkflowEngine\\\\Check\\\\FileName') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar placeholder = 'dummy.jpg';\n\t\t\tif (check['operator'] === 'matches' || check['operator'] === '!matches') {\n\t\t\t\tplaceholder = '/^dummy-.+$/i';\n\n\t\t\t\tif (this._validateRegex(check['value'])) {\n\t\t\t\t\t$(element).removeClass('invalid-input');\n\t\t\t\t} else {\n\t\t\t\t\t$(element).addClass('invalid-input');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$(element).css('width', '250px')\n\t\t\t\t.attr('placeholder', placeholder)\n\t\t\t\t.attr('title', t('workflowengine', 'Example: {placeholder}', {placeholder: placeholder}))\n\t\t\t\t.addClass('has-tooltip')\n\t\t\t\t.tooltip({\n\t\t\t\t\tplacement: 'bottom'\n\t\t\t\t});\n\t\t},\n\n\t\t_validateRegex: function (string) {\n\t\t\tvar regexRegex = /^\\/(.*)\\/([gui]{0,3})$/,\n\t\t\t\tresult = regexRegex.exec(string);\n\t\t\treturn result !== null;\n\t\t}\n\t};\n})();\n\nOC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.FileNamePlugin);","/**\n * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\n\tOCA.WorkflowEngine = OCA.WorkflowEngine || {};\n\tOCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {};\n\n\tOCA.WorkflowEngine.Plugins.FileSizePlugin = {\n\t\tgetCheck: function() {\n\t\t\treturn {\n\t\t\t\t'class': 'OCA\\\\WorkflowEngine\\\\Check\\\\FileSize',\n\t\t\t\t'name': t('workflowengine', 'File size (upload)'),\n\t\t\t\t'operators': [\n\t\t\t\t\t{'operator': 'less', 'name': t('workflowengine', 'less')},\n\t\t\t\t\t{'operator': '!greater', 'name': t('workflowengine', 'less or equals')},\n\t\t\t\t\t{'operator': '!less', 'name': t('workflowengine', 'greater or equals')},\n\t\t\t\t\t{'operator': 'greater', 'name': t('workflowengine', 'greater')}\n\t\t\t\t]\n\t\t\t};\n\t\t},\n\t\trender: function(element, check) {\n\t\t\tif (check['class'] !== 'OCA\\\\WorkflowEngine\\\\Check\\\\FileSize') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar placeholder = '12 MB'; // Do not translate!!!\n\t\t\t$(element).css('width', '250px')\n\t\t\t\t.attr('placeholder', placeholder)\n\t\t\t\t.attr('title', t('workflowengine', 'Example: {placeholder}', {placeholder: placeholder}))\n\t\t\t\t.addClass('has-tooltip')\n\t\t\t\t.tooltip({\n\t\t\t\t\tplacement: 'bottom'\n\t\t\t\t});\n\t\t}\n\t};\n})();\n\nOC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.FileSizePlugin);\n","/**\n * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\n\tOCA.WorkflowEngine = OCA.WorkflowEngine || {};\n\tOCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {};\n\n\tOCA.WorkflowEngine.Plugins.FileSystemTagsPlugin = {\n\t\tgetCheck: function() {\n\t\t\tthis.collection = OC.SystemTags.collection;\n\n\t\t\treturn {\n\t\t\t\t'class': 'OCA\\\\WorkflowEngine\\\\Check\\\\FileSystemTags',\n\t\t\t\t'name': t('workflowengine', 'File system tag'),\n\t\t\t\t'operators': [\n\t\t\t\t\t{'operator': 'is', 'name': t('workflowengine', 'is tagged with')},\n\t\t\t\t\t{'operator': '!is', 'name': t('workflowengine', 'is not tagged with')}\n\t\t\t\t]\n\t\t\t};\n\t\t},\n\t\trender: function(element, check) {\n\t\t\tif (check['class'] !== 'OCA\\\\WorkflowEngine\\\\Check\\\\FileSystemTags') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$(element).css('width', '400px');\n\n\t\t\t$(element).select2({\n\t\t\t\tallowClear: false,\n\t\t\t\tmultiple: false,\n\t\t\t\tplaceholder: t('workflowengine', 'Select tag…'),\n\t\t\t\tquery: _.debounce(function(query) {\n\t\t\t\t\tquery.callback({\n\t\t\t\t\t\tresults: OC.SystemTags.collection.filterByName(query.term)\n\t\t\t\t\t});\n\t\t\t\t}, 100, true),\n\t\t\t\tid: function(element) {\n\t\t\t\t\treturn element.get('id');\n\t\t\t\t},\n\t\t\t\tinitSelection: function(element, callback) {\n\t\t\t\t\tcallback($(element).val());\n\t\t\t\t},\n\t\t\t\tformatResult: function (tag) {\n\t\t\t\t\treturn OC.SystemTags.getDescriptiveTag(tag);\n\t\t\t\t},\n\t\t\t\tformatSelection: function (tagId) {\n\t\t\t\t\tvar tag = OC.SystemTags.collection.get(tagId);\n\t\t\t\t\tif (!_.isUndefined(tag)) {\n\t\t\t\t\t\treturn OC.SystemTags.getDescriptiveTag(tag);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(m) {\n\t\t\t\t\treturn m;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n})();\n\nOC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin);\n","/**\n * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\n\tOCA.WorkflowEngine = OCA.WorkflowEngine || {};\n\tOCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {};\n\n\tOCA.WorkflowEngine.Plugins.RequestRemoteAddressPlugin = {\n\t\tgetCheck: function() {\n\t\t\treturn {\n\t\t\t\t'class': 'OCA\\\\WorkflowEngine\\\\Check\\\\RequestRemoteAddress',\n\t\t\t\t'name': t('workflowengine', 'Request remote address'),\n\t\t\t\t'operators': [\n\t\t\t\t\t{'operator': 'matchesIPv4', 'name': t('workflowengine', 'matches IPv4')},\n\t\t\t\t\t{'operator': '!matchesIPv4', 'name': t('workflowengine', 'does not match IPv4')},\n\t\t\t\t\t{'operator': 'matchesIPv6', 'name': t('workflowengine', 'matches IPv6')},\n\t\t\t\t\t{'operator': '!matchesIPv6', 'name': t('workflowengine', 'does not match IPv6')}\n\t\t\t\t]\n\t\t\t};\n\t\t},\n\t\trender: function(element, check) {\n\t\t\tif (check['class'] !== 'OCA\\\\WorkflowEngine\\\\Check\\\\RequestRemoteAddress') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar placeholder = '127.0.0.1/32'; // Do not translate!!!\n\t\t\tif (check['operator'] === 'matchesIPv6' || check['operator'] === '!matchesIPv6') {\n\t\t\t\tplaceholder = '::1/128'; // Do not translate!!!\n\t\t\t\tif (this._validateIPv6(check['value'])) {\n\t\t\t\t\t$(element).removeClass('invalid-input');\n\t\t\t\t} else {\n\t\t\t\t\t$(element).addClass('invalid-input');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this._validateIPv4(check['value'])) {\n\t\t\t\t\t$(element).removeClass('invalid-input');\n\t\t\t\t} else {\n\t\t\t\t\t$(element).addClass('invalid-input');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$(element).css('width', '300px')\n\t\t\t\t.attr('placeholder', placeholder)\n\t\t\t\t.attr('title', t('workflowengine', 'Example: {placeholder}', {placeholder: placeholder}))\n\t\t\t\t.addClass('has-tooltip')\n\t\t\t\t.tooltip({\n\t\t\t\t\tplacement: 'bottom'\n\t\t\t\t});\n\t\t},\n\n\t\t_validateIPv4: function(string) {\n\t\t\tvar regexRegex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\/(3[0-2]|[1-2][0-9]|[1-9])$/,\n\t\t\t\tresult = regexRegex.exec(string);\n\t\t\treturn result !== null;\n\t\t},\n\n\t\t_validateIPv6: function(string) {\n\t\t\tvar regexRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(1([01][0-9]|2[0-8])|[1-9][0-9]|[0-9])$/,\n\t\t\t\tresult = regexRegex.exec(string);\n\t\t\treturn result !== null;\n\t\t}\n\t};\n})();\n\nOC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.RequestRemoteAddressPlugin);\n","/**\n * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\n\tOCA.WorkflowEngine = OCA.WorkflowEngine || {};\n\tOCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {};\n\n\tOCA.WorkflowEngine.Plugins.RequestTimePlugin = {\n\t\ttimezones: [\n\t\t\t\"Europe/Berlin\",\n\t\t\t\"Europe/London\"\n\t\t],\n\t\t_$element: null,\n\t\tgetCheck: function() {\n\t\t\treturn {\n\t\t\t\t'class': 'OCA\\\\WorkflowEngine\\\\Check\\\\RequestTime',\n\t\t\t\t'name': t('workflowengine', 'Request time'),\n\t\t\t\t'operators': [\n\t\t\t\t\t{'operator': 'in', 'name': t('workflowengine', 'between')},\n\t\t\t\t\t{'operator': '!in', 'name': t('workflowengine', 'not between')}\n\t\t\t\t]\n\t\t\t};\n\t\t},\n\t\trender: function(element, check) {\n\t\t\tif (check['class'] !== 'OCA\\\\WorkflowEngine\\\\Check\\\\RequestTime') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar startTime = '09:00',\n\t\t\t\tendTime = '18:00',\n\t\t\t\ttimezone = jstz.determine().name(),\n\t\t\t\t$element = $(element);\n\n\t\t\tif (_.isString(check['value']) && check['value'] !== '') {\n\t\t\t\tvar value = JSON.parse(check['value']),\n\t\t\t\t\tsplittedStart = value[0].split(' ', 2),\n\t\t\t\t\tsplittedEnd = value[1].split(' ', 2);\n\n\t\t\t\tstartTime = splittedStart[0];\n\t\t\t\tendTime = splittedEnd[0];\n\t\t\t\ttimezone = splittedStart[1];\n\t\t\t}\n\n\t\t\tvar valueJSON = JSON.stringify([startTime + ' ' + timezone, endTime + ' ' + timezone]);\n\t\t\tif (check['value'] !== valueJSON) {\n\t\t\t\tcheck['value'] = valueJSON;\n\t\t\t\t$element.val(valueJSON);\n\t\t\t}\n\n\t\t\t$element.css('display', 'none');\n\n\t\t\t$('<input>')\n\t\t\t\t.attr('type', 'text')\n\t\t\t\t.attr('placeholder', t('workflowengine', 'Start'))\n\t\t\t\t.attr('title', t('workflowengine', 'Example: {placeholder}', {placeholder: '16:00'}))\n\t\t\t\t.addClass('has-tooltip')\n\t\t\t\t.tooltip({\n\t\t\t\t\tplacement: 'bottom'\n\t\t\t\t})\n\t\t\t\t.addClass('start')\n\t\t\t\t.val(startTime)\n\t\t\t\t.insertBefore($element);\n\t\t\t$('<input>')\n\t\t\t\t.attr('type', 'text')\n\t\t\t\t.attr('placeholder', t('workflowengine', 'End'))\n\t\t\t\t.attr('title', t('workflowengine', 'Example: {placeholder}', {placeholder: '16:00'}))\n\t\t\t\t.addClass('has-tooltip')\n\t\t\t\t.tooltip({\n\t\t\t\t\tplacement: 'bottom'\n\t\t\t\t})\n\t\t\t\t.addClass('end')\n\t\t\t\t.val(endTime)\n\t\t\t\t.insertBefore($element);\n\n\t\t\tvar timezoneInput = $('<input>')\n\t\t\t\t.attr('type', 'hidden')\n\t\t\t\t.css('width', '250px')\n\t\t\t\t.insertBefore($element)\n\t\t\t\t.val(timezone);\n\n\t\t\ttimezoneInput.select2({\n\t\t\t\tallowClear: false,\n\t\t\t\tmultiple: false,\n\t\t\t\tplaceholder: t('workflowengine', 'Select timezone…'),\n\t\t\t\tajax: {\n\t\t\t\t\turl: OC.generateUrl('apps/workflowengine/timezones'),\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tquietMillis: 100,\n\t\t\t\t\tdata: function (term) {\n\t\t\t\t\t\tif (term === '') {\n\t\t\t\t\t\t\t// Default search in the same continent...\n\t\t\t\t\t\t\tterm = jstz.determine().name().split('/');\n\t\t\t\t\t\t\tterm = term[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tsearch: term\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t\tresults: function (response) {\n\t\t\t\t\t\tvar results = [];\n\t\t\t\t\t\t$.each(response, function(timezone) {\n\t\t\t\t\t\t\tresults.push({ id: timezone });\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tresults: results,\n\t\t\t\t\t\t\tmore: false\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tinitSelection: function (element, callback) {\n\t\t\t\t\tcallback(element.val());\n\t\t\t\t},\n\t\t\t\tformatResult: function (element) {\n\t\t\t\t\treturn '<span>' + element.id + '</span>';\n\t\t\t\t},\n\t\t\t\tformatSelection: function (element) {\n\t\t\t\t\tif (!_.isUndefined(element.id)) {\n\t\t\t\t\t\telement = element.id;\n\t\t\t\t\t}\n\t\t\t\t\treturn '<span>' + element + '</span>';\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Has to be added after select2 for `event.target.classList`\n\t\t\ttimezoneInput.addClass('timezone');\n\n\t\t\t$element.parent()\n\t\t\t\t.on('change', '.start', _.bind(this.update, this))\n\t\t\t\t.on('change', '.end', _.bind(this.update, this))\n\t\t\t\t.on('change', '.timezone', _.bind(this.update, this));\n\n\t\t\tthis._$element = $element;\n\t\t},\n\t\tupdate: function(event) {\n\t\t\tvar value = event.target.value,\n\t\t\t\tkey = null;\n\n\t\t\tfor (var i = 0; i < event.target.classList.length; i++) {\n\t\t\t\tkey = event.target.classList[i];\n\t\t\t}\n\n\t\t\tif (key === null) {\n\t\t\t\tconsole.warn('update triggered but element doesn\\'t have any class');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar data = JSON.parse(this._$element.val()),\n\t\t\t\tstartTime = moment(data[0].split(' ', 2)[0], 'H:m Z'),\n\t\t\t\tendTime = moment(data[1].split(' ', 2)[0], 'H:m Z'),\n\t\t\t\ttimezone = data[0].split(' ', 2)[1];\n\n\t\t\tif (key === 'start' || key === 'end') {\n\t\t\t\tvar parsedDate = moment(value, ['H:m', 'h:m a'], true).format('HH:mm');\n\n\t\t\t\tif (parsedDate === 'Invalid date') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar indexValue = 0;\n\t\t\t\tif (key === 'end') {\n\t\t\t\t\tindexValue = 1;\n\t\t\t\t}\n\t\t\t\tdata[indexValue] = parsedDate + ' ' + timezone;\n\t\t\t}\n\n\t\t\tif (key === 'timezone') {\n\t\t\t\tdata[0] = startTime.format('HH:mm') + ' ' + value;\n\t\t\t\tdata[1] = endTime.format('HH:mm') + ' ' + value;\n\t\t\t}\n\n\t\t\tthis._$element.val(JSON.stringify(data));\n\t\t\tthis._$element.trigger('change');\n\t\t}\n\t};\n})();\n\nOC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.RequestTimePlugin);\n","/**\n * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\n\tOCA.WorkflowEngine = OCA.WorkflowEngine || {};\n\tOCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {};\n\n\tOCA.WorkflowEngine.Plugins.RequestURLPlugin = {\n\t\tpredefinedValues: ['webdav'],\n\t\tgetCheck: function() {\n\t\t\treturn {\n\t\t\t\t'class': 'OCA\\\\WorkflowEngine\\\\Check\\\\RequestURL',\n\t\t\t\t'name': t('workflowengine', 'Request URL'),\n\t\t\t\t'operators': [\n\t\t\t\t\t{'operator': 'is', 'name': t('workflowengine', 'is')},\n\t\t\t\t\t{'operator': '!is', 'name': t('workflowengine', 'is not')},\n\t\t\t\t\t{'operator': 'matches', 'name': t('workflowengine', 'matches')},\n\t\t\t\t\t{'operator': '!matches', 'name': t('workflowengine', 'does not match')}\n\t\t\t\t]\n\t\t\t};\n\t\t},\n\t\trender: function(element, check) {\n\t\t\tif (check['class'] !== 'OCA\\\\WorkflowEngine\\\\Check\\\\RequestURL') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar placeholder = 'https://localhost/index.php';\n\n\t\t\tif (check['operator'] === 'matches' || check['operator'] === '!matches') {\n\t\t\t\tplaceholder = '/^https\\\\:\\\\/\\\\/localhost\\\\/index\\\\.php$/i';\n\t\t\t}\n\n\t\t\t$(element).css('width', '250px')\n\t\t\t\t.attr('placeholder', placeholder)\n\t\t\t\t.attr('title', t('workflowengine', 'Example: {placeholder}', {placeholder: placeholder}))\n\t\t\t\t.addClass('has-tooltip')\n\t\t\t\t.tooltip({\n\t\t\t\t\tplacement: 'bottom'\n\t\t\t\t});\n\n\t\t\tif (check['operator'] === 'matches' || check['operator'] === '!matches') {\n\t\t\t\tif (this._validateRegex(check['value'])) {\n\t\t\t\t\t$(element).removeClass('invalid-input');\n\t\t\t\t} else {\n\t\t\t\t\t$(element).addClass('invalid-input');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar self = this,\n\t\t\t\t\tdata = [\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: t('workflowengine', 'Predefined URLs'),\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t{id: 'webdav', text: t('workflowengine', 'Files WebDAV')}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t];\n\t\t\t\tif (this.predefinedValues.indexOf(check['value']) === -1) {\n\t\t\t\t\tdata.unshift({\n\t\t\t\t\t\tid: check['value'],\n\t\t\t\t\t\ttext: check['value']\n\t\t\t\t\t})\n\t\t\t\t}\n\n\n\t\t\t\t$(element).select2({\n\t\t\t\t\tdata: data,\n\t\t\t\t\tcreateSearchChoice: function(term) {\n\t\t\t\t\t\tif (self.predefinedValues.indexOf(check['value']) === -1) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tid: term,\n\t\t\t\t\t\t\t\ttext: term\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tid: function(element) {\n\t\t\t\t\t\treturn element.id;\n\t\t\t\t\t},\n\t\t\t\t\tformatResult: function (tag) {\n\t\t\t\t\t\treturn tag.text;\n\t\t\t\t\t},\n\t\t\t\t\tformatSelection: function (tag) {\n\t\t\t\t\t\treturn tag.text;\n\t\t\t\t\t},\n\t\t\t\t\tescapeMarkup: function(m) {\n\t\t\t\t\t\treturn m;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\n\t\t_validateRegex: function(string) {\n\t\t\tvar regexRegex = /^\\/(.*)\\/([gui]{0,3})$/,\n\t\t\t\tresult = regexRegex.exec(string);\n\t\t\treturn result !== null;\n\t\t}\n\t};\n})();\n\nOC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.RequestURLPlugin);\n","/**\n * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\n\tOCA.WorkflowEngine = OCA.WorkflowEngine || {};\n\tOCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {};\n\n\tOCA.WorkflowEngine.Plugins.RequestUserAgentPlugin = {\n\t\tpredefinedValues: ['android', 'ios', 'desktop'],\n\t\tgetCheck: function() {\n\t\t\treturn {\n\t\t\t\t'class': 'OCA\\\\WorkflowEngine\\\\Check\\\\RequestUserAgent',\n\t\t\t\t'name': t('workflowengine', 'Request user agent'),\n\t\t\t\t'operators': [\n\t\t\t\t\t{'operator': 'is', 'name': t('workflowengine', 'is')},\n\t\t\t\t\t{'operator': '!is', 'name': t('workflowengine', 'is not')},\n\t\t\t\t\t{'operator': 'matches', 'name': t('workflowengine', 'matches')},\n\t\t\t\t\t{'operator': '!matches', 'name': t('workflowengine', 'does not match')}\n\t\t\t\t]\n\t\t\t};\n\t\t},\n\t\trender: function(element, check) {\n\t\t\tif (check['class'] !== 'OCA\\\\WorkflowEngine\\\\Check\\\\RequestUserAgent') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar placeholder = 'Mozilla/5.0 User Agent';\n\n\t\t\tif (check.operator === 'matches' || check.operator === '!matches') {\n\t\t\t\tplaceholder = '/^Mozilla\\\\/5\\\\.0 (.*)$/i';\n\t\t\t}\n\n\t\t\t$(element).css('width', '250px')\n\t\t\t\t.attr('placeholder', placeholder)\n\t\t\t\t.attr('title', t('workflowengine', 'Example: {placeholder}', {placeholder: placeholder}))\n\t\t\t\t.addClass('has-tooltip')\n\t\t\t\t.tooltip({\n\t\t\t\t\tplacement: 'bottom'\n\t\t\t\t});\n\n\t\t\tif (check.operator === 'matches' || check.operator === '!matches') {\n\t\t\t\tif (this._validateRegex(check.value)) {\n\t\t\t\t\t$(element).removeClass('invalid-input');\n\t\t\t\t} else {\n\t\t\t\t\t$(element).addClass('invalid-input');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar self = this,\n\t\t\t\t\tdata = [\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: t('workflowengine', 'Sync clients'),\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t{id: 'android', text: t('workflowengine', 'Android client')},\n\t\t\t\t\t\t\t{id: 'ios', text: t('workflowengine', 'iOS client')},\n\t\t\t\t\t\t\t{id: 'desktop', text: t('workflowengine', 'Desktop client')},\n\t\t\t\t\t\t\t{id: 'mail', text: t('workflowengine', 'Thunderbird & Outlook addons')}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t];\n\t\t\t\tif (this.predefinedValues.indexOf(check.value) === -1) {\n\t\t\t\t\tdata.unshift({\n\t\t\t\t\t\tid: check.value,\n\t\t\t\t\t\ttext: check.value\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t$(element).select2({\n\t\t\t\t\tdata: data,\n\t\t\t\t\tcreateSearchChoice: function(term) {\n\t\t\t\t\t\tif (self.predefinedValues.indexOf(check.value) === -1) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tid: term,\n\t\t\t\t\t\t\t\ttext: term\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tid: function(element) {\n\t\t\t\t\t\treturn element.id;\n\t\t\t\t\t},\n\t\t\t\t\tformatResult: function (tag) {\n\t\t\t\t\t\treturn tag.text;\n\t\t\t\t\t},\n\t\t\t\t\tformatSelection: function (tag) {\n\t\t\t\t\t\treturn tag.text;\n\t\t\t\t\t},\n\t\t\t\t\tescapeMarkup: function(m) {\n\t\t\t\t\t\treturn m;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\n\t\t_validateRegex: function(string) {\n\t\t\tvar regexRegex = /^\\/(.*)\\/([gui]{0,3})$/,\n\t\t\t\tresult = regexRegex.exec(string);\n\t\t\treturn result !== null;\n\t\t}\n\t};\n})();\n\nOC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.RequestUserAgentPlugin);\n","/**\n * @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\n(function() {\n\n\tOCA.WorkflowEngine = OCA.WorkflowEngine || {};\n\tOCA.WorkflowEngine.Plugins = OCA.WorkflowEngine.Plugins || {};\n\n\tOCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin = {\n\t\tgetCheck: function() {\n\t\t\treturn {\n\t\t\t\t'class': 'OCA\\\\WorkflowEngine\\\\Check\\\\UserGroupMembership',\n\t\t\t\t'name': t('workflowengine', 'User group membership'),\n\t\t\t\t'operators': [\n\t\t\t\t\t{'operator': 'is', 'name': t('workflowengine', 'is member of')},\n\t\t\t\t\t{'operator': '!is', 'name': t('workflowengine', 'is not member of')}\n\t\t\t\t]\n\t\t\t};\n\t\t},\n\t\trender: function(element, check, groups) {\n\t\t\tif (check['class'] !== 'OCA\\\\WorkflowEngine\\\\Check\\\\UserGroupMembership') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$(element).css('width', '400px');\n\n\t\t\t$(element).select2({\n\t\t\t\tdata: { results: groups, text: 'displayname' },\n\t\t\t\tinitSelection: function (element, callback) {\n\t\t\t\t\tvar groupId = element.val();\n\t\t\t\t\tif (groupId && groups.length > 0) {\n\t\t\t\t\t\tcallback({\n\t\t\t\t\t\t\tid: groupId,\n\t\t\t\t\t\t\tdisplayname: groups.find(function (group) {\n\t\t\t\t\t\t\t\treturn group.id === groupId;\n\t\t\t\t\t\t\t}).displayname\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (groupId) {\n\t\t\t\t\t\tcallback({\n\t\t\t\t\t\t\tid: groupId,\n\t\t\t\t\t\t\tdisplayname: groupId\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tformatResult: function (element) {\n\t\t\t\t\treturn '<span>' + escapeHTML(element.displayname) + '</span>';\n\t\t\t\t},\n\t\t\t\tformatSelection: function (element) {\n\t\t\t\t\treturn '<span title=\"'+escapeHTML(element.id)+'\">'+escapeHTML(element.displayname)+'</span>';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n})();\n\nOC.Plugins.register('OCA.WorkflowEngine.CheckPlugins', OCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin);\n"],"sourceRoot":""} \ No newline at end of file
diff --git a/apps/workflowengine/lib/AppInfo/Application.php b/apps/workflowengine/lib/AppInfo/Application.php
index 882ccad5638..3fee0c3bb8e 100644
--- a/apps/workflowengine/lib/AppInfo/Application.php
+++ b/apps/workflowengine/lib/AppInfo/Application.php
@@ -60,19 +60,7 @@ class Application extends \OCP\AppFramework\App {
]);
script('workflowengine', [
- 'admin',
- 'templates',
-
- // Check plugins
- 'filemimetypeplugin',
- 'filenameplugin',
- 'filesizeplugin',
- 'filesystemtagsplugin',
- 'requestremoteaddressplugin',
- 'requesttimeplugin',
- 'requesturlplugin',
- 'requestuseragentplugin',
- 'usergroupmembershipplugin',
+ 'workflowengine',
]);
},
-100
diff --git a/apps/workflowengine/js/admin.js b/apps/workflowengine/src/admin.js
index d986c5a494a..d986c5a494a 100644
--- a/apps/workflowengine/js/admin.js
+++ b/apps/workflowengine/src/admin.js
diff --git a/apps/workflowengine/js/filemimetypeplugin.js b/apps/workflowengine/src/filemimetypeplugin.js
index 17c092d209f..17c092d209f 100644
--- a/apps/workflowengine/js/filemimetypeplugin.js
+++ b/apps/workflowengine/src/filemimetypeplugin.js
diff --git a/apps/workflowengine/js/filenameplugin.js b/apps/workflowengine/src/filenameplugin.js
index 7d8018c29cd..7d8018c29cd 100644
--- a/apps/workflowengine/js/filenameplugin.js
+++ b/apps/workflowengine/src/filenameplugin.js
diff --git a/apps/workflowengine/js/filesizeplugin.js b/apps/workflowengine/src/filesizeplugin.js
index 0efa9d00edf..0efa9d00edf 100644
--- a/apps/workflowengine/js/filesizeplugin.js
+++ b/apps/workflowengine/src/filesizeplugin.js
diff --git a/apps/workflowengine/js/filesystemtagsplugin.js b/apps/workflowengine/src/filesystemtagsplugin.js
index e66a35b73b9..e66a35b73b9 100644
--- a/apps/workflowengine/js/filesystemtagsplugin.js
+++ b/apps/workflowengine/src/filesystemtagsplugin.js
diff --git a/apps/workflowengine/js/requestremoteaddressplugin.js b/apps/workflowengine/src/requestremoteaddressplugin.js
index a66d6f51f0f..a66d6f51f0f 100644
--- a/apps/workflowengine/js/requestremoteaddressplugin.js
+++ b/apps/workflowengine/src/requestremoteaddressplugin.js
diff --git a/apps/workflowengine/js/requesttimeplugin.js b/apps/workflowengine/src/requesttimeplugin.js
index 111b2bb7437..111b2bb7437 100644
--- a/apps/workflowengine/js/requesttimeplugin.js
+++ b/apps/workflowengine/src/requesttimeplugin.js
diff --git a/apps/workflowengine/js/requesturlplugin.js b/apps/workflowengine/src/requesturlplugin.js
index 7c81deaaf33..7c81deaaf33 100644
--- a/apps/workflowengine/js/requesturlplugin.js
+++ b/apps/workflowengine/src/requesturlplugin.js
diff --git a/apps/workflowengine/js/requestuseragentplugin.js b/apps/workflowengine/src/requestuseragentplugin.js
index 881ea4b8ac7..881ea4b8ac7 100644
--- a/apps/workflowengine/js/requestuseragentplugin.js
+++ b/apps/workflowengine/src/requestuseragentplugin.js
diff --git a/apps/workflowengine/js/templates.js b/apps/workflowengine/src/templates.js
index 157d396357d..157d396357d 100644
--- a/apps/workflowengine/js/templates.js
+++ b/apps/workflowengine/src/templates.js
diff --git a/apps/workflowengine/js/templates/operation.handlebars b/apps/workflowengine/src/templates/operation.handlebars
index 0899890cef2..0899890cef2 100644
--- a/apps/workflowengine/js/templates/operation.handlebars
+++ b/apps/workflowengine/src/templates/operation.handlebars
diff --git a/apps/workflowengine/js/templates/operations.handlebars b/apps/workflowengine/src/templates/operations.handlebars
index 14b62ee79a6..14b62ee79a6 100644
--- a/apps/workflowengine/js/templates/operations.handlebars
+++ b/apps/workflowengine/src/templates/operations.handlebars
diff --git a/apps/workflowengine/js/usergroupmembershipplugin.js b/apps/workflowengine/src/usergroupmembershipplugin.js
index 53f35fedf2d..53f35fedf2d 100644
--- a/apps/workflowengine/js/usergroupmembershipplugin.js
+++ b/apps/workflowengine/src/usergroupmembershipplugin.js
diff --git a/apps/workflowengine/src/workflowengine.js b/apps/workflowengine/src/workflowengine.js
new file mode 100644
index 00000000000..48d670d203c
--- /dev/null
+++ b/apps/workflowengine/src/workflowengine.js
@@ -0,0 +1,13 @@
+import './admin'
+import './templates'
+import './filemimetypeplugin'
+import './filenameplugin'
+import './filesizeplugin'
+import './filesystemtagsplugin'
+import './requestremoteaddressplugin'
+import './requesttimeplugin'
+import './requesturlplugin'
+import './requestuseragentplugin'
+import './usergroupmembershipplugin'
+
+window.OCA.WorkflowEngine = OCA.WorkflowEngine
diff --git a/apps/workflowengine/webpack.js b/apps/workflowengine/webpack.js
new file mode 100644
index 00000000000..c35a63d4d5b
--- /dev/null
+++ b/apps/workflowengine/webpack.js
@@ -0,0 +1,37 @@
+const path = require('path');
+
+module.exports = {
+ entry: path.join(__dirname, 'src', 'workflowengine.js'),
+ output: {
+ path: path.resolve(__dirname, './js'),
+ publicPath: '/js/',
+ filename: 'workflowengine.js',
+ },
+ module: {
+ rules: [
+ {
+ test: /\.css$/,
+ use: ['style-loader', 'css-loader']
+ },
+ {
+ test: /\.scss$/,
+ use: ['style-loader', 'css-loader', 'sass-loader']
+ },
+ {
+ test: /\.js$/,
+ loader: 'babel-loader',
+ exclude: /node_modules/
+ },
+ {
+ test: /\.(png|jpg|gif|svg)$/,
+ loader: 'file-loader',
+ options: {
+ name: '[name].[ext]?[hash]'
+ }
+ }
+ ]
+ },
+ resolve: {
+ extensions: ['*', '.js']
+ }
+};
diff --git a/webpack.common.js b/webpack.common.js
index 0fb8e72f7f3..94398ebc4b8 100644
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -10,6 +10,7 @@ const oauth2 = require('./apps/oauth2/webpack')
const systemtags = require('./apps/systemtags/webpack')
const twofactor_backupscodes = require('./apps/twofactor_backupcodes/webpack')
const updatenotifications = require('./apps/updatenotification/webpack')
+const workflowengine = require('./apps/workflowengine/webpack')
module.exports = [].concat(
core,
@@ -22,5 +23,6 @@ module.exports = [].concat(
oauth2,
systemtags,
twofactor_backupscodes,
- updatenotifications
+ updatenotifications,
+ workflowengine
);