Commit Graph
136 Commits
Author SHA1 Message Date
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
Christophe Matthieu c8e7e1dc5b [FIX] web_editor: don't remove char after a selection when click on delete
Issue: click on an image or create a text selection and click on delete, the char after the selection is removed
2015-10-29 15:31:42 +01:00
Christophe Matthieu dbce114ba6 [FIX] web_editor: remove useless duplicated code 2015-10-29 15:31:42 +01:00
Nicolas Lempereur 1da79c54a1 [FIX] web{site,_editor}: gallery upload image
* when getting the src of an uploaded attachment we have to use src which
  is by default url,

* in a MediaDialog the pager is shared between the document and image
  dialog, but when changing page, it was done for both (even if not
  displayed),

* select the image after uploading it in the ImageDialog.

closes #9284
opw-653061
opw-653167
2015-10-29 13:25:27 +01:00
Christophe Matthieu a71caede2d [FIX] web_editor: keep the javascript reference to globalSelector object for odoo javascript module
related to #9284
opw-653061
opw-653167
2015-10-29 13:25:26 +01:00
qsm-odoo b3590c7104 [FIX] website, web_editor: missing returns in theme JS 2015-10-27 16:13:44 +01:00
qsm-odoo 652956d192 [FIX] web_editor: missing !important on mt,mb,ml,mr rules 2015-10-27 16:13:15 +01:00
Nicolas Lempereur cb23864262 [FIX] web_editor: ie issue with range within undisplayed
In IE11, when adding a range to a selection that can fail if this range
is not displayed (display non on itself or an ancestor) or is not already
inserted in the dom.

e.g: IE fails in the following situation: http://jsfiddle.net/7cmf2tt9/7/

The feature causing this situation is minimal : it only set the cursor
at the end of a FieldTextHtmlSimple widget (the default widget for
fields.Html). This commit thus only ignore that error.

note: this is not an issue on IE Edge.

closes #9216
opw-652347
2015-10-26 15:25:30 +01:00
Christophe Matthieu 148703370a [FIX] web_editor: visible char have the same feature that delete keydown 2015-10-26 11:43:37 +01:00
Christophe Matthieu 971437e8b0 [FIX] web_editor: remove td content on keydown delete with multi td selected 2015-10-26 11:43:37 +01:00
Christophe Matthieu 5451cf518f [FIX] web_editor: don't merge tr when keydown delete on the last row table cell 2015-10-26 11:43:37 +01:00
Christophe Matthieu ed9a410c11 [FIX] web_editor: add image display in width:100% by default 2015-10-26 11:43:37 +01:00
Christophe Matthieu 3959afc5b5 [FIX] web_editor: backspace and enter in table cell don't break or remove td (remove tr but not td alone) 2015-10-26 11:43:36 +01:00
Christophe Matthieu 0be54422c0 [FIX] web_editor: use arrow up/down to switch table cell 2015-10-26 11:43:36 +01:00
Christophe Matthieu a291adb314 [FIX] web_editor: copy-paste content keep architecture
The paste don't keep the architecture, usability team want to past the architecture but remove extra style and wrong node like span.
2015-10-26 11:43:36 +01:00
Christophe Matthieu d7b5eeabeb [IMP] web_editor: move picture options from snippet to summernote bar
Difficulty for the user to understand how to change the images.
Some options summernote being in the bar and the other in the snippets editor.
Need to merge this options.
2015-10-26 11:43:36 +01:00
Christophe Matthieu 0505c45164 [FIX] web_editor: don't display the summernote black picture overlay
Issue: the overlay is confusing for user because summernote the size change is not active (to have a responsive design)
2015-10-26 11:43:36 +01:00
Christophe Matthieu 80a396b9fd [FIX] web_editor: remove useless line 2015-10-26 11:43:36 +01:00
Odoo Translation Bot 265b789e38 [I18N] Update translation terms from Transifex 2015-10-25 01:34:24 +02:00
Odoo Translation Bot 7592d85b1f [I18N] Update translation terms from Transifex 2015-10-18 01:35:07 +02:00
Nicolas Martinelli d1e6ba6d9e [FIX] web_editor: forcedReload of the page
On Firefox, the website page is not completely reloaded after saving or
cancelling. Because of this behavior, the Edit button is kept disabled,
forcing the user to completely refresh the page in order to activate the
Edit button.
2015-10-14 11:24:11 +02:00
Nicolas Martinelli 7661a7402b [FIX] web_editor: trigger mouseup at start
When we initialize the web editor, the font size in the toolbar is
initialized to NaN.

What is done:
- Initialize the Summernote editor in initialize_content
- Render the content of the node in render_value
- Append the node to the DOM

Since the Summernote editor is initialized in initialize_content, the
node is still hidden. Since the node is hidden, Summernote won't be able
to determine the style info of the text (see method fromNode from
Style.js). Indeed, when jQueryCss is called, $node.is(':hidden') is true
which will lead to styleInfo['font-size'] = NaN.

To avoid patching Summernote, we take advantage of an existing trigger
which reloads the button content upon mouseup. This is also safer than
initializing Summernote after appending the node to the DOM.

opw-652041
2015-10-13 17:58:33 +02:00
Odoo Translation Bot ff9b997736 [I18N] Update translation terms from Transifex 2015-10-11 01:33:54 +02:00
Nicolas Lempereur 8acd1c40fe [FIX] web_editor: alt+tab in table and tab on collapse
When using the tab key on non text node range, it could fail in some
given case.

Also when removing the last element of the table row, a correction was done in
d33086c03f but if there was no element before the table (eg. the editor
is empty) an error could occur.
2015-10-09 08:43:49 +02:00
Nicolas Lempereur 8c3b4b80c6 [FIX] web_editor: null range and remember_selection
Tests for null range were not done in #8845, so in given case (where the
focus is not in the editor) we could get an issue.

The code for remembering the selection when clicking the editor
was made useful in d33086c03f, but there was an edge case when
the editor itself was in a modal: then the selection would be lost.

This commit change the code as following:

1) restore the selected range if:

- the current selected range is not in the editable of the active editor
- there is a corresponding saved selected range or we are in an embeded
  editor (and not in air mode as when editing the website)

2) save the selected range if:

- we don't restore the selection,
- the current selected range is in the active editor editable area
2015-10-09 08:43:43 +02:00
Markus Mattes e80e1e1c28 [FIX] web_editor: range is null if focus outside of editor
The range can be null if the focus is not in the editor at serveral
places.

closes #8845
2015-10-09 08:43:37 +02:00
Markus Mattes 0b18941e33 [IMP] web_editor: rename range variable rng to r
Put all rng to r to have the same concept in the whole file as well as
in the summernote codebase.

closes #8845
2015-10-09 08:43:31 +02:00
Odoo Translation Bot 8c4f17fd8b [I18N] Update translation terms from Transifex 2015-10-08 10:24:11 +02:00