@jswf/core
Version:
JavaScript Window Framework
82 lines • 3.14 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
require("../../scss/TextEditWindow.scss");
var EditableView_1 = require("./EditableView");
var FrameWindow_1 = require("../FrameWindow");
var Libs_1 = require("../Libs");
var TextArea_1 = require("../TextArea");
var Splitter_1 = require("../Splitter");
/**
*
*
* @export
* @class TextEditWindow
* @extends {JWF.FrameWindow}
*/
var TextEditWindow = /** @class */ (function (_super) {
__extends(TextEditWindow, _super);
function TextEditWindow() {
var _this = _super.call(this) || this;
_this.setJwfStyle("TextEditWindow");
_this.setSize(800, 600);
var splitter = new Splitter_1.Splitter();
_this.addChild(splitter, "client");
splitter.setSplitterPos(600);
_this.setPos();
var editableView = new EditableView_1.EditableView();
_this.editableView = editableView;
splitter.addChild(0, editableView, "client");
editableView.addEventListener("updateText", function () {
_this.htmlTimer.call();
});
var textArea = new TextArea_1.TextArea();
_this.textArea = textArea;
splitter.addChild(1, textArea, "client");
textArea.addEventListener("updateText", function () {
_this.textTimer.call();
});
//時間差更新処理
_this.htmlTimer = new Libs_1.TimerProc(function () {
textArea.setText(editableView.getHtml());
}, 500);
_this.textTimer = new Libs_1.TimerProc(function () {
editableView.setHtml(textArea.getText());
}, 500);
return _this;
}
TextEditWindow.prototype.setHtml = function (value) {
this.textArea.setText(value);
this.editableView.setHtml(value);
};
TextEditWindow.prototype.getHtml = function () {
return this.textArea.getText();
};
TextEditWindow.prototype.createControl = function (param) {
this.editableView.createControl(param);
};
TextEditWindow.prototype.getEditableView = function () {
return this.editableView;
};
TextEditWindow.prototype.insertNode = function (node) {
this.editableView.insertNode(node);
};
TextEditWindow.prototype.setRange = function () {
this.editableView.setRange();
};
return TextEditWindow;
}(FrameWindow_1.FrameWindow));
exports.TextEditWindow = TextEditWindow;
//# sourceMappingURL=TextEditWindow.js.map