Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
form = document.createElement( 'form' );
textarea = document.createElement( 'textarea' );
form.appendChild( textarea );
document.body.appendChild( form );
submitStub = sinon.stub( form, 'submit' );
// Prevents page realods in Firefox ;|
form.addEventListener( 'submit', evt => {
evt.preventDefault();
} );
class CustomEditor extends Editor {}
mix( CustomEditor, ElementApiMixin );
editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor();
editor.model.document.createRoot();
editor.model.schema.extend( '$text', { allowIn: '$root' } );
editor.fire( 'ready' );
editor.data.set( 'foo bar' );
} );
constructor( sourceElementOrData, config ) {
super( config );
if ( isElement( sourceElementOrData ) ) {
this.sourceElement = sourceElementOrData;
}
// Use the HTML data processor in this editor.
this.data.processor = new HtmlDataProcessor();
// Create the ("main") root element of the model tree.
this.model.document.createRoot();
this.ui = new ClassicTestEditorUI( this, new BoxedEditorUIView( this.locale ) );
// Expose properties normally exposed by the ClassicEditorUI.
this.ui.view.editable = new InlineEditableUIView( this.ui.view.locale, this.editing.view );
}
constructor( config ) {
super( config );
// Use the HTML data processor in this editor.
this.data.processor = new HtmlDataProcessor();
// Create the ("main") root element of the model tree.
this.model.document.createRoot();
}
constructor( config ) {
super( config );
// Use the HTML data processor in this editor.
this.data.processor = new HtmlDataProcessor();
// Disable editing pipeline.
this.editing.destroy();
// Create the ("main") root element of the model tree.
this.model.document.createRoot();
}
beforeEach( () => {
class CustomEditor extends Editor {}
mix( CustomEditor, DataApiMixin );
editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor();
editor.model.document.createRoot( '$root', 'main' );
editor.model.document.createRoot( '$root', 'secondRoot' );
editor.model.schema.extend( '$text', { allowIn: '$root' } );
} );
beforeEach( () => {
class CustomEditor extends Editor {}
mix( CustomEditor, ElementApiMixin );
editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor();
editor.model.document.createRoot();
editor.model.schema.extend( '$text', { allowIn: '$root' } );
} );
.then( newEditor => {
editor = newEditor;
editor.data.processor = new HtmlDataProcessor();
editor.model.schema.allow( { name: '$text', inside: '$root' } );
} );
} );
beforeEach( () => {
class CustomEditor extends Editor {}
mix( CustomEditor, ElementApiMixin );
editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor();
editor.model.document.createRoot();
editor.model.schema.extend( '$text', { allowIn: '$root' } );
} );
constructor() {
/**
* HTML data processor used to process HTML produced by the Markdown-to-HTML converter and the other way.
*
* @private
* @member {module:engine/dataprocessor/htmldataprocessor~HtmlDataProcessor}
*/
this._htmlDP = new HtmlDataProcessor();
}