summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
AgeCommit message (Collapse)Author
2021-05-27[FIX] website, web_editor: fix colorpicker previewxO-Tx
Issue: > Set bg color combination for a snippet... > Save > Edit mode > Select the snippet > Open color palette in bg option > Hover a color option > When a color button is left, the preview is cancelled but the color combination class is not applied anymore. In '_computeWidgetState' (for 'selectStyle' method), the right value ('o_cci') is not returned because we get empty "colorNames" (the "colorPalette" is not rendered on start). The goal of this commit is to fix this behaviour by rendering the colorPalette in start for snippet options, this way, the new code won't affect the speed fix added in [1] for 'OPTIONS' tab. [1]: https://github.com/odoo/odoo/pull/65223/commits/ce54c3f21293513673cb1fc6073ada5f0a2b5641 task-2538326 closes odoo/odoo#71174 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-28[FIX] web_editor: add check before updateLeftPanel timeoutArthur Detroux (ard)
Added a check to make sure that we do not set a timeout to update the option panel when said option panel is already open. This could sometimes occur which could cause all openned select to close and could fail some tests if said events happened in the middle of selecting an option. task-2502297 closes odoo/odoo#69119 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-28[FIX] web_editor: ensure document filename doesn't overflow its cellAntoine Guenet
The media modal's document tab has cells with icons and filenames. If the filename was too long, it would overflow its cell, which caused an ugly design glitch. This ensures an ellipsis on the filename when it is too long. closes odoo/odoo#69977 X-original-commit: 8a4f4bf04bd5e5f9cf827273ea27a189a43c2515 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-28[FIX] web_editor: email receiver see file iconNicolas Lempereur
Scenario: - add a file in mass mailing editor => an generic icon (instead of lower version where icon depended on mimetype) is added linking the file - save and send mail => no icon is shown in email received The system is targeting `a[href*="/web/content/"][data-mimetype]:empty` to add real image inside instead of using background-image attribute which is stripped in sanitized. With this commit, data-mimetype is not removed when image processing attributes are removed when a file is inserted. opw-2474053 closes odoo/odoo#69915 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-13[FIX] web_editor: always allow to properly see all the text toolsqsm-odoo
Commit [1] fixed visual bugs which occurred using the text tools but missed the fact that the tools were shrunk to a very small height when the editor panel was filled with a lot of snippet options. [1]: https://github.com/odoo/odoo/commit/a99ed0f4a261fba44b31e3fe7a5840d81727b6d0 Fixes https://github.com/odoo/odoo/issues/69097 closes odoo/odoo#69200 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-09[FIX] web_editor: have transcoder apply text-decorationNicolas Lempereur
The transcoder (transforming CSS rules into inline CSS for mail clients) was not working for text-decoration property because it would transform text-decoration values in: {'text-decoration-thickness': 'normal', 'text-decoration': none} And the regex that ensures we don't add duplicates check if there is: "(^|;)\s*text-decoration" so if there is text-decoration-thickness, text-decoration is not added. The regexp could be changed to: "(^|;)\s*text-decoration[^\w-]" but we already have special case for other text-decoration-* properties. With this change we should get text-decoration applied in: - edit mode (was already the case) - readonly mode (new) - mail client (only if mail client does not override it) As a side note: text-decoration-thickness seems to be rather new[^1] so at one point in time there was probably no issue. [^1]: https://developer.mozilla.org/docs/Web/CSS/text-decoration-thickness opw-2496490 closes odoo/odoo#69074 X-original-commit: f4f1b890e15e98d9a7e72586faf73327d3f7b716 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Co-authored-by: Kamen Zhekov <kzh@odoo.com>
2021-04-06[FIX] website_sale, *: make the product image container not editableYounn Olivier
*: web_editor It prevents user writing in the image preview of products. Also, the product image view now fit its container so that the user can click wherever in the frame to change the picture. Part of https://github.com/odoo/odoo/pull/65575 task-2446852 closes odoo/odoo#65575 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-06[FIX] web_editor: make dropdown menus scrollableYounn Olivier
The user was not able to select some options of the color and style pickers on the website editor. The menus were displayed either at the top, behind the top actions bar, or overflowing the bottom of the page on some small screens. The solution was to display the widget dropdown menus below the options (remove the transform that was displaying them at the top), and make the container scrollable with overflow-y and a flex display. Part of https://github.com/odoo/odoo/pull/65575 task-2446852
2021-04-01[FIX] web_editor: use escape for image renderingMartin Trigaux
To properly escape all tags and not just the first one And move the escape before the loop to apply for everybody This avoid weird preview with selected content rendered (had effect only on preview) closes odoo/odoo#68633 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-03-30[FIX] web_editor: show XML editor error if rejection valueNicolas Lempereur
Override in enterprise web_studio of _saveView on error never rejected promises. But now it does so the XML editor interface is not blocked after error. But we were already showing the correct error in web_studio use case, so we don't want another one and this change allow that by only showing an error if we received rejection value. opw-2460081 closes odoo/odoo#68554 Related: odoo/enterprise#17381 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-03-25[FIX] web_editor: don't run code when input is emptiedRomain Derie
Before this commit: - Edit mode, open image dialog - Upload an image to the media dialog - Reclick on Upload but don't select an image, close the browser image selector - This will trigger the input change event, as the input was emptied This is needed since in later commit, `_addData()` will do some code outside of the `files` loop, which is useless if there is no files selected. In thise case, the issue would be that it would open an empty toastr. task-2345082 Coming from #65828 Closes #68326 closes odoo/odoo#68334 X-original-commit: 94c45412714c1263788b2567ce3c9581453b2cd4 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-25[FIX] web_editor: fix race condition in option selectionSamuel Degueldre
Previously, when selecting certain options, especially ones which had slow updateUI methods, the selected value was sometimes reset to its previous value. This was caused by a race condition in which, when a snippet option updated its value, it would wait for options on the parent snippet editors to update all of their options' UI, but it incorrectly only waited for *one* of the snippet editors to finish instead of waiting for all of them. This commit fixes that by stopping the event propagation and triggering a new event that will let the direct parent know when all parent editors are done updating their options' UI before signalling that the UI update is done. task-2487578 closes odoo/odoo#68238 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: Arthur Detroux <ard@odoo.com>
2021-03-18[FIX] web, web_editor, website: fix incorrectly translated template literalsSamuel Degueldre
closes odoo/odoo#68085 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-03-17[FIX] website_forum: show normal image modal in forumNicolas Lempereur
In #67893 the image icon was removed, but it contradicts the interface and made a feature that was working for employee less available. Since saas-12.3, we always use the full media dialog when showing the editor on the forum so we could not add an image with the image icon if were not an employee. Before saas-12.3, the original summernote image dialog was shown for everyone but website editor that saw the full media dialog (beecause we are using the same editor to do both things). With this change, we always have the original dialog in the forum message editor thanks to a new option "disableFullMediaDialog". opw-2470720 closes odoo/odoo#68018 X-original-commit: 74af23fb0be60c996503ad599eb96bc2ab4d64f9 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-03-05[FIX] web_editor: fix media-dialog not showing most imagesSamuel Degueldre
This was caused by trying to not show dynamic-svgs that had already been downloaded when the option to not allow the media-library was activated (eg in the website logo, we do not want to allow dynamic SVGs) Unfortunately the domain was doing a string comparison to make sure the url wasn't like the one from dynamic SVGs but implicitly required that the url field be not null. This commit fixes that by explicitly allowing images with a null url field. task-2466819 part of odoo/odoo#66732 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-05[FIX] web_editor: adapt warning when quality options are unavailableSamuel Degueldre
Previously, when quality options were not available, the option would simply not be displayed. User feedback suggests that this is confusing, as for example, in the case of modifying the image in a t-field, quality options would not be available when starting the editor, but would become available when picking the image again in the media-dialog. Some leftover code allowed to display a warning about why the quality options were not available in the case where the image is not local to the database. This warning has been adapted to display a more informative message about why quality options are not available, as well as suggest a solution: - External image => download the image and upload it in odoo - t-field => "You need to choose this image again in the media-dialog or reupload it to have access to quality options" - Images that are in an unsupported format (anything other than PNG or JPEG) => short explanation that quality options are only available on PNG and JPEG images. task-2466819 part of odoo/odoo#66732
2021-03-04[FIX] web, web_editor: customize colorpicker inputs from web_editorYounn Olivier
Styles for the hex and rgba inputs from the color picker were modified on directly from the web module, which means that for a specification concerning only the frontend colorpicker, the backend colorpicker was also changed. This commit reverts the changes that were made and only applies the new style for the website editor. Related to https://github.com/odoo/odoo/pull/65249 closes odoo/odoo#67156 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-05[FIX] web_editor: fix parent element selectionxO-Tx
When a block is removed, the parent will be activated. If the parent element is empty and removable: 1) It will be removed too. 2) In '_activateSnippet' method, we look for the right element to be selected using the block's parent (removed from the DOM...). The goal of this commit is to fix this behaviour by computing the selected element before parent removal. task-2431506 closes odoo/odoo#65428 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-22[FIX] website_form, *: allow to update buttons using link dialogxO-Tx
*: web_editor, website_mass_mailing When we double click a link/button, a link dialog appears to update the target properties, and since the current link dialog can only handle anchor targets, using it on buttons leads to some inconsistencies : - visible href options for button & url required to save changes. - missing preview when button style changed. ... The goal of this commit is to add a fix (with minimum of code) on summernote linkdialog to handle button elements using the same logic as anchor nodes. Also, update website form test tour to test those new changes. Part of https://github.com/odoo/odoo/pull/62206 task-2381305
2021-02-23[FIX] web_editor: bgOptimize+parallax=bg no kaputNicolas Lempereur
Scenario: - set new background image - set parallax - save => on next edition, the editor doesn't work on background anymore Why: - backgroundOptimize copy attributes of the original image to the real target element on save - parallax change the real target element to a new child => so if the original element was an editor (with data-oe-model, ...) attributes, with the combination of the two options we will save these editing attribute on the child element which is wrong (the editing attributes are added dynamically and should not be saved). With this changeset, we don't copy the editing attributes in backgroundOptimize when we copy the original target image. opw-2427560 opw-2429340 closes odoo/odoo#66665 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-22[FIX] web_editor: can set bg position on root editorNicolas Lempereur
Scenario: - go to /slides and start editing the page - change the position of background banner - save => traceback Why: The code for pan tool duplicates the target element in an overlay. In the given use case, it means a node with .o_editable class is created that will cause an error when saving because the code expect the cloned element to be an editor (in `RTEWidget.save()`) but it is not (and is eg. missing `.data('options')`). opw-2427560 closes odoo/odoo#66639 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-19[FIX] web_editor: no error background position + ctrl ZNicolas Lempereur
Scenario: - start editing background position - press TAB key - press CTRL + Z => traceback Why: Restoring a snapshot with CTRL Z can send a click event with target not wrapped in a jQuery object which was not expected by the code. reported in https://github.com/odoo/odoo/pull/66462#issuecomment-782025417 opw-2423445 closes odoo/odoo#66540 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-18[FIX] web_editor: have video button even if sanitizedNicolas Lempereur
If a field is sanitized, a6e2b484e2 would hide the video button because the video does not show in backend. It is better for the consistency but if the field appear in frontend, the video would still show so we prevent something that worked (but is very not user friendly when editing in backend). This changeset go back to the previous behavior (keeping the code simplification), at one point there should be a fix so at least when editing we see the video (currently we see an empty div in given conditions). opw-2463746 closes odoo/odoo#66449 X-original-commit: 73f578192e453f7f8d276604017625b5e712b875 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-18[FIX] web_editor: don't save cropping tool on CTRL+ZNicolas Lempereur
Scenario: - start cropping of an image - press TAB key - do CTRL + Z => now the image cropping tool are inside the page and there is no way to remove them. Why: The image crop tool was added inside the editable elemnt, so if we did an action that changed history the cropping tools are saved in the snapshot and going back to it will add them without any code handling their removal. opw-2394877 opw-2423445 closes odoo/odoo#66462 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-18[FIX] web_editor: shift+enter in editor add direct newlineNicolas Lempereur
Enter keypress browser event were removed in 3c372d1da8b. It was reintroduced in text fields with d2f024d2543 and in source mode of html field with b10ca1f6094b. When doing ENTER in the editor, we do our special case of ENTER (eg. it will split the container in two and have other custom behavior) but when doing SHIFT+ENTER we let the browser handle it and add a normal newline. With the "Enter" prevention, SHIFT+ENTER did not work. opw-2463746 closes odoo/odoo#66442 X-original-commit: 27b84138b422f0dbb3e01c83bb817d0880e3eab3 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-16[FIX] web_editor: stop loading button once ace savedNicolas Lempereur
When we edit a view with ace in eg. studio, if it works the saved button would never be enabled again because of missing callback. Match the behavior of dom.addButtonLoadingEffect other usage (80592abd). opw-2457046 closes odoo/odoo#66269 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-16[FIX] web_editor: fix drag and drop when drop zones are too closeBenjamin Vray
Before this commit, the preview of the dragged snippet didn't work when moving a dragged snippet from a drop zone to an other drop zone when there was no space between those drop zones. It is because, in this case, the over event of the second drop zone is triggered before the out event of the first drop zone. task-2312878 closes odoo/odoo#66165 X-original-commit: 3ac79957d8f6948c965f76e0b5d73ba39a34c69e Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-15[IMP] web_editor: instantiate color palette only when necessaryBenoit Socias
Color palette are only visible once they are opened. However, we instantiate them a lot to build the "options" editor panel which caused the editor to appear buggy for some users... even if they would never open a colorpalette. This fixes that issue. The fix is not entirely stable but was made as stable as possible... better implementation will be done in master. task-2439295 https://github.com/odoo/odoo/pull/65223 closes odoo/odoo#65223 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-02-15[FIX] web, web_editor: avoid rendering color palettes more than onceBenoit Socias
Before this commit the palette was rendered each time it was opened. After this commit if the palette has already been rendered only the selected color is being updated in the palette (and its colorpicker). task-2439295 https://github.com/odoo/odoo/pull/65223 Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-02-15[FIX] website, web_editor: ensure the loader appears on click optionsBenoit Socias
Before this commit the loader did not always get displayed when switching to the options tab. After this commit the loader always gets displayed ASAP when switching to the options tab until the tab is ready and displayed. task-2439295 https://github.com/odoo/odoo/pull/65223 Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-02-12[FIX] mass_mailing,web_editor: content no under sidebarNicolas Lempereur
Depdending on situation several fixes (f885202, fc8e446) leads to issue in small screen size: - in iframe editor with without snippets => the width of the content is decreased of several times the sidebar that is not shown - in editor with sidebar => the content gets behind the sidebar With this changeset we remove part of the above commits which seem to fix both issue. note: this also fixes that the mass mailing content applied CSS should not depend on screen size, or what is send would differ dependin on which screen size clicked on SAVE (on last inlining of CSS). opw-2426400 closes odoo/odoo#66074 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-12[FIX] web_editor: content under top bar in iframeNicolas Lempereur
In ff81fa479 there was some refactoring for change of structure on frontend, but for the iframe editor (eg. mass mailing), this caused that the top edition bar was over the content. opw-2426400 closes odoo/odoo#66068 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-05[FIX] web_editor: insert record name as textSamuel Degueldre
Previously, the many2one widget from the web_editor used jQuery's '.html()' method when inserting a record name into the page. The record name was not HTML-escaped before this, which may have unexpect result and break the layout. This commit fixes that by using the '.text()' method instead. This bug only affects pages containing a many2one (contact excluded) at the time of selection and not after the selection. e.g. on the /event page, changing the category of an existing event via the website editor closes odoo/odoo#65642 X-original-commit: 53aff7f07317a8261b8b9c3e462d930141c7081b Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-04[FIX] web_editor: allow to center button with summernoteBenjamin Vray
Before this commit, it was not possible to center a button using the editor option 'align center'. It is because, using document.execCommand(), the Chrome browser doesnt want apply 'text-align: center' on nodes with centered children. And the buttons have the boostrap class '.btn' which adds text-align: center. So the hack here is disabling the text-align property from the '.btn' class during the execution of document.execCommand(). task-2423935 closes odoo/odoo#65544 X-original-commit: d4f38c344360713287eed22872614f46dec7e0f6 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-04[FIX] website, web_editor: fix empty parallax snippet not being removedSamuel Degueldre
Previously, when removing all the content of a snippet, that snippet would get automatically deleted. This was not the case for parallax snippets because we previously intended the user to drop the parallax snippet, empty it, and drop other content inside of it. Recently, we added the parallax option on all snippets, rendering the previous workflow obsolete. There is now no longer any reason to keep empty parallax snippets. This commit fixes that. task-2446008 closes odoo/odoo#64907 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-02[FIX] web_editor: fix background layers buttonsxO-Tx
Example to reproduce: Drop the "Cover" snippet and try to remove the background image. Clicking on image button has to be done 3 times to land on the correct result: - First click removes image, but not filter and leaves both buttons checked - Second click removes the filter and unchecks its button. - Third click unchecks the image button. It should be one click to remove image, filter and uncheck both buttons. The goal of this commit is to prevent _applyOptions() from setting background-image values if image is not optimizable. This filter will solve the issues since empty values (badly parsed by getBgImageURL()) won't be added as background urls. task-2312878 closes odoo/odoo#62984 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-28[FIX] mass_mailing, web_editor: send mail to outlook and keep image sizeNicolas Lempereur
Office Outlook doesn't take into account the [style] attribute, and it doesn't manage width/height in percent value. This commit set width/heigth attribute in pixels and also always set the width/height in style attribute (keeping them in the original unit and setting them to auto if not present). This is a reintroduction of 2015 commit bdf58adb465b opw-2447756 closes odoo/odoo#65212 X-original-commit: c51762a790d6fefd97e6c818bfaa9307180dd5b5 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-01-28[FIX] web_editor: fix dropzones with invisible elementBenjamin Vray
Before this commit, dropzones were created around invisible elements (e.g. the snippet popup). So we had 2 dropzones instead of one at some locations. After this commit, we avoid creating dropzones around elements that must not have dropzones. task-2312878 closes odoo/odoo#65198 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-27[FIX] web_editor: prevent a modal from closing when dropping a snippetBenjamin Vray
Before this commit, when you dropped a snippet using the move button in a modal. The modal closed after the drop. This commit allows to define an element in which to destroy the editors. Part of https://github.com/odoo/odoo/pull/61998 task-2312878 closes odoo/odoo#61998 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-27[FIX] web_editor: fix scroll during dragging a snippet in a modalBenjamin Vray
Before this commit, it was not possible to scroll a popup with a dragged snippet. Part of https://github.com/odoo/odoo/pull/61998 task-2312878
2021-01-27[FIX] web_editor: close open invisible elements before deleting itBenjamin Vray
Before this commit, open invisible elements were not closed before being deleted. This created issues like the 'modal-open' class wich was not removed from the body when removing a modal. Part of https://github.com/odoo/odoo/pull/61998 task-2312878
2021-01-27[FIX] web_editor: fix drag and drop a snippet in a modalBenjamin Vray
When a modal is open, allow the drop of a snippet only in this modal. Part of https://github.com/odoo/odoo/pull/61998 task-2312878
2021-01-27[FIX] web_editor: fix scroll event on snippet popupBenjamin Vray
Before this commit, when scrolling a snippet popup, the overlay was not updating its position. So now, we use addEventListener instead of jQuery for the scroll event on the scrolling element because we need the 'capture' parameter. Setting this capture parameter to true allows us to take advantage of event bubbling for events that otherwise don’t support it. Part of https://github.com/odoo/odoo/pull/61998 task-2312878 Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-01-27[FIX] web_editor: properly hide the custom colors section if neededqsm-odoo
The 'custom' key was not working anymore as a key to exclude the ability to choose a custom color from a color palette widget. It was thus appearing for choosing the transparent color for over-the-content headers... which is not possible to save right now. Part of https://github.com/odoo/odoo/pull/65139 closes odoo/odoo#65139 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-27[FIX] website, *: reset header items colors to default when transparentqsm-odoo
*: web_editor Users can choose one of their color combination to apply on the header. If they then choose to make the header transparent over the content for a specific page, the color of buttons & other components in the header should be reset to the default website color combination's colors as the header component are now appearing over the default content. Part of https://github.com/odoo/odoo/pull/65139
2021-01-25[FIX] web_editor: restore website header once page content is removedqsm-odoo
The affixed header was not reappearing if page content was removed and the page thus indirectly scrolled. task-2446020 closes odoo/odoo#64990 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-22[FIX] web_editor: save custom snippets per websiteBenoit Socias
Before this commit the custom snippets were saved across websites because the RPC mechanism used by the save & reload does not include the context by default. After this commit the custom snippets are saved for the specific website as initially intended. No migration is needed: already created snippets that have been created across all sites will have the correct lifecycle because of the copy-on-unlink system: trying to delete one will make it specific on other websites. Related to task-2374802 closes odoo/odoo#64917 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-21[FIX] website, web_editor: fix drop zones when dragging a snippetBenjamin Vray
Before this commit: -when moving a snippet using the drag and drop button, two drop zones instead of one was added at the initial location of the dragged snippet. -when moving a snippet using the drag and drop button, no drop zone was added at the initial location of the dragged snippet if the snippet was alone in its parent. For example, the left jumbotron in the banner snippet. -the drop zones handled by the "children rules" were never vertical when it was necessary. This commit also refactors the code to avoid some duplicated lines. task-2312878 closes odoo/odoo#64838 X-original-commit: e637056b3b1f4129342e5c79a4d761c7aaf56a40 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-13[FIX] web_editor: solve bold command issuesqsm-odoo
Summernote uses execCommand and, worth, obsolete queryCommandState function to customize the edited content. Here we try to hack the function to solve some problems by making the DOM and style easier to understand for the base functions for the duration of their executions. This won't obviously solves all problems but this is an improvement while waiting for the new Odoo editor coming in future versions. The original problem this solves is handling bold text in blog posts. Posts are using font-weight: 300 which is enough to confuse summernote. Hitting bold on a selected paragraph wraps its content in a <b> tag but hitting bold again does nothing... having a <b> rendered as fw-400 is enough to break it. What this commit does is: before any execCommand or queryCommandState being used to modify the DOM or retrieve its state, the whole DOM is forced to fw-400 and <b> elements to fw-700. This also solves issues in some base snippets. closes odoo/odoo#64472 X-original-commit: 424d9661c5657cbcf10ce40acb94a7a200c2a48b Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-12[FIX] web_editor: fix steps snippet line removed when change icon bg-colSamuel Degueldre
Previously, when changing the background-color of an icon in the s_process_steps snippet, the line that goes through the snippet would disappear from that block. This was caused by our font-application code attempting to remove extraneous DOM nodes when changing a font color or backrgound-color, but not considering elements with a ::before or ::after pseudoelement has having content, and subsequently removing them. opw-2423785 closes odoo/odoo#64404 X-original-commit: 6b363d202d9c35e8249f7bb2b0730b995fdf4a7d Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>