openerp的撰写消息中, 在文本输入框中, 具有设置文本字体,设置对齐方式 等多种功能, 就像像写这篇新浪blog一样, 可以输入富文本信息。 美中不足的是, 它不能插入图片。 

我们如何才能让openerp在撰写消息时插入图片呢?方法很简单。 因为openerp使用的富文本编辑器是cleditor。 cleditor的工具条已经具备了插入图片的功能, 只要在初始化时设置上就行。

在openerp中, 初始化cleditor的代码在 addonswebstaticsrcjsview_form.js 文件中, 大约在2700行附近:

 initialize_content: function() {

   ......

       this.$textarea.cleditor({

          width: width, // width not including margins, borders or padding 

          height: height, // height not including margins, borders or padding

          controls: // controls to add to the toolbar

                 "bold italic underline strikethrough " +

                 "| removeformat | bullets numbering | outdent " +

                 "indent | link unlink | source",

我们只需在source前面加上 image 就行了。如下所示:

 initialize_content: function() {

   ......

       this.$textarea.cleditor({

          width: width, // width not including margins, borders or padding 

          height: height, // height not including margins, borders or padding

          controls: // controls to add to the toolbar

                 "bold italic underline strikethrough " +

                 "| removeformat | bullets numbering | outdent " +

                 "indent | link unlink |  image source",

如下这个例子在文本编辑器的工具栏上 显示了更多的按钮:

controls:     // controls to add to the toolbar
"bold italic underline strikethrough subscript superscript | font size " +
"style | color highlight removeformat | bullets numbering | outdent " +
"indent | alignleft center alignright justify | undo redo | " +
"rule image link unlink | cut copy paste pastetext | print source",

最新文章

  1. 关于javascript中的this关键字
  2. [LeetCode] Rectangle Area 矩形面积
  3. 加载ComboBox控件
  4. Android 源码获取-----在Windows环境下通过Git得到Android源代码
  5. [PHP100] PHP如何防止注入及开发安全
  6. Nginx安全配置
  7. 树莓PI上跑爬虫
  8. c++回调编程本质
  9. Firefox中Vimperator插件配置
  10. [Unity3D]Unity3D游戏开发之鼠标滚轮实现放大缩小
  11. CentOS yum安装配置lnmp服务器(Nginx+PHP+MySQL)
  12. Ansible10:Playbook的角色与包含【转】
  13. poj_3258:River Hopscotch(二分)
  14. web.xml 文件中一般包括 servlet, spring, filter, listenr的配置的加载顺序
  15. SpringBoot14 SpringBoot整合mybatis
  16. java虚拟机内存区域
  17. 小程序 map组件问题 cover-view问题
  18. 关于手机ios和安卓和pc的点击事件的兼容
  19. 【IDEA】【1】准备工作
  20. java的GUI程序的基本思路是以JFrame为基础

热门文章

  1. Lua调用C++时打印堆栈信息
  2. C# 获取文件的MIME类型
  3. windows 安装ninja
  4. [转]windows7X64环境下wamp开启PHP_Curl组件
  5. Guava ClassToInstanceMap
  6. CImg、libjpeg--介绍、配置(操作JPEG)
  7. iOS:自定义导航栏,随着tableView滚动显示和隐藏
  8. 使用Spring Cloud Security OAuth2搭建授权服务
  9. C语言学习 - 字节对齐
  10. Ext4中获取下拉框的值