summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/widgets
AgeCommit message (Collapse)Author
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-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-06-14[MERGE] forward port branch saas-15 up to a53bea49fe4Christophe Simonis
2018-04-17[FIX] web_editor,mail: send email's attachments without write accessChristophe Matthieu
Before this fix, when a user don't have write access on a document, he can't send an email with attachment because, the attachments is added on the document. The change improving security was introduced by the commit: https://github.com/odoo/odoo/commit/6494f511718893eec3573c60c0a62e04d386359d With this fix, for mail, the attachments is added on the 'mail.compose.message' and re-render the fields attachments displayed in the current view. This change respect the access rules like all others attachment of 'mail.compose.message' (can send an email when the user have read access on the document). The media dialog of the html widget display all documents attachments and the added attachments Allowing users to use these in the body of their message.
2018-03-22[FIX] web_editor: correctly set image on double clickRomain Derie
Commit 321486851a fixed double click on media dialog when multiple selection is allowed. Still, it needs a deeper fix to ensure that the image is/remains selected when double clicking no matter it's state (selected or not) before the clicks. Double click should always force the image to be selected before saving. Step to reproduce: - Drop the Image Gallery snippet - Open new images manager (Customize > Add images or Add Images directly if no images set yet - Select an image (simple click) - Now double click on it It won't set the image since when double clicking, it: 1. Unselected the image on the first click (click event) 2. Selected the image on the second click (click event) 3. Unselected the image and saved (dblclick event)
2018-03-21[FIX] web_editor: correctly set image on double clickRomain Derie
Commit e011d58bee add the possibility to unselect images on the media dialog. But it introduced a collateral bug preventing double click to set the image. Indeed, double click event triggers not only the double click event but also twice the single click event. Before commit e011d58bee, it would work fine and as intented on double click: 1. It would trigger twice the single click, selecting twice the image. 2. Then, it would trigger the double click that would save the selected image. But after the commit: 1. It triggers twice the single click, selecting and then deselecting the image. 2. Then, it triggers the double click that saves nothing since the image got unselected on second single click event. Now, before saving on double click event, we select the image. task-1815165
2018-03-07[MERGE] forward port branch saas-15 up to cb87388d727Christophe Simonis
2018-02-21[MERGE] forward port branch saas-16 up to 49f85485571Christophe Simonis
2018-02-21[FIX] web_editor: Export classes and methods Jairo Llopis
Add various classes and methods to allow customization Closes #23180
2018-02-20[FIX] web_editor: don't format xml with script tagNicolas Lempereur
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
2018-02-14[MERGE] forward port branch saas-16 up to 77927559465Christophe Simonis
2018-02-12[FIX] web_editor: regression less editor 5af122387Nicolas Lempereur
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
2018-02-08[FIX] base/mail: Added an access_token on the attachments urlChristophe Matthieu
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.
2018-02-08[FIX] web_editor: encoding of the attachment name is missing in image srcChristophe Matthieu
2018-02-01[FIX] web_editor: xml editor first level not shownNicolas Lempereur
There is a slight visual inconsistency since: 9af8d5e6 the xml/less editor for first level of descendants were just prefixed by an invisible space. opw-807624 closes #22704
2018-01-25Revert "[FIX] base: bad back-port"Christophe Simonis
This reverts commit 0ac6043ec746ef4c4d4ddb66edc93c0ae098ca0b.
2017-12-12[MERGE] forward port branch saas-16 up to a2ea4ba095cChristophe Simonis
2017-11-30[MERGE] forward port branch saas-16 up to 5d7ad2b16ccChristophe Simonis
2017-11-16[MERGE] forward port branch saas-16 up to 745d00362abChristophe Simonis
2017-11-15[FIX] web_editor: restore selected images displayqsm-odoo
In the media dialog, when an image is selected, it has a colored border to indicate it. Commit https://github.com/odoo/odoo/commit/e011d58bee140411ccfb1ef9115dddc090d573c3 made changes, part of them designed to "Improve the image dialog to be able to select/unselect". While this commit was indeed doing that, it was also breaking stuff: when selecting image(s) then performing a search, the colored border disappeared while the images were in fact still selected. Fortunately, this stuff breaking is only due to code modification that was made for no reason (so reverting part of the commit is enough to restore the features while keeping the commit's improvements).
2017-11-02[FIX] web_editor: allow selecting an uploaded img without crashqsm-odoo
Somehow, fixing multi selection with https://github.com/odoo/odoo/commit/e011d58bee140411ccfb1ef9115dddc090d573c3 broke the use of the image upload button combined with no selected image at the beginning.
2017-10-27[MERGE] forward port branch saas-16 up to 8fdac4b6b2fChristophe Simonis
2017-09-29[FIX] web_editor: HTML/CSS Editor save feedbackNicolas Lempereur
The save on the frontend worked, but there was no feedback that it worked if the identifier of the file currently edited broke a jQuery attribute selector value (eg. /test.less breaks it).
2017-09-18[FIX] *: fix a bunch of incorrectly documented docstringXavier Morel
Fix a bunch of ill-documented/incomplete/incorrect method docs Without this, the automatic doc generation does not work.
2017-09-15[ADD] website: add new page managementrde
website.page = old ir.ui.view with page=True website.redirect is a new mechanism to replace in the futur the ir.attachment mechanism of redirect. From now, we don't have a specific /page controller to serve 'page'. We use a new model website.page which is rendered if none route matches the url and that the field 'url' on website.page matches the request.httprequest.path. The order to serve a path is: - Routes defines in controllers (/shop, /blog, ...) - ir.attachment with name matching the path - website.page with url matching the path - website.redirect with url_from matching the path - 404 To improve: - allow regexp in website.redirect model - allow to edit the view_arch from the page.management via redirect backend (needed when traceback in the page, or when modifying a js/css/less/...)
2017-09-12[MERGE] forward port branch saas-17 up to d08b4407be3Christophe Simonis
2017-08-31[IMP] web: lazy load nvd3, ace and fullCalendar lib to reduce asset sizeChristophe Matthieu
2017-08-24[MERGE] forward port branch saas-17 up to 877e7098719Christophe Simonis
2017-08-21[IMP] web_editor: make HTML editor select2 dropdown betterqsm-odoo
In saas-15, the LESS editor was introduced alongside the use of the select2 library to style the <select/> element which allows to choose the view / less file to edit. The problem is that the default behavior of the select2 library is to open a dropdown with a max-height of 200px and a width equals to the <select/> element (with no regards to the dropdown content). In most cases, the dropdown was then displaying only a few results, broken over multiple lines. Now, the dropdown is restyled so that it has no maximum height, no set width and more readable content.
2017-08-18[IMP] web_editor: add image filename at the end of URLsVandan Shah
When an image is added thanks to the media dialog, the URL that is used was '/web/image/<id-of-the-attachment>'. Now the name of the image will be added for SEO purposes ('/web/image/<id-of-the-attachment>/<name>'). Also protect URLs with quotes to allow spaces.
2017-08-17[REF] web_editor: improve "Video" dialog design and behaviorqsm-odoo
Original design by @stefanorigano.
2017-08-16[REF] web_editor, website, *: complete refactoringqsm-odoo
* mass_mailing, payment, point_of_sale, portal, survey, web, web_tour, website_blog, website_crm_partner_assign, website_event, website_event_questions, website_form, website_forum, website_gengo, website_hr_recruitment, website_links, website_mail, website_mail_channel, website_mass_mailing, website_quote, website_sale, website_sale_options, website_slides, website_twitter This commit reviews the whole "JS side" of the web_editor and website apps. This is a first step to be able to improve them with new and better functionnalities; this commit is not supposed to change any visual behavior. The main goal was to achieve a structure similar to the backend one. Now, the frontend side also has a root widget (like the WebClient) and all other widgets are attached to it one way or another. This allows the benefits of using the 'trigger_up' functionnality for example. As RPC are now mainly done with the `this._rpc` functionnality (being possible thanks to the parent hierarchy), the frontend will also be possible to test thanks to QUnit in a future update (besides the "text" editor side which still requires a refactoring to be able to do that). --- Here are some of the changes: (-) conventions and documentation The code has been updated to follow JS conventions and a lot of code has been commented (around +2000 lines of comment). This also means that lots of functions have been renamed to use camelCase or simply to make their name understandable. See https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines. (-) deprecated: web_editor.base The "web_editor.base" module has been split and does not force the modules which require it to wait for DOM ready anymore. This was indeed slowing loading times, but also prevented to use some modules in some contexts (see the LESS editor use in web_studio which is the subject of another task). Now the "editor context" can be got thanks to the "web_editor.context" JS module with its "get" function. The "web_editor.base" module should probably not be used anymore (see its code and recent updates). (-) new: web.dom_ready If a JS module should wait for the DOM to be ready to be executed, a new JS module has been created: "web.dom_ready". This should always be used in a module which only want to instantiate stuff. Do not extend (or worst, include) classes after DOM ready. (-) website.website The "website.website" module has been split. "website.website" does not return anything useful anymore, it just initialize some miscellaneous stuff, without waiting for the DOM to be ready. You might want to check "website.utils", "website.content.compatibility" or `WebsiteRoot`. Also `website.form` has been deleted (use `this._rpc`), so has been `website.error`. `website.prompt` will be removed in a future update to be replaced by `Dialog.prompt`. (-) widgets are great Many classes which were not widgets are now widgets. This allows them to use the 'events', the 'xmlDependencies' and the 'this._rpc' features for example. Here are some of the main ones: - Snippet options: these were classes with a `$el` for the menu element and `$target` for the customized element. This is still the case but following standard `Widget` structure (one exception: using `this.$(...)` searches in the `$target` as before this update). - Snippet animations: instead of class instances with a `$target` element which can be `start` and `stop`, these are now standard widgets which can be `start` and `destroy`. `this.$target` is an alias to `this.$el` for ease of compatibility. - Snippet editors: instead of class instances in charge of an editor overlay, these are now widgets. Each "child" snippet editor is properly attached as a "child", which allows editors to communicate and to be properly destroyed. (-) root widgets and website navbar The frontend is different of the backend. In the backend, the page has an empty <body/> element and all the components are instantiated from parent to children (i.e. the `WebClient` is instantiated and is in charge of instantiating the `ControlPanel`, etc). The frontend cannot work like that on page loadings as they are way more frequent than in the backend and we do not want them to flicker. A frontend page is loaded as a <body/> element which already contains the website navbar and its menus and the whole content page. JS code has to be "attached" to these existing elements. This is possible thanks to the `RootWidget` instances and the specialized `WebsiteRoot`, `IframeRoot` and `WebsiteNavbar` (see code for details). (-) lazy loading No more (or at least a lot less) XML/JS has to be loaded on page loading, thanks to the use of the `Widget.xmlDependencies` feature. XML which have to be lazy loaded is loaded only on related Widget instantiation if necessary, which allows to execute a lot of JS code before the DOM is ready and to start many widgets on DOM ready (not later). A visual benefit of this is clicking on the 'edit' button as soon as it is possible: before this commit, this was sometimes not doing anything as event handlers were not binded yet. Still a possible exception: loading the session and locales. This may be asynchronous stuff which is still required before widget instantiations but this will be the subject of another task. (-) deprecated code and code location More than reviewing code and organizing it, many apparent dead code was removed. More importantly, mislocated code was put in the right app. This is the case for snippet animations which is a concept for website apps but was defined in the web_editor app, or some translation concepts which were part of website but should have been part of web_editor. --- There are probably more things to say about this commit but I will let the comments speak for those.
2017-08-16[MOV] web_editor, website: reorganize filesqsm-odoo