diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/CHANGELOG.md b/assets/ckeditor/ckeditor/plugins/exportpdf/CHANGELOG.md new file mode 100644 index 00000000..13ebe74e --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/CHANGELOG.md @@ -0,0 +1,54 @@ +# CKEditor 4 Export to PDF Plugin Changelog + +## ckeditor4-plugin-exportpdf 1.0.3 + +Other Changes: + +* Updated test files. + +## ckeditor4-plugin-exportpdf 1.0.2 + +Other Changes: + +* Updated year in license headers. + +## ckeditor4-plugin-exportpdf 1.0.1 + +Other Changes: + +* Improved external CSS support for [Classic Editor](https://ckeditor.com/docs/ckeditor4/latest/examples/classic.html) by handling exceptions and displaying convenient [error messages](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#exportpdf-stylesheets-incaccessible). + +## ckeditor4-plugin-exportpdf 1.0.0 + +The first stable release of the CKEditor 4 WYSIWYG Editor Export to PDF plugin. After a few months of the beta phase, testing and listening to community feedback, the CKEditor 4 Export to PDF plugin is stable and can be used with full confidence. Enjoy! + +New Features: + +* Introduced access control mechanism. The plugin now can be configured with additional [exportPdf_tokenUrl](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-exportPdf_tokenUrl) option to allow commercial use. + +## ckeditor4-plugin-exportpdf 0.1.2 + +Other Changes: + +* Improved [plugin API documentation](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-exportPdf_fileName). +* Updated Export to PDF plugin npm readme to link to the [official plugin documentation](https://ckeditor.com/docs/ckeditor4/latest/features/exporttopdf.html). + +## ckeditor4-plugin-exportpdf 0.1.1 + +Other Changes: + +* Renamed the Export to PDF plugin button from `exportPdf` to `ExportPdf`. The `ExportPdf` name should now be used while setting up a custom toolbar with the [CKEDITOR.config.toolbar](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-toolbar) configuration option. + +## ckeditor4-plugin-exportpdf 0.1.0 + +The first beta release of the CKEditor 4 Export to PDF plugin. + +This plugin allows you to easily print your WYSIWYG editor content to a PDF file. When enabled, this feature sends the content of your editor together with the styles that are used to display it to the CKEditor Cloud Services HTML to PDF converter service. The service then generates a PDF document that can be downloaded by the user. + +Available features: + +* Exporting HTML content from CKEditor 4 WYSIWYG editor to PDF with a single click. +* Setting a custom name for the generated PDF file. +* Handling relative image paths. +* Changing the appearance of the PDF document (like margins, text styling, custom headers and footers etc.) with custom CSS styles. +* Pre-processing HTML content via synchronous and asynchronous code before the generation of the PDF file. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/LICENSE.md b/assets/ckeditor/ckeditor/plugins/exportpdf/LICENSE.md new file mode 100644 index 00000000..3140b390 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/LICENSE.md @@ -0,0 +1,18 @@ +Software License Agreement +========================== + +**CKEditor 4 Export to PDF plugin** (https://ckeditor.com/ckeditor-4/)
+Copyright (c) 2003-2021, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved. + +CKEditor 4 Export to PDF plugin is licensed under a commercial license and is protected by copyright law. +For more details about available licensing options please contact us at sales@cksource.com. + +Sources of Intellectual Property Included in CKEditor 4 export to PDF +--------------------------------------------------------------------- + +Where not otherwise indicated, all CKEditor 4 Export to PDF plugin content is authored by CKSource engineers and consists of CKSource-owned intellectual property. + +Trademarks +---------- + +**CKEditor** is a trademark of [CKSource](http://cksource.com) Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/README.md b/assets/ckeditor/ckeditor/plugins/exportpdf/README.md new file mode 100644 index 00000000..94254075 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/README.md @@ -0,0 +1,102 @@ +# CKEditor 4 Export to PDF Plugin + +The **Export to PDF** CKEditor 4 plugin allows you to easily print the WYSIWYG editor content to a PDF file. When enabled, this feature sends the content of your editor together with the styles that are used to display it to the CKEditor Cloud Services HTML to PDF converter service. The service then generates a PDF document that can be downloaded by the user. + +Thanks to this plugin, it takes exactly one button click to get a PDF file with content formatted in the same way as the one visible in CKEditor 4. + +CKEditor 4 **Export to PDF** also allows various customizations like changing the page size and margin, setting additional styling, adding custom headers and footers and pre-processing content. This gives great flexibility and control over the PDF output and allows to keep all the PDF documents consistent when it comes to styling. + +This is a premium feature. Please [contact us](https://ckeditor.com/contact/) if you would like to purchase a license. Let us know if you have any feedback or questions! You can also sign up for the [CKEditor Premium Features 30-day Free Trial](https://orders.ckeditor.com/trial/premium-features). + +If this feature is used without authorization, the resulting documents will be watermarked. + +![](https://c.cksource.com/a/1/img/npm/ckeditor4-pdf-export.gif) + +## Getting Started + +### Using with official CKEditor 4 presets + +Starting with CKEditor 4 version `4.15.0`, **Export to PDF** plugin is included in `standard-all`, `full` and `full-all` official presets. The `full` and `full-all` presets have the plugin active by default while for `standard-all` it needs to be enabled with the [`config.extraPlugins`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-extraPlugins) configuration option: + +```js +CKEDITOR.replace( 'editor', { + extraPlugins: 'exportpdf' +} ); +``` + +### Installation from npm + +To instal the plugin via npm, simply run: + +```bash +npm i ckeditor4-plugin-exportpdf +``` + +Then add the plugin to your CKEditor 4 instance with the [`addExternal()` method](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins.html#method-addExternal): + +```js +CKEDITOR.plugins.addExternal( 'exportpdf', './node_modules/ckeditor4-plugin-exportpdf/' ); +``` + +If you prefer not to link to the `node_modules` folder directly, you may simply copy the entire `./node_modules/ckeditor4-plugin-exportpdf/` directory as `ckeditor/plugins/exportpdf/` and add it with the [`config.extraPlugins`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-extraPlugins) configuration option: + +```js +CKEDITOR.replace( 'editor', { + extraPlugins: 'exportpdf' +} ); +``` + +### Other Installation Methods + +You can also use the [CKEditor 4 Add-ons repository](https://ckeditor.com/cke4/addons/plugins/all) to obtain the plugin via: + +* [Custom build with online builder](https://ckeditor.com/cke4/builder) +* [Manual download](https://ckeditor.com/cke4/addon/exportpdf) + +Refer to [Export to PDF installation documentation](https://ckeditor.com/docs/ckeditor4/latest/features/exporttopdf.html#installation) for more details. If you are having trouble setting up the Export to PDF plugin, please [contact us](https://ckeditor.com/contact/). + +### Setting up a license key + +If you have a commercial license for **Export to PDF** plugin, [exportPdf_tokenUrl](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-exportPdf_tokenUrl) configuration option should be set to remove watermark from generated documents: + +```js +CKEDITOR.replace( 'editor', { + exportPdf_tokenUrl: 'https://example.com/cs-token-endpoint' +} ); +``` + +This value is unique for each customer and can be found in the [CKEditor Ecosystem dashboard](https://dashboard.ckeditor.com). + +This is all. If you are having trouble in setting up Export to PDF plugin, please [contact us](https://ckeditor.com/contact/). + +## Features + +The CKEditor 4 Export to PDF plugin is really simple to use and works out-of-the-box. It does not require any additional configuration and due to its flexible nature, it covers a lot of cases internally while also providing an easy way to [customize output PDF files](https://ckeditor.com/docs/ckeditor4/latest/features/exporttopdf.html#configuration). + +The most important features are: + +* Exporting HTML content from CKEditor 4 WYSIWYG editor to PDF with a single click. +* [Setting a custom name](https://ckeditor.com/docs/ckeditor4/latest/features/exporttopdf.html#setting-dynamic-file-name) for the generated PDF file. +* [Handling relative image paths](https://ckeditor.com/docs/ckeditor4/latest/features/exporttopdf.html#relative-vs-absolute-urls). +* [Changing the appearance of the PDF document](https://ckeditor.com/docs/ckeditor4/latest/features/exporttopdf.html#custom-css-rules) (like margins, text styling, custom headers and footers etc.) with custom CSS styles. +* [Pre-processing HTML content](https://ckeditor.com/docs/ckeditor4/latest/features/exporttopdf.html#data-preprocessing) via synchronous and asynchronous code before the generation of the PDF file. + +## Browser and CKEditor 4 Support + +The CKEditor 4 Export to PDF plugin works in all the browsers [supported by CKEditor 4](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_browsers.html) except for Internet Explorer versions older than version 11. The plugin is compatible with CKEditor 4 versions starting from `4.6.1`. + +## Demo + +See the working ["Exporting editor content to PDF"](https://ckeditor.com/docs/ckeditor4/latest/examples/exporttopdf.html) sample that showcases printing your HTML content to a PDF file. + +## License + +**CKEditor 4 Export to PDF plugin** (https://ckeditor.com/ckeditor-4/)
+Copyright (c) 2003-2021, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved. + +CKEditor 4 export to PDF plugin is licensed under a commercial license and is protected by copyright law. +For more details about available licensing options please contact us at sales@cksource.com. + +### Trademarks + +**CKEditor** is a trademark of [CKSource](http://cksource.com) Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/plugindefinition.js b/assets/ckeditor/ckeditor/plugins/exportpdf/plugindefinition.js new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/plugindefinition.js @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/_helpers/tools.js b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/_helpers/tools.js new file mode 100644 index 00000000..681a6530 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/_helpers/tools.js @@ -0,0 +1,5 @@ +/* + Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +*/ +(function(){window.exportPdfUtils={useXHR:function(b,a){var c=sinon.useFakeXMLHttpRequest(),d;c.onCreate=function(a){d=a};b.execCommand("exportPdf");a&&a(d);c.restore()},getDefaultConfig:function(b,a){return CKEDITOR.tools.object.merge({extraPlugins:"exportpdf",exportPdf_appId:"cke4-tests-"+b},a)},initManualTest:function(){bender.loadExternalPlugin("exportpdf","/apps/plugin/");bender.tools.ignoreUnsupportedEnvironment("exportpdf")},toAbsoluteUrl:function(b,a){return(a?a:window.location.origin)+b}}})(); \ No newline at end of file diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/authentication.js b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/authentication.js new file mode 100644 index 00000000..1d6f9feb --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/authentication.js @@ -0,0 +1,6 @@ +(function(){bender.loadExternalPlugin("exportpdf","/apps/plugin/");CKEDITOR.plugins.load("exportpdf",function(){function d(a,c){var b=exportPdfUtils.getDefaultConfig("unit",a||{});bender.editorBot.create({name:"editor"+Date.now(),config:b,startupData:"\x3cp\x3eHello World!\x3c/p\x3e"},function(a){c&&c(a.editor)})}var b=function(){var a=sinon.fakeServer.create(),c=0;a.respondWith(function(a){"/incremental_token"===a.url?(a.respond(200,{},"sample-token-value"+c),c+=1):"/empty-token"===a.url?a.respond(200, +{},""):a.respond(200,{},"sample-token-value")});return a}(),e;bender.test({setUp:function(){bender.tools.ignoreUnsupportedEnvironment("exportpdf");e=sinon.stub(CKEDITOR.plugins.exportpdf,"downloadFile")},tearDown:function(){e.restore()},"test token is fetched if tokenUrl is correct":function(){d({exportPdf_tokenUrl:"/custom-url"},function(a){a.on("exportPdf",function(a){assert.areEqual(a.data.token,"sample-token-value","Token value is incorrect.")},null,null,17);b.respond();a.execCommand("exportPdf"); +b.respond()})},"test authentication header is added if token is provided":function(){d({exportPdf_tokenUrl:"/custom-url"},function(a){b.respond();a.execCommand("exportPdf");b.respond();assert.areEqual("sample-token-value",b.requests[b.requests.length-1].requestHeaders.Authorization,"Authorization token was not set properly.")})},"test console.warn is called if tokenUrl is not provided":function(){CKEDITOR.once("log",function(a){a.cancel();assert.areEqual("exportpdf-no-token-url",a.data.errorCode, +"There should be URL error log.")});d({exportPdf_tokenUrl:""})},"test console.warn is called on POST request if token is empty":function(){var a=CKEDITOR.on("log",function(c){"exportpdf-no-token"===c.data.errorCode&&(c.cancel(),CKEDITOR.removeListener("log",a),assert.areEqual("exportpdf-no-token",c.data.errorCode,"`exportpdf-no-token` should occur."))});d({exportPdf_tokenUrl:"/empty-token"},function(a){b.respond();a.execCommand("exportPdf");b.respond()})},"test console.warn is called on POST request if token was not fetched at all":function(){var a= +CKEDITOR.on("log",function(c){"exportpdf-no-token"===c.data.errorCode&&(c.cancel(),CKEDITOR.removeListener("log",a),assert.areEqual("exportpdf-no-token",c.data.errorCode,"`exportpdf-no-token` should occur."))});d({exportPdf_tokenUrl:"/custom-url"},function(a){a.execCommand("exportPdf");b.respond()})},"test token refreshes in the declared intervals":function(){CKEDITOR.once("instanceCreated",function(a){a.editor.exportPdfTokenInterval=200});d({exportPdf_tokenUrl:"/incremental_token"},function(a){b.respond(); +setTimeout(function(){resume(function(){b.respond();a.on("exportPdf",function(a){assert.areNotSame(a.data.token,"sample-token-value0","Token was not refreshed.")},null,null,17);a.execCommand("exportPdf");b.respond()})},500);wait()})},"test file is downloaded also without token":function(){d({exportPdf_tokenUrl:"/empty-token"},function(a){b.respond();a.execCommand("exportPdf");b.respond();sinon.assert.calledOnce(e);assert.pass()})}})})})(); \ No newline at end of file diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/exportpdf.js b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/exportpdf.js new file mode 100644 index 00000000..8fbc4cfd --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/exportpdf.js @@ -0,0 +1,10 @@ +(function(){bender.loadExternalPlugin("exportpdf","/apps/plugin/");CKEDITOR.plugins.load("exportpdf",function(){bender.test({setUp:function(){bender.tools.ignoreUnsupportedEnvironment("exportpdf")},"test data is correct at read and send stages":function(){bender.editorBot.create({name:"editor1",config:exportPdfUtils.getDefaultConfig("unit")},function(c){var b=c.editor;c.setHtmlWithSelection('\x3cp id\x3d"test"\x3eHello, World!\x3c/p\x3e^');b.once("exportPdf",function(a){assert.areEqual(a.data.html, +b.getData(),"Data from editor is incorrect.");assert.isTrue(CKEDITOR.tools.isEmpty(a.data.options),"`options` object should be initially empty.")});b.once("exportPdf",function(a){a.cancel();assert.areEqual('\x3cdiv class\x3d"cke_editable cke_contents_ltr"\x3e'+b.getData()+"\x3c/div\x3e",a.data.html,"Preprocessed data sent to endpoint is incorrect.");assert.isNotNull(a.data.css,"CSS should be attached.")},null,null,16);b.execCommand("exportPdf")})},"test options provided via config":function(){bender.editorBot.create({name:"editor2", +config:exportPdfUtils.getDefaultConfig("unit",{exportPdf_options:{format:"A6"}})},function(c){var b=c.editor;c.setHtmlWithSelection('\x3cp id\x3d"test"\x3eHello, World!\x3c/p\x3e^');b.once("exportPdf",function(a){a.cancel();assert.areEqual(a.data.options.format,"A6")});b.execCommand("exportPdf")})},"test html changed via event":function(){bender.editorBot.create({name:"editor3",config:exportPdfUtils.getDefaultConfig("unit")},function(c){var b=c.editor;c.setHtmlWithSelection('\x3cp id\x3d"test"\x3eHello, World!\x3c/p\x3e^'); +b.once("exportPdf",function(a){a.cancel();assert.areEqual(a.data.html,"")});b.once("exportPdf",function(a){assert.areNotEqual(a.data.html,"");a.data.html=""},null,null,1);b.execCommand("exportPdf")})},"test options changed via event":function(){bender.editorBot.create({name:"editor4",config:exportPdfUtils.getDefaultConfig("unit")},function(c){var b=c.editor;c.setHtmlWithSelection('\x3cp id\x3d"test"\x3eHello, World!\x3c/p\x3e^');b.once("exportPdf",function(a){a.cancel();assert.areEqual(a.data.options.format, +"A5")});b.once("exportPdf",function(a){a.data.options.format="A5"},null,null,1);b.execCommand("exportPdf")})},"test html changed via event asynchronously":function(){bender.editorBot.create({name:"editor5",config:exportPdfUtils.getDefaultConfig("unit")},function(c){var b=c.editor;c.setHtmlWithSelection('\x3cp id\x3d"test"\x3eHello, World!\x3c/p\x3e^');b.on("exportPdf",function(a){a.cancel();a.data.asyncDone&&(resume(),assert.areEqual(a.data.html,"\x3cp\x3eContent filtered!\x3c/p\x3e"),delete a.data.asyncDone, +assert.isUndefined(a.data.asyncDone))});b.on("exportPdf",function(a){a.data.asyncDone||setTimeout(function(){a.data.html="\x3cp\x3eContent filtered!\x3c/p\x3e";a.data.asyncDone=!0;b.fire("exportPdf",a.data)},1E3)},null,null,1);b.execCommand("exportPdf");wait()})},"test options changed via event asynchronously":function(){bender.editorBot.create({name:"editor6",config:exportPdfUtils.getDefaultConfig("unit",{exportPdf_options:{format:"A5"}})},function(c){var b=c.editor;c.setHtmlWithSelection('\x3cp id\x3d"test"\x3eHello, World!\x3c/p\x3e^'); +b.on("exportPdf",function(a){a.cancel();a.data.asyncDone&&(resume(),assert.areEqual(a.data.options.format,"A4"),delete a.data.asyncDone,assert.isUndefined(a.data.asyncDone))});b.on("exportPdf",function(a){a.data.asyncDone||setTimeout(function(){a.data.options.format="A4";a.data.asyncDone=!0;b.fire("exportPdf",a.data)},1E3)},null,null,1);b.execCommand("exportPdf");wait()})},"test default CKEditor config":function(){bender.editorBot.create({name:"editor7",config:exportPdfUtils.getDefaultConfig("unit")}, +function(c){CKEDITOR.config.exportPdf_isDev?assert.areEqual(c.editor.config.exportPdf_service,"https://pdf-converter.cke-cs-staging.com/v1/convert","Default dev endpoint is incorrect."):assert.areEqual(c.editor.config.exportPdf_service,"https://pdf-converter.cke-cs.com/v1/convert","Default prod endpoint is incorrect.");assert.areEqual(c.editor.config.exportPdf_fileName,"ckeditor4-export-pdf.pdf","Default file name is incorrect.")})},"test inaccessible stylesheets are handled correctly":function(){bender.editorBot.create({name:"editor8", +config:exportPdfUtils.getDefaultConfig("unit",{contentsCss:"https://cdn.ckeditor.com/4.16.0/full-all/samples/css/samples.css"})},function(c){var b=c.editor,a=!1,d=CKEDITOR.on("log",function(b){"exportpdf-stylesheets-inaccessible"===b.data.errorCode&&(b.cancel(),CKEDITOR.removeListener("log",d),a=!0)});c.setHtmlWithSelection('\x3cp id\x3d"test"\x3eHello, World!\x3c/p\x3e^');b.once("exportPdf",function(b){b.cancel();resume(function(){a?assert.pass():assert.fail("No errors thrown while accessing stylesheets rules.")})}, +null,null,19);CKEDITOR.tools.setTimeout(function(){b.execCommand("exportPdf")},1E3);wait()})}})})})(); \ No newline at end of file diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/configfilename.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/configfilename.html new file mode 100644 index 00000000..ec9bf1bd --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/configfilename.html @@ -0,0 +1,27 @@ +
+

My filename should be 'ckeditor4-export-pdf.pdf'.

+
+ +
+

And mine - 'different-name.pdf'.

+
+ +
+

Beautiful title

+
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/configfilename.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/configfilename.md new file mode 100644 index 00000000..c63e437c --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/configfilename.md @@ -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 `

` 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. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/emptyeditor.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/emptyeditor.html new file mode 100644 index 00000000..0e6822e5 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/emptyeditor.html @@ -0,0 +1,18 @@ +
+
+ +
+

My content and wrapper will be deleted.

+
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/emptyeditor.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/emptyeditor.md new file mode 100644 index 00000000..ec094870 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/emptyeditor.md @@ -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. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integration.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integration.html new file mode 100644 index 00000000..0ce17409 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integration.html @@ -0,0 +1,148 @@ +
+

Bilancino Hotel logoThe Flavorful Tuscany Meetup

+ +

Welcome letter

+ +

Dear Guest,

+ +

We are delighted to welcome you to the annual Flavorful Tuscany Meetup and hope you will enjoy the programme as well as your stay at the Bilancino Hotel.

+ +

Please find attached the full schedule of the event.

+ +
+

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!

+ +

Angelina Calvino, food journalist

+
+ +

Please arrive at the Bilancino Hotel reception desk at least half an hour earlier to make sure that the registration process goes as smoothly as possible.

+ +

We look forward to welcoming you to the event.

+ +

Victoria Valc signature

+ +

Victoria Valc

+ +

Event Manager
+ Bilancino Hotel

+ +

 

+ +
 
+ +

 

+ +

The Flavorful Tuscany Meetup Schedule

+ + + + + + + + + + + + + + + + + + + + + +
Saturday, July 14
9:30 AM - 11:30 AM +

Americano vs. Brewed - “know your coffee” with: 

+ +
    +
  • Giulia Bianchi
  • +
  • Stefano Garau
  • +
  • Giuseppe Russo
  • +
+
1:00 PM - 3:00 PM +

Pappardelle al pomodoro - live cooking 1

+ +

Incorporate the freshest ingredients 
+ with Rita Fresco

+
5:00 PM - 8:00 PM +

Tuscan vineyards at a glance - wine-tasting 
+ with Frederico Riscoli

+
+ +

 

+ +

1 Registration for the live cooking session is required as seats are limited.

+ +

 

+ +
+ +

Driving directions from the airport

+ +
    +
  1. Head southeast on R138 toward Nassau St.
  2. +
  3. Follow R138 and R148 to Bridgefoot St/R804. +
      +
    1. Use the left 2 lanes to turn slightly left onto Lincoln Pl/R138.
    2. +
    3. Turn left onto Westland Row/R118/R138.
    4. +
    5. Use any lane to turn left onto Pearse St/R118/R138/R802.
    6. +
    7. Continue to follow R138/R802.
    8. +
    +
  4. +
  5. Turn left onto Burgh Quay/George's Quay/R105/R138.
  6. +
  7. Continue onto Aston Quay/R148. +
      +
    • Continue to follow R148.
    • +
    +
  8. +
  9. Turn left onto Bridgefoot St/R804. +
      +
    • Continue to follow R804.
    • +
    +
  10. +
  11. After approximately 2 minutes, Bilancino Hotel will be on your left.
  12. +
+ +

 

+
+ +
+ + +

Document preview (based on send HTML and CSS)

+
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integration.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integration.md new file mode 100644 index 00000000..7d3cf749 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integration.md @@ -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 here. Just remember to check if it isn't already known. + +When comparing generated PDF to editor contents the best conversion results (close to 1:1 document formatting) can be observed in a Chrome browser. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integrations/easyimage.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integrations/easyimage.html new file mode 100644 index 00000000..88db9f25 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integrations/easyimage.html @@ -0,0 +1,27 @@ +
+

Foo bar

+
+ +
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integrations/easyimage.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integrations/easyimage.md new file mode 100644 index 00000000..a6cbf081 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/integrations/easyimage.md @@ -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. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notifications.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notifications.html new file mode 100644 index 00000000..ddc91bb0 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notifications.html @@ -0,0 +1,19 @@ +
+

Hello world!

+
+ +
+

Hello world!

+
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notifications.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notifications.md new file mode 100644 index 00000000..ececf7bd --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notifications.md @@ -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. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notificationsasync.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notificationsasync.html new file mode 100644 index 00000000..c1ee1efe --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notificationsasync.html @@ -0,0 +1,45 @@ +
+

Export to PDF test 1.

+
+ +
+

Export to PDF test 2.

+
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notificationsasync.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notificationsasync.md new file mode 100644 index 00000000..58ed71d0 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/notificationsasync.md @@ -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. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/paperformat.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/paperformat.html new file mode 100644 index 00000000..ba54fb8d --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/paperformat.html @@ -0,0 +1,29 @@ +
+

"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." +

+
+ +
+

"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." +

+
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/paperformat.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/paperformat.md new file mode 100644 index 00000000..dd26a0d3 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/paperformat.md @@ -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`). diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/readonly.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/readonly.html new file mode 100644 index 00000000..e6ed2cb5 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/readonly.html @@ -0,0 +1,18 @@ + +
+

This editor is read-only.

+
+ + + + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/readonly.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/readonly.md new file mode 100644 index 00000000..6f1d7253 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/readonly.md @@ -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. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/stylesheets.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/stylesheets.html new file mode 100644 index 00000000..9e2e67f9 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/stylesheets.html @@ -0,0 +1,36 @@ +

Classic Editor

+ + +

Divarea Editor

+
+ Divarea Editor +
+ +

Inline Editor

+
+ Inline Editor +
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/stylesheets.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/stylesheets.md new file mode 100644 index 00000000..3a38ab6f --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/stylesheets.md @@ -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 Bootstrap CDN. 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. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenfetching.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenfetching.html new file mode 100644 index 00000000..bd090caf --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenfetching.html @@ -0,0 +1,23 @@ +
+

Foo bar

+
+ +
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenfetching.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenfetching.md new file mode 100644 index 00000000..08ebf360 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenfetching.md @@ -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. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorscorrect.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorscorrect.html new file mode 100644 index 00000000..aaa9d370 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorscorrect.html @@ -0,0 +1,38 @@ +

Editor 1

+
+

Foo bar

+
+
+ +

Editor 2

+
+

Foo bar

+
+
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorscorrect.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorscorrect.md new file mode 100644 index 00000000..adf9b34f --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorscorrect.md @@ -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`. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorswrong.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorswrong.html new file mode 100644 index 00000000..4fdbc739 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorswrong.html @@ -0,0 +1,38 @@ +

Editor 1

+
+

Foo bar

+
+
+ +

Editor 2

+
+

Foo bar

+
+
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorswrong.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorswrong.md new file mode 100644 index 00000000..a1fd4ff9 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokentwoeditorswrong.md @@ -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`. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenwithouturl.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenwithouturl.html new file mode 100644 index 00000000..e2bee1cc --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenwithouturl.html @@ -0,0 +1,19 @@ +
+

Foo bar

+
+ +
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenwithouturl.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenwithouturl.md new file mode 100644 index 00000000..472e0e2d --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/tokenwithouturl.md @@ -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. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/wrongendpoint.html b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/wrongendpoint.html new file mode 100644 index 00000000..4b5586df --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/wrongendpoint.html @@ -0,0 +1,21 @@ +
+

Hello world!

+
+ +
+

Hello world!

+
+ + diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/wrongendpoint.md b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/wrongendpoint.md new file mode 100644 index 00000000..5151462e --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/manual/wrongendpoint.md @@ -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. diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/notification.js b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/notification.js new file mode 100644 index 00000000..ebd706d9 --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/notification.js @@ -0,0 +1,4 @@ +(function(){bender.loadExternalPlugin("exportpdf","/apps/plugin/");CKEDITOR.plugins.load("exportpdf",function(){function c(a,b){var c=a._.notificationArea.notifications[0];assert.areSame(b.message,c.message,"Message should be the same.");assert.areSame(b.type,c.type,"Type should be the same.");assert.areSame(b.progress,c.progress,"Progress should be the same.")}bender.editors={successEditor:{config:exportPdfUtils.getDefaultConfig("unit")},errorEditor:{config:exportPdfUtils.getDefaultConfig("unit")}}; +bender.test({setUp:function(){bender.tools.ignoreUnsupportedEnvironment("exportpdf");sinon.stub(CKEDITOR.plugins.exportpdf,"downloadFile")},tearDown:function(){CKEDITOR.plugins.exportpdf.downloadFile.restore()},"test notifications and progress steps are correct in happy path":function(){var a=this.editors.successEditor;this.editorBots.successEditor.setHtmlWithSelection('\x3cp id\x3d"test"\x3eHello, World!\x3c/p\x3e^');a.once("exportPdf",function(){c(a,{message:"Processing PDF document...",type:"progress", +progress:0})});a.once("exportPdf",function(){c(a,{message:"Processing PDF document...",type:"progress",progress:.2})},null,null,16);exportPdfUtils.useXHR(a,function(b){b.addEventListener("progress",function(){c(a,{message:"Processing PDF document...",type:"progress",progress:.8})});b.addEventListener("loadend",function(){c(a,{message:"Document is ready!",type:"success",progress:1})});b.respond(200,{},"")})},"test notifications and progress steps are correct in sad path":function(){var a=this.editors.errorEditor; +this.editorBots.errorEditor.setHtmlWithSelection('\x3cp id\x3d"test"\x3eHello, World!\x3c/p\x3e^');exportPdfUtils.useXHR(a,function(b){var d=sinon.stub(console,"error",function(a){assert.areSame("Validation failed.",a.message,"Message from endpoint is incorrect.");d.restore()});b.addEventListener("loadend",function(){c(a,{message:"Error occurred.",type:"warning"})});b.respond(400,{},'{ "message": "Validation failed." }')})}})})})(); \ No newline at end of file diff --git a/assets/ckeditor/ckeditor/plugins/exportpdf/tests/resourcespaths.js b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/resourcespaths.js new file mode 100644 index 00000000..1964499f --- /dev/null +++ b/assets/ckeditor/ckeditor/plugins/exportpdf/tests/resourcespaths.js @@ -0,0 +1,9 @@ +(function(){bender.loadExternalPlugin("exportpdf","/apps/plugin/");CKEDITOR.plugins.load("exportpdf",function(){function a(a,d,b){b=exportPdfUtils.getDefaultConfig("unit",b||{});bender.editorBot.create({name:"editor"+Date.now(),config:b},function(b){var c=b.editor;b.setHtmlWithSelection(a);c.once("exportPdf",function(b){assert.areEqual(a,b.data.html)},null,null,10);c.once("exportPdf",function(a){a.cancel();assert.areEqual('\x3cdiv class\x3d"cke_editable cke_contents_ltr"\x3e'+d+"\x3c/div\x3e",a.data.html)}, +null,null,16);c.execCommand("exportPdf")})}function b(a,b){a=a.replace(/\/$/g,"");b&&0b.version||b.quirks))};"undefined"==typeof a.plugins.scayt&&a.ui.addButton&&a.ui.addButton("SpellChecker",{label:a.lang.wsc.toolbar,click:function(a){var b=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.container.getText():a.document.getBody().getText();(b=b.replace(/\s/g,""))?a.execCommand("checkspell"):alert("Nothing to check!")},toolbar:"spellchecker,10"});CKEDITOR.dialog.add("checkspell",this.path+ +(CKEDITOR.env.ie&&7>=CKEDITOR.env.version?"dialogs/wsc_ie.js":window.postMessage?"dialogs/wsc.js":"dialogs/wsc_ie.js"))}}); \ No newline at end of file