|
|
@@ -7,73 +7,71 @@
|
|
|
|
|
|
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
|
|
|
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
|
|
|
-import { loadPerformanceData, renderPerformanceDataButtons } from '../../_utils/utils';
|
|
|
+import { getPerformanceData, renderPerformanceDataButtons } from '../../_utils/utils';
|
|
|
|
|
|
const editorCount = 5;
|
|
|
|
|
|
renderPerformanceDataButtons( document.querySelector( '#fixture-buttons' ) );
|
|
|
|
|
|
-loadPerformanceData()
|
|
|
- .then( fixtures => {
|
|
|
- const editorsWrapper = document.getElementById( 'editors-wrapper' );
|
|
|
- const buttons = document.querySelectorAll( '#test-controls button' );
|
|
|
+const fixtures = getPerformanceData();
|
|
|
+const editorsWrapper = document.getElementById( 'editors-wrapper' );
|
|
|
+const buttons = document.querySelectorAll( '#test-controls button' );
|
|
|
|
|
|
- for ( let i = 0; i < editorCount; i++ ) {
|
|
|
- const editorElement = document.createElement( 'div' );
|
|
|
- editorElement.setAttribute( 'id', `editor_${ i }` );
|
|
|
- editorsWrapper.appendChild( editorElement );
|
|
|
- }
|
|
|
-
|
|
|
- for ( const button of buttons ) {
|
|
|
- const fixtureName = button.getAttribute( 'data-file-name' );
|
|
|
- const content = fixtures[ fixtureName ];
|
|
|
+for ( let i = 0; i < editorCount; i++ ) {
|
|
|
+ const editorElement = document.createElement( 'div' );
|
|
|
+ editorElement.setAttribute( 'id', `editor_${ i }` );
|
|
|
+ editorsWrapper.appendChild( editorElement );
|
|
|
+}
|
|
|
|
|
|
- button.addEventListener( 'click', function() {
|
|
|
- for ( let i = 0; i < editorCount; i++ ) {
|
|
|
- const editorElement = document.querySelector( `#editor_${ i }` );
|
|
|
- editorElement.innerHTML = content;
|
|
|
+for ( const button of buttons ) {
|
|
|
+ const fixtureName = button.getAttribute( 'data-file-name' );
|
|
|
+ const content = fixtures[ fixtureName ];
|
|
|
|
|
|
- ClassicEditor
|
|
|
- .create( editorElement, {
|
|
|
- plugins: [ ArticlePluginSet ],
|
|
|
- toolbar: [
|
|
|
- 'heading',
|
|
|
- '|',
|
|
|
- 'bold',
|
|
|
- 'italic',
|
|
|
- 'link',
|
|
|
- 'bulletedList',
|
|
|
- 'numberedList',
|
|
|
- '|',
|
|
|
- 'outdent',
|
|
|
- 'indent',
|
|
|
- '|',
|
|
|
- 'blockQuote',
|
|
|
- 'insertTable',
|
|
|
- 'mediaEmbed',
|
|
|
- 'undo',
|
|
|
- 'redo'
|
|
|
- ],
|
|
|
- image: {
|
|
|
- toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
|
|
|
- },
|
|
|
- table: {
|
|
|
- contentToolbar: [
|
|
|
- 'tableColumn',
|
|
|
- 'tableRow',
|
|
|
- 'mergeTableCells'
|
|
|
- ]
|
|
|
- }
|
|
|
- } )
|
|
|
- .then( editor => {
|
|
|
- window.editor = editor;
|
|
|
- } )
|
|
|
- .catch( err => {
|
|
|
- console.error( err.stack );
|
|
|
- } );
|
|
|
- }
|
|
|
- } );
|
|
|
+ button.addEventListener( 'click', function() {
|
|
|
+ for ( let i = 0; i < editorCount; i++ ) {
|
|
|
+ const editorElement = document.querySelector( `#editor_${ i }` );
|
|
|
+ editorElement.innerHTML = content;
|
|
|
|
|
|
- button.disabled = false;
|
|
|
+ ClassicEditor
|
|
|
+ .create( editorElement, {
|
|
|
+ plugins: [ ArticlePluginSet ],
|
|
|
+ toolbar: [
|
|
|
+ 'heading',
|
|
|
+ '|',
|
|
|
+ 'bold',
|
|
|
+ 'italic',
|
|
|
+ 'link',
|
|
|
+ 'bulletedList',
|
|
|
+ 'numberedList',
|
|
|
+ '|',
|
|
|
+ 'outdent',
|
|
|
+ 'indent',
|
|
|
+ '|',
|
|
|
+ 'blockQuote',
|
|
|
+ 'insertTable',
|
|
|
+ 'mediaEmbed',
|
|
|
+ 'undo',
|
|
|
+ 'redo'
|
|
|
+ ],
|
|
|
+ image: {
|
|
|
+ toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
|
|
|
+ },
|
|
|
+ table: {
|
|
|
+ contentToolbar: [
|
|
|
+ 'tableColumn',
|
|
|
+ 'tableRow',
|
|
|
+ 'mergeTableCells'
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ } )
|
|
|
+ .then( editor => {
|
|
|
+ window.editor = editor;
|
|
|
+ } )
|
|
|
+ .catch( err => {
|
|
|
+ console.error( err.stack );
|
|
|
+ } );
|
|
|
}
|
|
|
} );
|
|
|
+
|
|
|
+ button.disabled = false;
|
|
|
+}
|