summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
AgeCommit message (Collapse)Author
2019-08-30[MERGE] forward port branch 12.0 up to 52f6e38cea8Christophe Simonis
2019-08-27[FIX] web_editor: bg-transparent filter=>no opaqueNicolas Lempereur
The color picker in snippet options has two way to set a color: have a data-color attribute => it is used, or have a o_custom_color class and the background-color is set directly on that color. In the case where we select no background color (transparent), it would work in preview, but when applied the opaque color of the transparent button (since opacity is not copied) is set which is wrong and unexpected. opw-2053636 closes #36131 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-08-23[FIX] web_editor: properly paste unwrapped textAntoine Guenet
When pasting from clipboard, the editor filters the nodes to paste. Among other things, it removes `meta`, `style` and `script` nodes. It did so using `jQuery`'s `not` method but that method has a side effect: it removes text and comment nodes as well if you pass it a `jQuery` selector. As a result, unwrapped text nodes could not be pasted. This commit fixes that by using `each` to remove the targeted nodes instead of using `not`. closes odoo/odoo#36012 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2019-08-21[MERGE] forward port branch saas-11.3 up to 668c360e32bChristophe Simonis
2019-08-21[MERGE] forward port branch 11.0 up to 1b234b1be75Christophe Simonis
2019-08-07[FIX] web_editor: Do not remove blockGoaman
Do not remove block in _removeNextEmptyUnbreakable. Before this commit, when you tried to remove insert a character in a td, with an empty td after the first one. The function _removeNextEmptyUnbreakable removed the empty td. It was for example breaking snippet in the website and mass_mailing. closes odoo/odoo#32096 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-08-07[FIX] web_editor: disable custom handling for Safari MacOSDavid Monjoie
2019-08-07[FIX] web_editor: fix selecting snippet template textDavid Monjoie
2019-08-07[FIX] web_editor: fix snippets preview on drop not displayingDavid Monjoie
2019-08-07[FIX] web_editor: fix snippets reloading tracebackDavid Monjoie
2019-08-21[MERGE] forward port branch saas-15 up to d8524aadf81Christophe Simonis
2019-08-21[MERGE] forward port branch saas-14 up to e854f683931Christophe Simonis
2019-08-21[MERGE] forward port branch 10.0 up to b058f709419Christophe Simonis
2019-08-20[FIX] web_editor: font>a colorize a change font colorNicolas Lempereur
If you change the color of a link with the editor without using the link edition menu, this do not work (which might be expected), but if the text outside the font had been colorized, the font will be applied outside of the link only. This is unexpected since if we have: "hello <a>cruel</a> world!", if we select only "cruel" and change color, the change only happen to "hello" and "world!". With this changeset, an anchor in the ancestor prevent to use an ancestor font tag to change color (which prevent the issue). opw-2044551 closes #35862 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-08-06[FIX] web_editor: remove virtual corrector/completion keyboard glitchGorash
For the ours need, we can not let the contentEditable behavior. Indeed, this one does not have the same behavior according to the browser. The DOM node could be erase, merge, cut, in them according to the keyboard interactions. The problem is that if we have to manage these behaviors, we have to manage everything. It was already the case in the previous version, however before we created an editor by zone and by a hack we mix the history. In the case of the virtual keyboard of some OS / Phone, the events are different and the autocompletion does not update (bug that prevents modification interactions with javascript). In order to solve these problems, we use another event for the insertion of the characters. However, we must also force the update of the corrector by forcing a blur and a focus. The current version is a temporary version. We are currently working on a version that uses a virtual dom and does not need to do excessive prevent default.
2019-08-07[FIX] web_editor: do to try to inline css for readonly html fieldsChristophe Simonis
closes odoo/odoo#35539 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-07-24[MERGE] forward port branch 11.0 up to 0375c0174daChristophe Simonis
2019-07-22[FIX] web_editor, website: stop snippet animations before cloningRomain Derie
Before this commit, when a snippet was cloned, its animation was not destroyed first. The flow was: 1. Clone the snippet (DOM) - web_editor trigger `snippet_cloned` 2. Start cloned snippet animation - website listen `snippet_cloned` This was causing bugs, eg facebook snippet for which the animation is to create an iframe containing the facebook widget. When cloning this snippet, its iframe would be cloned to, then its animation would be started, creating another iframe. To fix such flows, the snippet cloning flow should be: 1. Strop the snippet animation 2. Clone the snippet (DOM) - web_editor trigger `snippet_cloned` 3. Start cloned snippet animation - website listen `snippet_cloned` 4. Restart the original snippet animation task-1951466 closes odoo/odoo#35029 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-07-26[MERGE] forward port branch saas-12.2 up to 1d6d790513eChristophe Simonis
2019-07-25[MERGE] forward port branch 12.0 up to b82df99d7a8Christophe Simonis
2019-07-25[MERGE] forward port branch saas-11.3 up to 5f419d4ad33Christophe Simonis
2019-07-24[MERGE] Forward port of saas-12.2 to saas-12.3 up to 860ab5a1c28baMartin Trigaux
closes odoo/odoo#35119 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15[FIX] web_editor: avoid dialog error on email editionGorash
Under certain unknown conditions, the range cannot be applied and triggered an error. In order to allow the user to keep editing, we need to prevent the dialog from showing, hence the use of `console.error`. If this error appears, the carret is moved to the beginning of the focused node. If this error appears, then bullet can generate an error (I managed to have the bug once or simulate it by manually breaking the dom and range) We suspect a wrong snippet custom javascript code. see: https://github.com/odoo/odoo/pull/34188 closes odoo/odoo#34871 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-15[FIX] web_editor: can use copy-past as html with only textGorash
Some browser can send text content without tag when past html. To avoid this error we wrap the content before parse it with jQuery.
2019-07-18[FIX] web_editor, website: consistently apply undo on CTRL-ZAntoine Guenet
This fixes a bug in Website, that can be reproduced like so: - insert a snippet - insert a char in it - 2x CTRL-Z The second CTRL-Z didn't do anything because Summernote moved the range to the header, which is not editable. This fix moves the range to the first editable element in the editor in these cases, thereby keeping the focus in an editable area, and ensuring that hotkeys still function. The history feature being non-tested as of this version, no test could be added for this fix. closes odoo/odoo#34834 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-07-04[MERGE] forward port branch 11.0 up to 56ce29e71f7Christophe Simonis
2019-07-04[FIX] web_editor: tel url in werkzeug parserJorge Pinna Puissant
Before 8557bcf the URLs were never rewritten for multilang, which was an error and could duplicated the number of requests on frontend. Since 8557bcf the URLs are rewritten. In Odoo the werkzeug library is used to parse the URLs (this is similar to python parsing URL but works in python2 and python3 the same), and in this particular instance it chooses that tel:800800 is website http://tel:800800 and not a telephone number. The problem is when the url uses the uri 'tel:' and only numbers as a phone number, if the user uses the global format for telephone number (with the +) or using a separator for the numbers (e.g. '-' , '/'), in these cases there are no problems parsing the url (phone number RFC: https://tools.ietf.org/html/rfc3966). This commit changes the uri 'tel:' to 'tel://' this one is correctly parsed by the werkzeug library. opw-2029844 closes #34306 closes odoo/odoo#34586 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-16[MERGE] Forward port of saas-12.2 to saas-12.3 up to cf8e74a1a7d34Martin Trigaux
closes odoo/odoo#34907 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-05[MERGE] forward port branch saas-12.2 up to be5e8fdab80Christophe Simonis
2019-06-28[FIX] web_editor: restore broken VideoDialog optionsKishan Gajjar
- To enable loop on a video, only setting the 'loop' URL parameter to 1 will not work anymore. We also need to set the playlist parameter to the video ID. - Sound is no longer allowed in autoplay because of new autoplay policies of most browsers. To make autoplay work, the video must be explicitely muted. closes odoo/odoo#34323 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-07-11[FIX] web_editor: properly insert character in empty nested listAntoine Guenet
Fix a bug that can be reproduced like so: - Insert list - Type char - ENTER - TAB - Type char The character gets inserted _after_ the `br` instead of replacing it. closes odoo/odoo#34805 Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-06-21[MERGE] forward port branch saas-12.2 up to 8747d72f1efChristophe Simonis
2019-06-20[FIX] web_editor: avoid dialog error on email editionGorash
Under certain unknown conditions, the range cannot be applied and triggered an error. In order to allow the user to keep editing, we need to prevent the dialog from showing, hence the use of `console.error`. If this error appears, the carret is moved to the beginning of the focused node. If this error appears, then bullet can generate an error (I managed to have the bug once or simulate it by manually breaking the dom and range) closes odoo/odoo#34284 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-20[FIX] web_editor: allow fullscreen editor even when inside modalqsm-odoo
The new editor of https://github.com/odoo/odoo/pull/29775 came with a fullscreen option. When using the toggle when the editor is in inside a modal, the editor stretched only to match the size of the modal instead of the viewport. This is because the 'position: fixed' rule which is used to achieve the fullscreen layout cannot work if a parent of the element has a CSS transform applied on it. Indeed in that case, that element acts like the viewport for 'position: fixed' elements. closes odoo/odoo#34272 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-07-05[MERGE] forward port branch 12.0 up to 9c742d0c656Christophe Simonis
2019-07-04[MERGE] forward port branch saas-11.3 up to 1debaa89f14Christophe Simonis
2019-07-18[FIX] web_editor: remove "missing `class` on parent"Julien Castiaux
On a chromium based browser. Install theme_treehouse, add the "Step" widget. Double click on the FA-icon, error in log. The parent element of `self.$media` does not have a `class` attribute, accessing that attribute returns `undefined` and `cannot call match on undefined` error. closes odoo/odoo#34946 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-17[FIX] web_editor: avoid dialog error on email editionGorash
Under certain unknown conditions, the range cannot be applied and triggered an error. In order to allow the user to keep editing, we need to prevent the dialog from showing, hence the use of `console.error`. If this error appears, the carret is moved to the beginning of the focused node. If this error appears, then bullet can generate an error (I managed to have the bug once or simulate it by manually breaking the dom and range) closes odoo/odoo#34188 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-07[MERGE] forward port branch 11.0 up to bdc62d80314Christophe Simonis
2019-06-07[MERGE] forward port branch saas-14 up to 757846c5912Christophe Simonis
2019-06-07[MERGE] forward port branch 10.0 up to 7746621b92cChristophe Simonis
2019-06-04[FIX] web_editor: escape html tag when copy paste code and text contentGorash
closes odoo/odoo#33859 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-03[FIX] web_editor: modal open>save document keep itNicolas Lempereur
When we add a document with the "Select a Media" modal, if we reopen the modal then click on "Save" without modfiying anything, the element is broken since we do not have the data saying it is a document and the code try to display it as image. With this changeset, we keep the information that the attachment is a document and when saving it works as expected. opw-2004064 closes #33844 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-03[MERGE] forward port branch saas-12.2 up to 995aa1685eeChristophe Simonis
2019-06-03[FIX] web_editor: restoreRange on invalid nodePriyanka Kakadiya
In a web editor, add some text, select the text, add a link and immediately discard the link modal. Traceback. The traceback is a execute `setEnd` on `Range`, that error is thrown because editable DIV doesn't save old range Odoo wrap code does some text node split in order to attach the link just on the selected text. If it correctly re-set the underlying structure, it does not update the $(editable) structure used to restore ranges. After this commit, editable div will use newly created range for the element for ex: -> content: test -> selected content "test" when click on link dialog: ec: test , eo: 4, sc: test, so: 0 selected content -> start 0, end 4 -> "test" like this after clicking on discard: ec: null text element, eo: 4, sc: null text element, so: 0 selected content -> ec and sc both are null, so it will throw an error while setting cursor position after applying fix when click on discard: ec: test, eo: 4, sc: test, so: 0 selected content -> start 0, end 4 -> "test" task - 1955863 closes odoo/odoo#33692 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-07[MERGE] forward port branch saas-11.3 up to a2582c4252aChristophe Simonis
2019-06-03[FIX] web_editor: restoreRange on invalid nodePriyanka Kakadiya
In a web editor, add some text, select the text, add a link and immediately discard the link modal. Traceback. The traceback is a execute `setEnd` on `Range`, that error is thrown because editable DIV doesn't save old range Odoo wrap code does some text node split in order to attach the link just on the selected text. If it correctly re-set the underlying structure, it does not update the $(editable) structure used to restore ranges. After this commit, editable div will use newly created range for the element for ex: -> content: test -> selected content "test" when click on link dialog: ec: test , eo: 4, sc: test, so: 0 selected content -> start 0, end 4 -> "test" like this after clicking on discard: ec: null text element, eo: 4, sc: null text element, so: 0 selected content -> ec and sc both are null, so it will throw an error while setting cursor position after applying fix when click on discard: ec: test, eo: 4, sc: test, so: 0 selected content -> start 0, end 4 -> "test" task - 1955863 closes odoo/odoo#33792 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-05-31[FIX] web_editor: image modal nochange close on saveNicolas Lempereur
When you open the image modal of the website editor the selected image is the current image. But if the image is not an attachment with an `url` field set (eg. it has been uploaded and is not a file in a /static/ folder) the match between image modal and current did not work and to close it we need to: - actively select the current image then click "Save" - use the X button to close the modal without saving With this changeset, the match of current image with image list is done on the attachment `url` and if unavailable with /web/image/ID/name.jpg path which cover both possibilities. opw-2004073 closes #33799 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-05-13[MERGE] forward port branch saas-12.2 up to 243a4ae5cbcChristophe Simonis
2019-05-06[FIX] web_editor: drop an image in the 'mail.compose.message' modalGorash
Issue: Can not drop an image into the modal's editor because the server request a positional res_id arguments. closes odoo/odoo#33232 Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>