summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
AgeCommit message (Collapse)Author
2018-10-11[MERGE] forward port branch saas-15 up to 93c22558f36Christophe Simonis
2018-10-11[MERGE] forward port branch saas-14 up to 77286e4296bChristophe Simonis
2018-10-11[MERGE] forward port branch 10.0 up to c2688e45f31Christophe Simonis
2018-10-10[FIX] web_editor: properly allow to reset bg colorKishan Gajjar
If resetting a background color was the only edition that was done on a page and that this page was saved, the change was not properly saved as the page was not marked as dirty. Closes https://github.com/odoo/odoo/pull/27625 task-1879524
2018-10-10[FIX] web_editor: Not possible to edit a link on safariGoffin Simon
On Safari, when editing the template of a mail.mass_mailing, clicking the "Read more" button (or any button that can have a link to the website) didn't open pop up to set the URL of the website. PS: inspired from https://github.com/textAngular/textAngular/issues/762 opw:1889643
2018-09-05[MERGE] forward port branch saas-14 up to 6773d3644e5Christophe Simonis
2018-09-05[MERGE] forward port branch 10.0 up to 1d0940d96f3Christophe Simonis
2018-09-05[FIX] web_editor: image nameNicolas Martinelli
Add the image name in the website for SEO purpose. This is a backport of: 88a5d9a0000a5ea43afdc00ed 886c07dabb636767b80abb849 152e3f8686ec4f48ba22e5c13 opw-1880472
2018-09-04[MERGE] forward port branch saas-14 up to 14f8ef59b88Christophe Simonis
2018-09-04[MERGE] forward port branch 10.0 up to 0f0e43ae557Christophe Simonis
2018-09-04[MERGE] forward port branch 9.0 up to 61b771256caChristophe Simonis
2018-09-03[FIX] web_editor: back to first -> history stay okNicolas Lempereur
If we do: - one change that will be saved in history - go back to the document before any change - do other change we can easily get in a state were the history is no longer recorded. The history is kept like this: - pos: our position in the history - aUndo: the snapshots of history - toSnap: the last history snapshop that is to be saved so for example if we start without change (at originalState): {pos: 0, aUndo=[], toSnap=null} Then we do two changes (change1, change2): {pos: 2, aUndo=[originalState, change1], toSnap=change2} If we make an undo, we will get to: {pos: 1, aUndo=[originalState,change1,change2], toSnap=null) If we make another change (change3): {pos: 2, aUndo=[originalState, change1], toSnap=change3} So the history after the position is removed. But when we get back to the original, the state would forever be: {pos: 0, aUndo=[originalState], toSnap=change85} because when doing a change, the code only removed history from the max(pos, 1) index. opw-1870119 closes #26701
2018-09-03[FIX] web_editor: normal up/down in content in cellNicolas Lempereur
In the editor in a table cell, when we press UP/DOWN keys: - we have default editor/browser behavior if there is content before (UP) or after (DOWN) the element we are currently on - else we go to the previous (UP) or next (DOWN) row if available - else we go to the next content if available - else we have the default editor/browser behavior But when checking if there is an element before/after the content, we did not take into account if there was an ancestor node inside the cell that had content after, so for example with this structure: ``` <table> <tr><td> <p>hello <b>world</b></p> <p>cruel</p> </td></tr> <tr><td> <p>bingo</p> </td></tr> </table> ``` if the current range was on 'world' text node, we would just check if there is content after this text node, not if there is content after its `<p/>` ancestor. Before the fix we would get on the next row, after we would have default editor/browser behavior: ie. if cruel is on another line, going to this line. opw-1870119 closes #26701
2018-09-05[FIX] web_editor: image nameNicolas Martinelli
Add the image name when the image is uploaded. Complement of commits 886c07dabb6367 and 152e3f8686ec4f48ba2 opw-1880472
2018-09-04[MERGE] forward port branch saas-15 up to 653bbbc7330Christophe Simonis
2018-09-03[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. In 10.0 this was not necessary since the default values were sanely set when the editor was inside the DOM. In 11.0 the editor is not in the DOM when this is being done and the info was wrong (eg. NaN for text size). With this commit, we don't steal the focus and get the default like it was done in 10.0 instead. fixes #26366 opw-1874880 closes #26582
2018-08-10[FIX] web_editor: remove related videos at the end of youtube embedslen-odoo
If a user embeds a youtube video on his website, he has no option to remove the suggestion of related videos at the end of playback. Since there is no good reason to have it, we disable the related videos in all cases. opw 1868380
2018-08-06[FIX] base: inline buttons was breaking into multiple lines (outlook hack)Deep Patel
Because we converted buttons into tables so inline buttons was breaking into multiple lines so we need to add display inline and vertical align properties in tables. We allowed display property from mail sensitizer whitelist. Because in this commit https://github.com/odoo/odoo/commit/cf15030ed09f7479f5b2701ba101a5bed71f7409 we use display property for align items
2018-08-06[FIX] mass_mailing: fixed multiple buttons transcoding issues (outlook hack fix)Deep Patel
Because of outlook hack node was not find next sibling of current element. Due to this only first button is transcoded into inline css.
2018-07-18[FIX] web_editor: display a dialog if posting a translation failslen-odoo
When editing a translation on the website, if the user copy/pastes directly in the web editor, then the html formatting is also copied. Since the translation matching takes the html code into account when matching the translations, this breaks the pairing. When trying to save, the backend function validating the new translation thus fails and return a server error. However nothing was done with this error, and the user just witnesses that saving doesn't work (unless he opens the console to notice the rpc failure). We now display an alert dialog that notifies which tranlation causes the error. opw 1862784
2018-07-12[FIX] website, *: make datepicker properly behave in page property modalqsm-odoo
* web_editor Note: the <body/> element had to be explicitely 'position: relative;' for the library to work.
2018-07-11[FIX] mail: remove attachment feature in add followers modalChristophe Matthieu
Before this fix, the attachments are don't save to the record and are remove with the wizard. We can't add the attachments to mail.message (like 'mail.compose.message') because it's auto_delete/unlink and the attachments are removed before the recipient can read it.
2018-07-11[FIX] web_editor: display record linked to the record when add followersChristophe Matthieu
2018-07-11[FIX] web_editor: send an image thumbnail for attachment link in mailChristophe Matthieu
Before this fix attachmentThumbnailToLinkImg is not called for style-inline options. The mail received does not have thumbnail and the user can't click on the invisible link. opw-1863659
2018-06-22[FIX] web_editor: keep border when side style differNicolas Lempereur
Since e94702d8 when transcoding an element for the purpose of sending it by mail, if the element had: border-bottom-style: solid; in the CSS resulting from classes, it would be simplified to: border-style: 0 0 solid 0; which is wrong since 0 is invalid for border-style, the default being: none opw-1852839 closes #25423
2018-06-19[FIX] web_editor: convert link to send by emailChristophe Matthieu
Don't convert in table btn-link, and center the button
2018-06-14[MERGE] forward port branch saas-15 up to a53bea49fe4Christophe Simonis
2018-06-14[MERGE] forward port branch saas-14 up to 804d68efe54Christophe Simonis
2018-06-14[MERGE] forward port branch 10.0 up to 23a1bce2a9cChristophe Simonis
2018-06-14[MERGE] forward port branch 9.0 up to 90165e2d96aChristophe Simonis
2018-06-14[FIX] web_editor: properly save media dialog without any imageqsm-odoo
When saving the media dialog without any selected image, a crash occurred. Now, it properly closes the dialog. opw-1858614
2018-06-13[FIX] web_editor: link don't duplicate child textNicolas Lempereur
If we applied a link eg. on: ``` <span>hello <b>world</b></span> ``` The system actually gets the "label": hello worldworld because there is 3 nodes: text node: hello element node: `<b>world</b>` text node: world Also since "hello worldworld" is different than "hello world", instead of just keeping existing nodes and adding the link, the system would replace the selected range by: `<span><a>hello worldworld</a></span>' instead of: `<span><a>hello </a><b><a>world</a></b></span>` This commit ignores element nodes when creating a new link, since when getting the label of the link from the selection, only the text nodes insides the element nodes have any interest. There was a second issue because if we had: ``` <i><a href="hello">world</a></i>! ``` and tried to put a link over "world!", the code would decide: "world" is inside a link so we will just update that link. Thus we would get: ``` <i><a href="hello">world!</a></i>! ``` instead of: ``` <i><a href="hello">world</a></i><a href="hello">!</a> ``` opw-1848351 closes #25187
2018-06-13[FIX] web_editor: add <em> as inline tag and remove duplicate strongXavier Brochard
This commit closes #24818
2018-06-06[FIX] mail, web_editor: allow tel links in email templates (#24926)Tomas Alvarez
Before this commit: links like `tel:+1-555-555-5555` were being replaced both in javascript (prefixing `http`, when using the summernote editor) and python (prefixing the base url, when they were added directly to the template). After this commit: the replacement is avoided on links with `tel` scheme. This is related to commit: 8b97a39
2018-06-05[FIX] web_editor: disable button when html field loadingLucas Perais (lpe)
Backporting bed33e1 and 472c5a4f9fa262f2ec2e10f4ad3e97c8c1bf4083 from v10.0 OPW 1853150 closes #25043
2018-05-29[MERGE] forward port branch saas-15 up to 6be9593a0c0Christophe Simonis
2018-05-29[MERGE] forward port branch saas-14 up to 459efb42765Christophe Simonis
2018-05-29[MERGE] forward port branch 10.0 up to 2288a89564cChristophe Simonis
2018-05-29[MERGE] forward port branch 9.0 up to ea0fcd52d92Christophe Simonis
2018-05-28[FIX] web_editor: properly save a t-field in a t-ignore environmentqsm-odoo
When a t-field element was in an editable t-ignore environement, modifying it was leaving the edit mode style attached to it. This was because of: 1) When the t-field element was changed, it was marked dirty but also its parent editable container. Fixing this, only solves the case where only the t-field (and not one of its neighbors) is changed but it was worth fixing anyway. 2) Before saving an element, the potential 'o_editable' and summernote classes were not removed of its descendant and were thus saved. Bug found with task-38069, merged in stable as it might occur there too.
2018-05-14Revert "[FIX] web_editor: adapt test"Christophe Simonis
Was weirdly working in browser... This reverts commit fb18de745c10bb6373eb3f08ada3458f09c669b8.
2018-05-14[FIX] web_editor: adapt testChristophe Simonis
2018-05-14[FIX] web_editor: correct js code.Christophe Simonis
Oversight of previous forward-port
2018-05-14[MERGE] forward port branch saas-15 up to d818b516c14Christophe Simonis
2018-05-14[MERGE] forward port branch saas-14 up to 5274a620374Christophe Simonis
2018-05-14[MERGE] forward port branch 10.0 up to 7b1362ac557Christophe Simonis
2018-05-14[FIX] web_editor: ignore range error on RestrictedNicolas Lempereur
In firefox, if we have a range on eg.: `<input type="file">` and we tabulate to get to it, we have the range over: `<button type="button" tabindex="0">Browse…</button>` which seems to be a "virtual" element inside the `<input/>` but this magic element is "Restricted" and causes error such as: `Permission denied to access property "nodeName"` So this fix ignore errors when getting a range from current selection on keyup. opw-1819279 closes #24524
2018-05-11[FIX] web_editor: inline space in source codeNicolas Lempereur
Backport of 57f7c681062f07002312e91d79d02b2b1b59d9fe
2018-05-09[FIX] web_editor: optimize big mail transcodingNicolas Lempereur
The browser may throw an error when a big mail such as one with hundreds thousands of tags is being transformed to have a style more compatible with mail clients. The error would be: "Uncaught RangeError: Maximum call stack size exceeded" This happens in jquery because we hare too many nodes (there is an ongoing issue at https://github.com./jquery/sizzle/issues/403) so this commit replace that part by a DFS traversal over DOM nodes. There was also an issue that not having the option "style-inline" would still cause some style code to be ran albeit it was intended not to be solved in 55c7d2d5b00. opw-1841107 closes #24550
2018-05-08[FIX] web_editor: drag and dropNicolas Martinelli
Commit 6494f511718 introduces an access token to read images inside an email. This avoids access errors when accessing the email through a proxy (e.g. Gmail). That implies that all images are added as attachments. When going through the usual media dialog, the form is submitted to action '/web_editor/attachment/add', creating the attachment. However, the copy or the drag and drop of an image completely fails. Indeed, the same method `_onImageUpload` is called, but with a completely different argument type: `attachments` is a `FileList`, not a list of attachments. To solve this, we only call `_onImageUpload` on a the custom `onUpload` callback, which is not triggered during a drag and drop or a copy. Any image included thanks to these methods will be post-processed in the `create` method of `mail.message` (`base64_to_boundary`). Unfortunately, it's not possible to simulate an actual drag and drop or a copy, so we cannot add a test. opw-1840237 opw-1840411