Commit Graph
163 Commits
Author SHA1 Message Date
Nicolas Lempereur 5c50ba322f [FIX] web_editor: title tag with translation
b24d759 changed the wrapping translation span tags, this commit take it
into account for the "translation" title tag.
2016-01-14 11:20:00 +01:00
Nicolas Lempereur 060cff9be3 [FIX] web_editor: get unlink button working
f3f7bd9 improved some link editing behaviour by adding contenteditable
attribute on it.

But if contenteditable is set on a link, using command "unlink" on the
element for `document.execCommand` does not work.

Hence this commit adds a code so the first click outside the link remove
contenteditable.

closes #10436

second-part-of: opw-659772
2016-01-13 16:28:29 +01:00
Christophe Matthieu 10efb0621f [FIX] website: editor: enable/disable save/undo/redo button when resize snippet 2016-01-13 16:05:22 +01:00
Nicolas Lempereur b24d759036 [FIX] web_editor,base: transmit translation model
There is a logic on the front-end to escape translated text content when
saving them as ir.translation record.

This logic was in part base on html elements and if these element were
not coming from an html field other than "ir.ui.view" arch_db's field.

This logic was introduced in 8.0, and something similar was later
introduced in 9.0 with f5acea7, but in this instance, the information
[data-oe-model] on nodes was not available. Thus some html field from
other model than ui.ui.view would have their translation escaped
erroneously.

This commit adds a data-oe-model attribute on to-be-translated nodes
which will then be available to the frontend.

closes #10420

first-part-of: opw-659772
2016-01-12 15:14:07 +01:00
qsm-odoo cb79297a41 [FIX] web_editor: links edition (only website links)
Commit f3f7bd9f24 adds an improvement which allows the user to edit links in
an easier way. The problem is that it also allowed to edit... the edit
buttons (example: the discard button).

This commit moves the mentionned commit code below the code that checks
if the target can be edited or not.
2016-01-12 15:03:23 +01:00
Christophe Matthieu 0b2728d8b2 [FIX] web_editor: error when long delete keypress in mass_mailing html
issue: event does not a global var in firefox, and event is already prevented
2016-01-11 15:23:36 +01:00
Christophe Matthieu 50057c08aa [FIX] web_editor: clean pasted dom and avoid crappy dom
Chrome on windows add few comment tags and insert unwanted span.
2016-01-11 15:20:49 +01:00
Christophe Matthieu 7fcce928f3 [FIX] web_editor: allow custom template for html_frame field 2016-01-07 09:52:56 +01:00
Odoo Translation Bot 4dac9f2b73 [I18N] Update translation terms from Transifex 2016-01-03 01:24:45 +01:00
Martin Trigaux ddeb90d46e [I18N] Update translation terms from Transifex 2015-12-29 17:40:57 +01:00
Nicolas Lempereur 4bdba4af85 [FIX] web_editor: inline editor should not devore focus
The FieldTextHtmlSimple widget would focus on itself when changing its
value not by direct user interaction. But if this change was coming
from next/previous record, or an onchange that was breaking the
"autofocus" heuristic for field in Odoo.

With this commit:

- the autofocus heuristic is kept,

- if focused, selection is set at the end if it is possible on the
  browser, else (old internet explorer and not visible field) the
  selection is at the beginning.

opw-660486
2015-12-28 17:08:55 +01:00
Odoo Translation Bot e6a92e523f [I18N] Update translation terms from Transifex 2015-12-27 01:25:25 +01:00
Martin Trigaux ef762f4335 [FIX] wrongly translated planners
breaking the rendering
2015-12-24 16:09:06 +01:00
Martin Trigaux 4be1a8cc7d [I18N] Update French translation terms from Transifex
Some planners were incorrectly translated, breaking at rendering
Fixes #10190
2015-12-24 10:42:03 +01:00
Odoo Translation Bot 9e211ef127 [I18N] Update translation terms from Transifex 2015-12-20 01:26:02 +01:00
Christophe Matthieu 16a3bc7f22 [FIX] web_editor: unbind summernote mousedown on detach/stop editor 2015-12-15 10:47:50 +01:00
Christophe Matthieu f3f7bd9f24 [FIX] web_editor: help the user to edit the link
User can't edit the first and last chars of a link (same issue for a lot of editors), and users don't want to click on edit link button in the editor bar.
When the user click (not if the user use arrow) on a link the link is activate with a content editable true and can edit the first and last chars.

opw: 654280
2015-12-15 10:47:50 +01:00
Odoo Translation Bot 5254e31a46 [I18N] Update translation terms from Transifex 2015-12-13 01:27:04 +01:00
Nicolas Lempereur 893fbc0553 [FIX] web_editor: keep inline editor line spacing
opw-657955
2015-12-10 15:53:07 +01:00
Christophe Matthieu 3c64ee45a1 [FIX] web_editor: enter in a p tag empty (when user change with code view) can be raise an exception 2015-12-10 15:17:44 +01:00
Christophe Matthieu 6cc99df83e [FIX] web_editor: error when paste without any content in clipboard 2015-12-10 15:17:44 +01:00
Christophe Matthieu b72a3b67f8 [FIX] web_editor: remove exceed span on paste html content 2015-12-10 15:17:44 +01:00
Christophe Matthieu 2e074cb305 [FIX] web_editor: don't display translation modal for attribute on tag who have content 2015-12-10 09:10:29 +01:00
Christophe Matthieu 5257721bef [FIX] web_editor: translation feature for all string fields on website
* add the branding in translation mode
* change javascript to add the lang in the context (automatically removed in the rte => allow to create record and edit when use an other default language of en_US)
* avoid double saved
2015-12-10 09:10:29 +01:00
Christophe Matthieu 512ae81920 [FIX] web_editor: add code view in debug mode to allow jinja insertion 2015-12-08 09:50:11 +01:00
Odoo Translation Bot 8e7417ffa6 [I18N] Update translation terms from Transifex 2015-12-06 01:28:23 +01:00
Martin Trigaux 463044a8db [I18N] Update translation terms from Transifex
Manual sync to fix errors due to bad translation of <!DOCTYPE html>
making it impossible to use Odoo
2015-12-04 09:08:30 +01:00
Christophe Matthieu d1af67bf28 [FIX] web_editor: img classname is removed when change the url 2015-12-03 13:26:36 +01:00
Nicolas Martinelli 1e9ce28f7b [FIX] website, web_editor: open in new window
The field `isNewWindow` is used to open a link in a new tab. In this
case, the field newWindow was used, and therefore the property was not
applied.

opw-657510
2015-12-02 10:00:16 +01:00
Nicolas Lempereur 919678bed3 [FIX] web_editor: fallback to plain text when pasting
Depending of the location where the "Copying" happened, only text/plain
content could be available from the clipboard component.

So if no text/html was retrieved, we should fall back to plain text
pasting.

closes #9787
opw-657137
2015-11-30 10:35:35 +01:00
Nicolas Lempereur 7ddfd6285c [FIX] web_editor: update value at inline html save
In the base summernote library, each event modifying the editable area
DOM trigger an 'onChange' event which update the textarea associated
with the editor.

Some widget (ImageDialog) have been entirely rewritten for Odoo without
copying this behaviour. Hence for those components, if they were the
last to be used and only in the instance of inline backend editor
(FieldTextHtmlSimple widget), before saving updating the widget value by
the current editor value is required.

closes #9784
opw-654240
2015-11-27 12:40:55 +01:00
Martin Trigaux e8e5405d0c [I18N] Update French translation terms from Transifex
Fixes #9712
2015-11-25 17:22:26 +01:00
Odoo Translation Bot 3180f80bf9 [I18N] Update translation terms from Transifex 2015-11-22 01:30:36 +01:00
Nicolas Lempereur 21a8c76b6a [FIX] web_editor: set csrf_token in editor iframe
Some feature of the iframe embedded editor may require csrf token
present, thus it has been added in the same way that cea29e0c0 did.

The web editor iframe template is also used to display the value without
editing it and in this instance having the csrf has no meaning.

opw-656685
2015-11-18 14:31:55 +01:00
Nicolas Lempereur b820faed66 [FIX] web_editor: don't think HTML comment are visible
Summernote sometimes doesn't take into account HTML comment could be
embedded in the edited content, this can lead to issue since this
situation can happen in Odoo.

This commit patch the "isVisiblePoint" summernote's function to take
care of this issue.

opw-656332
2015-11-16 16:02:45 +01:00
Odoo Translation Bot 3d7ae73305 [I18N] Update translation terms from Transifex 2015-11-15 01:35:06 +01:00
Odoo Translation Bot 14799a9006 [I18N] Update translation terms from Transifex 2015-11-08 01:32:40 +01:00
Christophe Matthieu 1439b9744d [FIX] web_editor: move bootstrap default css value from editor.css to inline.css to don't overwrite backend css values and have css style in html field (iframe) 2015-11-05 12:00:04 +01:00
Christophe Matthieu 7a704aaba6 [FIX] web_editor: don't change the image style when change src 2015-11-04 16:10:44 +01:00
Christophe Matthieu f3ade95862 [FIX] web_editor: use _.bind for rte handler to use 'this' and avoid errors 2015-11-04 16:10:44 +01:00
Christophe Matthieu c7ff7cb491 [FIX] web_editor: remove editor bar flickering when edit a qweb field
Issue: When the user click on a field (like monetary, text...) the editor bar appear and disappear. The undo buton is hidden for this fields.
2015-11-04 16:10:44 +01:00
Christophe Matthieu 7228b29cb2 [FIX] web_editor: edition of monetary value
Issue: if the currency is before the value and we try to add a number at the begin of the value, the number is not saved (because the browser insert the number before the span).
Add a onEnableEditableArea in the rte to change the contenteditable value and the default behavior.
2015-11-04 16:10:44 +01:00
Christophe Matthieu 554bfa7d10 [FIX] web_editor: use history to enable or disable save button 2015-11-04 16:10:44 +01:00
Christophe Matthieu bdb787a18d [FIX] web_editor: value changes of many2one in the website enable the save button 2015-11-04 16:10:44 +01:00
Christophe Matthieu 4043909625 [FIX] web_editor: edit event badge on the website.
Issue: edit the badge on the event list in the website, the many2one widget doesn't work because the request domain is false.
2015-11-04 16:10:43 +01:00
Christophe Matthieu 4f72ba397a [FIX] web_editor: disable save button by default to avoid flickering 2015-11-04 16:10:43 +01:00
Nicolas Lempereur f5acea7f9c [FIX] web_editor: escape for xml in translation as done in ir.ui.view
Currently server side there is two differents source for html content
displayed on a qweb rendered page:

1) ir.ui.view arch value

are stored as xml and are unescaped before being displayed, so we have
to escape the text nodes before saving.

e.g:

*   should be stored as   since it is an HTML entity but
  not a defined XML entity,
* & should be stored as & since when unescaping it, it
  would become & which is invalid in HTML,
* < should be stored as < since when unescaping it, it would
  become `<` so HTML text node could become HTML element node.

The tag themselves can also be escaped but it often has the same result:
&lt;em&;gt;blah&lt;/em&gt; is the same as <em>blah</em> when unescaping
is applied to both.

But it is required is some instance, e.g <!DOCTYPE html> unescaped would
be invalid xml.

2) openerp.fields.Html value

are stored directly in HTML formatting and should, conversely, not be
escaped before being stored.

Thus when saving an ir.ui.view part modified thanks to the website
editor, an escaping of text node content is carried out to take this
into account, but the same was currently not done for the v9.0 new
translation system.

This commit apply the same logic when saving ir.ui.view as when saving
ir.translation values.
2015-11-03 13:35:19 +01:00
qsm-odoo c52e814d24 [FIX] web_editor: snippet options menu layout
Layout of snippet options buttons was wrong (spaces / linebreak / ...)
2015-11-02 16:02:10 +01:00
Odoo Translation Bot e3287faee6 [I18N] Update translation terms from Transifex 2015-11-01 01:32:05 +01:00
Christophe Matthieu 5b5f89e2be [FIX] web_editor: select default text of the snippet when click on the text 2015-10-29 15:31:42 +01:00