mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Workaround Facebook iOS URL copying bug
This commit is contained in:
parent
44a2b5c7a8
commit
e3d0576a38
3 changed files with 13 additions and 5 deletions
|
@ -2136,10 +2136,14 @@ var onPaste = function ( event ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// Abiword on Linux copies a plain text and html version, but the HTML
|
// Abiword on Linux copies a plain text and html version, but the HTML
|
||||||
// version is the empty string! So always try to get HTML, but if none,
|
// version is the empty string! So always try to get HTML, but if none,
|
||||||
// insert plain text instead.
|
// 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 (( data = clipboardData.getData( 'text/html' ) )) {
|
if (( data = clipboardData.getData( 'text/html' ) )) {
|
||||||
this.insertHTML( data, true );
|
this.insertHTML( data, true );
|
||||||
} else if (( data = clipboardData.getData( 'text/plain' ) )) {
|
} else if (
|
||||||
|
( data = clipboardData.getData( 'text/plain' ) ) ||
|
||||||
|
( data = clipboardData.getData( 'text/uri-list' ) ) ) {
|
||||||
this.insertPlainText( data, true );
|
this.insertPlainText( data, true );
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -131,10 +131,14 @@ var onPaste = function ( event ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// Abiword on Linux copies a plain text and html version, but the HTML
|
// Abiword on Linux copies a plain text and html version, but the HTML
|
||||||
// version is the empty string! So always try to get HTML, but if none,
|
// version is the empty string! So always try to get HTML, but if none,
|
||||||
// insert plain text instead.
|
// 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 (( data = clipboardData.getData( 'text/html' ) )) {
|
if (( data = clipboardData.getData( 'text/html' ) )) {
|
||||||
this.insertHTML( data, true );
|
this.insertHTML( data, true );
|
||||||
} else if (( data = clipboardData.getData( 'text/plain' ) )) {
|
} else if (
|
||||||
|
( data = clipboardData.getData( 'text/plain' ) ) ||
|
||||||
|
( data = clipboardData.getData( 'text/uri-list' ) ) ) {
|
||||||
this.insertPlainText( data, true );
|
this.insertPlainText( data, true );
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue