summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor/snippets.options.js
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-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-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-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-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-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-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>
2020-12-17[FIX] web_editor: fix permanent loading effect on option double-clickSamuel Degueldre
Previously, double clicking an arrow to change the order of images in the image-gallery snippet would cause the loading effect to permanently stay and block the snippet editor completely. This was caused by the fact that when clicking the arrow, the gallery snippet rebuilds itself from scratch. After a snippet option is used (in this case, the reordering arrow), we update the snippet overlay, and destroy snippet-editors whose target is no longer in the DOM. When double clicking, by the time we handle the second click, the target of the option has been removed from the DOM, and the widget has been destroyed. However, when we try to apply the option anyway, we trigger_up some events (eg to refresh the public widgets) and wait for the trigger_up to call back. Since the widget is already destroyed, it no longer has a parent and trigger_up fails silently, never calling us back, and blocking the mutex. This commit fixes that by checking whether the widget is destroyed before trying to apply the option, bailing immediately if it is the case, and unlocking the mutex. opw-2394953 closes odoo/odoo#63532 Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2020-12-10[FIX] web_editor: fix background position on shapesBenjamin Vray
Before this commit, the background-position was not removed from a shape when it was re-flipped to its original orientation. introduced in #61114 closes odoo/odoo#63173 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-04[FIX] survey, web, web_editor, website, website_form: Prevent invalid date ↵Achraf (abz)
stock.picking What are the steps to reproduce your issue? 1. Install "stock" 2. Go to Inventory/Inventory Overview/Internal Transfer 3. Create new record and set manually a date with year < 1000 like "0008-10-10 18:35:00" 4. Save What is currently happening? An error arises when saving the record, and it is then no longer possible to reopen the records or any view containing it. This also prevents us from correcting the date to no longer have the error Why is this happening? The root cause is an inconsistency in `strftime` for years < 1000 [1, 2]. To take it into account, a zero-padding is needed in the DateTime parser. How to fix the bug? The missing padding is added. However, such dates lead to problematic behaviors in Python: ``` DT_FORMAT = "%Y-%m-%d %H:%M:%S" new_date = "0008-02-05 18:10:10" datetime.strptime( datetime.strptime( new_date, DT_FORMAT ).strftime(DT_FORMAT), DT_FORMAT ) ``` This raises: ``` ValueError: time data '8-02-05 18:10:10' does not match format '%Y-%m-%d %H:%M:%S' ``` As of today there was no reported business cases where dates with year < 1000 would be necessary. Therefore, we limit the range to years >= 1000. [1] https://bugs.python.org/issue13305 [2] https://docs.python.org/dev/library/datetime.html#strftime-strptime-behavior opw-2408260 closes odoo/odoo#62818 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-11-20[FIX] web_editor, website_form: speed up and robustify form editingIEL
STEPS: * open website page with a form (e.g. /contactus) * click edit * slow down connection speed * click fast between form input lines or change order of the lines BEFORE: * 7 svg files are requested every click * get_authorized_fields is called every click * random error "'classList' of undefined" in SelectUserValueWidget::close * random similar errors when a method is called before initialization AFTER: * svg and get_authorized_fields are requested once * random errors are no reproduced or it's hard to do it * performance of switching between inputs doesn't depend on connection speed (though, still not instant) WHY: * about changing in SelectUserValueWidget::close: posible reason why this.menuTogglerEl may be undefined is because method start is async * the other updates just implement caching --- opw-2368928 closes odoo/odoo#61598 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-17[FIX] web_editor: fix shape transparency color preview handlingSamuel Degueldre
Previously, the transparency color for shapes was not taken into account when handling the preview state transitions of the background shape snippet option. This caused strange behaviours where the shape transparency color would always get reset when it was a class color, either when changing to a different shape (expected, all shape colors should get reset) or when changing any other shape setting like other shape colors or flipping the shape (not expected). On the other hand, if the transparency color was not a class color, it would always remain untouched, when changing other shapes settings (expected) but also when changing shape type (eg Origins 01 -> Blocks 02, unwanted). This commit fixes that by cloning the entire shape container during preview, and restoring it on preview-reset. task-2380815 closes odoo/odoo#61710 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-02[FIX] web_editor: fix gap between transformed shape and next sectionSamuel Degueldre
Previously, when flipping some shapes vertically on chrome, and vertically or horizontally on firefox, there was a gap of 1px or less at some screen widths. This is caused by the way these browsers render backgrounds on transformed elements. It seems like firefox will round the size of the element to render the background image on it if the element is transformed, while chrome will always render the background at the correct size (or render it at a larger size and clip it to the correct size after the fact), but will round the coordinates of the symmetry point, causing only the vertical flip to have this issue, and only if the background image would not extend beyond the bounds of the element (on firefox, even shapes that would extend beyond the bounds of the element would showcase a gap, eg origins 1) This commit fixes that by applying the transform to the SVG rather than to the element, by use of the shapes controller. task-2369560 closes odoo/odoo#61114 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-06[FIX] web_editor: allow single quotes in getShapeDataBenjamin Vray
Before this commit, the value of data-oe-shape-data required double quotes to be properly parsed in JSON in the getShapeData method. After this commit, we also allow single quotes to prevent issue if someone doesn't use double quotes in the the value of data-oe-shape-data. Which was precisely the case in one of the themes and this is why this commit is a fix. task-2327741 closes odoo/odoo#60835 Related: odoo/design-themes#421 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-02[FIX] web_editor: unblock the editor after dropping the "Quotes" snippetqsm-odoo
Before this commit, when the user dropped the "Quotes" snippet, the editor was not allowing to drop any more snippet (see [1]). This was because the editors initialization related to the drop of the "Quotes" snippet was not able to be fully performed. Indeed, it is composed of carousel items, themself containing images. As some of those carousel items are hidden, the images they contains are too... and some options actually wait to access their naturalWidth. As the images are lazy loaded since [2], we were thus waiting infinitely. [1]: https://github.com/odoo/odoo/commit/277f39904e7218bef2dd23b1c5b719ce8660008f [2]: https://github.com/odoo/odoo/commit/617c716aeafd7bbc776d81da134a9b25329f08c9 closes odoo/odoo#61123 Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2020-11-03[FIX] web_editor, website: restore footer visibility optionxO-Tx
Making the footer visible after having made it disappear was not possible anymore because of [1]. Part of https://github.com/odoo/odoo/pull/59624 task-2312878 [1]: https://github.com/odoo/odoo/commit/61ffe97d03deae0aee72568311c453d1cd3470c8 closes odoo/odoo#59624 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-02[FIX] web_editor: DOM is not cleaned before saving custom snippetsSamuel Degueldre
Previously, when saving a custom snippet, the outerHTML of the snippet was naively read directly and saved as a new custom snippet. Unfortunately this completely bypasses all cleanup mechanisms that we have before saving, such as stopping the public widgets, or creating attachments for cropped or optimized images. This would result in weird bugs, where public widgets would appear twice when dropping a custom snippet containing one, as well as the creating a new attachment for any image that was optimized or cropped before saving the custom snippet every time it was dropped in the page again. Unfortunately there is no good mechanism for an option to ask the editor to clean the DOM without actually saving it, as a temporary measure, the snippet-save option will instead save the whole page (which will clean up the DOM) and save the custom snippet after the save, before refreshing the page and reopening the editor, not unlike some theme options. task-2341612 closes odoo/odoo#61202 X-original-commit: 2fa955267a3f81495be82c4214abd8befcf1fc95 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-02[FIX] web_editor: avoid traceback on form inputs double-clicksBenjamin Vray
Before this commit, double clicking on the border or on the padding of a form input generated a traceback. task-2312878 closes odoo/odoo#60816 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-27[FIX] web_editor: properly allow to select a bg color for badgesqsm-odoo
Before this commit, the badges' background color was not possible to edit: the previews were done correctly but the background color was removed after final selection. This was because the background color property is animated on badges, messing with the related edition function. Closes https://github.com/odoo/odoo/issues/59337 closes odoo/odoo#60742 X-original-commit: 0b0f3a9c6d60cd9883628d83b6893efd24556aa3 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.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-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-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: 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-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] 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-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-22[FIX] web_editor, website: scroll effect dropdownstefanorigano (SRI)
Fix the design. Trig animations hovering any part of the button rather than its inner image only. task-2335267 part-of: #57942
2020-09-18[IMP] web_editor: perf; skip mutually-cancelling actions in editorSamuel Degueldre
Previously, when the user quickly hovered over many options (eg when trying to click on the last item of a select menu), all of the options that were briefly hovered would be previewed in succession. While this is not a problem for options that are fast to change, some option take some time (eg, image filters), but all of the intermediary previews would still show one after another, which is both very slow and completely useless. This commit adds a per-widget action queue. When a widget is called, it will immediately add an action item to this queue, but when the snippet_edition mutex becomes available to execute this action, it will first check that this action will not be immediately reverted, and if it will, the action is skipped entirely. task-2337344 closes odoo/odoo#57947 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-22[FIX] web_editor, *: wait for drag & drop ending before savingqsm-odoo
*: website This is not the cleanest of fixes because the original code have to be refactored first but this solves the problem we had *sometimes* when drag and dropping a snippet then immediately saving (only saw the bug in automatic tests): same as all snippet options, the operation had to be mutexed so that saving is done after its full execution. Part of https://github.com/odoo/odoo/pull/57975 task-2344227
2020-09-18[FIX] web_editor: fix color comparison and store normalized colorsSamuel Degueldre
Previously, shape colors were stored in non-normalized form (eg, would use the color's name if it was a palette color), this caused some issues if you chose a palette color for a shape, then changed the palette: the wrong color would appear in the color picker because it would look use the color of the current palette instead of the color that was actually chosen. This commit also normalizes the case of color strings before comparing them, as this was causing some colors to be considered non-default because of different capitalization. closes odoo/odoo#58026 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-16[IMP] web_editor, *: make media-dialog search odoo media-librarySamuel Degueldre
*: website, web_unsplash, website_blog We have recently created an odoo media library that exposes a public API for searching for open-source media, including dynamic SVGs that can be used with the dynamic background-shape system to create illustrations whose colors can be changed by the user. This commit adds the corresponding client-side functionalty: search for the images in the media-library, creating a corresponding attachment when selected, as well as an option to customize the colors of the dynamic SVGs. In the process, adaptations have been made in the web_unsplash module to avoid duplicating code and to adapt code that was making assumptions that are no longer valid. To make new users more aware of this feature, all default images have been hidden from the media-dialog, so that the user is prompted so search for images. Some tests and tours that were relying on having default images in the media-dialog (eg in website_blog) have been adapted to match. task-2316651 Linked to: odoo/iap-apps#235 closes odoo/odoo#56479 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-11[FIX] web_editor: do not display quality options on SVGs/GIFsSamuel Degueldre
When the width and quality option for images was moved from the optimize-dialog to the left-panel, it was made available on all image types. However, width and quality options don't make sense on SVGs and would break animated gifs. This commit makes it so that quality options are only available on JPEG and PNG images. closes odoo/odoo#57561 X-original-commit: 315be6f4765268eada4b39a637136c86a30720eb Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-04[FIX] web_editor: various shape fixes (hide on mobile, bad joint, ...)Samuel Degueldre
This commit fixes various things with the shapes: shapes are now hidden on mobile by default, the shapes "blobs 02" and "blobs 03" now connect properly, and the shape pager now shows the name of the current page. Airy shapes now have embedded media-queries so that they're more visible in the shape selector. The order of the pages in the shape selector has been adapted so that shapes that are easier to use are on the first few pages. A number of shapes have been "cut" differently to leave more space for content, and some shapes have had their top/bottom anchoring swapped. task-2319484 closes odoo/odoo#56567 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-08-22[IMP] web_editor, website: introduce foldable zones in the editor UIqsm-odoo
Now any set of widgets and rows can be placed in a we-collapse element so that those elements can be foldable. The first element inside (or the mentioned "string" on the we-collapse element itself) is used as the always shown element (with a toggler on its left to toggle the visibility of the other items). we-collapse inside other we-collapse is supported as well. Limitations / Other infos: - The use of '⌙' and &emsp; characters is not automatic (yet?). Sometimes it actually make sense to use them without a we-collapse or to not use them in a we-collapse. - The use of we-collapse is limited to widgets inside the same option. So unfortunately, there is no current way to add all bg image options in a folable section as those contain many different options. Maybe in the future. Part of https://github.com/odoo/odoo/pull/56350 closes odoo/odoo#56350 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-19[IMP] web_editor: add webgl image filtersSamuel Degueldre
This commit adds webgl image filter to the existing image options, including a custom filter that lets the user access color-correction options (saturation, brightness, contrast, sepia, ...) as well as blending modes for color filters. Part of https://github.com/odoo/odoo/pull/53114 task-2279190 closes odoo/odoo#53114 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-17[IMP] web_editor: add delete button on snippet overlayqsm-odoo
This commit adds a trash icon on the snippet overlay to delete the snippet without using the left panel button. task-2314805 closes odoo/odoo#55612 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-14[IMP] web_editor: review 'o_we_image_weight' designstefanorigano (SRI)
Part of https://github.com/odoo/odoo/pull/55959 task-2157252 closes odoo/odoo#55959 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-14[IMP] web_editor, website, *: adjust general ui spacing/alignmentstefanorigano (SRI)
*: website_form Part of https://github.com/odoo/odoo/pull/55959 task-2157252
2020-08-14[IMP] web_editor, *: add caret icon to dropdowns & colorpicker modalqsm-odoo
*: website Part of https://github.com/odoo/odoo/pull/55959 task-2157252 Co-authored-by: stefanorigano (SRI) <sri@odoo.com>
2020-08-13[FIX] web_editor, *: restore custom snippets thumbnailsqsm-odoo
*: website Since [1], the thumbnails of the saved snippets were not right anymore, all fallbacking to the default image. This is because snippets thumbs now use svg files instead of png and the snippet saving feature did not allow it. This commit fixes that and makes the feature more robust. - Allow to use any original thumbnail, and not only for website app. - Remove useless defaut image, a fallback for when the feature is broken is useless. - Identify snippets by key instead of by main class (possible since the new `data-snippet` attribute on snippets). [1]: https://github.com/odoo/odoo/commit/b7fe2bdae2f45372c0d538767a226a413b806f3f closes odoo/odoo#55896 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-10[IMP] web_editor: allow min, max and step param on range widgetqsm-odoo
Part of https://github.com/odoo/odoo/pull/47313 task-46147
2020-08-10[IMP] website, *: enable the parallax option for all snippetsqsm-odoo
*: web_editor, website_blog Unfortunately, this feature revealed a new batch of flaws in the editor widgets system so some hacks were made to make it work. We will always have the time to improve the pure technical side later. This commit also separates the notion of color filter from the notion of parallax. A color filter can now be applied independantly, when there is either a background image or a background video. Applying a color filter on top of a background video is actually a new feature. Applying a color filter on top of a background image is actually now achievable by two different ways: this new color filter layer or by applying the color transformation on the image itself via the related option. Depending on the user case, both could make sense at the same time, but more importantly: having a CSS color filter is useful for using those for default Odoo content (e.g. like the current contact us page where we use a cover banner with an image with a black filter on top of it: doing that without CSS color filter would mean to alter the image directly which would not be ok when the user changes the image). Also, sometimes you want the unfiltered image on a page and the exact same one but filtered on another (for example: forum images). Note: this commit also "fixes" an issue: the optimization feature for images when parallax was enabled was not available before. Part of https://github.com/odoo/odoo/pull/47313 task-46147
2020-08-07[IMP] web_editor, website: add background shapes snippet optionSamuel Degueldre
This commit adds a new snippet option allowing the user to choose one of a series of SVG shapes as their background, or to be overlaid over the background image of a snippet and to customize the colors of those shapes. Part of https://github.com/odoo/odoo/pull/53017 task-2210790 closes odoo/odoo#53017 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>