diff options
Diffstat (limited to 'sources/plugins/clipboard/dev/console.js')
-rw-r--r-- | sources/plugins/clipboard/dev/console.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/sources/plugins/clipboard/dev/console.js b/sources/plugins/clipboard/dev/console.js new file mode 100644 index 0000000..96ccd81 --- /dev/null +++ b/sources/plugins/clipboard/dev/console.js | |||
@@ -0,0 +1,49 @@ | |||
1 | /** | ||
2 | * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
3 | * For licensing, see LICENSE.md or http://ckeditor.com/license | ||
4 | */ | ||
5 | |||
6 | /* global CKCONSOLE */ | ||
7 | |||
8 | 'use strict'; | ||
9 | |||
10 | ( function() { | ||
11 | var pasteType, pasteValue; | ||
12 | |||
13 | CKCONSOLE.add( 'paste', { | ||
14 | panels: [ | ||
15 | { | ||
16 | type: 'box', | ||
17 | content: | ||
18 | '<ul class="ckconsole_list">' + | ||
19 | '<li>type: <span class="ckconsole_value" data-value="type"></span></li>' + | ||
20 | '<li>value: <span class="ckconsole_value" data-value="value"></span></li>' + | ||
21 | '</ul>', | ||
22 | |||
23 | refresh: function() { | ||
24 | return { | ||
25 | header: 'Paste', | ||
26 | type: pasteType, | ||
27 | value: pasteValue | ||
28 | }; | ||
29 | }, | ||
30 | |||
31 | refreshOn: function( editor, refresh ) { | ||
32 | editor.on( 'paste', function( evt ) { | ||
33 | pasteType = evt.data.type; | ||
34 | pasteValue = CKEDITOR.tools.htmlEncode( evt.data.dataValue ); | ||
35 | refresh(); | ||
36 | } ); | ||
37 | } | ||
38 | }, | ||
39 | { | ||
40 | type: 'log', | ||
41 | on: function( editor, log, logFn ) { | ||
42 | editor.on( 'paste', function( evt ) { | ||
43 | logFn( 'paste; type:' + evt.data.type )(); | ||
44 | } ); | ||
45 | } | ||
46 | } | ||
47 | ] | ||
48 | } ); | ||
49 | } )(); | ||