Skip to content

Commit

Permalink
refactor: commonjs to es6 import/export (fix #1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyuwoo.choi committed Dec 21, 2017
1 parent fdf286f commit 1c03eda
Show file tree
Hide file tree
Showing 105 changed files with 124 additions and 123 deletions.
2 changes: 1 addition & 1 deletion src/js/codeMirrorExt.js
Expand Up @@ -317,4 +317,4 @@ class CodeMirrorExt {
}
}

module.exports = CodeMirrorExt;
export default CodeMirrorExt;
2 changes: 1 addition & 1 deletion src/js/command.js
Expand Up @@ -124,4 +124,4 @@ Command.TYPE = {
GB: 2
};

module.exports = Command;
export default Command;
2 changes: 1 addition & 1 deletion src/js/commandManager.js
Expand Up @@ -152,4 +152,4 @@ CommandManager.command = function(type, props) {
return command;
};

module.exports = CommandManager;
export default CommandManager;
2 changes: 1 addition & 1 deletion src/js/componentManager.js
Expand Up @@ -69,4 +69,4 @@ class ComponentManager {
}
}

module.exports = ComponentManager;
export default ComponentManager;
2 changes: 1 addition & 1 deletion src/js/convertor.js
Expand Up @@ -247,4 +247,4 @@ class Convertor {
}
}

module.exports = Convertor;
export default Convertor;
2 changes: 1 addition & 1 deletion src/js/domUtils.js
Expand Up @@ -470,7 +470,7 @@ const getSiblingRowCellByDirection = function(node, direction, needEdgeCell) {
return null;
};

module.exports = {
export default {
getNodeName,
isTextNode,
isElemNode,
Expand Down
2 changes: 1 addition & 1 deletion src/js/eventManager.js
Expand Up @@ -260,4 +260,4 @@ class EventManager {
}
}

module.exports = EventManager;
export default EventManager;
2 changes: 1 addition & 1 deletion src/js/excelTableParser.js
Expand Up @@ -51,4 +51,4 @@ function getRows(content) {
return content.split('\n');
}

module.exports = excelTableParser;
export default excelTableParser;
2 changes: 1 addition & 1 deletion src/js/extManager.js
Expand Up @@ -52,4 +52,4 @@ class ExtManager {
}
}

module.exports = new ExtManager();
export default new ExtManager();
2 changes: 1 addition & 1 deletion src/js/extensions/mark/markdownMarkerHelper.js
Expand Up @@ -230,4 +230,4 @@ class MarkdownMarkerHelper {
}
}
}
module.exports = MarkdownMarkerHelper;
export default MarkdownMarkerHelper;
2 changes: 1 addition & 1 deletion src/js/extensions/mark/markerManager.js
Expand Up @@ -204,4 +204,4 @@ class MarkerManager {
return updatedMarkers;
}
}
module.exports = MarkerManager;
export default MarkerManager;
2 changes: 1 addition & 1 deletion src/js/extensions/mark/viewOnlyMarkerHelper.js
Expand Up @@ -219,4 +219,4 @@ function getRange() {
return range;
}

module.exports = ViewOnlyMarkerHelper;
export default ViewOnlyMarkerHelper;
2 changes: 1 addition & 1 deletion src/js/extensions/mark/wysiwygMarkerHelper.js
Expand Up @@ -199,4 +199,4 @@ class WysiwygMarkerHelper {
this.sqe.setSelection(range);
}
}
module.exports = WysiwygMarkerHelper;
export default WysiwygMarkerHelper;
2 changes: 1 addition & 1 deletion src/js/extensions/scrollFollow/scrollSync.js
Expand Up @@ -351,4 +351,4 @@ class ScrollSync {
}
}

module.exports = ScrollSync;
export default ScrollSync;
2 changes: 1 addition & 1 deletion src/js/extensions/scrollFollow/sectionManager.js
Expand Up @@ -423,4 +423,4 @@ function findElementNodeFilter() {
return this.nodeType === Node.ELEMENT_NODE;
}

module.exports = SectionManager;
export default SectionManager;
2 changes: 1 addition & 1 deletion src/js/extensions/table/wwMergedTableManager.js
Expand Up @@ -553,5 +553,5 @@ function any(arr, contition) {
return result;
}

module.exports = WwMergedTableManager;
export default WwMergedTableManager;

2 changes: 1 addition & 1 deletion src/js/htmlSanitizer.js
Expand Up @@ -103,4 +103,4 @@ function finalizeHtml($html, needHtmlText) {
return returnValue;
}

module.exports = htmlSanitizer;
export default htmlSanitizer;
2 changes: 1 addition & 1 deletion src/js/importManager.js
Expand Up @@ -250,4 +250,4 @@ function dataURItoBlob(dataURI) {
return blob;
}

module.exports = ImportManager;
export default ImportManager;
2 changes: 1 addition & 1 deletion src/js/keyMapper.js
Expand Up @@ -366,4 +366,4 @@ class KeyMapper {
}
}

module.exports = KeyMapper;
export default KeyMapper;
2 changes: 1 addition & 1 deletion src/js/layout.js
Expand Up @@ -204,4 +204,4 @@ class Layout {
}
}

module.exports = Layout;
export default Layout;
2 changes: 1 addition & 1 deletion src/js/lazyRunner.js
Expand Up @@ -71,4 +71,4 @@ class LazyRunner {
}
}
}
module.exports = LazyRunner;
export default LazyRunner;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/addImage.js
Expand Up @@ -43,4 +43,4 @@ const AddImage = CommandManager.command('markdown', /** @lends AddImage */ {
}
});

module.exports = AddImage;
export default AddImage;
5 changes: 3 additions & 2 deletions src/js/markdownCommands/addLink.js
Expand Up @@ -4,7 +4,8 @@
*/

import CommandManager from '../commandManager';
import {decodeURIGraceful, encodeMarkdownCharacters, escapeMarkdownCharacters} from '../importManager';
import ImportManager from '../importManager';
const {decodeURIGraceful, encodeMarkdownCharacters, escapeMarkdownCharacters} = ImportManager;

/**
* AddLink
Expand Down Expand Up @@ -49,4 +50,4 @@ const AddLink = CommandManager.command('markdown', /** @lends AddLink */{
}
});

module.exports = AddLink;
export default AddLink;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/blockquote.js
Expand Up @@ -58,4 +58,4 @@ const Blockquote = CommandManager.command('markdown', /** @lends Blockquote */{
}
});

module.exports = Blockquote;
export default Blockquote;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/bold.js
Expand Up @@ -108,4 +108,4 @@ const Bold = CommandManager.command('markdown', /** @lends Bold */{
}
});

module.exports = Bold;
export default Bold;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/code.js
Expand Up @@ -44,4 +44,4 @@ const Code = CommandManager.command('markdown', /** @lends Code */{
}
});

module.exports = Code;
export default Code;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/codeBlock.js
Expand Up @@ -46,4 +46,4 @@ const CodeBlock = CommandManager.command('markdown', /** @lends CodeBlock */{
}
});

module.exports = CodeBlock;
export default CodeBlock;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/heading.js
Expand Up @@ -86,4 +86,4 @@ function getHeadingMarkdown(text, size) {
return `${heading} ${text}`;
}

module.exports = Heading;
export default Heading;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/hr.js
Expand Up @@ -54,4 +54,4 @@ const HR = CommandManager.command('markdown', /** @lends HR */{
}
});

module.exports = HR;
export default HR;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/italic.js
Expand Up @@ -189,4 +189,4 @@ const Italic = CommandManager.command('markdown', /** @lends Italic */{
}
});

module.exports = Italic;
export default Italic;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/ol.js
Expand Up @@ -71,4 +71,4 @@ function isUlOrTask(line) {
return !!(line && (line.match(FIND_MD_TASK_RX) || line.match(FIND_MD_UL_RX)));
}

module.exports = OL;
export default OL;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/paragraph.js
Expand Up @@ -62,4 +62,4 @@ function getParagraphMarkdown(lineText) {
return lineText.replace(headingRx, '');
}

module.exports = Paragraph;
export default Paragraph;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/strike.js
Expand Up @@ -83,4 +83,4 @@ const Strike = CommandManager.command('markdown', /** @lends Strike */{
}
});

module.exports = Strike;
export default Strike;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/table.js
Expand Up @@ -102,4 +102,4 @@ function makeBody(col, row, data) {

return body;
}
module.exports = Table;
export default Table;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/task.js
Expand Up @@ -72,4 +72,4 @@ function isOlOrUl(line) {
return !!(line && (line.match(FIND_MD_UL_RX) || line.match(FIND_MD_OL_RX)));
}

module.exports = Task;
export default Task;
2 changes: 1 addition & 1 deletion src/js/markdownCommands/ul.js
Expand Up @@ -68,4 +68,4 @@ function isOlOrTask(line) {
return !!(line && (line.match(FIND_MD_TASK_RX) || line.match(FIND_MD_OL_RX)));
}

module.exports = UL;
export default UL;
2 changes: 1 addition & 1 deletion src/js/markdownEditor.js
Expand Up @@ -246,4 +246,4 @@ class MarkdownEditor extends CodeMirrorExt {
}
}

module.exports = MarkdownEditor;
export default MarkdownEditor;
2 changes: 1 addition & 1 deletion src/js/mdListManager.js
Expand Up @@ -236,4 +236,4 @@ class MdListManager {
}
}

module.exports = MdListManager;
export default MdListManager;
2 changes: 1 addition & 1 deletion src/js/mdTextObject.js
Expand Up @@ -133,4 +133,4 @@ class mdTextObject {
}
}

module.exports = mdTextObject;
export default mdTextObject;
2 changes: 1 addition & 1 deletion src/js/preview.js
Expand Up @@ -113,4 +113,4 @@ class Preview {
}
}

module.exports = Preview;
export default Preview;
2 changes: 1 addition & 1 deletion src/js/squireExt.js
Expand Up @@ -337,5 +337,5 @@ class SquireExt extends Squire {
}
}

module.exports = SquireExt;
export default SquireExt;

2 changes: 1 addition & 1 deletion src/js/ui/blockOverlay.js
Expand Up @@ -145,4 +145,4 @@ class BlockOverlay {
}
}

module.exports = BlockOverlay;
export default BlockOverlay;
6 changes: 3 additions & 3 deletions src/js/ui/button.js
Expand Up @@ -2,8 +2,8 @@
* @fileoverview
* @author Sungho Kim(sungho-kim@nhnent.com) FE Development Team/NHN Ent.
*/
const UIController = require('./uicontroller');
const tooltip = require('./tooltip');
import UIController from './uicontroller';
import tooltip from './tooltip';

/**
* Class Button UI
Expand Down Expand Up @@ -76,4 +76,4 @@ class Button extends UIController {
}
}

module.exports = Button;
export default Button;
2 changes: 1 addition & 1 deletion src/js/ui/codeBlockGadget.js
Expand Up @@ -101,4 +101,4 @@ class CodeBlockGadget extends BlockOverlay {
}
}

module.exports = CodeBlockGadget;
export default CodeBlockGadget;
2 changes: 1 addition & 1 deletion src/js/ui/defaultUI.js
Expand Up @@ -278,4 +278,4 @@ class DefaultUI {
}
}

module.exports = DefaultUI;
export default DefaultUI;
2 changes: 1 addition & 1 deletion src/js/ui/layerpopup.js
Expand Up @@ -285,4 +285,4 @@ class LayerPopup extends UIController {
}
}

module.exports = LayerPopup;
export default LayerPopup;
2 changes: 1 addition & 1 deletion src/js/ui/modeSwitch.js
Expand Up @@ -81,4 +81,4 @@ ModeSwitch.TYPE = {
WYSIWYG
};

module.exports = ModeSwitch;
export default ModeSwitch;
2 changes: 1 addition & 1 deletion src/js/ui/popupAddHeading.js
Expand Up @@ -95,4 +95,4 @@ class PopupAddHeading extends LayerPopup {
}
}

module.exports = PopupAddHeading;
export default PopupAddHeading;
2 changes: 1 addition & 1 deletion src/js/ui/popupAddImage.js
Expand Up @@ -170,4 +170,4 @@ class PopupAddImage extends LayerPopup {
}
}

module.exports = PopupAddImage;
export default PopupAddImage;
2 changes: 1 addition & 1 deletion src/js/ui/popupAddLink.js
Expand Up @@ -168,4 +168,4 @@ class PopupAddLink extends LayerPopup {
}
}

module.exports = PopupAddLink;
export default PopupAddLink;
2 changes: 1 addition & 1 deletion src/js/ui/popupAddTable.js
Expand Up @@ -380,4 +380,4 @@ PopupAddTable.CELL_HEIGHT = CELL_HEIGHT;
PopupAddTable.MIN_ROW_SELECTION_INDEX = MIN_ROW_SELECTION_INDEX;
PopupAddTable.MIN_COL_SELECTION_INDEX = MIN_COL_SELECTION_INDEX;

module.exports = PopupAddTable;
export default PopupAddTable;
2 changes: 1 addition & 1 deletion src/js/ui/popupCodeBlockEditor.js
Expand Up @@ -273,4 +273,4 @@ class PopupCodeBlockEditor extends LayerPopup {
}
}

module.exports = PopupCodeBlockEditor;
export default PopupCodeBlockEditor;
2 changes: 1 addition & 1 deletion src/js/ui/popupCodeBlockLanguages.js
Expand Up @@ -199,4 +199,4 @@ class PopupCodeBlockLanguages extends LayerPopup {
}
}

module.exports = PopupCodeBlockLanguages;
export default PopupCodeBlockLanguages;
2 changes: 1 addition & 1 deletion src/js/ui/popupTableUtils.js
Expand Up @@ -103,4 +103,4 @@ class PopupTableUtils extends LayerPopup {
}
}

module.exports = PopupTableUtils;
export default PopupTableUtils;
2 changes: 1 addition & 1 deletion src/js/ui/tab.js
Expand Up @@ -103,4 +103,4 @@ class Tab extends UIController {
}
}

module.exports = Tab;
export default Tab;
2 changes: 1 addition & 1 deletion src/js/ui/toolbar.js
Expand Up @@ -213,4 +213,4 @@ class Toolbar extends UIController {
}
}

module.exports = Toolbar;
export default Toolbar;
2 changes: 1 addition & 1 deletion src/js/ui/tooltip.js
Expand Up @@ -41,4 +41,4 @@ class Tooltip {
}
}

module.exports = new Tooltip();
export default new Tooltip();
2 changes: 1 addition & 1 deletion src/js/ui/uicontroller.js
Expand Up @@ -172,4 +172,4 @@ class UIController {
}
}

module.exports = UIController;
export default UIController;
2 changes: 1 addition & 1 deletion src/js/wwClipboardManager.js
Expand Up @@ -359,4 +359,4 @@ class WwClipboardManager {
}
}

module.exports = WwClipboardManager;
export default WwClipboardManager;
2 changes: 1 addition & 1 deletion src/js/wwCodeBlockManager.js
Expand Up @@ -306,4 +306,4 @@ function sanitizeHtmlCode(code) {
return code.replace(/[<>&]/g, tag => tagEntities[tag] || tag);
}

module.exports = WwCodeBlockManager;
export default WwCodeBlockManager;
2 changes: 1 addition & 1 deletion src/js/wwHeadingManager.js
Expand Up @@ -200,4 +200,4 @@ class WwHeadingManager {
}
}

module.exports = WwHeadingManager;
export default WwHeadingManager;
2 changes: 1 addition & 1 deletion src/js/wwHrManager.js
Expand Up @@ -243,4 +243,4 @@ function findTextNodeFilter() {
return this.nodeType === Node.TEXT_NODE;
}

module.exports = WwHrManager;
export default WwHrManager;

0 comments on commit 1c03eda

Please sign in to comment.