summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
AgeCommit message (Collapse)Author
2019-07-26[FIX] web_editor: enter at A edge no dup linkNicolas Lempereur
In the editor, when you write a letter at the end or beginning of a link it is written outside the link. But if you press "Enter", we get on a newline with an empty link duplicated on the new line. This is caused by the custom code handling "Enter" keypress. With this changeset, in this situation we place the range just before the beginning or after the end of a link. opw-1724606 opw-2042097 closes #35188 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-25[MERGE] forward port branch saas-11.3 up to 5f419d4ad33Christophe Simonis
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-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-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-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-07-04[MERGE] forward port branch saas-11.3 up to 1debaa89f14Christophe Simonis
2019-06-07[MERGE] forward port branch 11.0 up to bdc62d80314Christophe Simonis
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[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-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-04-08[MERGE] forward port branch 11.0 up to 9a7e3c8b498Christophe 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-20[FIX] web_editor: restore theme responsive spacingqsm-odoo
The factor parameter of the mixin in charge of generating the spacing classes was not correctly used. closes odoo/odoo#31996 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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-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-05[MERGE] forward port branch 11.0 up to 27081bf6f5fChristophe Simonis
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-14[MERGE] forward port branch saas-14 up to c1fe9f18d5aChristophe Simonis
2019-02-14[MERGE] forward port branch 10.0 up to 69719f598aaChristophe Simonis
2019-02-13[FIX] web_editor: focus lost with inline editorNicolas Lempereur
When an inline editor is eg. in a form view, the focus is always stolen by it. This is because we trigger a mouseup on the editor to update its toolbars values and informations. note: backport of 11.0's 7a453b0b7ae In 10.0 this trigger could cause a "blur" which in some instance is not wanted (eg. inside a newline of a list view). opw-1906581 closes #31078
2019-02-13[FIX] web_editor: html widget empty value stay emptyNicolas Lempereur
The html widget automatically replace an empty field value by `<p><br></p>` to be able to add content. But this may cause unintended "onchange", since the value has "changed" and the onchange themself could cause error when triggered at the wrong time (eg. inside a list view with required fields). With this changeset, the onchange is averted when the value was false and is now `<p><br></p>`. opw-1906581 closes #31078
2019-02-08[MERGE] forward port branch 11.0 up to 9553240adc4Christophe Simonis
2019-02-08[MERGE] forward port branch saas-15 up to 9773be345e1Christophe Simonis
2019-02-08[MERGE] forward port branch saas-14 up to 18228f9c4e1Christophe Simonis
2019-02-08[MERGE] forward port branch 10.0 up to be689c53c13Christophe Simonis
2019-02-07[FIX] web_editor: review drag and drop in the editorqsm-odoo
When dropping a snippet into a page, it is dropped in the drop-zone which is the nearest of the user cursor. When moving a snippet, that condition did not apply and the user was required to put the cursor at the exact location of the drop-zone. Also, for both drag and drop features, the drop zones which appeared were not displayed correctly for full width columns, which made dropping sometimes impossible when multiple col-*-12 were below each other. task-1937758 closes odoo/odoo#30899
2019-01-09[FIX] web_editor: icon widget complies to apiLucas Perais (lpe)
the search method should return a Deferred as explicit in MediaDialog OPW 1919549 closes odoo/odoo#30077
2019-01-08[MERGE] forward port branch 11.0 up to c07b7200b26Christophe Simonis
2019-01-07[FIX] web_editor: banner not horizontaly centeredJulien (juc) Castiaux
When creating a banner using the web editor, the targeted image appears centered in the editor but is aligned on the left in the email. The issue also happened with other alignment (left in a centered widget, right, ...) for example on outlook 2007 and should be solved with this changeset. opw-1904827 Co-authored-by: Nicolas Lempereur <nle@odoo.com> closes #29985 closes odoo/odoo#29214
2018-12-04[MERGE] forward port branch 11.0 up to 2156af480fdChristophe Simonis
2018-11-29[FIX] website, *: properly clean website widgetsqsm-odoo
* web_editor When an user saves its website, all the animations are destroyed so that a clean DOM is saved. This is particularly important for snippets like the latest post one that would crash the page if not cleaned before saving. Two cases were found where animations were not cleaned before saving and this is what this commit fixes: - When an user used the undo/redo system, all animations were lost as the DOM is recreated. - When an user duplicated a snippet, animations were not restarted on the cloned element. closes odoo/odoo#29159
2019-05-09[FIX] web_editor: restoreRange on invalid nodeJulien Castiaux
In a web editor, add some text, select the text, add a link and immediately discard the link modal. Traceback. The traceback is a DOM `IndexSizeError`, that error is thrown when the boundaries of a DOM Range (`document.createRange`) are outside of the ranged elements. In this context, the error happens because the element is empty and the range has an end bound set to the size of the selected text. 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. opw-1981751 closes odoo/odoo#33257 Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-04-30[FIX] web: change bootstrap fonts only for reportsMartin Trigaux
Commit 42530b02fe14 was fixing a bug in reports that were using the standard bootstrap fonts instead of the changes we made in $font-family-sans-serif To solve this, 42530b02fe14 replicated the change in the file web_editor/static/src/scss/bootstrap_overridden.scss which is imported in report_assets_common **before** web._assets_bootstrap This was solving the issue for the report but had also the side-effect of changing body font-family in enterprise as the bootstrap_overridden.scss file is also used in web_editor._assets_backend_helpers and web_editor._assets_frontend_helpers 42530b02fe14 had effect only on enterprise where the desired font is Roboto/Noto Create a new bootstrap_overridden (6th of the name) file only for report closes odoo/odoo#32902 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-30[FIX] web_editor: allow d&d of blocks between flex elementsqsm-odoo
When dragging a snippet in the editor, drop zones are created at the correct locations (e.g. between columns when dragging a column). Some code is in charge of "cleaning" the created drop zones to, for example, remove multiples ones which are at the same position. This code is also currently removing the drop zones which are between two "non-block" elements. This is preventing to swap form rows thanks to the form builder as rows are "non-block" elements as they are flex elements. This commit solves the problem by changing the "is non-block" condition to "is inline" condition which is what was intended. Note 1: rows became flex elements with BS4, that is why this is fixed in 12.0. Note 2: this could be back-ported in previous stable versions as this actually preventing to drop snippets between tables, list items, etc (all non-block elements) but this can be considered as a limitation unless a real breaking case presents itself. See task-1874350 which discovered the bug. closes odoo/odoo#33054 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-04-17[FIX] web_editor: insert br within a pLucas Perais (lpe)
Have a fieldHTML as: ``` <p> Some text <br> <br> More text </p> ``` In the Html field widget, place your cursor before the "M" press Enter to insert a newline Before this commit "Some text" and the subsequent `<br>` were deleted This was because the code: - split the original `<p>` into two ( i.e. it became ``` <p> Some text <br> <br> </p> <p> More text </p> ``` ) - took the last child of the first p, which is a text then fell back to the first p - replaced the whole p with <br> After this commit, the original p is still split, but we append the br to it instead of replacing it closes odoo/odoo#32777 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-15[FIX] web_editor: override fonts in reportsMartin Trigaux
Fixes odoo/odoo#27487 Noto Color Emoji produces an error on wkhtmltopdf, cf wkhtmltopdf/wkhtmltopdf#4149 In the backend assets, the $font-family-sans-serif is changed in web/static/src/scss/bootstrap_overridden.scss In the reports assets, the $font-family-sans-serif was NOT changed in web_editor/static/src/scss/bootstrap_overridden.scss The default boostrap fonts were still used in reports, ignoring the changes made for backend. closes odoo/odoo#32312 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-08[MERGE] forward port branch saas-11.3 up to 4c61621efbbChristophe Simonis
2019-03-25[MERGE] forward port branch saas-11.3 up to e9068c290b3Christophe Simonis
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-18[MERGE] forward port branch saas-11.3 up to 4e39328a76aChristophe Simonis