odoo.define('web_editor.backend', function (require) { 'use strict'; var core = require('web.core'); var session = require('web.session'); var Model = require('web.DataModel'); var common = require('web.form_common'); var base = require('web_editor.base'); var editor = require('web_editor.editor'); var summernote = require('web_editor.summernote'); var transcoder = require('web_editor.transcoder'); var QWeb = core.qweb; var _t = core._t; /** * FieldTextHtml Widget * Intended for FieldText widgets meant to display HTML content. This * widget will instantiate an iframe with the editor summernote improved by odoo */ var widget = common.AbstractField.extend(common.ReinitializeFieldMixin); var FieldTextHtmlSimple = widget.extend({ template: 'web_editor.FieldTextHtmlSimple', _config: function () { var self = this; var config = { 'focus': false, 'height': 180, 'toolbar': [ ['style', ['style']], ['font', ['bold', 'italic', 'underline', 'clear']], ['fontsize', ['fontsize']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']], ['table', ['table']], ['insert', ['link', 'picture']], ['history', ['undo', 'redo']] ], 'prettifyHtml': false, 'styleWithSpan': false, 'inlinemedia': ['p'], 'lang': "odoo", 'onChange': function (value) { self.internal_set_value(value); self.trigger('changed_value'); } }; if (session.debug) { config.toolbar.splice(7, 0, ['view', ['codeview']]); } return config; }, start: function () { var def = this._super.apply(this, arguments); this.$translate.remove(); this.$translate = $(); // Triggers a mouseup to refresh the editor toolbar this.$content.trigger('mouseup'); return def; }, initialize_content: function () { var self = this; this.$textarea = this.$("textarea").val(this.get('value') || "


"); this.$content = $(); if (this.get("effective_readonly")) { if (this.options['style-inline']) { var $iframe = $('