summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
AgeCommit message (Collapse)Author
2019-04-17[FIX] web_editor: FieldHtml commitChanges called too soonmgh-odoo
The original issue appeared in mass_mailing where triggering the mail template preview throws a client error. This commit prevents commitChanges() from being called before the element is rendered. Task-ID: 1950784
2019-04-10[MERGE] forward port branch saas-12.2 up to 2694174b410Christophe Simonis
2019-04-09[MERGE] forward port branch saas-12.1 up to 6d4940675f1Christophe Simonis
2019-04-09[MERGE] forward port branch 12.0 up to ea1fc124efcChristophe Simonis
2019-04-08[MERGE] forward port branch saas-11.3 up to 4c61621efbbChristophe Simonis
2019-04-08[MERGE] forward port branch 11.0 up to 9a7e3c8b498Christophe Simonis
2019-04-05[MERGE] forward port branch saas-12.2 up to f2be461f090Christophe Simonis
2019-04-01[FIX] web_editor: do nothing on select all with empty editableAntoine Guenet
Ctrl-A on an empty editable threw an error. This fixes it. closes odoo/odoo#32301 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-26[MERGE] forward port branch saas-12.1 up to f00c490be86Christophe Simonis
2019-03-25[MERGE] forward port branch 12.0 up to 11b1e12cde3Christophe Simonis
2019-03-25[MERGE] forward port branch saas-11.3 up to e9068c290b3Christophe Simonis
2019-03-25[MERGE] forward port branch 11.0 up to 0196a6feb5aChristophe Simonis
2019-04-08[FIX] web_editor: no lose tooltip on selectionNicolas Lempereur
The editor has a tooltip editor wizard "Change media description and tooltip", but when selecting an image there is also a tooltip: "Double-click to edit" added by the editor. The combination of the two break the functionality, eg: - if a tooltip is set with editor, then selecting the tooltip: we see the set tooltip and not "Double-click to edit" - if a tooltip is set with editor, then selecting the image back, then opening the tooltip editor => the set tooltip is lost With this changeset, we just do not show "Double-click to edit" tooltip if there is a tooltip set on the element. opw-1946801 closes #32482 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-04[MERGE] forward port branch saas-15 up to 214e819c1bbChristophe Simonis
2019-04-04[MERGE] forward port branch saas-14 up to 6e0c89867e3Christophe Simonis
2019-04-04[MERGE] forward port branch 10.0 up to 60592561d71Christophe Simonis
2019-04-04[FIX] web_editor: support youtube-nocookie.comqsm-odoo
closes odoo/odoo#32332 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-21[FIX] web_editor: editor hang on an infinite loopJulien Castiaux
In the `getMatchedCSSRule`, the transcoder try to find the real value of a `text-align: inherit` css rule by ascending the html tree until it finds a `text-align` with a meaningful value. By default is exits if it reachs the `<html>` top node but doesn't exit if a call to `.parent()` exits the dom (the behavior of jquery is to return a dummy element when calling `.parent()` on an element that has no parent). This lead to an infinite loop for badly formatted html content. opw-1951095 closes odoo/odoo#32014 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-21[MERGE] forward port branch saas-12.1 up to 6878c9f3424Christophe Simonis
2019-03-20[FIX] web_editor: review drag and drop in the editorqsm-odoo
Forward-port of https://github.com/odoo/odoo/commit/be689c53c13330832510c8cef332ac862d4ed5e8 was missed from 11.0. closes odoo/odoo#31971 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-19[MERGE] forward port branch 12.0 up to 82c4393fd02Christophe Simonis
2019-03-15[FIX] web_editor: handle snippet option submenus of submenusqsm-odoo
Commit https://github.com/odoo/odoo/commit/8ca92330b367d54fddf1c02089ee9d0bc3edbfdc did not think about submenus inside submenus, which is the case in the website animate option. This made snippets potentially have multiple animations on them, with undesired behaviors. This commit also accordingly reviews the _setActive method for the select-class option and also adapts following the recent forward-port of https://github.com/odoo/odoo/pull/31440 Related to task-1929133 closes odoo/odoo#31477 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-18[MERGE] forward port branch saas-11.3 up to 4e39328a76aChristophe Simonis
2019-03-11[MERGE] forward port branch saas-12.1 up to 2b3296bbf8bChristophe Simonis
2019-03-08[MERGE] forward port branch 12.0 up to c023d0784f2Christophe Simonis
2019-03-08[FIX] web_editor: update the handle on click input node in website editAntoine Guenet
When clicking on a snippet containing an input node on Firfeox, the handle wouldn't appear as expected. This is due to trying JQuery (but not only) trying to modify properties that are restricted on Firefox but not on Chrome. The error message still appears from time to time due to Summernote using `document.getSelection`, which is problematic with Firefox. This will be fixed with the next version of the editor. In the meantime the direct effect of that error (the handle issue) is fixed with this commit. The standard target (`Event.target`) is now looked for in first position instead of non-standard 'Event.srcElement` (IE alias for `Event.target`) then `Event.originalTarget` (Mozilla-specific) and finally `Event.target` (standard). `Event.originalTarget` is restricted on Firefox so it was giving the same cryptic error as mentioned above ("Error: Permission denied to access property", which generally points to same-origin policy violations). Ref: - https://developer.mozilla.org/en-US/docs/Web/API/Event/srcElement - https://developer.mozilla.org/en-US/docs/Web/API/Event/originalTarget - https://developer.mozilla.org/en-US/docs/Web/API/Event/target - https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects - https://developer.mozilla.org/en-US/docs/web/javascript/reference/errors/property_access_denied closes odoo/odoo#31710 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-05[MERGE] forward port branch 11.0 up to 27081bf6f5fChristophe Simonis
2019-03-05[FIX]web_editor: Fixed traceback due to 'field_html' widget while saving recordmgh-odoo
Previously, when user edited record having 'field_html' widget and tried to save the record immediately, a traceback was faced sometimes because content was not loaded yet. This commit fixes the issue by calling super method if the content is not loaded yet properly. Task: #1932687 Closes: #30833 closes odoo/odoo#31581 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-06[FIX] web_editor: properly set media dialog `onlyImages` and find videoAntoine Guenet
Media dialog was trying to reach the current media's parent node, which was not possible as it was cloned on instantiation. To fix this, the `showImageDialog` now passes the `onlyImages` option upon instantiation, checking the parent's data. It also passes the media's parent if said parent is a video. This way, neither of these two things need to be done in media dialog. closes odoo/odoo#31634 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-06[FIX] web_editor: wrong focus detection in the editorGorash
Issue detected with tests in the branch that replace deferred by native Promise. Need to add isMedia to detect if the target is already a media when focus the editor. closes odoo/odoo#31632 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-04[FIX] web_editor: Expose focus method for activate method of html fieldGorash
closes odoo/odoo#31577 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-04[FIX] web_editor: Evoid the risk of deleting the summernote libraryGorash
For iframes, we need to inject summernote because there are references to "document" in it. When loading the iframe, if it is canceled, there is a risk that the library is erased and that it breaks the field html. We must also slightly modify the library to prevent it from making changes to the library of the main "window".
2019-03-01[FIX] web_editor: wait for animation end before covering snippetsqsm-odoo
Part of https://github.com/odoo/odoo/pull/31440 opw-1929133 closes odoo/odoo#31440
2019-03-01[FIX] web_editor: properly check snippet optionsqsm-odoo
Commit https://github.com/odoo/odoo/commit/c2b8d2a3017256e4ea60a3710bdaab6d1f693d81 made the mistake of considering each dropdown-menu individually while all are considered to be the same when enabling a class. From saas-11.x, commit https://github.com/odoo/odoo/commit/8ca92330b367d54fddf1c02089ee9d0bc3edbfdc will group by dropdown menu but that will be another fix to make. Part of https://github.com/odoo/odoo/pull/31440 opw-1929133
2019-02-21[FIX] web_editor: stop removing empty block after deleting its contentsAntoine Guenet
Deleting all the contents of a block node replaced it with a blank paragraph node. To restore v12 behavior, it should only do that when pressing backspace in an already empty block, which is now what it does.
2019-02-21[FIX] web_editor: do nothing on save if no media was selected in modalAntoine Guenet
When in the media modal, if one selected no media but clicked the "ADD" button it resulted in an error and a failed RPC instead of simply closing the modal without doing anything. v12 behavior is now restored. closes odoo/odoo#31308
2019-02-19[FIX] web_editor: open the link modal on dblclick button descendentAntoine Guenet
The link modal only opened on double-click directly on an anchor, meaning that double-clicking text in a span node within the button (as is the case in the call-to-action snippet for instance) wouldn't open the modal. Now it opens as long as we have an ancestor that is an anchor, unless the double-click occurs on a media (eg: a pictogram), in which case it should open the media's modal. closes odoo/odoo#31229
2019-03-27[MERGE] forward port branch saas-12.2 up to 7c1a9a8204fChristophe Simonis
2019-03-25[MERGE] forward port branch saas-12.2 up to 230ad8c381eChristophe Simonis
closes odoo/odoo#32088 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-13[MERGE] forward port branch saas-12.2 up to c9f832d9f03Christophe Simonis
closes odoo/odoo#31790 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-06[REF] web_editor: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06[FIX] web_editor: wrong focus detection in the editorGorash
Issue detected with tests in the branch that replace deferred by native Promise. Need to add isMedia to detect if the target is already a media when focus the editor. This is a manual forwardport of PR odoo/odoo#31632. closes odoo/odoo#31633 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2019-03-06[FIX] web_editor: Expose focus method for activate method of html fieldGorash
closes odoo/odoo#31577 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-06[FIX] web_editor: Evoid the risk of deleting the summernote libraryGorash
For iframes, we need to inject summernote because there are references to "document" in it. When loading the iframe, if it is canceled, there is a risk that the library is erased and that it breaks the field html. We must also slightly modify the library to prevent it from making changes to the library of the main "window".
2019-02-19[FIX] web_editor: clean or hide image handle data according to image sizeChristophe Matthieu
closes odoo/odoo#31183
2019-02-19[FIX] web_editor: properly position image handle in product configuratorAntoine Guenet
The image handle (grey overlay over the image) was not properly repositioning on scroll in the product configurator (a side effect of not having a popover). closes odoo/odoo#31226
2019-02-19[FIX] web_editor: stop wrapping text in p on delete in anchorAntoine Guenet
This notably fixes a bug with the accordion snippet (website) where selecting a title and typing seemed to add a newline. closes odoo/odoo#31222
2019-02-18[FIX] web_editor: remove invisible space on insert media where forbiddenAntoine Guenet
The web editor inserts zero-width characters (unicode 200B) around media when inserting them in the DOM so as to be able to edit before and after said media (contenteditable caveat). It should however not do so in fake not-editable nodes - such as the navbar - given that we do not expect to edit in them but only to replace the media. This ensures that behaviour. closes odoo/odoo#31200
2019-02-18[FIX] *: various docstring formatting issuesXavier Morel
Would yield block quotes instead of code blocks or lists or whatnot.
2019-02-18[FIX] web_editor: various levels of broken in docstringsXavier Morel