Skip to content

Commit 41fd18b

Browse files
authored
Merge pull request #344 from cksource/t/16968
Paste as plain text doesn't work in Safari.
2 parents bae53ff + 930325e commit 41fd18b

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

plugins/pastetext/plugin.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@
5454
icons: 'pastetext,pastetext-rtl', // %REMOVE_LINE_CORE%
5555
hidpi: true, // %REMOVE_LINE_CORE%
5656
init: function( editor ) {
57-
var commandName = 'pastetext';
57+
var commandName = 'pastetext',
58+
pasteKeystroke = !CKEDITOR.env.safari ? CKEDITOR.CTRL + CKEDITOR.SHIFT + 86 : // Ctrl + Shift + V
59+
CKEDITOR.CTRL + CKEDITOR.ALT + CKEDITOR.SHIFT + 86; // Ctrl + Shift + Alt + V
5860

5961
editor.addCommand( commandName, pasteTextCmd );
6062

61-
editor.setKeystroke( CKEDITOR.CTRL + CKEDITOR.SHIFT + 86, commandName ); // Ctrl + Shift + V
63+
editor.setKeystroke( pasteKeystroke, commandName );
6264

6365
editor.ui.addButton && editor.ui.addButton( 'PasteText', {
6466
label: editor.lang.pastetext.button,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<h2>Helpers</h2>
2+
<p><b>Some</b> <i>rich</i> <s>text</s> <sup>with</sup> <a href="http://cksource.com">link</a></p>
3+
<h2>Editor</h2>
4+
<textarea name="editor1" id="editor1" cols="30" rows="10">
5+
<p>Paste the content here:</p>
6+
<h2>And here:</h2>
7+
</textarea>
8+
9+
<script>
10+
if ( !CKEDITOR.env.safari ) {
11+
bender.ignore();
12+
}
13+
14+
CKEDITOR.replace( 'editor1' );
15+
</script>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@bender-tags: tc, 4.7.0, 16968, pastetext
2+
@bender-ui: collapsed
3+
@bender-ckeditor-plugins: wysiwygarea, toolbar, undo, pastetext, sourcearea, elementspath, basicstyles, format, link
4+
5+
1. Copy some rich text / html.
6+
1. Focus editor and click on the `Paste as plain text` button.
7+
1. Paste using the shortcut shown in the notification in previous step.
8+
9+
**Expected:** Content is pasted as plain text.
10+
11+
**Unexpected:** Nothing is pasted.

0 commit comments

Comments
 (0)