summaryrefslogtreecommitdiff
path: root/addons/web_editor
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2016-03-11 11:42:43 +0100
committerDenis Ledoux <dle@odoo.com>2016-03-11 11:42:43 +0100
commit6e09293b7d921a13c014403acd4bdf7d70a03c48 (patch)
treeccbdfdbc3eb94b6a2fe2276d21b4b8378ccdb50e /addons/web_editor
parent0eb3170674d0df8b68ff72b3a0c60741531ee7fe (diff)
parent8e69043562c125666d63657733428d68e8e97caa (diff)
[MERGE] forward port of branch 9.0 up to 8e69043
Diffstat (limited to 'addons/web_editor')
-rw-r--r--addons/web_editor/controllers/main.py2
-rw-r--r--addons/web_editor/i18n/es_VE.po4
-rw-r--r--addons/web_editor/i18n/it.po7
-rw-r--r--addons/web_editor/static/src/js/backend.js12
-rw-r--r--addons/web_editor/static/src/js/summernote.js2
-rw-r--r--addons/web_editor/static/src/js/transcoder.js2
6 files changed, 18 insertions, 11 deletions
diff --git a/addons/web_editor/controllers/main.py b/addons/web_editor/controllers/main.py
index 24fb6064dcb..963a78488ce 100644
--- a/addons/web_editor/controllers/main.py
+++ b/addons/web_editor/controllers/main.py
@@ -84,6 +84,8 @@ class Web_Editor(http.Controller):
:returns PNG image converted from given font
"""
+ # Make sure we have at least size=1
+ size = max(1, size)
# Initialize font
addons_path = http.addons_manifest['web']['addons_path']
font_obj = ImageFont.truetype(addons_path + font, size)
diff --git a/addons/web_editor/i18n/es_VE.po b/addons/web_editor/i18n/es_VE.po
index 5d1531334c7..8f135858510 100644
--- a/addons/web_editor/i18n/es_VE.po
+++ b/addons/web_editor/i18n/es_VE.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Odoo 9.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-29 10:26+0000\n"
-"PO-Revision-Date: 2015-09-30 09:29+0000\n"
+"PO-Revision-Date: 2016-03-01 12:03+0000\n"
"Last-Translator: Martin Trigaux\n"
"Language-Team: Spanish (Venezuela) (http://www.transifex.com/odoo/odoo-9/language/es_VE/)\n"
"MIME-Version: 1.0\n"
@@ -20,7 +20,7 @@ msgstr ""
#. module: web_editor
#: model:ir.ui.view,arch_db:web_editor.layout
msgid "&lt;!DOCTYPE html&gt;"
-msgstr ""
+msgstr "&lt;!DOCTYPE html&gt;"
#. module: web_editor
#. openerp-web
diff --git a/addons/web_editor/i18n/it.po b/addons/web_editor/i18n/it.po
index 18034ad3058..bfe82f66f49 100644
--- a/addons/web_editor/i18n/it.po
+++ b/addons/web_editor/i18n/it.po
@@ -4,13 +4,14 @@
#
# Translators:
# Riccardo Di Maio <riccardodimaio11@gmail.com>, 2015
+# Simone Bernini <simone@aperturelabs.it>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo 9.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-29 10:26+0000\n"
-"PO-Revision-Date: 2016-01-26 10:43+0000\n"
-"Last-Translator: Riccardo Di Maio <riccardodimaio11@gmail.com>\n"
+"PO-Revision-Date: 2016-03-03 11:30+0000\n"
+"Last-Translator: Simone Bernini <simone@aperturelabs.it>\n"
"Language-Team: Italian (http://www.transifex.com/odoo/odoo-9/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -601,7 +602,7 @@ msgstr "URL link"
#: code:addons/web_editor/static/src/js/rte.summernote.js:93
#, python-format
msgid "Medium"
-msgstr "Medio"
+msgstr "Canale"
#. module: web_editor
#. openerp-web
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index 72bf61cbb7f..2a33cdd4758 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -38,6 +38,7 @@ var FieldTextHtmlSimple = widget.extend({
['insert', ['link', 'picture']],
['history', ['undo', 'redo']]
],
+ 'prettifyHtml': false,
'styleWithSpan': false,
'inlinemedia': ['p'],
'lang': "odoo",
@@ -66,12 +67,15 @@ var FieldTextHtmlSimple = widget.extend({
if (this.get("effective_readonly")) {
if (this.options['style-inline']) {
- this.$textarea.hide().after('<iframe class="o_readonly"/>');
- setTimeout(function () {
- self.$content = $("body", self.$('iframe').contents()[0]);
+ var $iframe = $('<iframe class="o_readonly"/>');
+ this.$textarea.hide().after($iframe);
+ var load = function () {
+ self.$content = $($iframe.contents()[0]).find("body");
self.$content.html(self.text_to_html(self.get('value')));
self.resize();
- });
+ };
+ setTimeout(load);
+ $iframe.on('load', load);
} else {
this.$content = $('<div class="o_readonly"/>');
this.$textarea.hide().after(this.$content);
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js
index e4d1c5b27c4..00cd04ac16b 100644
--- a/addons/web_editor/static/src/js/summernote.js
+++ b/addons/web_editor/static/src/js/summernote.js
@@ -1062,8 +1062,8 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) {
}
}
+ var node = dom.node(r.sc);
var exist = r.sc.childNodes[r.so] || r.sc;
- var node = dom.node(exist);
exist = dom.isVisibleText(exist) || dom.isBR(exist) ? exist : dom.hasContentAfter(exist) || (dom.hasContentBefore(exist) || exist);
// table: add a tr
diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js
index 14461ba1cf6..d327252b63d 100644
--- a/addons/web_editor/static/src/js/transcoder.js
+++ b/addons/web_editor/static/src/js/transcoder.js
@@ -133,7 +133,7 @@ var font_to_img = function ($editable) {
});
if (content) {
var color = $font.css("color").replace(/\s/g, '');
- var src = _.str.sprintf('/web_editor/font_to_img/%s/%s/'+$font.height(), window.encodeURI(content), window.encodeURI(color));
+ var src = _.str.sprintf('/web_editor/font_to_img/%s/%s/'+Math.max(1, $font.height()), window.encodeURI(content), window.encodeURI(color));
var $img = $("<img/>").attr("src", src)
.attr("data-class", $font.attr("class"))
.attr("class", $font.attr("class").replace(new RegExp("(^|\\s+)" + icon + "(-[^\\s]+)?", "gi"), '')) // remove inline font-awsome style