/* * Inspector text editor class. */ +function ($) { "use strict"; var Base = $.oc.inspector.propertyEditors.popupBase, BaseProto = Base.prototype var TextEditor = function(inspector, propertyDefinition, containerCell, group) { Base.call(this, inspector, propertyDefinition, containerCell, group) } TextEditor.prototype = Object.create(BaseProto) TextEditor.prototype.constructor = Base TextEditor.prototype.setLinkText = function(link, value) { var value = value !== undefined ? value : this.inspector.getPropertyValue(this.propertyDefinition.property) if (value === undefined) { value = this.propertyDefinition.default } if (!value) { value = this.propertyDefinition.placeholder $.oc.foundation.element.addClass(link, 'placeholder') } else { $.oc.foundation.element.removeClass(link, 'placeholder') } if (typeof value === 'string') { value = value.replace(/(?:\r\n|\r|\n)/g, ' '); value = $.trim(value) value = value.substring(0, 300); } link.textContent = value } TextEditor.prototype.getPopupContent = function() { return '
\ \