summaryrefslogtreecommitdiff
path: root/addons/web_editor
AgeCommit message (Collapse)Author
2021-05-30[I18N] Update translation terms from TransifexOdoo Translation Bot
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-05-23[I18N] Update translation terms from TransifexOdoo Translation Bot
2021-05-16[I18N] Update translation terms from TransifexOdoo Translation Bot
2021-05-09[I18N] Update translation terms from TransifexOdoo Translation Bot
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-05-02[I18N] Update translation terms from TransifexOdoo Translation Bot
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-25[I18N] Update translation terms from TransifexOdoo Translation Bot
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-11[I18N] Update translation terms from TransifexOdoo Translation Bot
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-04[I18N] Update translation terms from TransifexOdoo Translation Bot
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-28[I18N] Update translation terms from TransifexOdoo Translation Bot
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: prevent mismatch between mimetype and content typeRomain Derie
Since the image util method `image_base64()` is converting BMP images to PNG automatically[1], there would be a mismatch between the attachment content type and the attachment mimetype. - Content type: retrieve with `base64_to_image(data).format` -> return PNG as the image data was converted from BMP to PNG - Mimetype: set on `write()` and `create()` with `_check_contents()` which call `mimetypes.guess_type(file_name)`. BMP image `my_file_image.bmp` would have a mimetype set to BMP The computed field `image_src` would return `False` since the image.mimetype would be BMP, making the dialog picker not showing the image but loading `http://localhost:8069/false` instead. [1] https://github.com/odoo/odoo/blame/097f29d0f6a5b295c81fd074665dbd261eaf12fb/odoo/tools/image.py#L124 task-2345082 Coming from #65828 Closes #68326 X-original-commit: ef5b108b781df73342bb99342a1116fad86d3b58
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-21[I18N] Update translation terms from TransifexOdoo Translation Bot
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-14[I18N] Update translation terms from TransifexOdoo Translation Bot
2021-03-07[I18N] Update translation terms from TransifexOdoo Translation Bot
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-28[I18N] Update translation terms from TransifexOdoo Translation Bot
2021-02-25[FIX] base, web_editor, website: add missing encoding on etree.tostringJeremy Kersten
Since lxml 4.5.0 that use now use libxml2 2.9.10, without it, it can crash. Here sample of content that is broken: https://drive.google.com/file/d/1gB2-jl4fabHscLjH9OZc4WZgtSEbCVj7/view?usp=sharing note: this commit is to merge 3 changes of #64526 opw-2428617 opw-2428664 closes odoo/odoo#66866 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-22[FIX] web_editor: fix anchor range selectionxO-Tx
When we double click a form submit anchor, and depending on the selected element before click, the selection range ("document.getSelection()") can start from a parent of the targeted node. This will send a wrong range to be used in LinkDialog widget. The goal of this commit is to prevent this behaviour by adjusting the range if it starts from anchor parent. Note: the bug only occurred in Firefox. Part of https://github.com/odoo/odoo/pull/62206 task-2381305 closes odoo/odoo#62206 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-21[I18N] Update translation terms from TransifexOdoo Translation Bot
2021-02-19[FIX] web_editor: fix anchor click on submit buttonxO-Tx
Context: 1) Edit mode 2) Click on anchor edition button of website form submit button 3) Traceback occurs The "focus" triggered on $editable element in editor's 'getLinkInfo()' discards user's text selection on submit button, as a result, 'range.create()' method returns null since no selection is found. Note: the bug only occurred in Chrome. Note 2: [1] apparently tried to solve the same issue but the fix was not solving it correctly, at least not in all cases. [1]: https://github.com/odoo/odoo/commit/da14e4449e5e318eb72e1b9f268fb797adb0c6a6 opw-2443441 closes odoo/odoo#66552 X-original-commit: d2f3c9e7975188753fa17c06db3fc5c73c773944 Signed-off-by: Quentin Smetz (qsm) <qsm@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-14[I18N] Update translation terms from TransifexOdoo Translation Bot
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>