Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

Commit

Permalink
PLUGINS-994: Refactor plugin file tree and rename some files
Browse files Browse the repository at this point in the history
  • Loading branch information
xripoll-at-wiris authored and mcagigas-at-wiris committed Feb 6, 2019
1 parent 79854b0 commit c3e8516
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -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 );
Expand Down
Original file line number Diff line number Diff line change
@@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion converters/downcast.js → src/conversion/downcast.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions integration.js → src/integration.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions mathml.js → src/mathml.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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 ***/
Expand Down
File renamed without changes.
30 changes: 15 additions & 15 deletions wirisedition.js → src/mathtype.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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( {
Expand All @@ -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
} );
} );
Expand All @@ -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( {
Expand All @@ -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
} );
} );
Expand Down
22 changes: 11 additions & 11 deletions plugin.js → src/plugin.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -29,7 +29,7 @@ window.WirisPlugin = {
export default class Wiris extends Plugin {

static get requires() {
return [ MathML, WirisEdition ];
return [ MathML, MathType ];
}

static get pluginName() {
Expand Down
File renamed without changes
File renamed without changes

0 comments on commit c3e8516

Please sign in to comment.