Initial Commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<div id="editor1">
|
||||
<p>My filename should be 'ckeditor4-export-pdf.pdf'.</p>
|
||||
</div>
|
||||
|
||||
<div id="editor2">
|
||||
<p>And mine - 'different-name.pdf'.</p>
|
||||
</div>
|
||||
|
||||
<div id="editor3">
|
||||
<h1>Beautiful title</h1>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
CKEDITOR.replace( 'editor1', exportPdfUtils.getDefaultConfig( 'manual' ) );
|
||||
|
||||
CKEDITOR.replace( 'editor2', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
exportPdf_fileName: 'different-name.pdf',
|
||||
} ) );
|
||||
|
||||
var editor3 = CKEDITOR.replace( 'editor3', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
exportPdf_fileName: function() {
|
||||
return editor3.editable().findOne( 'h1' ).getText() + '.pdf';
|
||||
}
|
||||
} ) );
|
||||
</script>
|
||||
@@ -0,0 +1,46 @@
|
||||
@bender-tags: exportpdf, feature, 1
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, notification, format
|
||||
|
||||
1. Click `Export to PDF` button (the one next to the `Source` button) in the first editor.
|
||||
1. Wait for the file to download.
|
||||
|
||||
**Expected:**
|
||||
|
||||
File with `ckeditor4-export-pdf.pdf` name (possibly with number if file already existed) was downloaded.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
File was not downloaded or its name is incorrect.
|
||||
|
||||
1. Do the same in the second editor.
|
||||
|
||||
**Expected:**
|
||||
|
||||
File with `different-name.pdf` name (possibly with number if file already existed) was downloaded.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
File was not downloaded or its name is incorrect.
|
||||
|
||||
1. Repeat for the third editor.
|
||||
|
||||
**Expected:**
|
||||
|
||||
File with 'Beautiful title.pdf' name (possibly with number if file already existed) was downloaded.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
File was not downloaded or its name is incorrect.
|
||||
|
||||
1. Change text in the third editor to `New title` (**important:** it has to remain a `<h1>` element).
|
||||
1. Click and download PDF again.
|
||||
|
||||
**Expected:**
|
||||
|
||||
Name of a new file is 'New title.pdf'.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
Name is the same as before or there is an error.
|
||||
@@ -0,0 +1,18 @@
|
||||
<div id="editor1">
|
||||
</div>
|
||||
|
||||
<div id="editor2">
|
||||
<p>My content and wrapper will be deleted.</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
CKEDITOR.replace( 'editor1', exportPdfUtils.getDefaultConfig( 'manual' ) );
|
||||
|
||||
var editor2 = CKEDITOR.replace( 'editor2', exportPdfUtils.getDefaultConfig( 'manual' ) );
|
||||
|
||||
editor2.on( 'exportPdf', function( evt ) {
|
||||
evt.data.html = '';
|
||||
}, null, null, 16 );
|
||||
</script>
|
||||
@@ -0,0 +1,34 @@
|
||||
@bender-tags: exportpdf, feature, 11
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, notification
|
||||
|
||||
**Note:** At the beginning open the console.
|
||||
|
||||
1. Click `Export to PDF` button (the one next to the `Source` button) in the first editor.
|
||||
1. Wait for the file to download.
|
||||
1. Open the file.
|
||||
|
||||
**Expected:**
|
||||
|
||||
* Empty file was downloaded.
|
||||
* No errors in console.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
* File wasn't downloaded.
|
||||
* File was downloaded but can't be opened.
|
||||
* Error in the console appeared.
|
||||
|
||||
1. Click `Export to PDF` button in the second editor.
|
||||
|
||||
**Expected:**
|
||||
|
||||
* File wasn't downloaded.
|
||||
* The notification with error appeared in the editor.
|
||||
* There is an error message in the console.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
* File was downloaded and can't be opened.
|
||||
* Success notification was displayed.
|
||||
148
public/ckeditor/plugins/exportpdf/tests/manual/integration.html
Normal file
148
public/ckeditor/plugins/exportpdf/tests/manual/integration.html
Normal file
@@ -0,0 +1,148 @@
|
||||
<div id="editor">
|
||||
<h1 style="text-align:center"><img alt="Bilancino Hotel logo" src="https://ckeditor.com/docs/ckeditor4/latest/examples/assets/image/bilancino-logo.png" style="float:right;height:75px;width:75px;" /><span style="font-family:Georgia,serif">The Flavorful Tuscany Meetup</span></h1>
|
||||
|
||||
<h2 style="text-align:center"><span style="font-family:Georgia,serif"><span style="color:#2980b9">Welcome letter</span></span></h2>
|
||||
|
||||
<p>Dear Guest,</p>
|
||||
|
||||
<p>We are delighted to welcome you to the annual <em>Flavorful Tuscany Meetup</em> and hope you will enjoy the programme as well as your stay at the <a href="https://ckeditor.com">Bilancino Hotel</a>.</p>
|
||||
|
||||
<p>Please find attached the full schedule of the event.</p>
|
||||
|
||||
<blockquote>
|
||||
<p>The annual Flavorful Tuscany meetups are always a culinary discovery. You get the best of Tuscan flavors during an intense one-day stay at one of the top hotels of the region. All the sessions are lead by top chefs passionate about their profession. I would certainly recommend to save the date in your calendar for this one!</p>
|
||||
|
||||
<p>Angelina Calvino, food journalist</p>
|
||||
</blockquote>
|
||||
|
||||
<p>Please arrive at the <a href="https://ckeditor.com">Bilancino Hotel</a> reception desk at least <strong>half an hour earlier</strong> to make sure that the registration process goes as smoothly as possible.</p>
|
||||
|
||||
<p>We look forward to welcoming you to the event.</p>
|
||||
|
||||
<p><img alt="Victoria Valc signature" src="https://ckeditor.com/docs/ckeditor4/latest/examples/assets/image/signature.png" style="height:101px;width:180px" /></p>
|
||||
|
||||
<p><span style="font-size:16px"><strong>Victoria Valc</strong></span></p>
|
||||
|
||||
<p><strong>Event Manager<br />
|
||||
Bilancino Hotel</strong></p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<div style="page-break-after: always"><span style="display:none"> </span></div>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<h2 style="text-align:center"><span style="font-family:Georgia,serif"><span style="color:#2980b9">The Flavorful Tuscany Meetup Schedule</span></span></h2>
|
||||
|
||||
<table border="1" cellspacing="0" style="border-collapse:collapse; width:597px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" style="background-color:#999999"><span style="color:#ffffff">Saturday, July 14</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="background-color:#e6e6e6; text-align:center">9:30 AM - 11:30 AM</td>
|
||||
<td>
|
||||
<p><strong>Americano vs. Brewed - “know your coffee”</strong> with: </p>
|
||||
|
||||
<ul>
|
||||
<li>Giulia Bianchi</li>
|
||||
<li>Stefano Garau</li>
|
||||
<li>Giuseppe Russo</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#e6e6e6; text-align:center">1:00 PM - 3:00 PM</td>
|
||||
<td>
|
||||
<p><strong>Pappardelle al pomodoro</strong> - live cooking <sup>1</sup></p>
|
||||
|
||||
<p>Incorporate the freshest ingredients <br />
|
||||
with Rita Fresco</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#e6e6e6; text-align:center">5:00 PM - 8:00 PM</td>
|
||||
<td>
|
||||
<p><strong>Tuscan vineyards at a glance</strong> - wine-tasting <br />
|
||||
with Frederico Riscoli</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><sup>1</sup> <em><span style="background-color:#98e64c">Registration for the live cooking session is required as seats are limited.</span></em></p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2 style="text-align: center;"><span style="color:#2980b9"><span style="font-family:Georgia,serif">Driving directions from the airport</span></span></h2>
|
||||
|
||||
<ol>
|
||||
<li>Head southeast on R138 toward Nassau St.</li>
|
||||
<li>Follow R138 and R148 to Bridgefoot St/R804.
|
||||
<ol>
|
||||
<li>Use the left 2 lanes to turn slightly left onto Lincoln Pl/R138.</li>
|
||||
<li>Turn left onto Westland Row/R118/R138.</li>
|
||||
<li>Use any lane to turn left onto Pearse St/R118/R138/R802.</li>
|
||||
<li>Continue to follow R138/R802.</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li>Turn left onto Burgh Quay/George's Quay/R105/R138.</li>
|
||||
<li>Continue onto Aston Quay/R148.
|
||||
<ul>
|
||||
<li>Continue to follow R148.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Turn left onto Bridgefoot St/R804.
|
||||
<ul>
|
||||
<li>Continue to follow R804.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>After approximately 2 minutes, Bilancino Hotel will be on your left.</li>
|
||||
</ol>
|
||||
|
||||
<p> </p>
|
||||
</div>
|
||||
|
||||
<div id="preview">
|
||||
<style>
|
||||
#preview iframe {
|
||||
width: 840px;
|
||||
height: 500px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h2>Document preview (based on send HTML and CSS)</h2>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
var editor = CKEDITOR.replace( 'editor', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
width: 840,
|
||||
height: 400
|
||||
} ) );
|
||||
|
||||
editor.on( 'exportPdf', function( evt ) {
|
||||
var oldIframe = document.querySelector( '#preview iframe' ),
|
||||
html;
|
||||
|
||||
if ( oldIframe && oldIframe.parentNode ) {
|
||||
oldIframe.parentNode.removeChild( oldIframe );
|
||||
}
|
||||
|
||||
// Align iframe HTML with the one on the endpoint side by adding explicit encoding and DOCTYPE.
|
||||
html = '<!DOCTYPE html><html><head><style>' + evt.data.css + '</style><meta charset="UTF-8"></head><body>' + evt.data.html + '</body></html>';
|
||||
|
||||
var iframe = document.createElement( 'iframe' );
|
||||
document.querySelector( '#preview' ).appendChild( iframe );
|
||||
iframe.contentWindow.document.open();
|
||||
iframe.contentWindow.document.write( html );
|
||||
iframe.contentWindow.document.close();
|
||||
}, null, null, 16 );
|
||||
</script>
|
||||
@@ -0,0 +1,12 @@
|
||||
@bender-tags: exportpdf, feature, 17
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: basicstyles, bidi, blockquote, clipboard, colorbutton, colordialog, dialogadvtab, elementspath, enterkey, font, format, horizontalrule, htmlwriter, image, indentlist, indentblock, justify, link, list, liststyle, magicline, pagebreak, pastefromgdocs, pastefromlibreoffice, pastefromword, pastetext, specialchar, stylescombo, table, tableselection, tabletools, toolbar, undo, wysiwygarea, sourcearea, resize
|
||||
|
||||
1. Click `Export to PDF` button (the one next to the `Source` button).
|
||||
|
||||
1. Wait for the PDF to download and examine it.
|
||||
|
||||
If you find any bugs, please report them <a href="https://github.com/cksource/ckeditor4-plugin-exportpdf/issues" target="_blank">here</a>. Just remember to check if it isn't <a href="https://github.com/cksource/ckeditor4-plugin-exportpdf/issues?q=is%3Aopen+is%3Aissue+label%3Atype%3Abug" target="_blank">already known</a>.
|
||||
|
||||
When comparing generated PDF to editor contents the best conversion results (close to 1:1 document formatting) can be observed in a Chrome browser.
|
||||
@@ -0,0 +1,27 @@
|
||||
<div id="editor">
|
||||
<p>Foo bar</p>
|
||||
</div>
|
||||
|
||||
<div id="tokenValue" style="word-break:break-all;border:1px solid red;"></div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
var editor = CKEDITOR.replace( 'editor', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
extraPlugins: 'easyimage,exportpdf',
|
||||
cloudServices_uploadUrl: 'https://33333.cke-cs.com/easyimage/upload/',
|
||||
cloudServices_tokenUrl: 'https://33333.cke-cs.com/token/dev/ijrDsqFix838Gh3wGO3F77FSW94BwcLXprJ4APSp3XQ26xsUHTi0jcb1hoBt'
|
||||
} ) );
|
||||
|
||||
editor.on( 'instanceReady', function() {
|
||||
if ( !CKEDITOR.config.exportPdf_tokenUrl ) {
|
||||
bender.ignore();
|
||||
}
|
||||
} );
|
||||
|
||||
editor.on( 'exportPdf', function( evt ) {
|
||||
var value = CKEDITOR.document.findOne( '#tokenValue' );
|
||||
|
||||
value.setHtml( evt.data.token );
|
||||
}, null, null, 17 );
|
||||
</script>
|
||||
@@ -0,0 +1,26 @@
|
||||
@bender-tags: exportpdf, feature, 77
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, notification, format, easyimage
|
||||
|
||||
Note: You need the Internet connection to run this test.
|
||||
|
||||
1. Click `Export to PDF` toolbar button.
|
||||
1. Examine the area in the red frame below.
|
||||
|
||||
**Expected:** There is a long token string in the frame.
|
||||
|
||||
**Unexpected:** Frame is empty or says 'undefined'.
|
||||
|
||||
1. Wait for the file to download and examine it.
|
||||
|
||||
**Expected:** No information about being created with CKEditor was added.
|
||||
|
||||
**Unexpected:** There is an additional note about CKEditor at the bottom of page.
|
||||
|
||||
1. Upload an image.
|
||||
1. Examine browser console.
|
||||
|
||||
**Expected:** There are no errors or warnings.
|
||||
|
||||
**Unexpected:** Any error or warning concerning `Export to PDF` or `Easy Image` occurred.
|
||||
@@ -0,0 +1,19 @@
|
||||
<div id="editor1">
|
||||
<p>Hello world!</p>
|
||||
</div>
|
||||
|
||||
<div id="editor2">
|
||||
<p>Hello world!</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
CKEDITOR.replace( 'editor1', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
extraPlugins: 'exportpdf'
|
||||
} ) );
|
||||
|
||||
CKEDITOR.replace( 'editor2', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
removePlugins: 'notification'
|
||||
} ) );
|
||||
</script>
|
||||
@@ -0,0 +1,36 @@
|
||||
@bender-tags: exportpdf, feature, 4
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, notification
|
||||
|
||||
1. Read the expected results first as there will be a sequence of things happening quickly to examine.
|
||||
1. Click `Export to PDF` button in the first editor.
|
||||
|
||||
**Expected:**
|
||||
|
||||
* Button is disabled after click.
|
||||
* Nofitication bar of `info` type appeared.
|
||||
* When download started, notification type changed to `success`.
|
||||
* Once download finished, button is enabled again.
|
||||
* After 3 seconds notification bar disappeared.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
* Button wasn't disabled.
|
||||
* Button wasn't enabled after download started.
|
||||
* Notifications were incorrect.
|
||||
* Notification bar didn't disappear.
|
||||
|
||||
1. Click `Export to PDF` button in the second editor.
|
||||
|
||||
**Expected:**
|
||||
|
||||
* Neither notifications nor alerts appeared.
|
||||
* File was downloaded.
|
||||
* Button was disabled for the time between click and download.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
* Notification or browser alert appeared.
|
||||
* File wasn't downloaded.
|
||||
* Button wasn't disabled for the time between click and download.
|
||||
@@ -0,0 +1,45 @@
|
||||
<div id="editor1">
|
||||
<p>Export to PDF test 1.</p>
|
||||
</div>
|
||||
|
||||
<div id="editor2">
|
||||
<p>Export to PDF test 2.</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
var editor1 = CKEDITOR.replace( 'editor1', exportPdfUtils.getDefaultConfig( 'manual' ) );
|
||||
|
||||
editor1.on( 'exportPdf', function( evt ) {
|
||||
if ( !evt.data.asyncDone ) {
|
||||
setTimeout( function() {
|
||||
evt.data.html = '<p>Content filtered!</p>';
|
||||
evt.data.asyncDone = true;
|
||||
|
||||
editor1.fire( 'exportPdf', evt.data );
|
||||
}, 2000 );
|
||||
|
||||
evt.cancel();
|
||||
} else {
|
||||
delete evt.data.asyncDone;
|
||||
}
|
||||
}, null, null, 1 );
|
||||
|
||||
var editor2 = CKEDITOR.replace( 'editor2', exportPdfUtils.getDefaultConfig( 'manual' ) );
|
||||
|
||||
editor2.on( 'exportPdf', function( evt ) {
|
||||
if ( !evt.data.asyncDone ) {
|
||||
setTimeout( function() {
|
||||
evt.data.html = '<p>Content filtered!</p>';
|
||||
evt.data.asyncDone = true;
|
||||
|
||||
editor2.fire( 'exportPdf', evt.data );
|
||||
}, 2000 );
|
||||
|
||||
evt.cancel();
|
||||
} else {
|
||||
delete evt.data.asyncDone;
|
||||
}
|
||||
}, null, null, 17 );
|
||||
</script>
|
||||
@@ -0,0 +1,27 @@
|
||||
@bender-tags: exportpdf, feature, 4
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, notification
|
||||
|
||||
1. Click `Export to PDF` button (the one next to the `Source` button) in the first editor.
|
||||
1. Watch appearing notifications.
|
||||
|
||||
**Expected:**
|
||||
|
||||
* Notification `Processing PDF document...` was visible for about 2 seconds.
|
||||
* Progress steps were: `0`, `0.5`, `success`.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
Notification disappeared too fast to be noticable.
|
||||
|
||||
1. Do the same in the second editor.
|
||||
|
||||
**Expected:**
|
||||
|
||||
* Notification `Processing PDF document...` was visible for about 2 seconds.
|
||||
* Progress steps were: `0.2`, `0.5`, `success`.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
Notification disappeared too fast to be noticable.
|
||||
@@ -0,0 +1,29 @@
|
||||
<div id="editor1">
|
||||
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit,
|
||||
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
|
||||
irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
||||
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="editor2">
|
||||
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit,
|
||||
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
|
||||
irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
||||
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
CKEDITOR.replace( 'editor1', exportPdfUtils.getDefaultConfig( 'manual' ) );
|
||||
|
||||
CKEDITOR.replace( 'editor2', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
exportPdf_options: {
|
||||
format: 'A6'
|
||||
}
|
||||
} ) );
|
||||
</script>
|
||||
@@ -0,0 +1,18 @@
|
||||
@bender-tags: exportpdf, bug, 24
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, notification
|
||||
|
||||
1. Click `Export to PDF` button (the one next to the `Source` button) in the first editor.
|
||||
1. Wait for the file to download.
|
||||
1. Do the same in the second editor.
|
||||
1. Compare paper format in files.
|
||||
|
||||
**Expected:**
|
||||
|
||||
* First editor produced file in `A4` format (`8.27in x 11.7in`);
|
||||
* Second editor produced file in `A6` format (`4.13in x 5.83in`).
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
Any file is in different format than intended (e.g. `Letter` - `8.5in x 11in`).
|
||||
18
public/ckeditor/plugins/exportpdf/tests/manual/readonly.html
Normal file
18
public/ckeditor/plugins/exportpdf/tests/manual/readonly.html
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
<div id="editor">
|
||||
<p>This editor is read-only.</p>
|
||||
</div>
|
||||
|
||||
<button id="toggle">Toggle read-only mode</button>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
var editor = CKEDITOR.replace( 'editor', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
readOnly: true
|
||||
} ) );
|
||||
|
||||
CKEDITOR.document.getById( 'toggle' ).on( 'click', function() {
|
||||
editor.setReadOnly( !editor.readOnly );
|
||||
} );
|
||||
</script>
|
||||
28
public/ckeditor/plugins/exportpdf/tests/manual/readonly.md
Normal file
28
public/ckeditor/plugins/exportpdf/tests/manual/readonly.md
Normal file
@@ -0,0 +1,28 @@
|
||||
@bender-tags: exportpdf, feature, 1
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, notification
|
||||
|
||||
1. Examine `Export to PDF` button (the one next to the `Source` button).
|
||||
|
||||
**Expected:**
|
||||
|
||||
Button is clickable.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
Button is inactive.
|
||||
|
||||
1. Click the button.
|
||||
1. Wait for the file to download.
|
||||
|
||||
**Expected:**
|
||||
|
||||
File with correct content was downloaded.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
File was not downloaded or its content is incorrect.
|
||||
|
||||
1. Click `Toggle read-only mode` button.
|
||||
1. Repeat steps 1-3.
|
||||
@@ -0,0 +1,36 @@
|
||||
<h2>Classic Editor</h2>
|
||||
<textarea id="editor1">
|
||||
<span class="badge badge-success">Classic Editor</span>
|
||||
</textarea>
|
||||
|
||||
<h2>Divarea Editor</h2>
|
||||
<div id="editor2">
|
||||
<span class="badge badge-success">Divarea Editor</span>
|
||||
</div>
|
||||
|
||||
<h2>Inline Editor</h2>
|
||||
<div id="editor3" contenteditable="true">
|
||||
<span class="badge badge-success">Inline Editor</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
CKEDITOR.replace( 'editor1', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
exportPdf_stylesheets: [ 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' ],
|
||||
extraPlugins: 'wysiwygarea,exportpdf',
|
||||
allowedContent: true
|
||||
} ) );
|
||||
|
||||
CKEDITOR.replace( 'editor2', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
exportPdf_stylesheets: [ 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' ],
|
||||
extraPlugins: 'divarea,exportpdf',
|
||||
allowedContent: true
|
||||
} ) );
|
||||
|
||||
CKEDITOR.inline( 'editor3', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
exportPdf_stylesheets: [ 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' ],
|
||||
extraPlugins: 'floatingspace,exportpdf',
|
||||
allowedContent: true
|
||||
} ) );
|
||||
</script>
|
||||
@@ -0,0 +1,19 @@
|
||||
@bender-tags: exportpdf, feature, 31
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: toolbar, basicstyles, notification
|
||||
|
||||
**Note:** This test uses <a href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" target="_blank">Bootstrap CDN</a>. If something goes wrong, check if the link works correctly first.
|
||||
|
||||
1. Use `Export to PDF` button in the first editor.
|
||||
1. Open generated file.
|
||||
|
||||
**Expected:**
|
||||
|
||||
Text from editor was converted to a green badge.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
Content is the same as in the editor.
|
||||
|
||||
1. Repeat the same steps for the second and third editor.
|
||||
@@ -0,0 +1,23 @@
|
||||
<div id="editor">
|
||||
<p>Foo bar</p>
|
||||
</div>
|
||||
|
||||
<div id="tokenValue" style="word-break:break-all;border:1px solid red;"></div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
var editor = CKEDITOR.replace( 'editor', exportPdfUtils.getDefaultConfig( 'manual' ) );
|
||||
|
||||
editor.on( 'instanceReady', function() {
|
||||
if ( !CKEDITOR.config.exportPdf_tokenUrl ) {
|
||||
bender.ignore();
|
||||
}
|
||||
} );
|
||||
|
||||
editor.on( 'exportPdf', function( evt ) {
|
||||
var value = CKEDITOR.document.findOne( '#tokenValue' );
|
||||
|
||||
value.setHtml( evt.data.token );
|
||||
}, null, null, 17 );
|
||||
</script>
|
||||
@@ -0,0 +1,19 @@
|
||||
@bender-tags: exportpdf, feature, 77
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, notification, format
|
||||
|
||||
Note: You need the Internet connection to run this test.
|
||||
|
||||
1. Click `Export to PDF` toolbar button.
|
||||
1. Examine the area in the red frame below.
|
||||
|
||||
**Expected:** There is a long token string in the frame.
|
||||
|
||||
**Unexpected:** Frame is empty or says 'undefined'.
|
||||
|
||||
1. Wait for the file to download and open it.
|
||||
|
||||
**Expected:** No information about being created with CKEditor was added.
|
||||
|
||||
**Unexpected:** There is an additional note about CKEditor at the bottom of page.
|
||||
@@ -0,0 +1,38 @@
|
||||
<h3>Editor 1</h3>
|
||||
<div id="editor1">
|
||||
<p>Foo bar</p>
|
||||
</div>
|
||||
<div id="tokenValue1" style="word-break:break-all;border:1px solid red;"></div>
|
||||
|
||||
<h3>Editor 2</h3>
|
||||
<div id="editor2">
|
||||
<p>Foo bar</p>
|
||||
</div>
|
||||
<div id="tokenValue2" style="word-break:break-all;border:1px solid red;"></div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
var editor1 = CKEDITOR.replace( 'editor1', exportPdfUtils.getDefaultConfig( 'manual', { height: 100 } ) ),
|
||||
editor2 = CKEDITOR.replace( 'editor2', exportPdfUtils.getDefaultConfig( 'manual', { height: 100 } ) );
|
||||
|
||||
editor1.on( 'instanceReady', function() {
|
||||
if ( !CKEDITOR.config.exportPdf_tokenUrl ) {
|
||||
bender.ignore();
|
||||
}
|
||||
} );
|
||||
|
||||
editor1.on( 'exportPdf', function( evt ) {
|
||||
var value = CKEDITOR.document.findOne( '#tokenValue1' );
|
||||
|
||||
value.setHtml( evt.data.token );
|
||||
evt.cancel();
|
||||
}, null, null, 17 );
|
||||
|
||||
editor2.on( 'exportPdf', function( evt ) {
|
||||
var value = CKEDITOR.document.findOne( '#tokenValue2' );
|
||||
|
||||
value.setHtml( evt.data.token );
|
||||
evt.cancel();
|
||||
}, null, null, 17 );
|
||||
</script>
|
||||
@@ -0,0 +1,14 @@
|
||||
@bender-tags: exportpdf, feature, 77
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, notification, format
|
||||
|
||||
Note: You need the Internet connection to run this test.
|
||||
|
||||
1. Click `Export to PDF` button in both editors.
|
||||
|
||||
1. Examine the area in the red frames below each editor.
|
||||
|
||||
**Expected:** Content of two boxes are two different long strings.
|
||||
|
||||
**Unexpected:** Values in both boxes are the same or one of them says `undefined`.
|
||||
@@ -0,0 +1,38 @@
|
||||
<h3>Editor 1</h3>
|
||||
<div id="editor1">
|
||||
<p>Foo bar</p>
|
||||
</div>
|
||||
<div id="tokenValue1" style="word-break:break-all;border:1px solid red;"></div>
|
||||
|
||||
<h3>Editor 2</h3>
|
||||
<div id="editor2">
|
||||
<p>Foo bar</p>
|
||||
</div>
|
||||
<div id="tokenValue2" style="word-break:break-all;border:1px solid red;"></div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
var editor1 = CKEDITOR.replace( 'editor1', exportPdfUtils.getDefaultConfig( 'manual', { height: 100 } ) ),
|
||||
editor2 = CKEDITOR.replace( 'editor2', exportPdfUtils.getDefaultConfig( 'manual', { exportPdf_tokenUrl: '', height: 100 } ) );
|
||||
|
||||
editor1.on( 'instanceReady', function() {
|
||||
if ( !CKEDITOR.config.exportPdf_tokenUrl ) {
|
||||
bender.ignore();
|
||||
}
|
||||
} );
|
||||
|
||||
editor1.on( 'exportPdf', function( evt ) {
|
||||
var value = CKEDITOR.document.findOne( '#tokenValue1' );
|
||||
|
||||
value.setHtml( evt.data.token );
|
||||
evt.cancel();
|
||||
}, null, null, 17 );
|
||||
|
||||
editor2.on( 'exportPdf', function( evt ) {
|
||||
var value = CKEDITOR.document.findOne( '#tokenValue2' );
|
||||
|
||||
value.setHtml( evt.data.token );
|
||||
evt.cancel();
|
||||
}, null, null, 17 );
|
||||
</script>
|
||||
@@ -0,0 +1,14 @@
|
||||
@bender-tags: exportpdf, feature, 77
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, notification, format
|
||||
|
||||
Note: You need the Internet connection to run this test.
|
||||
|
||||
1. Click `Export to PDF` button in both editors.
|
||||
|
||||
1. Examine the area in the red frames below each editor.
|
||||
|
||||
**Expected:** First box contains token value and the second one `undefined`.
|
||||
|
||||
**Unexpected:** Values in both boxes are the same or none of them is `undefined`.
|
||||
@@ -0,0 +1,19 @@
|
||||
<div id="editor">
|
||||
<p>Foo bar</p>
|
||||
</div>
|
||||
|
||||
<div id="tokenValue" style="word-break:break-all;border:1px solid red;"></div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
var editor = CKEDITOR.replace( 'editor', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
exportPdf_tokenUrl: ''
|
||||
} ) );
|
||||
|
||||
editor.on( 'exportPdf', function( evt ) {
|
||||
var value = CKEDITOR.document.findOne( '#tokenValue' );
|
||||
|
||||
value.setHtml( evt.data.token );
|
||||
}, null, null, 17 );
|
||||
</script>
|
||||
@@ -0,0 +1,31 @@
|
||||
@bender-tags: exportpdf, feature, 77
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, notification, format
|
||||
|
||||
Note: You need the Internet connection to run this test.
|
||||
|
||||
1. Open and examine console.
|
||||
|
||||
**Expected:** `exportpdf-no-token-url` warning appeared.
|
||||
|
||||
**Unexpected:** No warning.
|
||||
|
||||
1. Click `Export to PDF` button in the editor.
|
||||
1. Examine the area in the red frame below.
|
||||
|
||||
**Expected:** Frame has text `undefined`.
|
||||
|
||||
**Unexpected:** There is a long token string in the frame.
|
||||
|
||||
1. Examine console.
|
||||
|
||||
**Expected:** `exportpdf-no-token` warning appeared.
|
||||
|
||||
**Unexpected:** No warning.
|
||||
|
||||
1. Wait for the file to download and open it.
|
||||
|
||||
**Expected:** File contains info about being created with CKEditor.
|
||||
|
||||
**Unexpected:** No copyright info was added.
|
||||
@@ -0,0 +1,21 @@
|
||||
<div id="editor1">
|
||||
<p>Hello world!</p>
|
||||
</div>
|
||||
|
||||
<div id="editor2">
|
||||
<p>Hello world!</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
exportPdfUtils.initManualTest();
|
||||
|
||||
CKEDITOR.replace( 'editor1', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
extraPlugins: 'exportpdf',
|
||||
exportPdf_service: 'https://cksource.com'
|
||||
} ) );
|
||||
|
||||
CKEDITOR.replace( 'editor2', exportPdfUtils.getDefaultConfig( 'manual', {
|
||||
removePlugins: 'notification',
|
||||
exportPdf_service: 'https://cksource.com'
|
||||
} ) );
|
||||
</script>
|
||||
@@ -0,0 +1,34 @@
|
||||
@bender-tags: exportpdf, feature, 4
|
||||
@bender-ui: collapsed
|
||||
@bender-include: ../_helpers/tools.js
|
||||
@bender-ckeditor-plugins: wysiwygarea, toolbar, notification
|
||||
|
||||
**Note:** Errors in console during this test are allowed.
|
||||
|
||||
1. Click `Export to PDF` button in the first editor.
|
||||
|
||||
**Expected:**
|
||||
|
||||
* Warning notification with `Error occured.` message appeared.
|
||||
* Button is clickable.
|
||||
* File wasn't downloaded.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
* Notification didn't show up.
|
||||
* Button wasn't reenabled.
|
||||
* File was downloaded.
|
||||
|
||||
2. Click `Export to PDF` button in the second editor.
|
||||
|
||||
**Expected:**
|
||||
|
||||
* Alert appeared instead of notification.
|
||||
* Button is clickable.
|
||||
* File wasn't downloaded.
|
||||
|
||||
**Unexpected:**
|
||||
|
||||
* Notification didn't show up.
|
||||
* Button wasn't reenabled.
|
||||
* File was downloaded.
|
||||
Reference in New Issue
Block a user