summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/views/queryModal.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-06-08 17:37:43 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-06-08 17:37:44 +0200
commit2cf160d497e501bf254bd8be054c0f5880ab90ca (patch)
tree03a720b6142cc03fe7ef258fa8d17da92b30a462 /module/web/static/js/views/queryModal.js
parentMerge pull request #151 from vuolter/invertedconf (diff)
downloadpyload-2cf160d497e501bf254bd8be054c0f5880ab90ca.tar.xz
restructured webui to single-page-app, removed jinja
Diffstat (limited to 'module/web/static/js/views/queryModal.js')
-rw-r--r--module/web/static/js/views/queryModal.js68
1 files changed, 0 insertions, 68 deletions
diff --git a/module/web/static/js/views/queryModal.js b/module/web/static/js/views/queryModal.js
deleted file mode 100644
index 5477334a0..000000000
--- a/module/web/static/js/views/queryModal.js
+++ /dev/null
@@ -1,68 +0,0 @@
-define(['jquery', 'underscore', 'app', 'views/abstract/modalView', './input/inputLoader', 'text!tpl/default/queryDialog.html'],
- function($, _, App, modalView, load_input, template) {
- return modalView.extend({
-
- // TODO: submit on enter reloads the page sometimes
- events: {
- 'click .btn-success': 'submit',
- 'submit form': 'submit'
- },
- template: _.compile(template),
-
- // the notificationView
- parent: null,
-
- model: null,
- input: null,
-
- initialize: function() {
- // Inherit parent events
- this.events = _.extend({}, modalView.prototype.events, this.events);
- },
-
- renderContent: function() {
- var data = {
- title: this.model.get('title'),
- plugin: this.model.get('plugin'),
- description: this.model.get('description')
- };
-
- var input = this.model.get('input').data;
- if (this.model.isCaptcha()) {
- data.captcha = input[0];
- data.type = input[1];
- }
- return data;
- },
-
- onRender: function() {
- // instantiate the input
- var input = this.model.get('input');
- var inputView = load_input(input);
- this.input = new inputView(input);
- // only renders after wards
- this.$('#inputField').append(this.input.render().el);
- },
-
- submit: function(e) {
- e.stopPropagation();
- // TODO: load next task
-
- this.model.set('result', this.input.getVal());
- var self = this;
- this.model.save({success: function() {
- self.hide();
- }});
-
- this.input.clear();
- },
-
- onShow: function() {
- this.input.focus();
- },
-
- onHide: function() {
- this.input.destroy();
- }
- });
- }); \ No newline at end of file