16825 |
efrain |
1 |
<h3>Editor 1</h3>
|
|
|
2 |
<div id="editor1">
|
|
|
3 |
<p>Foo bar</p>
|
|
|
4 |
</div>
|
|
|
5 |
<div id="tokenValue1" style="word-break:break-all;border:1px solid red;"></div>
|
|
|
6 |
|
|
|
7 |
<h3>Editor 2</h3>
|
|
|
8 |
<div id="editor2">
|
|
|
9 |
<p>Foo bar</p>
|
|
|
10 |
</div>
|
|
|
11 |
<div id="tokenValue2" style="word-break:break-all;border:1px solid red;"></div>
|
|
|
12 |
|
|
|
13 |
<script>
|
|
|
14 |
exportPdfUtils.initManualTest();
|
|
|
15 |
|
|
|
16 |
var editor1 = CKEDITOR.replace( 'editor1', exportPdfUtils.getDefaultConfig( 'manual', { height: 100 } ) ),
|
|
|
17 |
editor2 = CKEDITOR.replace( 'editor2', exportPdfUtils.getDefaultConfig( 'manual', { exportPdf_tokenUrl: '', height: 100 } ) );
|
|
|
18 |
|
|
|
19 |
editor1.on( 'instanceReady', function() {
|
|
|
20 |
if ( !CKEDITOR.config.exportPdf_tokenUrl ) {
|
|
|
21 |
bender.ignore();
|
|
|
22 |
}
|
|
|
23 |
} );
|
|
|
24 |
|
|
|
25 |
editor1.on( 'exportPdf', function( evt ) {
|
|
|
26 |
var value = CKEDITOR.document.findOne( '#tokenValue1' );
|
|
|
27 |
|
|
|
28 |
value.setHtml( evt.data.token );
|
|
|
29 |
evt.cancel();
|
|
|
30 |
}, null, null, 17 );
|
|
|
31 |
|
|
|
32 |
editor2.on( 'exportPdf', function( evt ) {
|
|
|
33 |
var value = CKEDITOR.document.findOne( '#tokenValue2' );
|
|
|
34 |
|
|
|
35 |
value.setHtml( evt.data.token );
|
|
|
36 |
evt.cancel();
|
|
|
37 |
}, null, null, 17 );
|
|
|
38 |
</script>
|