var prefix = self.classPrefix;
self.items().each(function (ctrl, i) {
var id = self._id + '-t' + i;
ctrl.aria('role', 'tabpanel');
ctrl.aria('labelledby', id);
tabsHtml += '<div id="' + id + '" class="' + prefix + 'tab" ' + 'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' + self.encode(ctrl.settings.title) + '</div>';
return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + '<div id="' + self._id + '-head" class="' + prefix + 'tabs" role="tablist">' + tabsHtml + '</div>' + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + layout.renderHtml(self) + '</div>' + '</div>';
postRender: function () {
self.settings.activeTab = self.settings.activeTab || 0;
self.activateTab(self.settings.activeTab);
this.on('click', function (e) {
var targetParent = e.target.parentNode;
if (targetParent && targetParent.id === self._id + '-head') {
var i = targetParent.childNodes.length;
if (targetParent.childNodes[i] === e.target) {
initLayoutRect: function () {
minW = funcs.getSize(self.getEl('head')).width;
minW = minW < 0 ? 0 : minW;
self.items().each(function (item) {
minW = Math.max(minW, item.layoutRect().minW);
minH = Math.max(minH, item.layoutRect().minH);
self.items().each(function (ctrl) {
var headH = funcs.getSize(self.getEl('head')).height;
self.settings.minWidth = minW;
self.settings.minHeight = minH + headH;
rect.innerH = rect.h - rect.deltaH;
var TextBox = Widget.extend({
init: function (settings) {
self.classes.add('textbox');
if (settings.multiline) {
self.classes.add('multiline');
self.on('keydown', function (e) {
self.parents().reverse().each(function (ctrl) {
self.fire('submit', { data: rootControl.toJSON() });
self.on('keyup', function (e) {
self.state.set('value', e.target.value);
var style, rect, borderBox, borderW, borderH = 0, lastRepaintRect;
style = self.getEl().style;
lastRepaintRect = self._lastRepaintRect || {};
var doc = domGlobals.document;
if (!self.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
style.lineHeight = rect.h - borderH + 'px';
borderBox = self.borderBox;
borderW = borderBox.left + borderBox.right + 8;
borderH = borderBox.top + borderBox.bottom + (self.settings.multiline ? 8 : 0);
if (rect.x !== lastRepaintRect.x) {
style.left = rect.x + 'px';
lastRepaintRect.x = rect.x;
if (rect.y !== lastRepaintRect.y) {
style.top = rect.y + 'px';
lastRepaintRect.y = rect.y;
if (rect.w !== lastRepaintRect.w) {
style.width = rect.w - borderW + 'px';
lastRepaintRect.w = rect.w;
if (rect.h !== lastRepaintRect.h) {
style.height = rect.h - borderH + 'px';
lastRepaintRect.h = rect.h;
self._lastRepaintRect = lastRepaintRect;
self.fire('repaint', {}, false);
renderHtml: function () {
var settings = self.settings;
attrs[name] = settings[name];
attrs.disabled = 'disabled';
attrs.type = settings.subtype;
elm = funcs.create(settings.multiline ? 'textarea' : 'input', attrs);
elm.value = self.state.get('value');
elm.className = self.classes.toString();
value: function (value) {
this.state.set('value', value);
if (this.state.get('rendered')) {
this.state.set('value', this.getEl().value);
return this.state.get('value');
postRender: function () {
self.getEl().value = self.state.get('value');
self.$el.on('change', function (e) {
self.state.set('value', e.target.value);
bindStates: function () {
self.state.on('change:value', function (e) {
if (self.getEl().value !== e.value) {
self.getEl().value = e.value;
self.state.on('change:disabled', function (e) {
self.getEl().disabled = e.value;
var getApi = function () {
Collection: Collection$2,
ReflowQueue: ReflowQueue,
KeyboardNavigation: KeyboardNavigation,
Notification: Notification,
AbsoluteLayout: AbsoluteLayout,
ButtonGroup: ButtonGroup,
PanelButton: PanelButton,
ColorButton: ColorButton,
ColorPicker: ColorPicker,
ElementPath: ElementPath,
FormatControls: FormatControls,
ResizeHandle: ResizeHandle,
SplitButton: SplitButton,
StackLayout: StackLayout,
BrowseButton: BrowseButton
var appendTo = function (target) {
global$4.each(getApi(), function (ref, key) {
var registerToFactory = function () {
global$4.each(getApi(), function (ref, key) {
registerToFactory: registerToFactory
Api.appendTo(window.tinymce ? window.tinymce : {});
global.add('inlite', function (editor) {
FormatControls.setup(editor);
Buttons.addToEditor(editor, panel);
return ThemeApi.get(editor, panel);