// Script CKEditor
DecoupledEditor
	.create( document.querySelector( '#page-title' ), {
	} );

DecoupledEditor
	.create( document.querySelector( '#editor' ), {
		filebrowserBrowseUrl: '/browser/browse.php',
		filebrowserUploadUrl: '/uploader/upload.php',
		fontFamily: {
            options: [
				'sans-serif, Helvetica, Arial'
            ]
        },
	} )
	.then( editor => {
		window.editor = editor;

		// Set a custom container for the toolbar.
		document.querySelector( '.document-editor__toolbar' ).appendChild( editor.ui.view.toolbar.element );
		document.querySelector( '.ck-toolbar' ).classList.add( 'ck-reset_all' );
	} )
	.catch( handleSampleError );

function handleSampleError( error ) {
	const issueUrl = 'https://github.com/ckeditor/ckeditor5/issues';

	const message = [
		'Oops, something went wrong!',
		`Please, report the following error on ${ issueUrl } with the build id "itoh4mj1p1k4-h27ktsxtvku" and the error stack trace:`
	].join( '\n' );

	console.error( message );
	console.error( error );
}
