In f29699231 (12.3) part of the code of the editor `Link Dialog` was
moved to a web_editor/static/src/js/wysiwyg/plugin/link.js file/class.
In 13.0 the 12.3 editor changes were mostly reverted in 35b61822a but
part of the change of `Link Dialog` that was moved to another file/class
was not moved back, thus: it does not work as expected => eg. if we add
a link over an image, the image is removed.
In this commit we get back the missing part as it was in 12.0 version.
opw-2086444
closes#39858closesodoo/odoo#39881
X-original-commit: 9996d04fd2ec8329cd5561a4bc94ccc35d529d93
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Indeed, the carousel-item elements are linked to other DOM (like
indicators) and removing one would imply enabling another one... all of
this is handled by the carousel "remove slide" option.
Note: the UI to add and remove slides will be refactored in a future
update of this future saas anyway.
Part of https://github.com/odoo/odoo/pull/38997
task-2090180
closesodoo/odoo#38997
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previously, the carousel and quotes carousel snippets were the only ones
that were not enclosed in section blocks. This had a number of
undesirable side effects, such as editing the anchor on the carousel
breaking the carousel functionality, and the inability to separately
choose a background for the carousel itself and individual slides.
I also used this opportunity to move controls relative to the entire
carousel onto the carousel itself rather than the individual slides. The
sizing_y (vertical padding) will however keep targeting individual
slides, as the carousel uses the height of its tallest slide, and also
because padding on the carousel will not get covered by slide
backgrounds and saty blank, which is unwanted.
Lastly, most of the snippet options for the carousel were rewritten, as
they were quite broken. There was some compatibility code for saas-3
left, some useless events were bound to the controls, even though they
were already handled through event-delegation at the document level.
Finally, most of the edition features were broken on duplicated
carousels since the onClone method wasn't reassigning most of the things
it needed to.
Part of https://github.com/odoo/odoo/pull/38997
task-2090180
Previously, when trying to enable a snippet overlay & options, the
'toggleFocus' method was called. Now the logic is separated for overlay
and options toggling so that we stop calling onFocus/onBlur method of
parent options when only a child snippet is being enabled.
For example, for a section with two columns inside, we had this behavior
before this commit:
1) Click on first column
2) -> the section's onFocus is called
3) -> the first column's onFocus is called
4) Click on second column
5) -> the section's onBlur is called
6) -> the first column's onBlur is called
7) -> the section's onFocus iscalled
8) -> the second column's onFocus is called
9) Click on another snippet
10) -> the section's onBlur is called
11) -> the second column's onBlur is called
Now, steps 5 and 7 are gone.
Related to https://github.com/odoo/odoo/pull/38997
Related to task-2090180
It was technically possible that two editors for the same element are
created in the same JS stack execution... and since 13.0 and the
use of native promises, it happens everytime a block is dropped in the
page.
Note: this commit fixes the problem with minimal code but the logic
should be improved in master.
closesodoo/odoo#39668
X-original-commit: 497bc892697ba1b5d2e7140f07970e468b7c90a7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
There recently were some fixes to the system of onFocus/onBlur with the
new left panel of the 13.0 editor and one still remained: the onBlur
method was most of the time called only on the main snippet options and
not the child ones. Now it works as it should, even if the system logic
has to be improved to be more robust.
One difference remains with 12.0 but this can be considered as a change
for the 13.0 version: the parent options onFocus/onBlur are called
before the child options while it was the opposite before.
closesodoo/odoo#39659
X-original-commit: 502db91c0b38567dede5d683370fef82890a99f0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In the editor, the snippets from uninstalled module are shown with the
possibility to install the module to get snippet.
Before this commit:
When clicking on it, it will redirect to the module page, in the backend from
where you can install the module.
Now:
A popup will be shown to save current changes and install the module.
The installation will be done without changing page, in the editor. Once done,
the page will reload in editor enabled mode.
task-2089285
closesodoo/odoo#39138
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* web_editor
Commit https://github.com/odoo/odoo/commit/7e2b0ebe7996c9fa35f75949b7fc8cd5a58d7c36
broke the website JS loading as it added a dependency to a lazy loaded
JS module which was not even always lazy loaded.
A test so that this does not happens anymore will be made in another
commit.
Related to task-2092386
closesodoo/odoo#39391
X-original-commit: 5ac269d722f9ff8c206215dd1c07b8544cfd5382
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: website
Inherited colorpicker were not used due to the context missing the
website_id and the method call being used instead of call_kw.
task-2092386
closesodoo/odoo#39357
X-original-commit: 7e2b0ebe7996c9fa35f75949b7fc8cd5a58d7c36
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, when clicking inside a snippet which is already
enabled, it was disabled then re-enabled... which had the side effect
of calling onBlur/onFocus methods. This can be a problem with some
onFocus/onBlur implementation relying on the old behavior.
Note: this commit restores the exact same behavior as before. If an
internal snippet of the active one is clicked, then we still call the
onBlur then onFocus for the old active one (the parent) as the actual
enabled snippet changed (even if it is simply a child snippet).
closesodoo/odoo#39261
X-original-commit: 076992bdf099f3a645c9a1ef6df2cdcccbf1c2b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The issue here is, for modal dialogs (eg newsletter popup), when we close
the dialog, the modal is destroyed and so after the delayed execution due to
timeout, the dialog will not be available and it will generate the issue.
removed delayed execution for the traceback, which is relevant to
the modal dialogs.
task-2075232
closesodoo/odoo#38914
X-original-commit: 93deb25f873f5c4aba239b050e543b23685f5ba0
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
If two snippet options are declared using the same data-js="..." and
that they end up targeting the same snippet in some cases, only one of
those two snippet options was shown.
This case occurred in a theme (avantgarde) for the map snippet.
closesodoo/odoo#38551
X-original-commit: 2072bfd9981eebc8c8d8d03d2f44f0e4a2489692
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When an option group is opened, all the other opened option groups were
closed. The problem is that an option group may contain other option
groups, so when trying to open a sub-group the main parent group was
closed first.
Note: this case only occurs for one option in themes for now.
Part of https://github.com/odoo/odoo/pull/38495
task-2083198
X-original-commit: 102151da12c28746bf16dd7f009c1ca3933d06ba
* website_form
To support old theme options, a hack had to be made to allow access to
left panel UI. This will be improved in master.
Part of https://github.com/odoo/odoo/pull/38495
task-2083198
X-original-commit: 5ac6a7a5dbd2af1190d0d027d0239dd1cfc257b0
In the backend, when a mailing popup was being edited, it was not
centered in the edition area (and went under the editor UI) and was not
using the correct style.
task-2083465
closesodoo/odoo#38449
X-original-commit: 6ccf3b618b4b0774deccb4f75bf33f3ea4dc8b75
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* web_editor
The purpose is to force our dropdown style in our UI so that themes do
not break it anymore (same way all the other elements are forced (cards,
headings, etc)).
task-2059538
closesodoo/odoo#38321
X-original-commit: 4ef0eac5ba134f462f72f3e9c60e5c9fc95f3a8c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
When on Firefox, with sale_product_matrix and sale_quotation_builder installed,
clicking anywhere on the matrix (after opening it) raises a traceback.
It is due to the fact that isBody tries to access anchorNode.nodeName, which
is unexpectedly unaccessible as anchorNode is {Reserved}.
Due to the absence of clear documentation of the possible reasons of this problem,
it was decided to reuse the existing fallback on 'return null', which avoids the
traceback.
closesodoo/odoo#38277
X-original-commit: 70c484e72bffc9ab759df3c376ad9157acec3965
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Before this commit, we hide the 'relative warning' when you don't start
you url with the current location. Now we show it only when you start
your url with the current location.
Before this commit, when you create a new link, the warning was shown
until you type a first char in the input to trigger the input change.
+ some small design theme (label font weight, muted color, ...)
closesodoo/odoo#38224
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, the feature for selecting a link and then clicking
on the "link" button or hitting the CTRL+K was partially broken.
The method "commonAncestor" was not returing the expected value.
This commit add a check in the method "showLinkDialog" to prevent
this error to happen.
closesodoo/odoo#38103
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, the selection of a pictogram in the media
dialog of the website builder and the mass_mailing was not
working.
The pictogram already has the class "o_we_attachment_selected"
upon selection. This commit allow the class "font-icons-icon"
to be included in an existing selector.
closesodoo/odoo#38085
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
A common software development pattern is to have the same data replicated across different environments, such as production and staging. This happens i.e. in Odoo.sh.
Let's assume your production instance is in ``https://www.example.com`` and your staging one is in ``https://staging.example.com``. Then:
1. A user in production modifies a website menu and makes it link to ``https://www.example.com/my-cool-page``.
1. A new change lands in staging, with a fresh copy of the production database.
1. The user goes to ``https://staging.example.com`` and navigates through the menus to validate the changes.
1. While navigating, he clicks in the website menu that links to ``https://www.example.com/my-cool-page``.
1. He makes some changes. **He didn't realize he was modifying production**.
To avoid this kind of problems, if a user pastes a link that starts with the current domain, it gets removed.
closesodoo/odoo#35715
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
In the case of an <ol> in an <ol> we would have something like:
1.
2. 1.
2.
3.
With this changeset we get back what we had in 12.0:
1.
1.
2.
3.
which is not perfect but the same as 12.0 version.
opw-2073751
closes#37163closesodoo/odoo#37706
X-original-commit: 479db16fdb86c6925a7f94a24f2821f3a5c047b5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, when a hierarchy of options was displayed in the
editor left panel and that the user click on any one, the related
snippet was enabled making all the children options disappear (like
the "go to parent" button in the old UI). Now we only keep this behavior
when we click on the title of the snippet's options.
closesodoo/odoo#37538
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
If we have a content such as:
`aaa <B>bbb</B> ccc`
and you eg. change size of `a bbb c`, the c gets bold because of an
issue in the merging after style is applied.
reason: we check that the style was same as previous nodes, but because
walkpoints text[a]->B->text[bbb]->B->text[c] is expurged of duplicates
it becomes text[a]->B->text[bbb]->text[c] so we erroneoulsy think that
the node before text[c] is text[bbb] (instead of B tag)
note: 12.5 forward-port (skipping [12.3,12.4]) of 11.0 #37254 (also
contain #37345)
opw-2071930
closes#37295
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, the web_editor toolbar wasn't horizontally scrollable
and part ot the items were not displayed.
To fix this, we have to revert back the initial position on some elements.
closesodoo/odoo#37076
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit, the web_editor toolbar wasn't horizontally scrollable
and part ot the items were out of the screen area.
To fix this, we have to revert back the initial position on some elements.
Before this commit, web_editor dialog was opened inside an iframe and
not on the window.top. So dialogs didn't take all screen area.
To fix this, we open dialogs in full screen mode but we also put the
web editor in full screen to increase the size of the iframe.
Note that the initial state of the web editor (full screen or not) is
preserved when you close the modal.
We also add some fixes to make the "web_editor media dialog" responsive.
* website
Following the new editor merge at https://github.com/odoo/odoo/pull/29775
(which was finally partially reverted for 13.0), the crop dialog was not
working anymore on sub-sequent crop. This was due to 2 things:
1) Re-cropping an image that was just cropped now
The original source of the recently cropped image is saved as temporary
jQuery data on the image element. Unfortunately, for some strange
reason, that image is cloned before any edition and thus lose that data.
This commit fixes the problem by cloning the data too... supposing the
orignal clone is there for a reason.
2) Re-cropping an image that was saved before
This did not work anymore simply because... the cropped images were not
saved in database anymore but saved as base64 data in the view... For
some reason, the cropped images to save were searched in the original
DOM instead of the edited DOM...
Also fixing the random use of a mutex.
Discovered while working on task-2059480
closesodoo/odoo#36878
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In the inline editor (eg. task description), the inline bar of an
element (eg. link or image) has higher bootstrap z-index than modal that
can be opened via this bar (eg. croping window for an image, link
editing for a link).
So the bar would be over the modal opened by the bar which is
unexpected.
This was solved in 12.3 f2969923 by setting the inline bar to z-index of
$o-wysiwyg-zindex (defined to 1000).
This is the equivalent of 12.0 #37119 fix.
opw-2073761
closes#37125
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In multi-level checkboxes, if there is only one checkbox per level, the
expected behavior is that all checkbox will be checked if one of them is
checked. This was not the case before this commit.
When setting align right on a picture, the popover of the picture was
partially overflowing the editable zone, rendering it useless.
This commit mimicks the behavior of Odoo 12 by disabling the fact
that the popover follows the picture.
The style for custom color in the editor color menu from 12.0 was
dropped in 12.3 (correctly because of the changed structure) but in 12.5
the HTML structure changed again and the CSS is once again necessary.
opw-2073734
closes#37090
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When clicking on edit in a form with a wysiwig widget inside, that widget would gain focus. It is not the expected behaviour (focusing the first field) and is really an issue on mobile, where the screen would scroll and the keyboard open.
The mouseup event was there to force summernote refreshing the editor toolbar (which will not display which buttons were active until the editor is focused). So removing it still has drawbacks (the toolbar is not up-to-date), but with chm it was decided to remove it as the issue with focus is worse.
Task-2047389 Closes#36360