【发布时间】:2022-09-27 20:49:40
【问题描述】:
我想将消息字段从这个扩展到这个
在文件addons\\mail\\static\\src\\components\\composer_text_input\\composer_text_input.xml 中有一个带有当前文本区域的模板:
<t t-name=\"mail.ComposerTextInput\" owl=\"1\">
<div class=\"o_ComposerTextInput\">
<t t-if=\"composerView\">
<t t-if=\"composerView.hasSuggestions\">
<ComposerSuggestionList
composerViewLocalId=\"props.composerViewLocalId\"
isBelow=\"props.hasMentionSuggestionsBelowPosition\"
/>
</t>
<textarea class=\"o_ComposerTextInput_textarea o_ComposerTextInput_textareaStyle\" t-att-class=\"{ \'o-composer-is-compact\': props.isCompact }\" t-esc=\"composerView.composer.textInputContent\" t-att-placeholder=\"textareaPlaceholder\" t-on-click=\"_onClickTextarea\" t-on-focusin=\"_onFocusinTextarea\" t-on-focusout=\"_onFocusoutTextarea\" t-on-keydown=\"_onKeydownTextarea\" t-on-keyup=\"_onKeyupTextarea\" t-on-input=\"_onInputTextarea\" t-ref=\"textarea\"/>
<!--
This is an invisible textarea used to compute the composer
height based on the text content. We need it to downsize
the textarea properly without flicker.
-->
<textarea class=\"o_ComposerTextInput_mirroredTextarea o_ComposerTextInput_textareaStyle\" t-att-class=\"{ \'o-composer-is-compact\': props.isCompact }\" t-esc=\"composerView.composer.textInputContent\" t-ref=\"mirroredTextarea\" disabled=\"1\"/>
</t>
</div>
</t>
这是一个在纯 HTML 文件中如何工作的示例(2 个文件与 *.html 文件放在同一目录中):
<html>
<head>
<link href=\"froala_editor.pkgd.min.css\" rel=\"stylesheet\" type=\"text/css\" />
</head>
<body>
<textarea id=\"example\"></textarea>
<script type=\"text/javascript\" src=\"froala_editor.pkgd.min.js\"></script>
<script type=\"text/javascript\" >
var editor = new FroalaEditor(\'#example\');
</script>
</body>
</html>
问题是当我插入该代码时,就像这样:
<link href=\"froala_editor.pkgd.min.css\" rel=\"stylesheet\" type=\"text/css\" />
<script type=\"text/javascript\" src=\"froala_editor.pkgd.min.js\"></script>
odoo 找不到,line with styles 也不行。 我还尝试将来自 froala_editor.pkgd.min.js 的代码粘贴到标签中。在纯 HTML 中它可以工作,而在 odoo .xml 中则不行。
我做错了什么?
标签: javascript xml odoo odoo-15