Skip to content

Commit

Permalink
Merge pull request #226 from ckeditor/i/209
Browse files Browse the repository at this point in the history
Fixed the editor class name in the production build
  • Loading branch information
fredck committed Sep 4, 2020
2 parents bfea7be + b522544 commit 52b3576
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export default class Editor {

this.domManipulator.addAttribute( root, 'data-github-writer-id', this.id );

// Add a class for this editor contructor, for easy to customize specific editors.
this.domManipulator.addClass( root, 'github-writer-' + this.constructor.name.toLowerCase() );
// Add a class for this editor type, for easy to customize specific editors.
this.domManipulator.addClass( root, 'github-writer-' + String( this.type ).toLowerCase() );

// Inject our classes in the dom. These will help controlling the editor through CSS.
this.domManipulator.addClass( this.dom.panels.markdown, 'github-writer-panel-markdown' );
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/codeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default class CodeEditor extends Editor {
registerUpdateListener( this );
}

get type() {
return 'CodeEditor';
}

getDom( root ) {
const dom = super.getDom( root );

Expand Down
4 changes: 4 additions & 0 deletions src/app/features/codelinecommenteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import Editor from '../editor/editor';
let listening = false;

export default class CodeLineCommentEditor extends Editor {
get type() {
return 'CodeLineCommentEditor';
}

static run() {
if ( !listening ) {
// Code line comments: the "+" button...fires an event when the form for code comments is injected.
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/commenteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import Editor from '../editor/editor';
import { addClickListener } from '../modules/util';

export default class CommentEditor extends Editor {
get type() {
return 'CommentEditor';
}

injectEditable( editable ) {
const container = this.createEditableContainer( editable );

Expand Down
4 changes: 4 additions & 0 deletions src/app/features/milestoneeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export default class MilestoneEditor extends Editor {
root.classList.add( 'github-writer-type-milestone' );
}

get type() {
return 'MilestoneEditor';
}

getDom( root ) {
const dom = super.getDom( root );

Expand Down
4 changes: 4 additions & 0 deletions src/app/features/newcodeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export default class NewCodeEditor extends CodeEditor {
this._checkFileType();
}

get type() {
return 'NewCodeEditor';
}

_setInitialMode() {
super._setInitialMode( editorModes.MARKDOWN );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/newcommenteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class NewCommentEditor extends Editor {
get type() {
return 'NewCommentEditor';
}

getSizeContainer() {
return this.dom.root.querySelector( '.timeline-comment' );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/newinlinecommenteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import Editor from '../editor/editor';
import { addClickListener } from '../modules/util';

export default class NewInlineCommentEditor extends Editor {
get type() {
return 'NewInlineCommentEditor';
}

getSizeContainer() {
return this.dom.root;
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/newissueeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class NewIssueEditor extends Editor {
get type() {
return 'NewIssueEditor';
}

static run() {
return this.createEditor( 'form#new_issue' );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/newpullrequesteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class NewPullRequestEditor extends Editor {
get type() {
return 'NewPullRequestEditor';
}

static run() {
return this.createEditor( 'form#new_pull_request' );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/releaseeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class ReleaseEditor extends Editor {
get type() {
return 'ReleaseEditor';
}

getDom( root ) {
const dom = super.getDom( root );
delete dom.toolbar;
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/revieweditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class ReviewEditor extends Editor {
get type() {
return 'ReviewEditor';
}

static run() {
return this.createEditor( 'div.pull-request-review-menu > form' );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/savedreplyeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class SavedReplyEditor extends Editor {
get type() {
return 'SavedReplyEditor';
}

static run() {
return this.createEditor( 'form.new_saved_reply, form.edit_saved_reply' );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/wikieditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import Editor from '../editor/editor';

export default class WikiEditor extends Editor {
get type() {
return 'WikiEditor';
}

getDom( root ) {
const dom = super.getDom( root );

Expand Down

0 comments on commit 52b3576

Please sign in to comment.