0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00

Fix issue in Safari with paste

This commit is contained in:
Robert O'Leary 2017-01-30 16:57:09 +01:00
parent ec27c90c57
commit a69c81fbd7
No known key found for this signature in database
GPG key ID: DD07530AA9B1D961
3 changed files with 5 additions and 7 deletions

View file

@ -2340,8 +2340,7 @@ var onPaste = function ( event ) {
if ( !isEdge && types && (
indexOf.call( types, 'text/html' ) > -1 || (
!isGecko &&
indexOf.call( types, 'text/plain' ) > -1 &&
indexOf.call( types, 'text/rtf' ) < 0 )
indexOf.call( types, 'text/plain' ) > -1 )
)) {
event.preventDefault();
// Abiword on Linux copies a plain text and html version, but the HTML
@ -2349,7 +2348,7 @@ var onPaste = function ( event ) {
// insert plain text instead. On iOS, Facebook (and possibly other
// apps?) copy links as type text/uri-list, but also insert a **blank**
// text/plain item onto the clipboard. Why? Who knows.
if ( !choosePlain && ( data = clipboardData.getData( 'text/html' ) ) ) {
if ( !choosePlain && !this._config.usePlainTextOnPaste && ( data = clipboardData.getData( 'text/html' ) ) ) {
this.insertHTML( data, true );
} else if (
( data = clipboardData.getData( 'text/plain' ) ) ||

File diff suppressed because one or more lines are too long

View file

@ -210,8 +210,7 @@ var onPaste = function ( event ) {
if ( !isEdge && types && (
indexOf.call( types, 'text/html' ) > -1 || (
!isGecko &&
indexOf.call( types, 'text/plain' ) > -1 &&
indexOf.call( types, 'text/rtf' ) < 0 )
indexOf.call( types, 'text/plain' ) > -1 )
)) {
event.preventDefault();
// Abiword on Linux copies a plain text and html version, but the HTML
@ -219,7 +218,7 @@ var onPaste = function ( event ) {
// insert plain text instead. On iOS, Facebook (and possibly other
// apps?) copy links as type text/uri-list, but also insert a **blank**
// text/plain item onto the clipboard. Why? Who knows.
if ( !choosePlain && ( data = clipboardData.getData( 'text/html' ) ) ) {
if ( !choosePlain && !this._config.usePlainTextOnPaste && ( data = clipboardData.getData( 'text/html' ) ) ) {
this.insertHTML( data, true );
} else if (
( data = clipboardData.getData( 'text/plain' ) ) ||