Commit Graph
1257 Commits
Author SHA1 Message Date
qsm-odoo a17cd93864 [FIX] web_editor: allow recropping a newly cropped image
Since https://github.com/odoo/odoo/commit/a473453b3166a381130d9bd6ec4851b9e1ecab26,
a newly cropped image gets a base64 src until the user choose to save
the page (where we create an attachment for the cropped picture). The
problem is that when reentering the crop edition at once... it was not
able to be performed because we did not handle base64 images there.

This commit solves this and accidentally adds a feature: allow cropping
base64 images.
2018-06-22 17:09:54 +02:00
qsm-odoo 6209b12937 [FIX] web_editor: do 'reset' crop feature when changing ratio
This reverts commit bf64efb5a0.

Indeed, it was in fact necessary as more complex bugs of the library
can appear if we do not reset before. They even do that themself in
their library demo: https://fengyuanchen.github.io/cropperjs/
2018-06-22 17:09:54 +02:00
qsm-odoo a473453b31 [FIX] web_editor: review crop attachment creation/discard
Previous implementation was wrong as it did not care about the ability
to discard a crop edition. Indeed, whenever a crop dialog was saved,
a crop attachment was created or updated at once. Discarding the editor
would then either:

- Seem to discard a first-time cropped image but would have created an
  attachment for nothing (just the image src was reset)

OR

- Fail to discard a second-time cropped image as the cropped attachment
  would have been directly updated and the image src would not have
  changed

This commit changes the way it works:

- On crop dialog save, the image is marked with required data for a
  potential future save of the cropped image (as a DB attachment) and
  the src is set to the base64 cropped image directly.

Note that the code ends up being clearer and efficient that way too.
2018-06-21 12:59:16 +02:00
qsm-odoo cd812bd6f4 [FIX] web_editor: fix saving and restoring of crop aspect ratio
When an image was cropped and saved with a specific aspect ratio,
it was not restored properly on further crop editions.
2018-06-21 12:58:33 +02:00
qsm-odoo a9366de8f9 [FIX] web_editor: do not show cropped images in media dialog
Cropped image attachment were not meant to appear in the media dialog,
only original ones.
2018-06-21 12:58:03 +02:00
qsm-odoo bf64efb5a0 [FIX] web_editor: do not 'reset' crop feature when changing ratio
Before this commit, when the user changed the ratio option in the crop
dialog, the image zoom/rotation were reset for no apparent reason.
2018-06-21 12:56:38 +02:00
qsm-odoo a04b79a205 [FIX] web_editor, *: properly remove DOM portions in a snippet
* website, website_mail_channel

Before this commit, when using the 'number of columns' option from a
column's snippet editor, the snippet overlay remained floating in the
void if the current column was removed by the option. This was because
the option did a simple "destroy" on the column without caring about
the snippet editors.

This commit introduces a new event which can be trigger_up'ed to ask
the editor to properly remove a DOM portion (destroy related editors,
call the 'onRemove' callbacks, ...).
2018-06-21 12:54:17 +02:00
qsm-odoo f6bbc40fbe [FIX] web_editor: reset snippet editors on snippet move
As indicated in a code comment, destroying and rebuilding all snippet
editors when a snippet is moved is more accurate as the snippet options
may depend on the new locations in a way the 'onMove' callback cannot
handle. That operation seemed however too costly for no visual benefit
at the time. Now, not implementing it is a source of bugs and redundant
code (as with the new "number of columns" option which is not properly
updated once a column is moved in another row), so this commit
implements the feature.

This also allows for some improvement: the 'cleanForSave' part of
snippet editors is always performed when they are destroyed.

If this proves to be ok and safe, we might want to backport this in
previous versions.
2018-06-21 12:54:17 +02:00
Kishan Gajjar 47b5c00181 [FIX] web_editor: properly compute scss files
In LESS, 'fadeOut' function is used to make a color more transparent.
In SCSS, that function is called 'fade-out'.

Closes https://github.com/odoo/odoo/pull/25233
2018-06-18 12:09:49 +02:00
Christophe Simonis 73652a0b19 [MERGE] forward port branch saas-11.3 up to 50860317cc
Note: 1aacc96262 has been ignored and will
be forward-ported later
2018-06-15 13:27:27 +02:00
Christophe Simonis 50860317cc [MERGE] forward port branch saas-11.2 up to b170a753e1 2018-06-15 11:30:27 +02:00
Christophe Simonis b170a753e1 [MERGE] forward port branch 11.0 up to b05e4d5f95 2018-06-15 10:15:27 +02:00
Christophe Simonis b05e4d5f95 [MERGE] forward port branch saas-15 up to a53bea49fe 2018-06-14 21:28:39 +02:00
Christophe Simonis 803df909b1 [MERGE] forward port branch saas-14 up to 804d68efe5 2018-06-14 18:05:38 +02:00
Christophe Simonis 804d68efe5 [MERGE] forward port branch 10.0 up to 23a1bce2a9 2018-06-14 18:03:26 +02:00
Christophe Simonis 23a1bce2a9 [MERGE] forward port branch 9.0 up to 90165e2d96 2018-06-14 17:29:56 +02:00
qsm-odoo 50418c4811 [FIX] web_editor: properly save media dialog without any image
When saving the media dialog without any selected image, a crash
occurred. Now, it properly closes the dialog.

opw-1858614
2018-06-14 10:47:38 +02:00
Nicolas Lempereur c4ddf55880 [FIX] web_editor: link don't duplicate child text
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 16:20:40 +02:00
Xavier Brochard b10e34ed1a [FIX] web_editor: add <em> as inline tag and remove duplicate strong
This commit closes #24818
2018-06-13 14:56:16 +02:00
Ivan Yelizariev 4f9d9d169f [IMP] website: multi-website snippets with the same key
Allow duplicate snippets to have different versions for different websites

This commit closes #24429
2018-06-11 12:45:09 +02:00
Odoo Translation Bot 11515e14f7 [I18N] Update translation terms from Transifex 2018-06-10 00:27:35 +02:00
Christophe Simonis 2ab7ad8361 [MERGE] forward port branch saas-11.3 up to c00df14654 2018-06-07 11:43:07 +02:00
Christophe Simonis 969eb3fa2f [MERGE] forward port branch saas-11.2 up to c834c0f587 2018-06-06 15:46:36 +02:00
Christophe Simonis 116826e02d [MERGE] forward port branch 11.0 up to e7aff3775f 2018-06-06 10:47:53 +02:00
Tomas Alvarez 1db6c8d0ad [FIX] mail, web_editor: allow tel links in email templates (#24926)
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-06 09:57:53 +02:00
Lucas Perais (lpe) 0046bf7292 [FIX] web_editor: disable button when html field loading
Backporting bed33e1 and 472c5a4f9f from v10.0

OPW 1853150
closes #25043
2018-06-05 09:52:09 +02:00
Odoo Translation Bot 75c44c4778 [I18N] Update translation terms from Transifex 2018-06-04 11:08:02 +02:00
Odoo Translation Bot 395459d077 [I18N] Update translation terms from Transifex 2018-06-03 04:41:19 +02:00
Odoo Translation Bot d88dd23ae2 [I18N] Update translation terms from Transifex 2018-06-03 00:27:35 +02:00
Odoo Translation Bot ea3b895589 [I18N] Update translation terms from Transifex 2018-06-01 02:39:45 +02:00
Christophe Simonis e008ef302a [MERGE] forward port branch saas-11.3 up to 53300648ed 2018-05-30 12:18:52 +02:00
Christophe Simonis c2c9a60466 [MERGE] forward port branch saas-11.2 up to a2f275dfc4 2018-05-29 21:05:26 +02:00
Christophe Simonis a2f275dfc4 [MERGE] forward port branch 11.0 up to 4ea3838d89 2018-05-29 20:00:31 +02:00
Christophe Simonis 4ea3838d89 [MERGE] forward port branch saas-15 up to 6be9593a0c 2018-05-29 19:24:08 +02:00
Christophe Simonis 6be9593a0c [MERGE] forward port branch saas-14 up to 459efb4276 2018-05-29 19:02:43 +02:00
Christophe Simonis 459efb4276 [MERGE] forward port branch 10.0 up to 2288a89564 2018-05-29 18:45:00 +02:00
Christophe Simonis 2288a89564 [MERGE] forward port branch 9.0 up to ea0fcd52d9 2018-05-29 17:52:20 +02:00
Christophe Simonis f36e6917bd [MERGE] forward port branch saas-11.3 up to 37eed7c509 2018-05-29 17:34:43 +02:00
Odoo Translation Bot ca653c8c44 [I18N] Update translation terms from Transifex 2018-05-29 14:14:28 +02:00
qsm-odoo ea0fcd52d9 [FIX] web_editor: properly save a t-field in a t-ignore environment
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-28 12:20:07 +02:00
Odoo Translation Bot a89e46fdc0 [I18N] Update translation terms from Transifex 2018-05-27 04:10:26 +02:00
Odoo Translation Bot 63401868a5 [I18N] Update translation terms from Transifex 2018-05-27 00:26:12 +02:00
qsm-odoo 38ac59871e [FIX] portal, web_editor: keep BS 'img-responsive' *opt-in*
Bootstrap 'img-responsive' behavior was opt-in for a reason but commit
https://github.com/odoo/odoo/commit/f79b00c3b71e02f73537cb17285a6902fc0906b5
tried to defy that anyway. This would break existing client databases
... or at least our odoo.com.

This commit adds the img-responsive class for *new* *editor* images
(still with inline-block display), preventing breaking libraries or
custom (prod) images.
2018-05-25 17:58:54 +02:00
Christophe Simonis 37eed7c509 [MERGE] forward port branch saas-11.2 up to 58e3552246 2018-05-25 14:34:18 +02:00
Kishan Gajjar 5766fac388 [IMP] web_editor: highlight the selected image/icon
When we selected an image/icon, there was no visual feedback explaining
to the user that the image/icon had been selected (except for images on
chrome).

task-35020
Closes https://github.com/odoo/odoo/pull/24160
2018-05-23 11:57:49 +02:00
Jeremy Kersten 2a43614c3c [FIX] web_editor: avoid traceback when open img editor
In some case, (e.g.: demo data), datas_fname is undefined and match of
undefined will crash and block the modal to be opened.

Uncaught TypeError: r.datas_fname.match is not a function
2018-05-22 10:39:35 +02:00
Odoo Translation Bot 9dd56e1972 [I18N] Update translation terms from Transifex 2018-05-20 04:09:56 +02:00
Odoo Translation Bot b6419117d9 [I18N] Update translation terms from Transifex 2018-05-20 00:26:31 +02:00
Kishan Gajjar d66e260391 [IMP] web_editor: allow cropping content images 2018-05-18 12:15:42 +02:00
Kishan Gajjar fd5cffe235 [ADD] web_editor: add new cropper lib 2018-05-18 12:15:42 +02:00