removed support of devices without clipboard api

This commit is contained in:
antelle 2017-04-15 16:57:37 +02:00
parent 539f60ef5d
commit c94cacb14c
5 changed files with 5 additions and 34 deletions

View File

@ -1,4 +1,3 @@
const FeatureDetector = require('../util/feature-detector');
const Launcher = require('./launcher');
const AppSettingsModel = require('../models/app-settings-model');
@ -27,19 +26,11 @@ const CopyPaste = {
}
},
createHiddenInput: function(text, pos) {
createHiddenInput: function(text) {
const hiddenInput = $('<input/>')
.val(text)
.attr({ type: 'text', 'class': pos ? '' : 'hide-by-pos' })
.attr({ type: 'text', 'class': 'hide-by-pos' })
.appendTo(document.body);
if (FeatureDetector.canCopyReadonlyInput()) {
hiddenInput.attr('readonly', true);
}
if (pos) {
hiddenInput.css({ position: 'absolute', zIndex: 100, padding: '0 .6em',
border: 'none', background: 'transparent', color: 'transparent',
left: pos.left, top: pos.top, width: pos.width, height: pos.height });
}
hiddenInput[0].selectionStart = 0;
hiddenInput[0].selectionEnd = text.length;
hiddenInput.focus();

View File

@ -28,12 +28,6 @@ const FeatureDetector = {
if (this.isWindows) { return 'Alt+PrintScreen'; }
return '';
},
shouldMoveHiddenInputToCopySource: function() {
return this.isiOS && !/Version\/10/.test(navigator.userAgent);
},
canCopyReadonlyInput: function() {
return !(/CriOS/i.test(navigator.userAgent));
},
supportsTitleBarStyles: function () {
return this.isMac;
}

View File

@ -416,9 +416,7 @@ const DetailsView = Backbone.View.extend({
CopyPaste.createHiddenInput(fieldText);
}
const copyRes = CopyPaste.copy(fieldText);
if (copyRes) {
this.fieldCopied({ source: editView, copyRes: copyRes });
}
this.fieldCopied({ source: editView, copyRes: copyRes });
}
},

View File

@ -1,5 +1,4 @@
const Backbone = require('backbone');
const FeatureDetector = require('../../util/feature-detector');
const CopyPaste = require('../../comp/copy-paste');
const Tip = require('../../util/tip');
@ -47,16 +46,6 @@ const FieldView = Backbone.View.extend({
fieldLabelClick: function(e) {
e.stopImmediatePropagation();
const field = this.model.name;
if (FeatureDetector.shouldMoveHiddenInputToCopySource()) {
const box = this.valueEl[0].getBoundingClientRect();
const textValue = this.value && this.value.isProtected ? this.value.getText() : this.getEditValue(this.value);
if (!textValue) {
return;
}
CopyPaste.createHiddenInput(textValue, box);
// CopyPaste.copy(); // maybe Apple will ever support this?
return;
}
let copyRes;
if (field) {
const value = this.value || '';
@ -69,9 +58,7 @@ const FieldView = Backbone.View.extend({
CopyPaste.createHiddenInput(text);
}
copyRes = CopyPaste.copy(text);
if (copyRes) {
this.trigger('copy', { source: this, copyRes: copyRes });
}
this.trigger('copy', { source: this, copyRes: copyRes });
return;
}
}

View File

@ -11,6 +11,7 @@ Release notes
`+` showOnlyFilesFromConfig config option
`+` mac os window style options
`+` lock on hide mac os hide
`-` removed support of devices without clipboard api
##### v1.4.1 (2017-03-26)
`+` fix #544: read files with empty binaries