summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor/transcoder.js
AgeCommit message (Collapse)Author
2019-01-17[REF] web_editor,*: Move and rename files to prepare refactoringChristophe Matthieu
The refactoring of the wysiwyg editor and 'html' field allows us to move some of the code that was in web_editor but only used in website or in mass_mailing. Some parts are still in web_editor but will be moved at a later time.
2019-01-08[FIX] web_editor: left/right/center image for mailJulien (juc) Castiaux
When creating a banner using the web editor, the targeted image appears centered in the editor but is aligned on the left in the email. The issue also happened with other alignment (left in a centered widget, right, ...) for example on outlook 2007 and should be solved with this changeset. note: 12.0 version of #29214 opw-1904827 Co-authored-by: Nicolas Lempereur <nle@odoo.com> closes #29954
2018-08-10[MERGE] forward port branch saas-11.4 up to edd586002e9Christophe Simonis
2018-08-07[MERGE] forward port branch 11.0 up to 3513e599a7aChristophe Simonis
2018-08-06[FIX] base: inline buttons was breaking into multiple lines (outlook hack)Deep Patel
Because we converted buttons into tables so inline buttons was breaking into multiple lines so we need to add display inline and vertical align properties in tables. We allowed display property from mail sensitizer whitelist. Because in this commit https://github.com/odoo/odoo/commit/cf15030ed09f7479f5b2701ba101a5bed71f7409 we use display property for align items
2018-08-06[FIX] mass_mailing: fixed multiple buttons transcoding issues (outlook hack fix)Deep Patel
Because of outlook hack node was not find next sibling of current element. Due to this only first button is transcoded into inline css.
2018-08-06[IMP] mass_mailing, mail: added support for media queries in mass mailDeep Patel
- Email generated from mass mailing will have its own layout with internal css. - strip_classes is removed from mail_message because mail client are now supporting internal stylesheet. we need it for make mail responsive. mail: manually removed classes from incoming mail body Because we removed strip_classes from mail message body field because we want to allow classes in outgoing mail to make it responsive but classes are not removed from incoming mails so here we manually removed classes from incoming mail. opw-1836556
2018-06-27[MERGE] forward port branch 11.0 up to 152519cd658Christophe Simonis
2018-06-22[FIX] web_editor: keep border when side style differNicolas Lempereur
Since e94702d8 when transcoding an element for the purpose of sending it by mail, if the element had: border-bottom-style: solid; in the CSS resulting from classes, it would be simplified to: border-style: 0 0 solid 0; which is wrong since 0 is invalid for border-style, the default being: none opw-1852839 closes #25423
2018-06-21[MERGE] forward port branch 11.0 up to c5ed3729709Christophe Simonis
2018-06-19[FIX] web_editor: convert link to send by emailChristophe Matthieu
Don't convert in table btn-link, and center the button
2018-05-14[MERGE] forward port branch 11.0 up to 2787de8c68fChristophe Simonis
2018-05-14[FIX] web_editor: correct js code.Christophe Simonis
Oversight of previous forward-port
2018-05-14[MERGE] forward port branch saas-15 up to d818b516c14Christophe Simonis
2018-04-23[MERGE] forward port branch 11.0 up to 3ab25b60bc5Christophe Simonis
2018-04-23[FIX] web_editor: wrong display of the link buttons (btn) in outlook 2013Christophe Matthieu
The css generates all the attributes separately and not in simplified form. In order to have a better compatibility we simplify the css tags. e.g. border-left-style: none; border-bottom-s .... will be simplified in border-style = none We convert the link.btn into a table to have a good rendering in outlook, and revert the change when the user edit the content.
2018-04-23[FIX] web_editor: wrong display for td in Apple MailChristophe Matthieu
the td are displayed with wrong background color if the td tag is empty
2018-02-15[MERGE] forward port branch saas-11.1 up to a277b585072Christophe Simonis
2018-02-14[MERGE] forward port branch saas-16 up to 77927559465Christophe Simonis
2018-02-12[MERGE] forward port branch saas-11.1 up to c69d00157edChristophe Simonis
2018-02-08[FIX] web_editor: add thumbnail image to send attachmentChristophe Matthieu
2018-02-07[MERGE] forward port branch saas-16 up to 23752102a08Christophe Simonis
2018-01-16[REF] web_editor, website(_*): refactore media & link dialogsqsm-odoo
* blog, gengo, sale
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