summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/editor
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-05-18[FIX] website: correctly set accordion idsSébastien Mottet (oms)
data-parent fields were set on tab link and not on the tabpanel div. It prevented the accordion of having the right behavior: closing all the other tabs when a tab is clicked to be opened. closes odoo/odoo#70960 X-original-commit: 32b2c17eb7bec5293dfc0cfb4bb07d19dc2ec5c3 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-04-06[FIX] website: decrease moving blocks speed by 35%Younn Olivier
When moving blocks up and down, the speed has been decreased by 35%, as it was too fast for the user before. Part of https://github.com/odoo/odoo/pull/65575 task-2446852
2021-03-04[FIX] website: state not saved for accordion snippetBenjamin Vray
Before this commit, the states (collapsed/not collapsed) of the tabs of the accordion snippet were not saved if it was the only changement in edit mode. After this commit, we trigger a content change when the states of the tabs is changed. task-2442237 closes odoo/odoo#67252 X-original-commit: 18af2ecade9482b5243059aefbfa79410ebf59a6 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-02-24[FIX] website: hide block in mobile display modeOussama MESSAOUDI
Before this commit, display mode is changed to block after hiding it on mobile mode. After this commit, only change display mode for mobile and use inherited mode otherwise. task-2431659 closes odoo/odoo#65716 Signed-off-by: Quentin Smetz (qsm) <qsm@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-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-01-19[FIX] website: an erroneous Google font makes website not editablenie
Steps: - Go to "Website" > "Go to Website" - Click Edit in the top right corner - Click Options - Select "Add a Google Font" in the Font Family field - Insert an erroneous Google Font link (e.g. https://fonts.google.com/specimen/Robotoj ) - Save & Reload - Click Edit again Bug: The Edit button is not responding anymore Explanation: We try to `@import` the link in multiple files. For example, here: https://github.com/odoo/odoo/blob/70eb39b0cf30c1acf9a7116e109874b60e27aa2c/addons/website/static/src/scss/website.scss#L10 An erroneous font family results in an error 400 from the Google Fonts server. This prevents parts of the JS to load and makes it impossible to enter the edition mode. `EditPageMenu` handles the behavior when clicking on the Edit button. This menu depends on `website.compiled_assets_wysiwyg` as seen here: https://github.com/odoo/odoo/blob/b02a99bec709b5a6dc4dabb6cb81435dadc24e7e/addons/website/static/src/js/menu/edit.js#L10-L14 Since there is an error generating the file, the Promise fails but the error is not handled: https://github.com/odoo/odoo/blob/70eb39b0cf30c1acf9a7116e109874b60e27aa2c/addons/web/static/src/js/core/ajax.js#L164-L168 This commit prevents CSS loading errors from silently failing. The crash screen will only show up if the user is logged in and has edition rights. This commit also prevents the user from posting the form if the font is not accessible. At the moment, querying an unknown Google font from a script will result in a CORS error. A valid one will pass just fine. In case Google changes the behavior of these queries and allows the 400 to be sent, the fix also checks if the query returned an `ok` status code. opw:2439073 closes odoo/odoo#64695 Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-01-11[FIX] web_editor, website: prevent multiple click on saveRomain Derie
Clicking on save on html editor is taking quite some time. The user might think something is not happening and need to click again. If he does click again, 2 write RPC will be sent, making the COW business code being triggered twice, ultimately leading to create 2 COW. Instead of A / \ B B' It will be A / | \ B B' B' With as many B' than there is click on save. This commit adds a generic helper to make a button load/spin. closes odoo/odoo#63417 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-31[FIX] website: fix blog post / event title colorSiddarth Gajjar
Before this commit, due to change in cover option refactoring at [1], class 'o_record_has_cover' was removed from default configuration and may not be saved properly. [1]: https://github.com/odoo/odoo/commit/da32bdb88a4726a0dcee73f2c505ef5ea68c72ef task-2387990 closes odoo/odoo#62004 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-10[IMP] website: improve autocomplete dropdown UISiddarth Gajjar
- Before this commit, Autocomplete dropdown ui is not compatible with existing editor ui. - After this, Autocomplete dropdown UI for url and GMAP imrpoved. closes odoo/odoo#60735 Taskid: 2352870 Closes: https://github.com/odoo/odoo/pull/60735 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-17[FIX] website: remove multi snippets zones in the headerqsm-odoo
task-2387598 closes odoo/odoo#61835 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.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-03[FIX] website: fix footer/header item moveqsm-odoo
Using the handle to move elements from footer/header anywhere in the page would make the main element disappear with endless content loading animation. The end of the drag and drop executes a serie of methods : _destroyEditors > cleanForSave > toggleTargetVisibility Since the "cleaning for save" is called for all snippets and the footer doesn't contain a 'o_snippet_invisible' class, the "onTargetShow" method is called... but actually hide the footer because the "onTargetShow" implementation was so that it clicks on the visibility checkboxes regardless of its current status. Part of https://github.com/odoo/odoo/pull/59624 task-2312878
2020-10-20[FIX] website: fix add slide carousel snippetBenjamin Vray
Before this commit, when adding a new slide, the data-target of the new indicator was wrong because we were using the slide ID instead of the carousel ID. task-2318526 closes odoo/odoo#60381 X-original-commit: ac7a117ccc64df54cfd271ee4c4b62ef49dd71ff Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-14[FIX] website: show the correct value for hoverable dropdown optionqsm-odoo
Before this commit, the hoverable dropdown option was broken because we changed the option selector to the navbar element instead of the header element. But we forgot to care about the data-select-class which adds a class on the header. This commit fixes the issues by changing the $target back to the header element for the related option as the fact it is linked to the navbar element is only so that the options appear in a different section, on navbar click. Part of https://github.com/odoo/odoo/pull/59842 task-2312878 closes odoo/odoo#59842 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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[REM] website: remove the folded list snippetAntoine Guenet
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-25[FIX] website: prevent dynamic snippet flicker in edit modeLaurent Stukkens (LTU)
* Prior to this commit the dynamic snippet was flickering (destroy followed by init) because the parallax option triggers a _refreshPublicWidgets in the onFocus. As such each time the user clicks somewhere in the snippet the snippet desapears and reappears which can be confusing for the user. * After this commit, the parallax option will only trigger a refresh on snippets that are using parallax. This commit also prevent the user from selecting an element of the dynamic snippet as it is not customizable. task-2339246 closes odoo/odoo#57693 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-23[FIX] website: restore top editor bar for translate modeqsm-odoo
The text tools were moved in the right panel with a temporary solution but as there is no right panel in translate mode, the text tools were just floating summernote-way. This commit restores the top editor bar in that case while waiting for the new editor. Part of https://github.com/odoo/odoo/pull/58347 closes odoo/odoo#58347 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-22[FIX] website: remove console.logstefanorigano (SRI)
Commit [1] introduced the console.log by mistake. [1]: https://github.com/odoo/odoo/commit/eb34a7841978aea5c3f2d04121fd0e6adda94e3b#diff-24b0433302053618c5b742f3eded1d67R2153 task-2335267 closes odoo/odoo#57942 Part-of: #57942 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-22[FIX] website: reorder/reword header's optionsstefanorigano (SRI)
task-2335267 part-of: #57942
2020-09-22[IMP] website, *: move page scrollbar to #wrapwrapqsm-odoo
*: web, web_editor, portal, account, website_blog, website_forum This is probably not ideal to move the scrolling behavior out of the html element but this will be needed for the editor to not have a double scrollbar on the right. This is actually also useful for the scrollbar to appear under the purple odoo menu instead of its right. This commit, if to be reverted in the future, however contains many improvements to make the transition easier that should be kept: jQuery and Odoo functions to be able to scrollTo a specific element, get the top scrollable element, check if an element is scrollable, etc. Also, some magic was done: if some code tries to scroll to a specific scroll position via jQuery's scrollTop or animate functions on the html/body element, those will still work as intended (obviously, using the new utils to do that is however recommended). This commit also reviews our scroll behaviors to make them more robust and share the code. Part of https://github.com/odoo/odoo/pull/57975 task-2344227
2020-09-16[IMP] web_editor, website: improve editor loading effectsqsm-odoo
- Share the code for tab switching loading and slow option loading. - Now add a loading effect over the content when the content is changed and a loading effect over the editor panel when the editor panel is being changed Part of https://github.com/odoo/odoo/pull/55614 task-2213114 closes odoo/odoo#55614 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-15[FIX] website, *: review scroll button and height option behaviorsqsm-odoo
*: website_blog - The scroll button option is now again available for all snippets, not only when the height is forced to 50% or 100%. Indeed, nobody would think to change that option if the snippet is already naturally tall and you could well want that scroll button on small-height covers. - The scroll button is now placed on top of the snippet content instead of below in its natural flow. This allows it to work with snippets like "Big Boxes" and actually prevent to miscenter the snippet content just by adding that scroll button. - Review the option UI and allow to control the spacing around the scroll button. - the "Big Boxes" snippet was at last adapted to work well with 50% and 100% height options. - The 100% height option has now associated JS so that the height is computed to use 100% minus the size of the header. Note: this may be backported to 13.2 where the option was introduced and where those improvements may appear essential for the feature to not be considered as buggy. Part of https://github.com/odoo/odoo/pull/57764 task-2224404
2020-09-14[FIX] website: fix google map snippet tracebackThanh Dodeur
before this commit, when selectioning the snippet with an invalid API key, a traceback was triggered and the snippet was destroyed. task-2338730 closes odoo/odoo#57615 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-27[IMP] website: reorganize header options UI + implement shadow & bordersqsm-odoo
Also change the default behavior of all shadow options: now switching inset / outset resets to default bootstrap values. Part of https://github.com/odoo/odoo/pull/56427 task-2264627 Co-authored-by: Cocographique <nmi@odoo.com>
2020-08-27[IMP] website, *: review existing navbar templates and templates systemCocographique
*: portal, website_sale, website_sale_wishlist Portal-without-website header is now more basic, without the need of a collapsed element. It is then entirely replaced when website is installed with header templates, t-calling all the main parts. Part of https://github.com/odoo/odoo/pull/56427 task-2264627 Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-27[IMP] website, *: add off-canvas and other hamburger menu optionsstefanorigano (SRI)
*: web, portal Part of https://github.com/odoo/odoo/pull/56427 task-2264627 Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-24[IMP] website: implement body image as a SCSS variableqsm-odoo
This is unfortunately replacing old hacks by new ones but using SCSS variables for this is more consistent with the rest of our website customization possibilities. The hack here is for the UI which is controlling two SCSS variables at the same time (body-image and body-image-type). This has to be improved. closes odoo/odoo#56420 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.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-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, 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, *: review 'options' tab specific components designstefanorigano (SRI)
*: website Part of https://github.com/odoo/odoo/pull/55959 task-2157252
2020-08-13[IMP] web_editor, *: add snippets search filterxO-Tx
*: website Add a search bar at the top of the "Blocks" tab to filter snippets. Part of https://github.com/odoo/odoo/pull/55272 task-2309832 closes odoo/odoo#55272 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-10[IMP] website: review parallax option UIqsm-odoo
Instead of two select: Parallax: none/fixed/very slow/slow/... Direction: Bottom to top/top to bottom We now have: Parallax: none/fixed/bottom to top/top to bottom Intensity: slider Part of https://github.com/odoo/odoo/pull/47313 task-46147 closes odoo/odoo#47313 Related: odoo/design-themes#335 Related: odoo/upgrade#1553 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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: review color combination previewstefanorigano (SRI)
Part of https://github.com/odoo/odoo/pull/55645 task-2157252
2020-08-07[IMP] web_editor, website, *: create background-type toggler optionSamuel Degueldre
*: website_blog Previously, background colors, images, and videos could all be applied on the same section, such that the image can be used as a fallback for the video, and the color as a fallback for the image. However, if you wanted to change the background color behind the background image, the background image would be removed. The background image and background video also shared the same widget to pick the image or video. This commit adds a background-type toggler, where the user can toggle the background color, image and video individually. It also makes the video picker into its own UserValueWidget, such that the user can pick both an image and video without overriding the other. Part of https://github.com/odoo/odoo/pull/53017 task-2210790
2020-08-07[IMP] web_editor, *: simplify UserValueWidget updatesqsm-odoo
*: website Before this commit, editor widgets were updated by 3 successive calls to methods 'setValue', 'updateUI' and '_updateUI'. The last two were in charge of updating the UI depending of the value that was set, only in specific condition (like "if the widget is not focused", "or not previewed", ...). This is now in fact useless: 'setValue' can be in charge of the UI update. Indeed, when a value is set on a widget there is no reason to not update its UI anymore. This was useful when the UI was updated on preview, which is not the case anymore. This could also be useful for widget with multiple options attached to them... but in those rare cases updating the UI multiple times (one time per option method) should not be a problem. Part of https://github.com/odoo/odoo/pull/55588
2020-08-06[FIX] website: restore sub-headings edition togglingqsm-odoo
Since [1], the sub-headings edition was not possible anymore in the 'options' tab of the editor panel. This is because the visibility of rows is now automatic, depending of the visibility of the inner widgets. The custom code for that row visibility, controlled by the user, was thus not working anymore. Note: this fix solves the problem with big hacks. Better code will handle foldable zones generically. [1]: https://github.com/odoo/odoo/commit/8d57f21d7df2033f462ead60fcb5abba4546213e Part of https://github.com/odoo/odoo/pull/55529 closes odoo/odoo#55529 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-08-06[IMP] website, *: review the 'options' tab of editor panelqsm-odoo
*: web_editor This will more probably change again in the future but this is a first step towards a hierarchized 'options' tab for the editor panel. Part of https://github.com/odoo/odoo/pull/55529
2020-07-23[IMP] website: ease google font selectionBenjamin Vray
Before this commit users needs to link an embed code provided by Google. But it became less obvious to find this code so we now ask for the link of the font page. But we still keep the possibility to link an embed code if ever a user is wrong. task-2304075 closes odoo/odoo#54816 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-28[IMP] website: allow to change GMap API key from left panelThanh Dodeur
Part of https://github.com/odoo/odoo/pull/49101 task-2091396
2020-07-28[IMP] website, *: move all google map options to left panelqsm-odoo
*: web_editor -> Introduce the we-gpspicker widget and improve the way the gmap lib is loaded (for Odoo / multiple snippets / ...). Part of https://github.com/odoo/odoo/pull/49101 task-2091396
2020-07-22[FIX] web_editor, *: restore editor UI for selected CSS variablesqsm-odoo
*: website Commit [1] broke the UI for some options related to CSS variables when using Chrome. The commit made sure the string-value CSS variables are printed with quotes, so that the JS representation of the CSS values can distinguish them (strings = strings with surrounding quotes, others like colors, numbers, etc = strings without surrounding quotes). With chrome, the printed surrounding single quotes are read as double quotes for strange reasons though... so the value "a" was not considered equal to the value 'a'. This commit makes sure surrounding quotes are normalized. This is done through a new utility function to read CSS variables. This also makes sure the values are trimmed, and colors normalized. [1]: https://github.com/odoo/odoo/commit/3a34e39caa8544059dfb1888edc29c62c3efde31 closes odoo/odoo#54757 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-15[IMP] website, *: make cover options always availableDramixDw
*: website_blog, website_event It would make sense to be able to change the height of a cover or to change the text alignment even if there's no backgroung-image. Therefore, we're removing the background-image restriction for the options of the cover snippet. Part of https://github.com/odoo/odoo/pull/47933 task-2210733 closes odoo/odoo#47933 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-14[IMP] web_editor, *: review background color/image options UIqsm-odoo
*: website, mass_mailing, website_blog, doc Part of https://github.com/odoo/odoo/pull/53930 task-2157252
2020-07-14[IMP] web_editor, *: review the editor design CSSqsm-odoo
*: web, mass_mailing, website, website_form, website_sale New CSS design of the editor (step 1/x). This work is unfortunately far from perfect but is a first step towards what we want. In particular, much CSS linked to elements that are meant to be removed/moved in the upcoming weeks was done in a huge rush but will thus hopefully be removed/reviewed before the 14.0 release. As the design is now far more complex including gradients and other "complex" elements, it was also very difficult to keep a design based on css-variable so this system was removed, which means that the editor now appears the same everywhere (backend, frontend, ...). The original goal of this system was to have an adapted style for backend, frontend and website visitors. Unfortunately, the current result was a very good frontend editor design, a not-so-good backend editor design (for mass mailing at least) and a totally unadapted design for the website visitors. Making this perfect will be achievable by loading different assets for those 3 areas and hopefully those assets will only differ by the values of editor scss variables. Part of https://github.com/odoo/odoo/pull/53930 task-2157252