summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/less/web_editor.ui.components.less
AgeCommit message (Collapse)Author
2018-01-10[REF] portal, website, web: rename/regroup LESS filesqsm-odoo
2017-09-30[FIX] web_editor: link dialog color buttons style was broken in some themesKishan Gajjar
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-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-07-10[IMP] web_editor, website: preserve tabs in modalsstefanorigano
2017-07-10[IMP] web_editor: refine @o-we-color-paper color + 'Well' colorstefanorigano
2017-07-10[IMP] web_editor: 'Media Dialog' library navigation btns designstefanorigano
2017-07-10[IMP] web_editor: make compact design for 'o_switch'stefanorigano
- Cleaner design - Reduce element size - Use LESS variables to simplify maintenance. - Switch from ‘em’ to ‘ex’ measure units. - Remove :hover state (not useful).
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[IMP] web_editor: use select2 in HTML/CSS editorqsm-odoo
The select DOM element which allows to select the template or the LESS file to edit has been replaced by a select2 element to improve usability. - Add search bar - Allow to add "customized", "unsaved changes" and level indentation a better way (styled and icons) - Add debug info (full less url / xml_id) only in debug, in small
2017-02-14[ADD] web_editor, website, web: new LESS editorqsm-odoo
The old "HTML" editor now handles LESS edition. The editor has now a button to switch between XML and LESS edition. By default, it only displays the odoo files which only appear in the assets_frontend bundle and in debug mode, it allows to see all the files that influenced the page design. The new editor has a new set of options which allows to use it as a xml editor only or a less editor only if needed. Also: make the "include bundles" option appear only in debug mode. Technical details: - When saving a modified LESS file, an attachment is created with the full modified content and an extension view xpaths the bundle where the original file was added to link this attachment instead. This relies on the fact that qweb, when generating assets bundle, replaces missing files by the "datas" contents of the ir.attachment's which have an "url" field equal to the urls it is searching. - If a LESS error is introduced, the recent changes in assets bundle generation (see c248674a5c615c9db113357eec9d9adaf50b888e) will not break the design but only open a dialog on page loading, with the LESS error. The user can then go to the LESS editor and reset its changes. This feature code has been started with original work of @pga-odoo
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
2016-12-01[IMP] web_editor: ace_editor: right resize barAdrien Dieudonne
Before this commit, it's was only possible to resize the width of the ace editor when it was on the right side of the screen. In studio, we need to put the ace editor on the left. So, we needed to add a new resize bar. For that, we also add a new option to know the position of the ace_editor. We also prevent the width of the ace editor from being recorded too many times in the local storage for nothing. This is why we added _.debounce.
2016-11-08[REF] website, web_editor: refactor ace editorqsm-odoo
Stop using ugly code for ace editor. * Really close the ace editor by changing its display property thanks to the dedicated do_show and do_hide method. * Make the common part of ace editors (website, web_studio) consistent so that the extensions are really small. * Do not do RPC to retrieve data already retrieved (now, there is only one unique RPC when the editor starts an one RPC per view changed on save). * Fix born-dead code so that the website editor starts automatically if the URL contains its associated hash and loads the correct view * Better handle errors (previous behavior only worked partially and only on chrome): - Jump to the error line and make it red. - Do not open a Dialog with mostly incomprehensible message but allow to open it on click of the error marker. - Do not save any changed file if one contains an error. - Do not allow formatting a file if it contains an error (show the error instead). * Do not use different routes to get the same content (remove the /website/customize_template_get route as it returns the same content as /web_editor/customize_template_get route). Note: in a further commit this route will be refactored. * In a general way, use consistent method names and behaviors / comment the code / lint files / ... * Open the code to extensions (so that it may later load other data than XML). Note: this refactoring allowed to fix bugs in previous odoo versions but this commit message will not detail them.
2016-10-13[FIX] website: fix usability/design issues in o_select_media_dialogstefanorigano
2016-09-28[REF] web_editor, website: move ACE editor to web_editorMartin Geubelle
The commit e59a7fe3ff5222288b0aa3d5fe356e437ed0741a has moved the ACE editor from website to web_editor. As some code on ir_ui_view was used for this widget, the code has also been moved to web_editor.
2016-09-07[IMP] web_editor: change design of transparent colors palettestefanorigano
* Add a "transparent" button * Add a special background for transparent background buttons + Some minor colorpicker design change
2016-09-02[MERGE] forward port branch saas-11 up to bde7f88Christophe Simonis
2016-08-30[FIX] web_editor: correctly display image and focus point in bg option dialogqsm-odoo
Before this commit, the focus point the user can move on the image in the background position configuration dialog was only following the mouse as we want if the image original width was larger than the dialog one. This is because the javascript relies on the fact the image takes 100% width of its container. To fix this, the container now does not take 100% of modal width but the size of its internal image (with a max-width of 100%).
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-02-24[REF] web,web_editor,website,report,mass_mailing,mail: LESSqsm-odoo
* Convert some CSS to LESS * Split/Join LESS files * Remove duplicates between website and web_editor * UI improvements * Allow simple customizations thanks to LESS var&mixins for website