1
0
mirror of https://github.com/keeweb/keeweb.git synced 2024-06-21 07:06:39 +02:00

fix emitter copy-paste

This commit is contained in:
antelle 2016-04-17 14:56:19 +03:00
parent 11a12cceb4
commit b7586f5be9
5 changed files with 15 additions and 10 deletions

View File

@ -47,8 +47,7 @@ AutoTypeEmitter.prototype.setDelay = function(delay) {
AutoTypeEmitter.prototype.copyPaste = function(text) {
logger.debug('CopyPaste', text);
Launcher.setClipboardText(text);
this.impl.paste(this.callback);
this.impl.copyPaste(text, this.callback);
};
AutoTypeEmitter.prototype.waitComplete = function() {

View File

@ -56,10 +56,13 @@ AutoTypeEmitterImpl.prototype.key = function(key, callback) {
callback();
};
AutoTypeEmitterImpl.prototype.paste = function(callback) {
AutoTypeEmitterImpl.prototype.copyPaste = function(text, callback) {
this.pendingScript.push('delay 0.5');
this.pendingScript.push('set the clipboard to "' + text.replace(/"/g, '\\"') + '"');
this.pendingScript.push('delay 0.5');
this.pendingScript.push('keystroke "v" using command down');
this.pendingScript.push('delay 0.5');
this.waitComplete(callback);
callback();
};
AutoTypeEmitterImpl.prototype.waitComplete = function(callback) {

View File

@ -62,7 +62,8 @@ AutoTypeEmitterImpl.prototype.key = function(key, callback) {
callback();
};
AutoTypeEmitterImpl.prototype.paste = function(callback) {
AutoTypeEmitterImpl.prototype.copyPaste = function(text, callback) {
// todo
this.pendingScript.push('^v');
this.waitComplete(callback);
};

View File

@ -36,10 +36,12 @@ var Scrollable = {
if (this.scroll) {
this.scroll.update();
this.requestAnimationFrame(function() {
this.scroll.update();
var barHeight = this.scrollerBar.height(),
wrapperHeight = this.scrollerBarWrapper.height();
this.scrollerBarWrapper.toggleClass('invisible', barHeight >= wrapperHeight);
if (this.scroll) {
this.scroll.update();
var barHeight = this.scrollerBar.height(),
wrapperHeight = this.scrollerBarWrapper.height();
this.scrollerBarWrapper.toggleClass('invisible', barHeight >= wrapperHeight);
}
});
}
},

View File

@ -760,7 +760,7 @@ var DetailsView = Backbone.View.extend({
autoType: function() {
var entry = this.model;
AutoType.hideWindow(function() {
AutoType.run(entry, '{password}', false, _.noop);
AutoType.run(entry, '{password}', true, _.noop);
});
},