* Move description button at the end of the toolbar
* Add an "auto" state button for the image width (alongside 100%,
50% and 25%) (when these last three are unchecked, the auto button
becomes checked).
Now, when choosing a background-color when a background-image has
already been selected, the background image is removed on hover/click
of the color option.
However, the opposite operation remains the same. So if you choose a
background-color, you can then choose a background-image and the
colors will be kept.
Refactor snippet structure
* new "cover" snippet
* move the title out of col-md-12
* delete snippets (s_quote_slider)
* rename snippets (FAQ Roller -> Accordion)
* ...
Refactor the way the background images are handled so that themes
can customize the defaults ones easily without ugly xpath or ugly
css.
* Always allow to delete a part (and delete parent if empty)
* Show parent options (by displaying the snippet name if any,
"column" for col-* and "Block" otherwise)
* ...
* Mobile preview dialog
* Add page dialog (allow to click anywhere to close the modal)
* Change label for "auto resize" and "resize" options to "auto size"
and "fixed size" and add a checkmark to the currently active one
* Overlay border / Options dialog content
* Hide the odoo navbar after a delay when the editor starts
Users copy/past text from various king of document into the editor.
These texts contain useless line breaks that should be removed before
pasting. Also, the editor currently add a paragraph element between
each line.
To correct this behaviour the onPaste callback of the summernote lib
is used. However for some reason, this is triggered after the text
is pasted (we should update and refactor the lib in a better way).
So this commit uses a hack: undo the past thanks to the undo command
then paste the formatted text we want.
* Remove dead code + optimization
* Use Dialog API from web module
* Reorganize files
* Correct buggy $() function for snippet option class
* Add comments
* Fix the snippet parent navigation :
If a page contained a three level snippet structure (i.e A contains
B contains C), when editing the following bug occured :
If B or C was selected first, parenting buttons were correctly set.
But if selecting A then C, clicking on the parent lead to going back
on A instead of going on B.
* Fix snippet thumbnail layout
* Better isolate ui css from themes
* MediaDialog image list : prevent displaying empty attachments
* ...
* The compiled templates are cached per user, lang, inherit context values
* ir.ui.fields: attributes method return an dict, and record_to_html return only the content value of the field
* all rendered text use build_text and all attributes use build_attribute
* t-esc-options is removed and replace by format_value method
* AssetsBundle receive the list files and remains
When going over the colorpicker when no bg-* class was selected yet,
the bg-undefined class was added on the snippet.
Also, when clicking on the reset button, the bg-* class was removed
but the selected button in the colorpicker was not unselected.
There are not cat... but you cannot know all the existing website in the world...
So, have faith in the user !
To do: allow to customize size or get it from iframe provided
The class modal-open on body tag allow to scroll on the modal content
which is useful if the content is taller than the window viewport.
When closing the modal, this class is removed but there may be another
modal open on which we will not be able to scroll to view
buttons/content if too big.
This commit check if a modal is still opened after closing an editor
modal and in the affirmative add back the modal-open class.
opw-674475
note : was already present in 8.0 with ec47493, it is also present for
web.Dialog (but the modal of the editor do not inherit from web.Dialog)
The web_editor.colorpicker defines a series of color buttons which
toggle the bg-* and text-* classes. The problem is that themes can
define new buttons whose bg-* and text-* classes only exist in the
frontend. So these buttons should not be displayed in the backend.
Only solution for the current implementation is to add this ugly rule
(in this backend file) which hides every button and redisplayed the
default ones.
This fix is temporary and has to be improved in next versions.
The editor had been restyled thinking its DOM structure was the same
in every context. The problem is that the message composer editor
DOM structure is different. So, some important style like button
icons were missing in this context.
* Bad forward port of saas-9 created a bug where the snippet handles
were wrongly positioned.
* The add job offer button did not work as the modal was marked to
dismiss itself on click (and because this button has not any handler
attached to it; it's the only real link amongst the add buttons).
This issue happen for example on a full runbot when clicking with
shift + key pressed on a sale order not in an editable.
We can see that initial_data.rect is only defined in mousedown when the
click target is inside an editable block, hence it could lead to an
issue otherwise.
closes#11527
Before 9.0 web_editor separation in 8c55904, some style would make
inline button be visible over topbar.
This commit reintroduce that and also make the margin over the inline
editor content a little bigger (so the inline buttons on the top of a
content will cover a little less the topbar).
closes#11526
opw-671649
Some image functionalities of the inline summernote would only take the
first of multiple editor into account when selecting the targeted image
of an image button action (image size, image padding, ...).
This commit select the appropriate editor given the current editable.
closes#11474
opw-668861
- Issue: Edit sale.order form view, add new line, change product who have
taxes and click quickly on save (with slow network) => error message.
Because some deferreds are lost.
- reduce number of reads and onchange for x2m widgets
- remove before_save method and use commit_value (the issue was that if the
before_save and the change trigger an onchange, the onchange deferred is not
checked before saving the content.
Before 3959afc the `node` tested would be the selection containing node,
but since then it may have been a `<br/>` which has some damaging
effects: now entering double enter at the end of a list, quote or code
block doesn't end this block.
Testing the use case corrected by 3959afc, the said change seems to have
no effect so this commit reverts it.
opw-667618
Bootstrap handles the primary color in a different way than the other
colors. So to not break the backend UI, the o-create-color-classes
mixin has to consider this difference.
Notice that colors management should be further improved in the future.
* Convert some CSS to LESS
* Split/Join LESS files
* Remove duplicates between website and web_editor
* UI improvements
* Allow simple customizations thanks to LESS var&mixins for website
In IE11 the values can be not string (for example a number and so not
have .indexOf method), but then there will no be !important bits and we
can just ignore this feature (which check if an overriding rule has an
!important flag).
There was another edge case when getting a "" set style, we get undefined.
opw-667917