This commit improves link creation in web editor.
Before this commit, anything with a @ would be considered as valid email which
is obviously not the case. It would then be prefixed by 'mailto:'.
This was causing 2 issues:
- URL with @ symbol in it would have 'mailto:' added as prefix, like google
maps coordinates.
eg: mailto:http://www.google.com/maps/whatever/@312211.22,321321
- Incorrect emails would go through (eg: @@@, ko@k@k@, mail@mail)
Now, we will try to detect and identify valid emails from invalid emails from
URLs. It will also handle 'mailto:' directly typed in the input.
This commit comes with it's counterpart in enterprise https://github.com/odoo/enterprise/pull/1859
This closes#11984, closes#22936
Note that there is a WIP in master to use this new is_email function
everywhere we try to validate emails. It will aim to uniformize email
validation in odoo's javascript that are often performed with different mean
here and there, some more permissive than others, some only checking for @.
It happens from time to time that someone use "Format" on the
web.layout template. Thus:
```
<script type="text/javascript">
var odoo = {
csrf_token: "<t t-esc="request.csrf_token(None)"/>",
};
</script>
```
becomes:
```
<script type="text/javascript">
var odoo = {
csrf_token: "
<t t-esc="request.csrf_token(None)"/>",
};
</script>
```
breaking a number of things on the frontend and everything on the
backend.
On a pure javascript content, we could wrap it with:
```
//<![CDATA[
/* javascript content */
//]]>
```
but in this instance we still want the xml to be processed.
This commit avoids formatting XML containing a script tag.
opw-815865
closes#23164
* web_editor, website
This commit fixes a bug with table duplication in mailing template:
- Click on a snippet with two columns
- Duplicate it
-> the snippet is duplicated but the two columns are transformed in two
rows.
This was because there is an implemented behavior for column
duplication: if we duplicate a column which was alone on its row, we
duplicate the row instead. This code should however be triggered when
duplicating the column alone to be working, not the snippet that
contains it.
Note: this required a backport of a33ec972ab
which was fixing a non-critical "bug" for 11.0. This non-critical "bug" is
therefor fixed here too.
opw-807105
Browsers' default alignement of <td/> is 'inherit'. Some mail clients do
not set this value properly though and even if it is explicitely set,
they do not compute the final value well.
As a fix, this commit forces the 'inherit' value on <td/> and computes
the real alignment for 'inherit' values when transcoding.
opw-813688
On latest chromium (as of version 64), accessing rules of a stylesheet
is forbidden for cross-domain.
This commit catch and ignores the error when that happened.
chromium commit: https://chromium.googlesource.com/chromium/src/+/a4ebe08c91
opw-813480
opw-815860
closes#23009
With this commit, any component that needs an instance of the
root widget can simply require the module 'root.widget'. Based on
the context (backend, frontend, iframe), the real root.widget
will resolve to either the webclient, the website root instance, or
the iframe root instance.
This is desirable in order for the tour_manager to become a child
of the root widget, as tours are enabled in any of the above contexts.
This commit is a requirement in order to solve an issue with JS services,
in which there should be only one service provider at any given time.
In 5af12238 a change was made to have the correct hierarchy levels, but
this can cause an issue when editing less files.
This is because we now had "undefined + 1" which gives NaN which breaks
Array constructor.
opw-814579
opw-815397
opw-814322
opw-815265
opw-814021
closes#23006
The access_token is automatically added by the media editor. It's added
on the website and by the html editor to send by email. The widget display
the attachments from 'ir.ui.view' (public attachment) and the attachment
from the current record.
Issue: can't load image in gmail or mobile because the client mail use a
proxy who avoid ours odoo access.
Deleting/replacing an image through summernote gave unexpected results.
As modifiying the related function may be tricky, this commit instead
wrap them to solve the specific erratic behavior: if the range is in/
matches an image, then simply remove the image and move the cursor to
its previous location.