all files / rich-text-editor/renderer/ markdown-renderer.js

100% Statements 24/24
100% Branches 0/0
100% Functions 9/9
100% Lines 24/24
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39   70×   70× 70× 70×         70× 70× 70×   136×   2857×     70×   536×        
define(["require", "exports"], function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var MarkdownRender = (function () {
        function MarkdownRender(parent) {
            this.parent = parent;
        }
        MarkdownRender.prototype.renderPanel = function () {
            var rteObj = this.parent;
            var div = this.parent.createElement('div', { id: this.parent.getID() + '_view', className: 'e-rte-content' });
            this.editableElement = this.parent.createElement('textarea', {
                className: 'e-content',
                id: this.parent.getID() + '_editable-content',
                attrs: { 'aria-labelledby': this.parent.getID() + '_view' }
            });
            div.appendChild(this.editableElement);
            this.setPanel(div);
            rteObj.rootContainer.appendChild(div);
        };
        MarkdownRender.prototype.getPanel = function () {
            return this.contentPanel;
        };
        MarkdownRender.prototype.getEditPanel = function () {
            return this.editableElement;
        };
        MarkdownRender.prototype.getText = function () {
            return this.getEditPanel().value;
        };
        MarkdownRender.prototype.setPanel = function (panel) {
            this.contentPanel = panel;
        };
        MarkdownRender.prototype.getDocument = function () {
            return this.getEditPanel().ownerDocument;
        };
        return MarkdownRender;
    }());
    exports.MarkdownRender = MarkdownRender;
});