| Age | Commit message (Collapse) | Author |
|
This commit reverts the saas-12.2 editor by putting back the editor
of Odoo 12.
The saas-12.2 editor was an intermediate work between the previous
editor of Odoo 12 and the new one slated for Odoo 13. It was unstable
but it was supposed to be replaced by the new editor of version 13.
However, since the new editor has been postponed to Odoo 14, the
saas-12.2 one would have been staying in Odoo 13, which would have
been a nightmare to maintain. To avoid this outcome, we chose to
put back the 12.0 editor in its place.
This has the particular advantage that Odoo 13 will share the same
bugfixes as Odoo 12 and 11 as they all run under the same core
editor, while the saas-12.2 one would have been an entirely
different beast to maintain.
This is a partial revert of f2969923.
Part of PR 35677.
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
|
|
|
|
|
|
Do not remove block in _removeNextEmptyUnbreakable.
Before this commit, when you tried to remove insert a character in
a td, with an empty td after the first one. The function
_removeNextEmptyUnbreakable removed the empty td. It was for
example breaking snippet in the website and mass_mailing.
closes odoo/odoo#32096
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
|
|
|
|
|
|
For the ours need, we can not let the contentEditable behavior. Indeed,
this one does not have the same behavior according to the browser. The
DOM node could be erase, merge, cut, in them according to the keyboard
interactions. The problem is that if we have to manage these behaviors,
we have to manage everything. It was already the case in the previous
version, however before we created an editor by zone and by a hack we
mix the history.
In the case of the virtual keyboard of some OS / Phone, the events are
different and the autocompletion does not update (bug that prevents
modification interactions with javascript). In order to solve these
problems, we use another event for the insertion of the characters.
However, we must also force the update of the corrector by forcing a blur
and a focus.
The current version is a temporary version. We are currently working on a
version that uses a virtual dom and does not need to do excessive prevent
default.
|
|
|
|
closes odoo/odoo#35119
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
|
|
closes odoo/odoo#35059
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
|
|
Under certain unknown conditions, the range cannot be applied and
triggered an error. In order to allow the user to keep editing, we need
to prevent the dialog from showing, hence the use of `console.error`.
If this error appears, the carret is moved to the beginning of the focused
node.
If this error appears, then bullet can generate an error (I managed to
have the bug once or simulate it by manually breaking the dom and range)
We suspect a wrong snippet custom javascript code.
see: https://github.com/odoo/odoo/pull/34188
closes odoo/odoo#34871
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
|
|
Some browser can send text content without tag when past html. To avoid
this error we wrap the content before parse it with jQuery.
|
|
|
|
closes odoo/odoo#34907
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
|
|
This fixes a bug in Website, that can be reproduced like so:
- insert a snippet
- insert a char in it
- 2x CTRL-Z
The second CTRL-Z didn't do anything because Summernote moved the range
to the header, which is not editable. This fix moves the range to the
first editable element in the editor in these cases, thereby keeping the
focus in an editable area, and ensuring that hotkeys still function.
The history feature being non-tested as of this version, no test could
be added for this fix.
closes odoo/odoo#34834
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
|
|
Fix a bug that can be reproduced like so:
- Insert list
- Type char
- ENTER
- TAB
- Type char
The character gets inserted _after_ the `br` instead of replacing it.
closes odoo/odoo#34805
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
|
|
|
|
Under certain unknown conditions, the range cannot be applied and
triggered an error. In order to allow the user to keep editing, we need
to prevent the dialog from showing, hence the use of `console.error`.
If this error appears, the carret is moved to the beginning of the focused
node.
If this error appears, then bullet can generate an error (I managed to
have the bug once or simulate it by manually breaking the dom and range)
closes odoo/odoo#34188
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
|
|
|
|
closes odoo/odoo#33859
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
|
|
Under certain unknown conditions, the range cannot be applied and
triggered an error. In order to allow the user to keep editing, we need
to prevent the dialog from showing, hence the use of `console.error`.
If this error appears, the carret is moved to the beginning of the focused
node.
If this error appears, then bullet can generate an error (I managed to
have the bug once or simulate it by manually breaking the dom and range)
closes odoo/odoo#34284
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
|
|
|
|
This commit removes the field `datas_fname` from `ir.attachment` as
it was unnecessary and most of the time the duplicate of `name` or
`url`.
Task #1909865
closes odoo/odoo#32976
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
|
|
* = website, website_blog
The goal is to give the user an opportunity to optimize his images before using
them.
For this we introduce a preview/configuration dialog after every image upload,
where appropriate default values are filled for the quality and resolution,
based on where the image is going to be used. Since this is not going to be
perfect all the time, we still allow the user to configure them, and we display
a preview to ease this process.
Indeed it is important for SEO and for usability in general that the images are
as light as possible in size.
Technically the original image is uploaded and saved first, and then it can be
optimized. This way the upload only happens once, and the preview can be
computed from the already saved image.
task-1930726
PR: #31208
|
|
* = web_unsplash, website
Remove iframe upload and replace it with a proper RPC. The route is now only
accepting one file at a time, which makes it easier to maintain, and allows to
process the first file as soon as it is ready, instead of having to wait on
everything.
Also fix a bug where a document could not be uploaded because it would try to
parse it as an image.
Remove filter after search result from the JS and add the corresponding
conditions in the domain to avoid processing and returning unnecessary records.
If multiple attachments exist with the same URL, now display them all to avoid
confusion.
Compute all the necessary values in the python model instead of in the JS.
Allow SVG in the widget (the server already accepted them before).
Disable multiple image upload when not in multiImages mode.
task-1930726
PR: #31208
|
|
|
|
The reason this widget was moved is that the next improvement
([IMP] base: Configure document layout) defines a new field (FieldColor)
which needs to call the colorpicker dialog inside of the base module.
This couldn't be done while the dialog was located in the wysiwyg assets.
|
|
|
|
Issue: Can not drop an image into the modal's editor because the server
request a positional res_id arguments.
closes odoo/odoo#33232
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
|
|
Issue: can't drop a image if the editor is not focused or if the editor is
empty
|
|
|
|
The link and media tooltips were not taking Summernote's `tooltip`
option into account. That option ensures that tooltips are disabled if
the option is off (which is for instance the case on mobile).
This fix ensures that these tooltips are disabled when the option is
set to `false`.
It also disables tooltips in the keyboard tests. They are not relevant
to the keyboard tests and occasionally caused the DOM to not be properly
cleaned after the tests were run (most likely due to their 2000ms
`setTimeout`).
|
|
closes odoo/odoo#33327
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
|
|
|
|
Converting a checklist into an ordered list didn't remove the
o_checklist class. In consequence, converting a checklist to an
ordered list and then to an unordered list failed as the unordered list
with the o_checklist class is effectively a checklist. This fixes that
bug.
closes odoo/odoo#31432
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
|
|
When trying to remove a format (bold, italic, underline), collapsed at
the start of the DOM, an error occurred because of a wrong range.
Ex.: `<p><b>Odoo</b></p>` -> when clicking before the word "Odoo", then
clicking the "bold" button, we expect to be able to start writing in
plain (not bold) text (for that, the DOM has to look like this:
`<p>\u200B<b>Odoo</b></p>`). We now have that proper behavior without
the accompanying error message and loss of selection.
Task ID: 1978515
closes odoo/odoo#33038
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
|
|
The web_editor had two different events `save` and `saved` doing more or less
the same thing but with a different signature.
In this commit we keep only the `save` event and adapt the code accordingly.
PR: #33509
|
|
* = partner_autocomplete, point_of_sale, web_editor,
website_forum, website_slides
This can be used for example to preview an image from a file input field.
It can also be used to send the base64 content of the input by RPC instead of
having to rely on form submit as POST with multipart/form-data.
Technically wrap FileReader.readAsDataURL in a Promise.
This will also be used in task-1930726
PR: #33508
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
|
|
|
|
Ctrl-A on an empty editable threw an error. This fixes it.
closes odoo/odoo#32301
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
|
|
Media dialog was trying to reach the current media's parent node, which
was not possible as it was cloned on instantiation.
To fix this, the `showImageDialog` now passes the `onlyImages` option
upon instantiation, checking the parent's data. It also passes the
media's parent if said parent is a video. This way, neither of these two
things need to be done in media dialog.
closes odoo/odoo#31634
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
|
|
Issue detected with tests in the branch that replace deferred by native
Promise. Need to add isMedia to detect if the target is already a media
when focus the editor.
closes odoo/odoo#31632
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
|
|
The "comparisons" website snippet uses a list group with the class set
on a UL. In consequence, the web editor considers it as a regular list
and may try to outdent it, which is not the expected behavior with a
list group. This fix ensures that ULs with the `list-group` class cannot
be in/outdented.
closes odoo/odoo#32709
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
|
|
A list item with text can be written as <li>text</li> or as
<li><p>text</p></li>. Issues occurred when both syntaxes need to be
merged together. Namely, the <p>text</p> was being appended to the other
list item, thereby creating a visible new line.
|
|
This addresses various bugs that occured with nested lists - including
lists that are nested with a UL within a LI (as opposed to a UL directly
within another UL).
|
|
The `o_checklist` class was preserved when converting a checklist to an
ordered list.
|
|
This resolves an issue with pasting in text only mode (no HTML): the
list of nodes to paste was being modified with the `_mergeAdjacentULs`
method which is irrelevant to text nodes. Because of that, a corrupted
list of nodes was inserted into the DOM.
opw-1962743
closes odoo/odoo#32454
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
|
|
On ENTER in a checklist item, a new checklist item is created. The new
one should never be checked. This ensures that ENTER in a checked
checklist item never creates a checked checklist item but instead cleans
the class.
closes odoo/odoo#32684
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
|
|
Deleting all the contents of a block node replaced it with a blank
paragraph node. To restore v12 behavior, it should only do that when
pressing backspace in an already empty block, which is now what it does.
|
|
When in the media modal, if one selected no media but clicked the "ADD"
button it resulted in an error and a failed RPC instead of simply
closing the modal without doing anything. v12 behavior is now restored.
closes odoo/odoo#31308
|