summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/widgets.js
AgeCommit message (Collapse)Author
2017-08-16[MOV] web_editor, website: reorganize filesqsm-odoo
2017-07-24[IMP] web, *: lazy load dialog xml templateqsm-odoo
* web_editor, web_planner, website The 'Dialog' class is used in both backend and frontend. Also, lots of actions can be done without the use of any modal. It thus makes sense to lazy load its related xml only when a first modal is opened. This change also allows to get rid of the "base_common.xml" file as the dialog template is the only remaining one in there and, in the future website update, it will allow to not load any static XML file on website page loadings.
2017-07-10[IMP] web_editor: 'Media Dialog' library navigation btns designstefanorigano
2017-06-14[IMP] web_editor: in link dialog, do not hide 'open in new page' if empty linkdbh
2017-06-14[IMP] website, web_editor: improve the gallery snippetdbh
- Change the info message "Add Images from Customize menu" to "Add Images" and make it clickable - Reorganize snippet options menu - Improve the image dialog to be able to select/unselect - Make sure previews are adapted when changing gallery images
2017-04-13[MERGE] forward port branch saas-14 up to 8f30e707e53Christophe Simonis
2017-04-07[FIX] web_editor: allow to save unchanged icons with media dialogqsm-odoo
There was a bug with the icon edition when following these steps: - Open the Media dialog to edit an existing icon - Hit the "save" button in the dialog without choosing the icon - The edited icon disappears This happenned for icons whose original values were aliases of the related icon. Indeed, following these steps to edit an "fa-facebook-f" was leaving the icon unchanged as expected but doing it for a "fa-facebook" icon made the icon disappeared. This is because the last one is an alias of the first one and that the media dialog was ignoring aliasies when saving the original value. opw-725813
2017-03-28[MERGE] forward port branch saas-14 up to 2f68e9e93a1Christophe Simonis
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-02-20[FIX] web_editor, website: restore content menu featureqsm-odoo
Commit 3c9e6c89e7207636c1bdab4ed8118c0c1089d43e made big changes to the link editor dialog... but also broke many features with it. Commit 9a1ea6dc08af8b6dc5c5a47277f03f662094d4b2 already fixed some of them but this commit fixes a bigger one. Indeed, the menu edition feature was totally broken since the changes. Also, the DOM was messy which broke form navigation, etc. This commit also simplifies the LESS which was uselessly big.
2017-02-14[FIX] web_editor: link dialog (init & classes)qsm-odoo
Commit 3c9e6c89e7207636c1bdab4ed8118c0c1089d43e made big changes to the link dialog. This commit fixes two bugs it introduced: * The color class preview was not properly set when opening a dialog (so changing nothing and saving would change the result) * New btn color classes were wrongly initialized. It did not use less generation and made the button text always white. This could introduce bugs when using different colors in themes. Note: this code is already being refactored anyway.
2017-02-10[FIX] web_editor: Show only image tab in media dialog if field type is 'image'jpr-odoo
Reproducible steps: Select an icon instead of a picture -> it breaks it up or a video, or a document. The tabs shouldn't be displayed at all.
2017-02-10[IMP] web_editor: improve `LinkDialog` widget design and usabilityParth Gajjar
Specification ============= - no boxes around fields - use regular form style for input fields - don't split page/URL into two fields, just do one URL field, with autocomplete - Add alpha, beta, gamma, delta and epsilon color in color selection because they are used in mass mailing and themes also. - Add a selection option with label "L" inside circle for link. - Add Color selector for choosing button color - Remov select2 page selector and used jquery autocomplete on same input - Fix issue of page search in ir.http
2017-01-02[MERGE] forward port branch saas-11 up to b844d938890Christophe Simonis
2017-01-02[MERGE] forward port branch 9.0 up to 3805eb620aaChristophe Simonis
2016-12-19[FIX] web_editor: do not focus or set an empty imageDenis Ledoux
When editing the website, adding a gallery, choosing the grid mode and then adding images, an extra, empty, image was added to the grid, in the first position, making it looking weird or at least not aligned. This was due to the `start` method of the widget, which is trying to focus the image in the images browser when you double click on an image (in the big image building block for instance) and set an image without url in the case where `o.url` was undefined, and the url of one of the records was also undefined. opw-692205
2016-11-15[MERGE] forward port branch saas-12 up to ca20038Christophe Simonis
2016-11-14[FIX] web_editor: allow vimeo, youku and undefined video sources againqsm-odoo
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.
2016-10-13[FIX] web_editor: improve web_editor UI style preservationstefanorigano
* 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
2016-09-28[MERGE] forward port branch saas-12 up to 7134affChristophe Simonis
2016-09-27[FIX] website, *: properly process saving from editor dialogsqsm-odoo
* 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".
2016-09-22[MERGE] forward port branch saas-12 up to b1b700aChristophe Simonis
2016-09-22[MERGE] forward port branch saas-11 up to 6854887Christophe Simonis
2016-09-22[MERGE] forward port branch saas-10 up to 477482eChristophe Simonis
2016-09-22[MERGE] forward port branch 9.0 up to 78f6117Christophe Simonis
2016-09-21[FIX] mass_mailing: can't change color button snippet when edit mass mailingChristophe Matthieu
2016-09-20[FIX] web_editor: adapt code which updates editor bar after image editionqsm-odoo
This fixes a bug where the media dialog reopened after closing after edition of a t-field="image_small" block.
2016-09-20[FIX] web_editor: activate autoplay feature for videosqsm-odoo
The checkbox was there to activate autoplay... but was not doing anything since the web_editor/website split.
2016-08-31[IMP] web_editor: improve usability to select image in media dialogqsm-odoo
Before this commit, we had to click on the image we want, then click on save in the modal footer. Now we can also double click on the image we want, with the same result. Same goes for icons.
2016-08-19[FIX] web_editor,website: stop closing web_editor dialog two timesqsm-odoo
This commit fixes two problems: * Clicking on the save button of a web_editor dialog closed the dialog two times because the button was created with the flag "close: true" and binded to a handler which closes the dialog. This also prevented to extend this handler by placing the this._super call in a deferred. * Some web_editor dialog extended the save callback but forgot to use the this._super, which prevents the "saved" event to be triggered (currently not used anywhere but useful for custo and master).
2016-08-19[FIX] web_editor,website: stop closing web_editor dialog two timesqsm-odoo
This commit fixes two problems: * Clicking on the save button of a web_editor dialog closed the dialog two times because the button was created with the flag "close: true" and binded to a handler which closes the dialog. This also prevented to extend this handler by placing the this._super call in a deferred. * Some web_editor dialog extended the save callback but forgot to use the this._super, which prevents the "saved" event to be triggered (currently not used anywhere but useful for custo and master).
2016-07-25[MERGE] forward port branch saas-11 up to 7ae5121Christophe Simonis
2016-07-25[MERGE] forward port branch 9.0 up to 1089dcfChristophe Simonis
2016-07-20[FIX] web_editor,website: allow creating pages from edit menuqsm-odoo
The code for page creation from menu edition dialog was there but invisible to the user because of a wrong qweb template inheritance. Indeed, the edit menu dialog relies on an extension of the link dialog template. But this one is extended in-place in another location and that extension is not considered when the second extension is made because a t-extend always use the base template. The only solution to achieve the same result is to copy the edit menu dialog qweb extension in Javascript. Note: the feature was still available from the link dialog in page edition though because this was not concerned by the wrong qweb extension. However, adding a page by this way would create multiple pages because one was created each time a page name was entered (and not only on save !). So typing "test", then changing its mind and typing "hello", then rechanging to "test", then hitting the save button created the "test, "test-1", "test-2" and "hello" pages. This fix takes advantage of an already present parameter which can determine if a new page should be created or not. However, a code refactoring should be done in master for these classes.
2016-07-04[REF] web_editor: code refactoring and simplificationqsm-odoo
* Remove dead code + optimization * Use Dialog API from web module * Reorganize files * Correct buggy $() function for snippet option class * Add comments * Fix the snippet parent navigation : If a page contained a three level snippet structure (i.e A contains B contains C), when editing the following bug occured : If B or C was selected first, parenting buttons were correctly set. But if selecting A then C, clicking on the parent lead to going back on A instead of going on B. * Fix snippet thumbnail layout * Better isolate ui css from themes * MediaDialog image list : prevent displaying empty attachments * ...
2016-05-13[MERGE] forward port of branch saas-9 up to 087729fChristophe Simonis
2016-05-13[FIX] web_editor: video - allow to add video from unknown sourceJeremy Kersten
There are not cat... but you cannot know all the existing website in the world... So, have faith in the user ! To do: allow to customize size or get it from iframe provided
2016-05-12[FIX] web_editor: scroll and editing menu modalNicolas Lempereur
The class modal-open on body tag allow to scroll on the modal content which is useful if the content is taller than the window viewport. When closing the modal, this class is removed but there may be another modal open on which we will not be able to scroll to view buttons/content if too big. This commit check if a modal is still opened after closing an editor modal and in the affirmative add back the modal-open class. opw-674475 note : was already present in 8.0 with ec47493, it is also present for web.Dialog (but the modal of the editor do not inherit from web.Dialog)
2016-02-24[REF] web_editor,website,mass_mailing: JS/XML updateqsm-odoo
* Adapt DOM selectors * Refactore dialog XMLs to have odoo styling * New editor options (background-position, ...) * Various improvements
2015-12-03[FIX] web_editor: img classname is removed when change the urlChristophe Matthieu
2015-12-02[FIX] website, web_editor: open in new windowNicolas Martinelli
The field `isNewWindow` is used to open a link in a new tab. In this case, the field newWindow was used, and therefore the property was not applied. opw-657510
2015-11-04[FIX] web_editor: don't change the image style when change srcChristophe Matthieu
2015-11-04[FIX] web_editor: remove editor bar flickering when edit a qweb fieldChristophe Matthieu
Issue: When the user click on a field (like monetary, text...) the editor bar appear and disappear. The undo buton is hidden for this fields.
2015-11-04[FIX] web_editor: edition of monetary valueChristophe Matthieu
Issue: if the currency is before the value and we try to add a number at the begin of the value, the number is not saved (because the browser insert the number before the span). Add a onEnableEditableArea in the rte to change the contenteditable value and the default behavior.
2015-10-29[FIX] web{site,_editor}: gallery upload imageNicolas Lempereur
* when getting the src of an uploaded attachment we have to use src which is by default url, * in a MediaDialog the pager is shared between the document and image dialog, but when changing page, it was done for both (even if not displayed), * select the image after uploading it in the ImageDialog. closes #9284 opw-653061 opw-653167
2015-10-26[FIX] web_editor: add image display in width:100% by defaultChristophe Matthieu
2015-10-02[FIX] web_editor, mass_mailing: summernote oversight and videoNicolas Lempereur
* some oversight when updating summernote with d33086c, * fix style when replacing image with video
2015-09-01[FIX] web_editor: wrong typo in fontIconsDialog widgetChristophe Matthieu