mirror of https://github.com/OCA/web.git
commit
a1a0a553d7
|
@ -8,11 +8,6 @@ This module adds a new widget for text field in form view on Odoo:
|
||||||
|
|
||||||
[1]: http://www.codingdrama.com/bootstrap-markdown/ "bootstrap-markdown"
|
[1]: http://www.codingdrama.com/bootstrap-markdown/ "bootstrap-markdown"
|
||||||
|
|
||||||
Installation
|
|
||||||
============
|
|
||||||
|
|
||||||
It was tested on openerp trunk, 8.0 branch.
|
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
|
||||||
|
@ -48,6 +43,16 @@ Contributors
|
||||||
------------
|
------------
|
||||||
|
|
||||||
* Nicolas Jeudy <nicolas@sudokeys.com>
|
* Nicolas Jeudy <nicolas@sudokeys.com>
|
||||||
|
* Nguyen Tan Phuc <phuc.nt@komit-consulting.com>
|
||||||
|
|
||||||
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
|
Funders
|
||||||
|
-------
|
||||||
|
|
||||||
|
The development of this module has been financially supported by:
|
||||||
|
|
||||||
|
* Komit https://komit-consulting.com
|
||||||
|
|
||||||
Maintainer
|
Maintainer
|
||||||
----------
|
----------
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Copyright (C) 2014 Sudokeys (<http://www.sudokeys.com>)
|
# Copyright (C) 2014 Sudokeys (<http://www.sudokeys.com>)
|
||||||
|
# Copyright (C) 2017 Komit (<http://www.komit-consulting.com>)
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published
|
# it under the terms of the GNU Affero General Public License as published
|
||||||
|
@ -20,18 +21,26 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'web_widget_text_markdown',
|
'name': 'web_widget_text_markdown',
|
||||||
'version': '8.0.1.0.0',
|
'version': '10.0.1.0.0',
|
||||||
'author': "Sudokeys,Odoo Community Association (OCA)",
|
"author": "Komit, "
|
||||||
'maintainer': 'Sudokeys',
|
"Sudokeys, "
|
||||||
'category': '',
|
"Odoo Community Association (OCA)",
|
||||||
|
'category': 'Web',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'depends': ['base', 'web'],
|
'website': 'https://github.com/OCA/web',
|
||||||
'website': 'http://www.sudokey.com',
|
'depends': [
|
||||||
'data': ['views/main.xml', ],
|
'base', 'web'
|
||||||
"qweb": ["static/src/xml/bootstrap_markdown.xml",
|
],
|
||||||
],
|
'demo': [
|
||||||
'demo': [],
|
"demo/bootstrap_markdown.xml",
|
||||||
'installable': False,
|
],
|
||||||
|
'data': [
|
||||||
|
'views/main.xml',
|
||||||
|
],
|
||||||
|
"qweb": [
|
||||||
|
"static/src/xml/bootstrap_markdown.xml",
|
||||||
|
],
|
||||||
|
'installable': True,
|
||||||
'auto_install': False,
|
'auto_install': False,
|
||||||
'application': False
|
'application': False
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record id="view_groups_form_inherited" model="ir.ui.view">
|
||||||
|
<field name="model">res.groups</field>
|
||||||
|
<field name="inherit_id" ref="base.view_groups_form" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="comment" position="attributes">
|
||||||
|
<attribute name="widget">bootstrap_markdown</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_widget_text_markdown
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# SaFi J. <safi2266@gmail.com>, 2015
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: web (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2015-12-16 07:41+0000\n"
|
||||||
|
"PO-Revision-Date: 2015-12-16 17:24+0000\n"
|
||||||
|
"Last-Translator: SaFi J. <safi2266@gmail.com>\n"
|
||||||
|
"Language-Team: Arabic (http://www.transifex.com/oca/OCA-web-8-0/language/ar/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: ar\n"
|
||||||
|
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
|
||||||
|
|
||||||
|
#. module: web_widget_text_markdown
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js:12
|
||||||
|
#, python-format
|
||||||
|
msgid "MarkDown"
|
||||||
|
msgstr "مارك داون"
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_widget_text_markdown
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Rudolf Schnapka <rs@techno-flex.de>, 2016
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: web (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-01-10 07:31+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-01-18 20:15+0000\n"
|
||||||
|
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n"
|
||||||
|
"Language-Team: German (http://www.transifex.com/oca/OCA-web-8-0/language/de/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: de\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: web_widget_text_markdown
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js:12
|
||||||
|
#, python-format
|
||||||
|
msgid "MarkDown"
|
||||||
|
msgstr "Abschlag"
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_widget_text_markdown
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2015
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: web (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2015-11-23 13:46+0000\n"
|
||||||
|
"PO-Revision-Date: 2015-11-07 11:29+0000\n"
|
||||||
|
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>\n"
|
||||||
|
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-web-8-0/language/es/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: es\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: web_widget_text_markdown
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js:12
|
||||||
|
#, python-format
|
||||||
|
msgid "MarkDown"
|
||||||
|
msgstr "MarkDown"
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_widget_text_markdown
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2016
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: web (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-01-10 07:31+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-02-01 09:42+0000\n"
|
||||||
|
"Last-Translator: Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>\n"
|
||||||
|
"Language-Team: Finnish (http://www.transifex.com/oca/OCA-web-8-0/language/fi/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: fi\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: web_widget_text_markdown
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js:12
|
||||||
|
#, python-format
|
||||||
|
msgid "MarkDown"
|
||||||
|
msgstr "Markdown"
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_widget_text_markdown
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Christophe CHAUVET <christophe.chauvet@gmail.com>, 2016
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: web (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-05-06 15:50+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-05-06 08:22+0000\n"
|
||||||
|
"Last-Translator: Christophe CHAUVET <christophe.chauvet@gmail.com>\n"
|
||||||
|
"Language-Team: French (http://www.transifex.com/oca/OCA-web-8-0/language/fr/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: fr\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
|
#. module: web_widget_text_markdown
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js:12
|
||||||
|
#, python-format
|
||||||
|
msgid "MarkDown"
|
||||||
|
msgstr "MarkDown"
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_widget_text_markdown
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# danimaribeiro <danimaribeiro@gmail.com>, 2016
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: web (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-03-11 02:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-03-05 16:20+0000\n"
|
||||||
|
"Last-Translator: danimaribeiro <danimaribeiro@gmail.com>\n"
|
||||||
|
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-web-8-0/language/pt_BR/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: pt_BR\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
|
#. module: web_widget_text_markdown
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js:12
|
||||||
|
#, python-format
|
||||||
|
msgid "MarkDown"
|
||||||
|
msgstr "MarkDown"
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_widget_text_markdown
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: web (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2015-11-23 13:46+0000\n"
|
||||||
|
"PO-Revision-Date: 2015-11-08 05:48+0000\n"
|
||||||
|
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
|
||||||
|
"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-web-8-0/language/sl/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: sl\n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
|
||||||
|
|
||||||
|
#. module: web_widget_text_markdown
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js:12
|
||||||
|
#, python-format
|
||||||
|
msgid "MarkDown"
|
||||||
|
msgstr "MarkDown"
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_widget_text_markdown
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Ahmet Altınışık <aaltinisik@altinkaya.com.tr>, 2016
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: web (8.0)\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2016-01-10 07:31+0000\n"
|
||||||
|
"PO-Revision-Date: 2016-01-31 11:44+0000\n"
|
||||||
|
"Last-Translator: Ahmet Altınışık <aaltinisik@altinkaya.com.tr>\n"
|
||||||
|
"Language-Team: Turkish (http://www.transifex.com/oca/OCA-web-8-0/language/tr/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: tr\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
|
#. module: web_widget_text_markdown
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js:12
|
||||||
|
#, python-format
|
||||||
|
msgid "MarkDown"
|
||||||
|
msgstr "MarkDown"
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
||||||
.openerp .oe_form .oe_form_field_markdown .oe_form_text_content {
|
.oe_form_field_markdown {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
/* display: inline-block;
|
/* display: inline-block;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
@ -6,7 +6,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.openerp .markdown-body thead th:first-child {
|
.markdown-body thead th:first-child {
|
||||||
border-left: 1px solid #ddd !important;
|
border-left: 1px solid #ddd !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,20 @@
|
||||||
openerp.web_widget_text_markdown = function (oe) {
|
/* Copyright 2014 Sudokeys <http://www.sudokeys.com>
|
||||||
|
* Copyright 2017 Komit - <http:///komit-consulting.com>
|
||||||
|
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */
|
||||||
|
odoo.define("web_widget_text_markdown.bootstrap_markdown",
|
||||||
|
function (require) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
var _lt = oe.web._lt;
|
var core = require('web.core');
|
||||||
|
var form_common = require('web.form_common');
|
||||||
|
var formats = require ("web.formats");
|
||||||
|
|
||||||
oe.web.form.widgets.add('bootstrap_markdown', 'openerp.web_widget_text_markdown.FieldTextMarkDown');
|
var _lt = core._lt;
|
||||||
|
var ListView = require('web.ListView');
|
||||||
|
var list_widget_registry = core.list_widget_registry;
|
||||||
|
|
||||||
oe.web_widget_text_markdown.FieldTextMarkDown = oe.web.form.AbstractField.extend(
|
var FieldTextMarkDown = form_common.AbstractField.extend(
|
||||||
oe.web.form.ReinitializeFieldMixin,
|
form_common.ReinitializeFieldMixin,
|
||||||
{
|
{
|
||||||
|
|
||||||
template: 'FieldMarkDown',
|
template: 'FieldMarkDown',
|
||||||
|
@ -23,7 +32,7 @@ openerp.web_widget_text_markdown = function (oe) {
|
||||||
},
|
},
|
||||||
|
|
||||||
parse_value: function(val, def) {
|
parse_value: function(val, def) {
|
||||||
return oe.web.parse_value(val, this, def);
|
return formats.parse_value(val, this, def);
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize_content: function () {
|
initialize_content: function () {
|
||||||
|
@ -32,23 +41,28 @@ openerp.web_widget_text_markdown = function (oe) {
|
||||||
// - BUT NOT when switching to next object.
|
// - BUT NOT when switching to next object.
|
||||||
this.$txt = this.$el.find('textarea[name="' + this.name + '"]');
|
this.$txt = this.$el.find('textarea[name="' + this.name + '"]');
|
||||||
if (!this.get('effective_readonly')) {
|
if (!this.get('effective_readonly')) {
|
||||||
this.$txt.markdown({autofocus: false, savable: false});
|
this.$txt.markdown({
|
||||||
|
autofocus: false,
|
||||||
|
savable: false,
|
||||||
|
iconlibrary: "fa"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this.old_value = null; // will trigger a redraw
|
this.old_value = null; // will trigger a redraw
|
||||||
},
|
},
|
||||||
|
|
||||||
store_dom_value: function () {
|
store_dom_value: function () {
|
||||||
if (!this.get('effective_readonly') &&
|
if (!this.get('effective_readonly') &&
|
||||||
this._get_raw_value() !== '' &&
|
|
||||||
this.is_syntax_valid()) {
|
this.is_syntax_valid()) {
|
||||||
// We use internal_set_value because we were called by
|
// We use internal_set_value because we were called by
|
||||||
// ``.commit_value()`` which is called by a ``.set_value()``
|
// ``.commit_value()`` which is called by a ``.set_value()``
|
||||||
// itself called because of a ``onchange`` event
|
// itself called because of a ``onchange`` event
|
||||||
this.internal_set_value(
|
this.internal_set_value(
|
||||||
this.parse_value(
|
this.parse_value(
|
||||||
this._get_raw_value()));
|
this._get_raw_value()
|
||||||
}
|
)
|
||||||
},
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
commit_value: function () {
|
commit_value: function () {
|
||||||
this.store_dom_value();
|
this.store_dom_value();
|
||||||
|
@ -58,7 +72,7 @@ openerp.web_widget_text_markdown = function (oe) {
|
||||||
_get_raw_value: function() {
|
_get_raw_value: function() {
|
||||||
if (this.$txt === false)
|
if (this.$txt === false)
|
||||||
return '';
|
return '';
|
||||||
return this.$txt.val();
|
return this.$txt.val();
|
||||||
},
|
},
|
||||||
|
|
||||||
render_value: function () {
|
render_value: function () {
|
||||||
|
@ -82,8 +96,41 @@ openerp.web_widget_text_markdown = function (oe) {
|
||||||
},
|
},
|
||||||
|
|
||||||
format_value: function (val, def) {
|
format_value: function (val, def) {
|
||||||
return oe.web.format_value(val, this, def);
|
return formats.format_value(val, this, def);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
core.form_widget_registry.add('bootstrap_markdown',
|
||||||
|
FieldTextMarkDown);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* bootstrap_markdown support on list view
|
||||||
|
**/
|
||||||
|
ListView.Column.include({
|
||||||
|
|
||||||
|
init: function(){
|
||||||
|
this._super.apply(this, arguments);
|
||||||
|
hljs.initHighlightingOnLoad();
|
||||||
|
marked.setOptions({
|
||||||
|
sanitize: true,
|
||||||
|
highlight: function (code) {
|
||||||
|
return hljs.highlightAuto(code).value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_format: function(row_data, options){
|
||||||
|
options = options || {};
|
||||||
|
var markdown_text = marked(
|
||||||
|
formats.format_value(
|
||||||
|
row_data[this.id].value, this, options.value_if_empty
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return markdown_text;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
list_widget_registry.add('field.bootstrap_markdown', ListView.Column);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- vim:fdl=1:
|
<!-- * Copyright 2014 Sudokeys <http://www.sudokeys.com>
|
||||||
-->
|
* Copyright 2017 Komit - <http:///komit-consulting.com>
|
||||||
|
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).-->
|
||||||
|
|
||||||
<templates id="template" xml:space="preserve">
|
<templates id="template" xml:space="preserve">
|
||||||
|
|
||||||
<t t-name="FieldMarkDown">
|
<t t-name="FieldMarkDown">
|
||||||
|
@ -15,7 +17,7 @@
|
||||||
t-att-autofocus="widget.node.attrs.autofocus"
|
t-att-autofocus="widget.node.attrs.autofocus"
|
||||||
t-att-placeholder="! widget.get('effective_readonly') ? widget.node.attrs.placeholder : ''"
|
t-att-placeholder="! widget.get('effective_readonly') ? widget.node.attrs.placeholder : ''"
|
||||||
t-att-maxlength="widget.field.size"
|
t-att-maxlength="widget.field.size"
|
||||||
></textarea><img class="oe_field_translate oe_input_icon"
|
/><img class="oe_field_translate oe_input_icon"
|
||||||
t-if="widget.field.translate and !widget.get('effective_readonly')"
|
t-if="widget.field.translate and !widget.get('effective_readonly')"
|
||||||
t-att-src='_s + "/web/static/src/img/icons/terp-translate.png"'
|
t-att-src='_s + "/web/static/src/img/icons/terp-translate.png"'
|
||||||
width="16"
|
width="16"
|
||||||
|
@ -24,7 +26,7 @@
|
||||||
/>
|
/>
|
||||||
</t>
|
</t>
|
||||||
<t t-if="widget.get('effective_readonly')">
|
<t t-if="widget.get('effective_readonly')">
|
||||||
<span class="oe_form_text_content"></span>
|
<span class="oe_form_text_content"/>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- vim:fdn=3:
|
<!-- * Copyright 2014 Sudokeys <http://www.sudokeys.com>
|
||||||
-->
|
* Copyright 2017 Komit - <http:///komit-consulting.com>
|
||||||
|
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).-->
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<data>
|
||||||
<template id="assets_backend" name="web_widget_text_markdown assets" inherit_id="web.assets_backend">
|
<template id="assets_backend" name="web_widget_text_markdown assets" inherit_id="web.assets_backend">
|
||||||
|
@ -8,10 +9,10 @@
|
||||||
<link rel="stylesheet" href="/web_widget_text_markdown/static/src/css/bootstrap-markdown.min.css"/>
|
<link rel="stylesheet" href="/web_widget_text_markdown/static/src/css/bootstrap-markdown.min.css"/>
|
||||||
<link rel="stylesheet" href="/web_widget_text_markdown/static/lib/highlight/styles/railscasts.css"/>
|
<link rel="stylesheet" href="/web_widget_text_markdown/static/lib/highlight/styles/railscasts.css"/>
|
||||||
<link rel="stylesheet" href="/web_widget_text_markdown/static/src/css/main.css"/>
|
<link rel="stylesheet" href="/web_widget_text_markdown/static/src/css/main.css"/>
|
||||||
<script type="text/javascript" src="/web_widget_text_markdown/static/lib/highlight/highlight.min.js"></script>
|
<script type="text/javascript" src="/web_widget_text_markdown/static/lib/highlight/highlight.min.js"/>
|
||||||
<script type="text/javascript" src="/web_widget_text_markdown/static/lib/marked/marked.js"></script>
|
<script type="text/javascript" src="/web_widget_text_markdown/static/lib/marked/marked.js"/>
|
||||||
<script type="text/javascript" src="/web_widget_text_markdown/static/lib/bootstrap-markdown/bootstrap-markdown.js"></script>
|
<script type="text/javascript" src="/web_widget_text_markdown/static/lib/bootstrap-markdown/bootstrap-markdown.js"/>
|
||||||
<script type="text/javascript" src="/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js"></script>
|
<script type="text/javascript" src="/web_widget_text_markdown/static/src/js/web_widget_text_markdown.js"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
</data>
|
</data>
|
||||||
|
|
Loading…
Reference in New Issue