summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/transcoder.js
AgeCommit message (Collapse)Author
2017-08-16[MOV] web_editor, website: reorganize filesqsm-odoo
2017-05-17[FIX] mass_mailing, web_editor: increase mail clients compatibilityqsm-odoo
Following bee3253b44850c0d563ee8973556ece33376781b, this commit is made to increase the mail clients compatibility for the mails that are created with the odoo mail editor. Three new problems are handled: - Font family of titles had to be forced too as outlook was not inheriting parent font family on those either. - Default text font-size had to be forced as was not detected in transcoding correctly. - text-decoration rule was decomposed in text-decoration(-line, -style and -color) in transcoding. Outlook is ignoring those three rules for some reason. As the decomposition is useless, the transcoder now forces the recomposition of these three rules.
2017-03-28[MERGE] forward port branch saas-11 up to c2569b9df1bChristophe Simonis
2017-03-24[MERGE] forward port branch 9.0 up to 8376f538b56Christophe Simonis
2017-03-22[FIX] web_editor: properly transcode `fa` alias iconsqsm-odoo
When adding a font-awesome icon to a mail template, the icon is converted to an image once the template is saved. To do that, the code checks all the `.fa-XXX` definitions in the stylesheets to know which content the image have to use. The problem is that this was not considering the font-awesome aliases. Indeed, the `fa-facebook-f` icon was able to be used while its alias `fa-facebook` was not working.
2017-03-17[MERGE] forward port branch saas-11 up to aefdf96c259Christophe Simonis
2017-03-17[MERGE] forward port branch 9.0 up to af64780a2d8Christophe Simonis
2017-03-16[FIX] web_editor: handle margin:initial correctlyNicolas Lempereur
The transcoder (which transforms stylesheet rules to inline style) did some compression of the padding and margin css properties to not always have margin-top + margin-right + margin-bottom + margin-left. This could cause an issue when the value of margin or padding contained an initial or inherit value because browsers (at least firefox and google chrome) doesn't allow it. Thus the preview could for example have bigger veritcal spaces arround `<p />` tag than what was seen when editing. With this fix instead of invalid: margin:initial initial initial initial we have: margin:initial And instead of invalid: margin:initial 5px 6px 7px we have: margin-top: initial; margin-right: 5px; margin-bottom: 6px; margin-left: 7px; opw-706535
2016-09-23[FIX] web_editor: properly convert fa icon to images with transcoderqsm-odoo
Previous implementation was not robust as css style was able to change the image height. Also refactore the method to be more efficient.
2016-09-20[FIX] web_editor: remove breaking cache of transcoderqsm-odoo
The web_editor transcoder, who is in charge to change mail css style into inline style and vice versa, has a cache to improve its efficiency. The problem is that it was designed to work only if a particular "<tag>.className" has always the same css style no matter what its parent or neighbors are. This is obviously not compatible with theme switching. Indeed, only by switching from one theme to another, the parent of every snippet have a different className which is used in css to design differently every snippet. Also inside a same theme, we obviously want to be able to style a particuler .myClass element differently from one snippet to another without having to multiple css classes. This commit removes the cache system to allow theme switching and liberty in theme designing. This however make the edition start and the saving really slower...
2016-09-05[REF] mass_mailing: change/add snippets/themes layout/designCsaba Fazekas
* Airmail/Lemon/Tech template/Odoo template * Add bg color option * Clean snippets
2016-09-05[FIX] web_editor: saved mass_mailing have small difference with editionChristophe Matthieu
2016-03-16[MERGE] forward port of branch saas-7 up to revision ↵qdp-odoo
71d16a369e01515aac988c62371d70549d3b5294
2016-03-03[FIX] web_editor: image sizeNicolas Martinelli
Make sure to create an image of a size larger than zero. A size of zero will generate a traceback.
2016-02-10[MERGE] forward port of branch saas-7 up to cab5c48Christophe Simonis
2016-02-04[FIX] web_editor: minor tweaks IE11Nicolas Lempereur
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
2016-02-02[MERGE] forward port of branch saas-8 up to 2611a81Christophe Simonis
2016-01-28[FIX] web_editor: remove style attribute if emptyChristophe Matthieu
2016-01-27[MERGE] forward port of branch saas-8 up to 7e44ddcChristophe Simonis
2016-01-20[FIX] web_editor: firefox can have undefined value for style and broke ↵Christophe Matthieu
inliner feature
2016-01-18[FIX] web_editor: inliner don't apply color when background-colorChristophe Matthieu
2016-01-18[FIX] web_editor: inliner take in care the '!important' attributesChristophe Matthieu
2016-01-18[FIX] web_editor: don't limit the css inliner to the class but for all tagChristophe Matthieu
(can reduce the performances)
2016-01-06[IMP] web_editor: use unicode number for FontAwesome controllerNicolas Lempereur
In some non-usual circumstances, using unicode in controllers can lead to issue. For example on a terminal using C encoding (instead of the mighty UTF-8) werkzeug might use sys.getfilesystemencoding to encode the request URL which will fail with UTF-8 inside. This commit change the URL character of the font awesome controller to UTF-8, but keep the old way since every sent mail might still use it. There is the overlap of character 0 to 9 which are overidden in this commit by unicode code 0 to 9, but these were not used in font-awesome anyway (or these are not even visible ASCII characters). closes #9572
2015-09-28[IMP] web_editor: Convert font-awsome into picture before convert class into ↵Christophe Matthieu
style to remove unnecessary style attributes
2015-09-28[FIX] web_editor: send mail to outlook and keep image sizeChristophe Matthieu
Office Outlook doesn't take into account the [style] attribute, and it doesn't manage width/height in percent value. This commit set width/heigth attribute in pixels and also always set the width/height in style attribute (keeping them in the original unit and setting them to auto if not present).
2015-09-23[MERGE] forward port of branch saas-6 up to a669433Christophe Simonis
2015-09-08[FIX] website_mail: special case for css splittingNicolas Lempereur
The css of a mail is inlined as best as possible for the mail sending. Previously, if there was a selector like .ch[onclick="ga(this,event)"] the simple splitting would split in the middle and get one erroneous selector (which then would trigger an error). With his commit, rules containing " or ' are ignored. opw-643548 note: forward port of 6316bce
2015-07-31[FIX]web_editor: Fixed the issue of firefox not able to enumerate on ↵Mohammed Shekha
cssRules, it is due to Cross domain security policy of firefox, used try catch, so that if there is cross domain css then skip it, it should not break the system, atleast it should work for same domain css, cross domain css should skipped
2015-07-31[FIX] web_editor: _.find break if the value is a spaceChristophe Matthieu
Some classes are not checked. Compact values to remove empty string classes.
2015-07-31[FIX] web_editor: on firefox css rules doesn't have key with hyphenChristophe Matthieu
On save (eg: in mass_mailing), the style contains 'undefined' values
2015-07-10[IMP] web_editor: split website into web_editor (to use editor in backend ↵Christophe Matthieu
for html field) and website