summaryrefslogtreecommitdiff
path: root/addons/web_editor/static
AgeCommit message (Collapse)Author
2020-10-23[FIX] web_editor: do not show overlay for invisible elementsqsm-odoo
When a snippet is out of the viewport or hidden, the overlay should not be visible. Two distinct cases we had: - When the page is scrolled, the header is sometimes hidden thanks to tranform: translate(0, -100%); for some kind of effect -> the header is thus still visible but out of the viewport, any selected snippet inside that header would still have this overlay enabled so we would see the move and delete button on the top of the screen. - When the page is scrolled, with the vertical header, some part of the header are hidden for the affixed version. If any snippet in those hidden elements was selected, the overlay is still visible floating. task-2312878 closes odoo/odoo#58383 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: Benjamin Vray <bvr@odoo.com> Co-authored-by: Thanh Dodeur <tso@odoo.com>
2020-10-21[FIX] web_editor: prevent switching to text tools immediatelyqsm-odoo
On editor start, "the cursor enters editable text" at a "random" time thus switching immediately to text tools or not depending on the fact text tools switching was initialized or not. We now only allow to do so after some fixed delay after the editor is ready, to prevent any automatic switching on editor start (which may break tours). Part of https://github.com/odoo/odoo/pull/60383 task-2352339 closes odoo/odoo#60383 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-21[FIX] web_editor: stop showing text tools on empty oe_structureqsm-odoo
Do not switch to text tools if the cursor is in an empty oe_structure (to encourage using snippets there and actually avoid breaking tours which suppose the snippet list is visible). Part of https://github.com/odoo/odoo/pull/60383 Related to task-2352339
2020-10-22[FIX] web_editor: restore overlay top options on top of the pageqsm-odoo
When the overlay covers a snippet, if that snippet is at the top of the page, the options at the top of the overlay are hidden. A system was made to make them change position in that case but this was broken by [1], leaving the toggling of a class for that case but without its related scss. This commit restores that scss and also improves the detection of that problematic case. [1]: https://github.com/odoo/odoo/commit/4f27e52cabb77b8b1a9637a11185ddf882adc9af closes odoo/odoo#60464 X-original-commit: 97f11571f9e3deacc9b9e1dc0d2cc8fc6b93f15c Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-21[FIX] web_editor: disable embedded video for html fields in backendIEL
TLDR: the videos doesn't work anyway, but nobody noticed it for years; at the same time there is no easy way to fix it STEPS: * create a record with html field, e.g. project.task * add an embedded video (File/Image icon) * save BEFORE: video doesn't work AFTER: there is no option to add embedded video anymore WHY: * iframe tags are removed before storing html in database, so after saving a record, embedded video doesn't work anymore * possible fixes look too tricky for stable branches: * new field attribute sanitize_iframe=False -- requires changes in core python framework which may have side effect * adding iframe on client side -- the problem is that the backend doesn't have mechanism to use animation in html fields like it's done in website: https://github.com/odoo/odoo/blob/ced500e9bcbb5c84033463689d135ad4c7dc4f39/addons/website/static/src/js/content/snippets.animation.js#L623-L632 * adding iframe on server side -- parsing html fields in _read... Doesn't look good either * double selector is required to make it work both in frontend and backend: $editable.closest('.o_editable, .note-editor') * we don't need hardcoded exception for mailing.mailing, mail.compose.message because those fields marked as sanitized (default value) https://github.com/odoo/odoo/blob/c92f058571b0656451f24e24154dd1bdb3bdb48a/odoo/fields.py#L1589-L1590 https://github.com/odoo/odoo/blob/c92f058571b0656451f24e24154dd1bdb3bdb48a/addons/mail/wizard/mail_compose_message.py#L115 https://github.com/odoo/odoo/blob/61734cdaf1cf6857125b1ece63928ab080359c6c/addons/mass_mailing/models/mailing.py#L77 * I don't apply this for Odoo 12, because js is refactored in Odoo 13 (e.g. field_html.js has another name in Odoo 12) --- opw-2353103 closes odoo/odoo#60474 X-original-commit: 2dcbac08effcedafbcf50610355752030902b16d Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-10-21[FIX] web_editor: Autocomplete options can break layoutNasreddin (bon)
Issue - Install "Website" app - Go to "Contact us" page on website - Edit Page, then click on submit button to edit form style - Alter 'Recipient Email' by selecting a value from 'autocomplete' values Other input text options are also altered. Cause Due to chrome autocompletition, others text input fields are also altered (like it will do with a form address). In this case, the error was obvious since it alter also the 'Labels Width' who break the layout. Solution Disable autocompletition on `<input type='text'/>` options elements. opw-2361169 closes odoo/odoo#60470 X-original-commit: 978788bbdf1a4a3d563fd70e2af89fdd1fd039ec Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-10-21[FIX] web_editor: fix option background positionBenjamin Vray
Keep the original position of the background as a percentage. In this way, we avoid converting in pixel a direction that we have not changed. Part of #55857 Related to task-2318526
2020-10-20[FIX] web_editor: fix mouse up event on active handlesBenjamin Vray
Before this commit, the mouseup event was not detected outside the body element when resizing paddings. task-2312878 closes odoo/odoo#60356 X-original-commit: 127410f9dcf9f07eba2ca9999e9427889e25f6df Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-20[FIX] web_editor: disable overlay pointer events on wheel eventBenjamin Vray
This commit disable the pointer events on the overlay during the mouse wheel event. To prevent page scrolling from stopping when hovering over the overlay. task-2312878 closes odoo/odoo#60160 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-19[FIX] web_editor: do not allow we-checkbox to shrink below checkbox sizeqsm-odoo
E.g. the scrolltop button option has a checkbox followed by a select on the same row and the checkbox was partly cut because of it. Part of https://github.com/odoo/odoo/pull/60271 task-2312878
2020-10-19[FIX] web_editor: fix select with we-titleBenjamin Vray
Before this commit, line height on items in a select was not applied if the items were in a we-title tag (this is the case when using the string attribute on we-button instead of text content). Part of https://github.com/odoo/odoo/pull/60271 task-2312878
2020-10-19[FIX] mass_mailing, *: restore mass mailing optionsqsm-odoo
*: web_editor The snippet options which were specific to mass mailing were not loaded anymore as they were loaded outside of the iframe where the edition take places. Fortunately, the generic options were still working and are the most important. This bug was only revealed thanks to another bug fix which wanted to be done in the unloaded file. Note: this fix is a series of huge hack to make it possible and as safe as possible in stable versions. This obviously has to be refactored in master, if not already done. Part of https://github.com/odoo/odoo/pull/60203 X-original-commit: 7225ce6b862c4f6b99a97732833b43189530699a
2020-10-19[FIX] web_editor: fix width of SVG images in media dialogJeremy Kersten
This solves an issue with svg images from Isometric for example. The media dialog assigns width to its displayed images thanks to the flex-basis and flex-grow properties of their container, based on the aspect ratio of each image. This was done correctly for SVG images too. However, after assigning a nice space for a specific SVG image, the image itself was not made to fill that assigned space... it only worked if the natural width of the image was higher than the assigned space. This was of course more obvious with SVG files with no intrinsic width as they would simply not appear. closes odoo/odoo#60193 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-10-16[FIX] web_editor: keep `<i/>` elements after icon editionqsm-odoo
Any non `<span/>` element which was transformed into an icon thanks to the media dialog was transform into a `<span/>` then processed by summernote. In some cases, this processing breaks the DOM... for no reason as the DOM should not have been transformed into a `<span/>` in the first place: `<i/>` elements inside a `<span/>` for example should stay `<i/>` elements after edition. closes odoo/odoo#60200 X-original-commit: 4bfcb80e3664ccc74b7ec5e7e10ace6e44ab98d3 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-16[FIX] web_editor: fix colorpalette traceback on snippet clickqsm-odoo
Sometimes, when clicking too fast, some methods were called on a not-fully-initialized colorpalette, which made it crash. task-2312878 closes odoo/odoo#60171 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-14[FIX] website, *: restore navbar options for 'Boxed' headerqsm-odoo
*: web_editor The selector targeting the navbar for the related editor options was not correct to target the navbar of the 'Boxed' version of the header. Part of https://github.com/odoo/odoo/pull/59842 task-2312878
2020-10-14[FIX] web_editor: fix dimensionless SVGs in media-dialog on firefoxSamuel Degueldre
Previously, dimensionless SVGs (SVGs with no intrinsic width or height) were rendered with a width of 0 in the media-dialog on firefox. This is caused by the fact that firefox reports a naturalWidth and naturalHeight of 0 for dimensionless images, which we were relying on to compute the image's aspect ratio. See: https://github.com/whatwg/html/issues/3510#issuecomment-369982529 for more details on the way browsers handle dimensionless images. This commit fixes that by giving the image a width, letting the browser render the image, and reading the height of the rendered image to compute the aspect ratio in the cases where the naturalHeight of the image is 0. task-2345120 closes odoo/odoo#59785 X-original-commit: b59208db376f738a8773d1ec88838af69fa3ef9d Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-13[FIX] web_editor: remove useless code breaking the editor scrollingqsm-odoo
Since the editor panel is placed on the right, the content was not possible to scroll when in a iframe, like for mass mailing. This was because of some strange code introduced with [1]. As the problem the mentioned commit says fixing is still fixed without that code, I see no reason to keep this... especially since it may introduce difference between readonly and editmode content. [1]: https://github.com/odoo/odoo/commit/f9bf408a827fa86323bc2d1891cb5173b4781e7b closes odoo/odoo#59902 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-12[FIX] web_editor: fix background-sizing previewxO-Tx
with background-sizing option, user drags background image to adjust its position using an overlay with the same content from snippet (cloned element). Some CSS child selector rules will not be applied since the clone element has a different container from the snippet content. The CSS "background-attachment" property should be the same in both parallax snippet & its copy, this will keep the preview more "wysiwyg" instead of getting different result when bg position saved. This can be improved by copying all style from snippet content and override it with overlay related style (copying all css into overlay will not work since it will change the style of its content too) task-2327025 closes odoo/odoo#59769 X-original-commit: aaa3e63985789ea07464a5957eb18481e70a383f Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-09[FIX] web_editor: fix background-images not being auto-optimized on dropSamuel Degueldre
Previously, background-images were not properly optimized when inserted, whereas they should be just like regular images. This commit fixes that. It also changes the default quality (used for automatic optimization) to 75 as the difference is not usually very noticeable but can bring a big decrease in image size. task-2357332 closes odoo/odoo#59587 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-07[FIX] web_editor: restore adding bg video in some contextqsm-odoo
Since [1] the feature was broken because of a traceback which occured while trying parse a background image URL of an element which is not in the DOM. [1]: https://github.com/odoo/odoo/commit/7558dcce791f707e3f3470835133f91ec7ff074f closes odoo/odoo#59425 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-07[IMP] web_editor: replace some bottom shape colors with transparentSamuel Degueldre
Previously, rainy 05 and wavy 06 had a bottom color with a hard edge. This means that in order to not have a harsh color transition in the section, the user would have to match the bottom color to the background color of the section or vice versa. This commit makes it so that this color is transparent by default instead. This means that the user can now simply choose the background color and have the same result, without having to configure two separate colors. Part of: odoo/odoo#58333 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-07[FIX] web_editor: various shapes fixesSamuel Degueldre
This commit fixes a number of shapes, usually the problems were with imperfect joints between connecting shapes, shapes being cut not close enough to the edge, or shapes using embedded PNGs for shadows instead of using SVG filters. Part of: odoo/odoo#58333
2020-10-07[FIX] web_editor: reduce clickable area of checkboxes in editor panelqsm-odoo
Before this commit the clickable zone of a checkbox in the editor was all the width of the panel. After this commit, the clickable zone is only the label width + the checkbox width. Also, the active and hover states of the label have been removed to not confuse the user. task-2312878 closes odoo/odoo#59240 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-06[FIX] web_editor: fix empty media dialog save issuexO-Tx
when media dialog launched for the first time (with no selected media attachment), "FileWidget.selectedAttachments" contains a default object {url:... , alt:...} (default attachment already on the target), and the click on "Add" button will cause a backtrace since the code on "_save" method tries to access "image_src" attribute on all selectedAttachments elements including default one. The simplest solution would be to check if the object already has an "image_src" attribute. task-2312878 closes odoo/odoo#58143 Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2020-10-06[FIX] web_editor: allow to go the parent snippet more easilyqsm-odoo
Before this commit to select a parent snippet you had to click on its title in the editor panel. After this commit, we can still click on the title but also on the whole line. At the same time, make it so the title has a pointer cursor and so that long titles work too. task-2327182 closes odoo/odoo#56986 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: Benjamin Vray <bvr@odoo.com>
2020-10-05[FIX] web_editor: fix background-image urls becoming absolute on dropSamuel Degueldre
With the recent addition of the parallax option on all snippets, background-image urls were being converted from relative to absolute on snippet-drop. This was caused by trying to read the background-image's url and setting it back onto the target, but there is no way to reliably read a background-image url in relative form, so it was returned in absolute form and then written back to the element as is. This commit fixes that by always converting the absolute URL to relative when they are on the same origin as the database. task-2312878 closes odoo/odoo#59098 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-01[FIX] web_editor: fix select with images in left panelBenjamin Vray
Before this commit, we were looking for text content inside SVG element to set the selected value of a select in the editor panel. After this commit, we avoid looking inside SVG tags. task-2312878 closes odoo/odoo#56739 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-29[FIX] website, *: fix background layer elsewhere than in a sectionBenjamin Vray
*: web_editor Before this commit, the elements (other than section) and with the background layer options avaible (shape, color filter, etc.) did not have the relative position added on their children. So all the children were hidden behind the layer element which is in absolute position. Part of https://github.com/odoo/odoo/pull/58850 task-2312878
2020-09-29[IMP] web_editor: add assets for jabberwock editorGoaman
This commit lays the groundwork for the new editor by adding empty files to the assets in order to change them later on. The new editor is not stable enough to be merged right now, but delaying it to 15.0 would be problematic as the current editor has many bugs that we are unable to fix because of how summernote interacts with browser-dependent code as well as all the hacks that were done on top of it for Odoo since 8.0. closes odoo/odoo#58678 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-09-29[FIX] website_blog, web_editor: fix tag layout issue in blogBenjamin Vray
Before this commit the layout of the front-end edition of tags in blog was broken. And the default value of the select element was not filled. We fixed those design issues and also improve some small design details. And for the select issue, we add a return value in the computeWidgetState of the addTag method because even if the value will still be empty we need to return something because we want the select to be filled by the default value of setValue() wich is "/". task-2312878 closes odoo/odoo#58307 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-29[FIX] web_editor: fix remove btn z-index in media dialogBenjamin Vray
Add a z-index on remove btn in media dialog because before that the button was hidden behind images. Also review a little bit the style of the button. task-2312878 closes odoo/odoo#58815 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-29[IMP] web_editor: add tooltips on editor panel labels if overflowxO-Tx
task-2312878 closes odoo/odoo#56161 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-29[FIX] web_editor: restore background and foreground color previews againqsm-odoo
This was fixed in 13.0 and forward-ported twice in 14.0 with [1] and [2] But the combination of the two commit were messed up. [1]: https://github.com/odoo/odoo/commit/225ec35e50b5d71fa795f64cb9a9a6c2ceda7631 [2]: https://github.com/odoo/odoo/commit/19be84634d394f47ceb882c5ddd24585f31b50ae closes odoo/odoo#58768 Related: odoo/enterprise#13659 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-29[FIX] web_editor: make we-input full-width if unit is largeqsm-odoo
The design was made considering the units would not be bigger than 2 or 3 characters... but it is currently used with translated texts like "products". In those cases, force the input to be full-width. task-2312878 closes odoo/odoo#57927 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-28[FIX] web_editor: restore background and foreground color previewsqsm-odoo
closes odoo/odoo#58727 X-original-commit: ee8cd9952736d9ea57609e218e3479963785a78d Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-28[FIX] web_editor: restore background and foreground color previewsqsm-odoo
Forward-port of [1] for the custom text tools for the website editor. Still has to be improved with the future text tools. [1]: https://github.com/odoo/odoo/pull/58690 Part of https://github.com/odoo/odoo/pull/58638 closes odoo/odoo#58638 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-28[FIX] web_editor: review temporary text tools designstefanorigano (SRI)
The text tools are being reworked with the new editor. Meanwhile, this commit will get closer to the desired design with a pure CSS solution. Part of https://github.com/odoo/odoo/pull/58638
2020-09-28[FIX] web_editor, *: show text tools in style tab onlyqsm-odoo
*: website As the text editor is still the summernote one, this improvement was made possible through a series of hack. It has to be reviewed once the new editor is ready. This makes the text tools only appear in the style tab by switching to it as soon as the summernote tools are updated. To prevent flickering, css and js hacks had to be made. This also moves the undo/redo buttons in the top bar with another hack: those simulates click on the hidden summernote ones. Part of https://github.com/odoo/odoo/pull/58638
2020-09-28[IMP] web_editor, *: automatically increase default link color contrastqsm-odoo
*: website Inside a color combination (or outside, as considered the same as inside color combination number 1), the link color can be configured. It is set by themes to one of the 5 theme colors. Sometimes, no color of those 5 colors contrast enough with the color combination's background and we accepted that before, relying on the fact the user can change the link color if he wants too. Now we automatically increase the contrast of those link colors, except if the user overrides it. This system might be extended to all foreground colors in the future but the system has to be improved for that. closes odoo/odoo#58538 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-28[FIX] web_editor, website: fix menu colors in table of contentBenjamin Vray
Before this commit, the colors of the navbar in the table of content menu were not adapted to the color combinations system. With navbar in top position, the background and the colors of the links were using the same color. After this commit, the colors of the list-group-item links are also adapted with color combinations. task-2312878 closes odoo/odoo#58601 X-original-commit: a0dc17676c570887773854243bcb8cd8823359d5 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-25[FIX] web, web_editor: fix scroll to hidden dropped snippetsBenjamin Vray
Fix the scroll when the snippet is the dynamic one because it did not work as we tried to get the offset of an element with the d-none class. Remove the scrollValue variable because we don't need it anymore. It was used before the code was reviewed in a previous commit. task-2312878 closes odoo/odoo#58486 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-25[FIX] web_editor: prevent scroll over right panelLaurent Stukkens (LTU)
* Prior to this commit, the auto scroll is triggered when dragging items over the right panel (if the dragged item is close to bottom or top). * After this commit the auto scroll is is no more triggered as long as the dragged item is over the right panel area. closes odoo/odoo#58470 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-24[FIX] website, *: review modal behaviors with right-panelizationqsm-odoo
*: web, web_editor Since the right-panelization made with [1], the modals were not compensating the body scrollbar when opened anymore and the backdrop was misplaced. This commit fixes the problems generically, to support modals with non-body scrolling. [1]: https://github.com/odoo/odoo/pull/57975 closes odoo/odoo#58414 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-24[FIX] web_editor: hide the remove button for image t-fieldBenjamin Vray
task-2312878 closes odoo/odoo#56920 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-23[FIX] web_editor: fix overlay on image changedBenjamin Vray
Before this commit the overlay of an image was not updated when the image was replaced by another. task-2312878 closes odoo/odoo#58328 X-original-commit: d4641b5bdc2b05523e29fb87a3b953dea90fbd8a Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-18[FIX] web_editor: buttons on snippet moveLaurent Stukkens (LTU)
task-2312878 closes odoo/odoo#56276 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-22[FIX] web_editor: handle text selectionstefanorigano (SRI)
task-2335267 part-of: #57942
2020-09-22[FIX] web_editor: collapsible component, adjust designstefanorigano (SRI)
task-2335267 part-of: #57942
2020-09-22[FIX] web_editor, website: reword theme options, highlight <we-title>stefanorigano (SRI)
Reword some theme options, highlight <we-title> components when used as a "sub-section" titles. task-2335267 part-of: #57942