The scenario when using the code view is the following :
- click on code view button to use code view
- make changes
- click on code view button to get back to wysiwyg view
- save from the wysiwyg view
If the 3rd step is not done:
- for the inline editor, we lose the changes that have been done in code
view,
- for the iframe editor, we lose the entirety of the content.
At one time the user was forced to go back to wysiwyg before being able
to save, but this have been removed hence the present usability issue.
With this fix, when the editor content is saved, if the user is in code
view he is automatically set back to wysiwyg view.
closes#14339
opw-693052
The refactoring made with https://github.com/odoo/odoo/commit/62fb1bb92493b00bd45ed3f4eced5ca8b23f81d6#diff-2b3acc31ced2b1e9f7522a3e29f33c22L825
broke the possibility to add vimeo, youku or other undefined video
sources.
This is because of jQuery. With jQuery you can create elements thanks to
multiple methods. From least efficient to most efficient:
- All in a string:
$("<tag attr1='value1' attr2='value2'/>");
- Tag in a string, attrs thanks to methods:
$("<tag/>").attr("attr1", "value1").attr("attr2", "value2");
- Tag in a string, attrs in second arg:
$("<tag/>", {attr1: "value1", attr2: "value2"});
The mentionned refactoring transformed the use of the second method
into the use of the last one. But there is a bug in jQuery: you cannot
use the first method and the last one all together. So:
$("<tag attr1='value1'/>", {attr2: "value2"});
will create a tag with attr1 but will totally ignore the attr2 part.
It happens that the allowfullscreen attr was left directly in the
creation string for vimeo and youku, preventing the src to be added.
This commit removes the use of allowfullscreen attr as fullscreen
is already handled by source players anyway.
The widget html is used for plain text and html content.
Need to check if the content is a valid html code, if is not wrap with p tag every lines.
opw-692158
* Tip are never destroyed when change view mode
* unbind methods
* mail: memory leak with unbind methods
* web: memory leak because 'ui-autocomplete' is never destroyed
* web_editor: memory leak for wrong unbind on destroy
* web: memory leak: must remove fileupload handler
* bus: memory leak: correctly debind handlers on window in bus.Bus
* remove handlers on switch buttons and views $buttons
* remove handlers on breadcrumbs
* web: memory leak: correctly debind handlers
* im_odoo_support: memory leak: remove fileupload handler odoo_support
Note: part of this commit was actually authored by aab
If a snippet contains a .oe_structure element inside of it, it allows
the user to drop other snippets in that location. The web_editor
contains code which removes all empty parent of an element being
deleted. This is done so that, for example, when the last col of a
3-col snippet is removed, the whole snippet is removed.
However, there was an exception to this rule which was not considered,
if one of these empty parent is an .oe_structure, it should not be
removed.
Note: the only snippet which does this is the parallax snippet.
When pasting, the paste event is cancelled and done back with the
corrected data.
This works fine on firefox, but this can have unwanted results on other
browser like pasting two times or copying the end of the line at the
beginning.
This commit replace completely the summernote functionality with our
small implementation of pasting corrected text.
closes#14043
opw-690814
Before the ace editor was split so that it can be used in the backend
and the frontend, the displayError function finished by:
website.error(a, b);
As website.error cannot be used in the backend, the method was changed
to return the error and the extensions of the method were in charge
of displaying it. Unfortunatly this return was done like this:
return a, b;
which is not valid javascript.
Now the method return an object with a "title" and a "message" value
instead of wrongly returning two values.
Note: this fix relies on another fix which will be forward-ported from
saas-11.
These two fixes are now important since the ViewEditor is now also
used in the backend.
* The start method must return a deferred.
* The destroy method must unbind the event on the document element.
Note: in master, the ViewEditor is being refactored.
Commit e11f23b701 split the website
customize_template_get into web_editor and website ones. This split
was not perfect and commit 20861b482a
tried to make it work... but did not made it totally and added an
indirect dependency to website module in web_editor...
As the final result is wrong and inconsistent and that the previous
9.0 implementation was already ugly, this was not possible to make
a consistent full-stable fix.
This commit tries to make a fix as stable as possible (the main method
name did not change, the arguments did not change, their purpose is
the same, ...) which makes the code work and be less ugly. However,
the function returns are now slightly different (and JS depends on it).
It returns only valid view information (not header stuff which is not
related to anything and the inherit_id value is now a combination of
the inherit view id and name). Also, a new private method has been
created.
Also, the method contained code which was deprecated since saas-6 but
was never removed (and never broke anything "by chance").
In master these methods will be refactored to make more sense.
* add and use preservation mixins to prevent undesired customizations
made by themes
* remove some style preservation code (and use the mixins instead)
* add UI states' colour variables
The image icon was not clear enough. The editor bar appears in the
website builder, the mail composer, the forum composer, ... In each
of them, we can both link a picture or a file but a picture makes
more sense in some context and in some other ones not.
This commit solves the problem by changing the icon to fa-file-image-o
which is a mixed of file and image. This also solves the problem of
having two buttons with the image icon in the website builder (indeed
an image icon is also used for the image look button).
Change color #a24689 to #875A7B
Commit https://github.com/odoo/enterprise/commit/8ac1c19fac7615fecd51e670f798d13158a4e53c
changed the odoo interface violet by changing the main LESS variable
but forgot there was many direct occurences in XML/HTML/... (for
example for the mobile browser color).
Even if it's community the odoo interface violet is used at many places
(module description, XML demo data, ...).
Animation preview on images did not work as the web_editor stopped
every potential animation when an image entered edition. As the
behavior does not seem useful as there is no infinite animation which
is possible with standard odoo (and even if it was the case, it would
not be too strange that the animation continues), the feature is
removed with this commit.
broken by e11f23b
If not full, result was always empty
This commit fix the list of view when you click on Customize top menu in website.
This menu should only display the 'customize_show' views.
Previous commit tried to handle iframe assets in a more standard way
but instead broke the order followed to install iframe communication.
While waiting for a more clean way to handle iframe assets and
communication, revert to old set up.
The commit e59a7fe3ff has moved
the ACE editor from website to web_editor. As some code on ir_ui_view
was used for this widget, the code has also been moved to web_editor.
Ace editor is not very smart, it does a rpc for each inherited view, it
tries to load workers before deciding not to use them, and it does way
too much work in general. This commits tries to make sure that only the
necessary rpcs are done (lazily).
fix some issues with ace editor: lazy loading
fix various issues with ace editor
* event, website_event, website_forum,
* website_hr_recruitment, website_sale
Website access rights were buggy. The editor assets and website editor
assets have to be loaded together to work so the previous behavior
which only loaded one with the restricted access right was not right.
Also, people which had the "Manager" access right for model like event
or job only got access to creation and edition of those objects if they
had the full access to website access rights.
Now the website module creates the two same groups :
* group_website_publisher: load all editor assets, give access to
page creation for model the user has access (event, job, ...) and
edition of those pages
* group_website_designer: implies the first one and give access in
creation and edition of all pages + access of all website menus
The manager access rights for event, product, jobs, etc now implies
the group_website_publisher group for the user (so that the manager
have the editor assets and editor ui).
Note: some python codes use the group_website_publisher for no right
reason, this has to be adapted.
* web_editor, website_blog
Since recent refactoring, web editor dialogs automatically trigger
an event when closed (saved or cancel). The problem is that there
still was manual trigger of those events or variants ("save" instead
of "saved").
To prevent multi-saving and be consistent, all save events are now
automatically triggered on save/close (no more manual) and the event
name is "save".
The content to translate is yellow and the translated content is green
in page translation mode. When the user starts translating a paragraph
it stayed yellow, making it difficult to see the remaining content to
translate when translating a big page.
This commit colors the dirty text in a paler green so that the user can
see the distinction.