diff --git a/openformulaeditorchemistrycommand.js b/src/commands/chemtypeeditor.js similarity index 84% rename from openformulaeditorchemistrycommand.js rename to src/commands/chemtypeeditor.js index a59b339..3300c4a 100644 --- a/openformulaeditorchemistrycommand.js +++ b/src/commands/chemtypeeditor.js @@ -1,8 +1,8 @@ import Command from '@ckeditor/ckeditor5-core/src/command'; -import CKEditor5Integration from './integration'; +import CKEditor5Integration from '../integration'; -export default class OpenFormulaEditorChemistryCommand extends Command { +export default class ChemTypeEditor extends Command { constructor( editor ) { super( editor ); diff --git a/openformulaeditorcommand.js b/src/commands/mathtypeeditor.js similarity index 85% rename from openformulaeditorcommand.js rename to src/commands/mathtypeeditor.js index 4fb591e..50736f6 100644 --- a/openformulaeditorcommand.js +++ b/src/commands/mathtypeeditor.js @@ -1,8 +1,8 @@ import Command from '@ckeditor/ckeditor5-core/src/command'; -import CKEditor5Integration from './integration'; +import CKEditor5Integration from '../integration'; -export default class OpenFormulaEditorCommand extends Command { +export default class MathTypeEditor extends Command { constructor( editor ) { super( editor ); diff --git a/converters/downcast.js b/src/conversion/downcast.js similarity index 98% rename from converters/downcast.js rename to src/conversion/downcast.js index 182ee6d..6f9203a 100644 --- a/converters/downcast.js +++ b/src/conversion/downcast.js @@ -1,6 +1,6 @@ import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor'; -import Parser from '../core/src/parser.js'; +import Parser from '../../core/src/parser.js'; import MathmlDataProcessor from './mathmldataprocessor' diff --git a/converters/mathmldataprocessor.js b/src/conversion/mathmldataprocessor.js similarity index 99% rename from converters/mathmldataprocessor.js rename to src/conversion/mathmldataprocessor.js index 0c771c1..c1f5ef7 100644 --- a/converters/mathmldataprocessor.js +++ b/src/conversion/mathmldataprocessor.js @@ -2,7 +2,7 @@ import XmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/xmlda import { BR_FILLER } from '@ckeditor/ckeditor5-engine/src/view/filler'; import DomConverter from '@ckeditor/ckeditor5-engine/src/view/domconverter'; -import MathML from '../core/src/mathml.js'; +import MathML from '../../core/src/mathml.js'; export default class MathmlDataProcessor extends XmlDataProcessor { diff --git a/converters/post-fixer.js b/src/conversion/post-fixer.js similarity index 100% rename from converters/post-fixer.js rename to src/conversion/post-fixer.js diff --git a/integration.js b/src/integration.js similarity index 96% rename from integration.js rename to src/integration.js index 1535d8a..da2dd2e 100644 --- a/integration.js +++ b/src/integration.js @@ -1,10 +1,10 @@ import Position from '@ckeditor/ckeditor5-engine/src/model/position'; -import MathmlDataProcessor from './converters/mathmldataprocessor' +import MathmlDataProcessor from './conversion/mathmldataprocessor' -import IntegrationModel, { integrationModelProperties } from './core/src/integrationmodel'; -import Util from './core/src/util'; -import Configuration from './core/src/configuration'; +import IntegrationModel, { integrationModelProperties } from '../core/src/integrationmodel'; +import Util from '../core/src/util'; +import Configuration from '../core/src/configuration'; /** * This class represents the MathType integration for CKEditor5. diff --git a/mathml.js b/src/mathml.js similarity index 94% rename from mathml.js rename to src/mathml.js index f94ebc9..395549b 100644 --- a/mathml.js +++ b/src/mathml.js @@ -4,7 +4,7 @@ import { downcastElementToElement } from '@ckeditor/ckeditor5-engine/src/convers import { upcastElementToElement } from '@ckeditor/ckeditor5-engine/src/conversion/upcast-converters'; import { schema as mathmlSchema, attributes as mathmlAttributes } from './mathmlschema'; -import MathmlDataProcessor from './converters/mathmldataprocessor'; +import MathmlDataProcessor from './conversion/mathmldataprocessor'; export default class MathML extends Plugin { @@ -21,7 +21,7 @@ export default class MathML extends Plugin { const editor = this.editor; const schema = editor.model.schema; - // If the WirisEdition plugin is loaded, we don't create editingDowncasts + // If the MathType plugin is loaded, we don't create editingDowncasts let editingDowncast = true;//!editor.config.get( 'plugins' ).some( plugin => plugin.name == 'Wiris' ); /*** Extend model ***/ diff --git a/mathmlschema.js b/src/mathmlschema.js similarity index 100% rename from mathmlschema.js rename to src/mathmlschema.js diff --git a/wirisedition.js b/src/mathtype.js similarity index 83% rename from wirisedition.js rename to src/mathtype.js index 6c63edb..c85c3bb 100644 --- a/wirisedition.js +++ b/src/mathtype.js @@ -3,27 +3,27 @@ import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; import ClickObserver from '@ckeditor/ckeditor5-engine/src/view/observer/clickobserver'; import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard'; -import { integrationModelProperties } from './core/src/integrationmodel'; +import { integrationModelProperties } from '../core/src/integrationmodel'; import MathML from './mathml'; -import { downcast } from './converters/downcast'; -import { postFixer } from './converters/post-fixer'; -import OpenFormulaEditorCommand from './openformulaeditorcommand'; -import OpenFormulaEditorChemistryCommand from './openformulaeditorchemistrycommand'; +import { downcast } from './conversion/downcast'; +import { postFixer } from './conversion/post-fixer'; +import MathTypeEditor from './commands/mathtypeeditor'; +import ChemTypeEditor from './commands/chemtypeeditor'; import CKEditor5Integration from './integration'; -import mathIcon from './icons/formula.svg'; -import chemIcon from './icons/chem.svg'; +import mathIcon from '../theme/icons/formula.svg'; +import chemIcon from '../theme/icons/chem.svg'; -export default class WirisEdition extends Plugin { +export default class MathType extends Plugin { static get requires() { return [ MathML ]; } static get pluginName() { - return 'WirisEdition'; + return 'MathType'; } init() { @@ -74,13 +74,13 @@ export default class WirisEdition extends Plugin { } // Add command to open the formula editor - editor.commands.add( 'ckeditor_wiris_openFormulaEditor', new OpenFormulaEditorCommand( editor ) ); + editor.commands.add( 'MathTypeEditor', new MathTypeEditor( editor ) ); // Add command to open the chemistry formula editor - editor.commands.add( 'ckeditor_wiris_openFormulaEditorChemistry', new OpenFormulaEditorChemistryCommand( editor ) ); + editor.commands.add( 'ChemTypeEditor', new ChemTypeEditor( editor ) ); // Add button for the formula editor - editor.ui.componentFactory.add( 'ckeditor_wiris_openFormulaEditor', locale => { + editor.ui.componentFactory.add( 'MathTypeEditor', locale => { const view = new ButtonView( locale ); view.set( { @@ -91,7 +91,7 @@ export default class WirisEdition extends Plugin { // Callback executed once the image is clicked. view.on( 'execute', () => { - editor.execute( 'ckeditor_wiris_openFormulaEditor', { + editor.execute( 'MathTypeEditor', { 'integration': integration, // Pass integration as parameter } ); } ); @@ -100,7 +100,7 @@ export default class WirisEdition extends Plugin { } ); // Add button for the chemistry formula editor - editor.ui.componentFactory.add( 'ckeditor_wiris_openFormulaEditorChemistry', locale => { + editor.ui.componentFactory.add( 'ChemTypeEditor', locale => { const view = new ButtonView( locale ); view.set( { @@ -111,7 +111,7 @@ export default class WirisEdition extends Plugin { // Callback executed once the image is clicked. view.on( 'execute', () => { - editor.execute( 'ckeditor_wiris_openFormulaEditorChemistry', { + editor.execute( 'ChemTypeEditor', { 'integration': integration, // Pass integration as parameter } ); } ); diff --git a/plugin.js b/src/plugin.js similarity index 50% rename from plugin.js rename to src/plugin.js index 5b7c445..eee568a 100644 --- a/plugin.js +++ b/src/plugin.js @@ -1,17 +1,17 @@ import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; import MathML from './mathml'; -import WirisEdition from './wirisedition'; +import MathType from './mathtype'; -import Core from './core/src/core.src.js'; -import Parser from './core/src/parser.js'; -import Util from './core/src/util.js'; -import Image from './core/src/image.js'; -import Configuration from './core/src/configuration.js'; -import Listeners from './core/src/listeners'; -import IntegrationModel from './core/src/integrationmodel.js'; -import CoreMathML from './core/src/mathml.js'; -import Latex from './core/src/latex'; +import Core from '../core/src/core.src.js'; +import Parser from '../core/src/parser.js'; +import Util from '../core/src/util.js'; +import Image from '../core/src/image.js'; +import Configuration from '../core/src/configuration.js'; +import Listeners from '../core/src/listeners'; +import IntegrationModel from '../core/src/integrationmodel.js'; +import CoreMathML from '../core/src/mathml.js'; +import Latex from '../core/src/latex'; // Expose WirisPlugin variable to the window. window.WirisPlugin = { @@ -29,7 +29,7 @@ window.WirisPlugin = { export default class Wiris extends Plugin { static get requires() { - return [ MathML, WirisEdition ]; + return [ MathML, MathType ]; } static get pluginName() { diff --git a/icons/chem.svg b/theme/icons/chem.svg similarity index 100% rename from icons/chem.svg rename to theme/icons/chem.svg diff --git a/icons/formula.svg b/theme/icons/formula.svg similarity index 100% rename from icons/formula.svg rename to theme/icons/formula.svg