diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-03-24 15:51:30 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-03-24 15:51:30 +0100 |
commit | 7ca154e613329050885b7c6a799488475266218e (patch) | |
tree | 6da18e4565766aee6a3f47f23dd0dfc396fec78e /module/web/static/js/models/InteractionTask.js | |
parent | implemented interactions for multi user, show waiting queries on webui (diff) | |
download | pyload-7ca154e613329050885b7c6a799488475266218e.tar.xz |
enter captchas on webui
Diffstat (limited to 'module/web/static/js/models/InteractionTask.js')
-rw-r--r-- | module/web/static/js/models/InteractionTask.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/module/web/static/js/models/InteractionTask.js b/module/web/static/js/models/InteractionTask.js index 4ba88a539..56fdbf8bf 100644 --- a/module/web/static/js/models/InteractionTask.js +++ b/module/web/static/js/models/InteractionTask.js @@ -1,5 +1,5 @@ -define(['jquery', 'backbone', 'underscore', 'utils/apitypes'], - function($, Backbone, _, Api) { +define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'], + function($, Backbone, _, App, Api) { return Backbone.Model.extend({ @@ -12,7 +12,9 @@ define(['jquery', 'backbone', 'underscore', 'utils/apitypes'], default_value: null, title: "", description: "", - plugin: "" + plugin: "", + // additional attributes + result: "" }, // Model Constructor @@ -20,8 +22,19 @@ define(['jquery', 'backbone', 'underscore', 'utils/apitypes'], }, + save: function(options) { + options = App.apiRequest('setInteractionResult/' + this.get('iid'), + {result: this.get('result')}, options); + + return $.ajax(options); + }, + isNotification: function() { return this.get('type') === Api.Interaction.Notification; + }, + + isCaptcha: function() { + return this.get('type') === Api.Interaction.Captcha; } }); });
\ No newline at end of file |