diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-06-01 15:18:47 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-06-01 15:18:47 +0200 |
commit | 9b8d4a5db97489bfbb5116b081dbdc8de706e502 (patch) | |
tree | f30f195d51963b92918f6d1b1c5cf6e0c48ac065 | |
parent | fixed js hint (diff) | |
download | pyload-9b8d4a5db97489bfbb5116b081dbdc8de706e502.tar.xz |
fixed click captcha size
-rw-r--r-- | pyload/web/app/scripts/views/queryModal.js | 9 | ||||
-rw-r--r-- | pyload/web/app/styles/default/style.less | 6 | ||||
-rwxr-xr-x | pyload/web/app/templates/default/dialogs/interactionTask.html | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/pyload/web/app/scripts/views/queryModal.js b/pyload/web/app/scripts/views/queryModal.js index be66a47b4..6877687b3 100644 --- a/pyload/web/app/scripts/views/queryModal.js +++ b/pyload/web/app/scripts/views/queryModal.js @@ -3,6 +3,8 @@ define(['jquery', 'underscore', 'app', 'utils/apitypes', 'views/abstract/modalVi 'use strict'; return modalView.extend({ + className: 'query-modal', + events: { 'click #captchaImage': 'onClick', 'click .btn-success': 'submit', @@ -32,9 +34,6 @@ define(['jquery', 'underscore', 'app', 'utils/apitypes', 'views/abstract/modalVi if (this.model.isCaptcha()) { data.captcha = input[0]; data.type = input[1]; - - if (input.type == Api.InputType.Click) - data.click = true; } return data; }, @@ -44,6 +43,9 @@ define(['jquery', 'underscore', 'app', 'utils/apitypes', 'views/abstract/modalVi var input = this.model.get('input'); var InputView = load_input(input); this.input = new InputView({input: input}); + if (input.type == Api.InputType.Click) + this.$('#captchaImage').css('cursor', 'crosshair'); + // only renders after wards this.$('#inputField').append(this.input.render().el); }, @@ -53,6 +55,7 @@ define(['jquery', 'underscore', 'app', 'utils/apitypes', 'views/abstract/modalVi var posX = el.offset().left, posY = el.offset().top; + // TODO: calculate image size, scale positions to displayed / real image size this.input.onClick(Math.round(e.pageX - posX), Math.round(e.pageY - posY)); }, diff --git a/pyload/web/app/styles/default/style.less b/pyload/web/app/styles/default/style.less index ad60e5b59..fb441b882 100644 --- a/pyload/web/app/styles/default/style.less +++ b/pyload/web/app/styles/default/style.less @@ -222,6 +222,12 @@ header { // background-color: @greyDark; } +.query-modal { + img { + max-width: none; + } +} + /* Actionbar */ diff --git a/pyload/web/app/templates/default/dialogs/interactionTask.html b/pyload/web/app/templates/default/dialogs/interactionTask.html index e1d649d1a..722d43365 100755 --- a/pyload/web/app/templates/default/dialogs/interactionTask.html +++ b/pyload/web/app/templates/default/dialogs/interactionTask.html @@ -17,7 +17,7 @@ </label> <div class="controls"> - <img id="captchaImage" src="data:image/{{ type }};base64,{{ captcha }}" {{#if click}}style="cursor: crosshair;"{{/if}}> + <img id="captchaImage" src="data:image/{{ type }};base64,{{ captcha }}"> </div> </div> <div class="control-group"> |