summaryrefslogtreecommitdiff
path: root/addons/website_mail/static/src/js/website_mail.js
AgeCommit message (Collapse)Author
2019-02-26[REF] *: use 'frontend' system in non-website appsqsm-odoo
* account, auth_signup, payment, portal, project, sale, sale_management, web_unsplash, website, website_mail, website_rating, website_sale This commit does probably not do what is stated for all non-website apps but it is a first step. It also uses the system in apps which could have already used it but did not. Part of https://github.com/odoo/odoo/pull/29442 task-1932066
2017-08-16[MOV] portal,website_mail: move chatter frontend to portalJérome Maes
This split responsiblilies : - portal provides basic chatter for portal document, and website documents (slides, blog, ...). - website_mail provides comments moderation (unpublished mail message) - website_rating integrate rating when posting comments
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-06-30[ADD] website_rating: generic rating management on chatter frontendJérome Maes
Extend new dynamic chatter to manage rating when posting comment. The model should inherit of rating.mixin and its frontend chatter should allow rating to enjoy star widget and rating card. This is more generic : stats, rating, ... are manage in one place (this module) for all document.
2017-06-30[IMP] website_mail: make the frontend chatter lazyJérome Maes
Message are now fetched and display using javascript to optimize performance. Also the chatter is completely rewrite : add pager, filter possiblity, ... This commit is mainly technical: posting feature does not change. Only the display with pager is new. The goal is also to prepare frontend chatter for a better integration with rating widget. The mail.thread mixin is extended to manage the field website_message_ids (display all messages that can be seen on frontend by user (employee or not). When fetching or posting message, a check is done to see if we need to do it as sudo(). website_mail implement posting messages with token or sha_in (using in website_quote). The same verification is now done when fetching messages, via '_special_access_object' method.
2014-05-28[FIX] website_mail, websit_mail_group: moved discussion group snippet to the ↵Thibault Delavallée
right module; it should not be available when the mailing list archives module is not installed. Also fixed get_alias_info route to be mail_group specific and to avoid allowing people to browse the database.
2014-05-28[FIX] website_mail: fixed is_follower controller, that could leak data about ↵Thibault Delavallée
records. Added instead a controller to get alias data. This controller is called by the discussion group snippet to have the info about the alias.
2014-05-27[CLEAN] website_mail: cleaned a lost console.log and a commented line that ↵Thibault Delavallée
should have been removed with pr 213
2014-05-27[IMP] website_mail: improved snippet to subscribe to a mail.group.Thibault Delavallée
Main modifications : - layout: input - button when not following, links (email - archives - unsubscribe) when following - when adding your email, update all other subscribe snippets input in the page to avoid havign to re-type it - management of fields of the record to subscribe to, used to have access to the alias of the group
2014-03-18[IMP] website_mail: refactor follow button; add partner_id in session for ↵chm@openerp.com
public user bzr revid: chm@openerp.com-20140318101505-4yivw8h5oujyhm9b
2014-03-06[IMP] website: snippet : website.snippet.animationRegistry.followchm@openerp.com
bzr revid: chm@openerp.com-20140306140323-o2e77a66eu28bddu
2014-03-06[FIX] website snippet: clean_for_save; display email in subscribe snippetchm@openerp.com
bzr revid: chm@openerp.com-20140306134746-oi0p580c3s3t2a24
2014-03-06[IMP] website: dynamic website_mail snippet with jschm@openerp.com
bzr revid: chm@openerp.com-20140306130240-cpsd5mssziuvrpf8
2014-01-29[FIX] website:_mail: fix followersChristophe Matthieu
bzr revid: chm@openerp.com-20140129170829-abmv73xswzl6ccm9
2014-01-13[FIX] website_mail: follow/subscribe buttonChristophe Matthieu
bzr revid: chm@openerp.com-20140113110542-jkb13xfiy3tno50n
2013-11-16[IMP] Cleaning code of followers and website_published, 200 lines removedFabien Pinckaers
[IMP] CSS and design of options and follow, avoid custom CSS bzr revid: fp@openerp.com-20131116150927-4mjk1zdcgfzt4e95
2013-10-02[IMP] add website_hr_recruitmentChristophe Matthieu
Module for jobs displayed on the website. The public user can apply or follow the jobs. little fixes in website_mail bzr revid: chm@openerp.com-20131002115603-ikgipps88vbf69ef
2013-09-30[IMP] website_mail, website_blog: improved follow / unfollow (always display ↵Thibault Delavallée
email, more visible) bzr revid: tde@openerp.com-20130930143357-0r61uikrf8nx92fg
2013-09-23[IMP] website_blog:Thibault Delavallée
Some file renaming Delegated followers of categories / blog posts management to website_mail, allowing to remove some templates and controllers Various cleanings and improvements in blog templates bzr revid: tde@openerp.com-20130923101730-b9606qcyd3sj2pwx
2013-09-23[ADD] website_mail: added templates, js and css to have a generic follow button.Thibault Delavallée
Based on the same principle as publish, there is now a generic button to follow or unfollow objects in openerp. This should replace all custom instance of subscription in other addons. bzr revid: tde@openerp.com-20130923095909-4p5aiswlwy14g32k