summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.snippets.editor.js
AgeCommit message (Collapse)Author
2017-08-16[MOV] web_editor, website: reorganize filesqsm-odoo
2017-06-06[MERGE] forward port branch saas-16 up to 6f3eada2c3aChristophe Simonis
2017-06-06[MERGE] forward port branch saas-15 up to f687a27b79eChristophe Simonis
2017-06-03[MERGE] Forward-port 10.0 up to 76cd8d2558d2a1fc11681dbc4a134ba06fb698c0Olivier Dony
2017-06-02[FIX] web_editor, website: allow to detect indirect clonesDharmraj Jhala
When cloning a snippet section thanks to the editor, the associated snippet options' `on_clone` methods are called. Now these methods receive a new argument `options`. The option this commit introduces is the `isCurrent` one. It allows the method to know if the snippet section it is associated to is the one that was cloned or if it is a child of the one that was cloned. This is useful to solve a known bug when cloning elements which have bootstrap columns: - When one column is cloned we want it to lose its col-*-offset-* classes so that the offset is not duplicated (only the column). - When a container with column children is cloned we do not want these column' offsets to be removed (we want the whole cloned container to be the same).
2017-06-01[FIX] website: properly update parralax imageDharmraj Jhala
Fixed some issues with parralax image updates: - Background updated without clicking - Default wallpaper not coming back - Background disappearring sometimes
2017-06-01[FIX] website: properly rebind background eventsDharmraj Jhala
In carousel snippet, the target element for background snippet option is being changed manually. So for the new target, we have to rebind the associated events that were bound in `start` function of the snippet option. For that, some code is extracted from the `start` function and is used to rebind necessary events for new targets. In particular, this was preventing the carousel slides' backgrounds to be automatically removed when a background-color was selected.
2017-05-16[MERGE] Forward-port saas-15 up to 878fbc75ff9ebade92f43748500e64350367a824Olivier Dony
2017-05-16[MERGE] Forward-port 10.0 up to 1545995b393a1d347c6c1988da03dd1c6f1ea037Olivier Dony
2017-05-12[FIX] website: fix missed forward-portqsm-odoo
A forward-port ported this commit: https://github.com/odoo/odoo/commit/c12f2cd5ccc72a680ab741b4ce16d3913dd3854e#diff-473476fda8a8b38a9ee4480eb2bf2e2eR150 But ignored that a more recent one did remove the related code: https://github.com/odoo/odoo/commit/0eafeab1#diff-473476fda8a8b38a9ee4480eb2bf2e2eL173 The result was misindented breaking code.
2017-04-11[REF] web, *: simplify our RPC system (in JS)Géry Debongnie
The RPC system was not completely satisfactory, we decided to prepare the future and do it properly. This commit introduces the new rpc system, which replace the previous new one. We now simply have a method, this._rpc, which takes a dictionary of parameters. The idea is that depending on the parameters, it is able to add correct default value when necessary. For situations where we don't have the this._rpc method, we can use the rpc.query method, which takes the same arguments, but directly calls ajax.rpc instead of triggering up some events.
2017-04-11[REF] *: use _rpc method for all rpcsGéry Debongnie
The _rpc method is now the preferred method to do a rpc, so we need to update all calls.
2017-04-11[REF] web,*: remove 'web.model' and 'web.dataModelGéry Debongnie
Use this.rpc instead of Model object, with web.ajax if necessary. nb: EventDispatcherMixin include now the custom_events managment instead of widget
2017-02-14[FIX] website: restore company edition optionqsm-odoo
Commit d1a8d54aca2e386d804162d1dcfe2c213ae339ec broke the feature without mercy. The mentioned commit introduces a nice improvement to allow the edition of the company logo directly from frontend. However it also breaks the option for non-logo parts (example: clicking on the address on the contact us page). It also leaves most of the option code behind, which makes useless code being executed for nothing. This commit restores the company option the way it was and simply deactivates it for the logo edition, which was the desired behavior.
2017-02-10[IMP] website: Make company logo editable from frontendjpr-odoo
Purpose ======= Clicking the company logo takes to the backend's company settings. Users get lost and don't know how to go back to the website. Specs ===== It should be a picture selection wizard. If possible the default picture should be the company logo if already set.
2016-11-22[REF] website: refactor parallax snippetstefanorigano
This commit is a refactoring of the 's_parallax' snippet. Note that it is compatible with previous parallax snippet (old snippets are just transformed into the brand new one on page load). Note that scroll speed are changed by this implementation though. This solves several issues: - Bg image went easily off of the frame if scroll speed was too fast - The 'scroll speed' effect was visually inconsistent across different devices. - If the Bg image was smaller than the frame (condition which occurs often in a responsive environment), then the image was totally offset. - Since the previous implementation use background-position property to perform the effect, It was not possible to define an image focus point. This implementation solves the previous issues introducing a safe-area that limit the effect range. It's calculated dynamically, according to the current screen size and the 'speed' option. The effect if now achieved thanks to the translation of a DOM element instead of background-position changes. This allows to solve the last mentionned problem and improve performance. The implementation rely on the new animation methods of the snippets Animation class. As this use the "requestAnimationFrame" function, the snippet knows the right time to repaint itself, instead of using the "scroll" event which is triggered too many times and thus occurs between painting frames. This change greatly improved performances (CPU/painting usage many times smaller).
2016-10-18[FIX] website: properly unbind events of parallax snippet optionqsm-odoo
Recent refactoring of the parallax changed the snippet option JS and attached a callback on a editor element but forgot to detach it if the parallax snippet is removed. This added a bug which broke the editor every time a parallax snippet was removed.
2016-09-20[IMP] website, web_editor, mass_mailing: move margin and size optionsqsm-odoo
website -> web_editor so that they are available for mass_mailing. To allow setting margins on td elements: As the above mentionned option allows to control the mt and mb classes on the mass mailing items, the problem is that we would ideally want it to be functionnal on td element as they are the main part of a mail. As they don't support margins, there were many options to fix the problem: - Add more JS to place the mt and mb classes on children of td element - Place the option on children of td element and not td element itself but in that case, the width control of td would imply a lot of parent option hierarchy, or the width control had also to be adapted to control children - Control padding instead of margin. This forces to add lots of css rules like pt4 pt8, ... (or td.mt4, td.mt8, ...). The last solution has been chosen. Padding is more supported than margins in mail client anyway and the css rules will be isolated in the mail editor anyway. Using td.mt4 instead of pt4 had the advantage to not require any JS modification.
2016-09-15[FIX] website: refactore parallax snippet (perf / browser compatibility)qsm-odoo
* Do not read multiple DOM data on each scroll. Simply read this when necessary (edition / initialization). * Throttle scroll event and debounce resize events (-> performance in edition and navigation improved). * Do not save useless data in the DOM. * Have the parallax state consistent if the page undergo other changes * Simplify DOM structure and LESS - Allow to better see how to place snippets inside the area - Before this commit, default parallax had different height on chrome and firefox
2016-09-15[FIX] website, web_editor: remove born-dead codeqsm-odoo
This code was introduced in 8.0 and has never been called.
2016-09-15[FIX] website: missing JS module dependencyqsm-odoo
Commit 3c98c78fc75da13398826ed2ecb5b126c4f57fd1 removed a JS dependency by mistake.
2016-09-09[MERGE] forward port branch saas-12 up to 9f28139Christophe Simonis
2016-09-09[MERGE] forward port branch saas-11 up to dc4d6b6Christophe Simonis
2016-09-09[MERGE] forward port branch 9.0 up to af87c57Christophe Simonis
2016-09-07[FIX] website: properly allow to remove slide from banner snippetqsm-odoo
Removing a slide was buggy : * Removing the last slide left the slide handles (and the user had to click on remove slide again) * There was an ugly delay before the removal * Changing the bg image of a slide was not possible anymore once one slide was removed * ...
2016-09-07[FIX] website: colorpicker option for banner snippetqsm-odoo
2016-08-19[IMP] mrp: App MRP --> Manufacturing (consistency between app and menu)Fabien Pinckaers
[IMP] website: better dialog when clicking on a menu in edit mode (less options is easier)
2016-08-19[IMP] website: propose edition of company data in frontendqsm-odoo
When clicking on the logo or the company adress in the website edit mode, the user can now choose to be redirected to the form view of the company so that it can edit the data.
2016-08-19[IMP] website: allow to navigate through menus in edit modeqsm-odoo
Now, when clicking on a menu item while being in edit mode, a modal opens asking if we want to go to that page, edit that page, edit the menu or do nothing (it only allowed to edit the menu item before).
2016-08-04[FIX] website: properly duplicate FAQ Roller questionsqsm-odoo
/!\ This is a backport from saas-10 When duplicating a question in the FAQ Roller snippet, the cloned question was opening the original answer instead of its own answer.
2016-07-04[REF] web_editor,website(_*): snippetsqsm-odoo
Refactor snippet structure * new "cover" snippet * move the title out of col-md-12 * delete snippets (s_quote_slider) * rename snippets (FAQ Roller -> Accordion) * ... Refactor the way the background images are handled so that themes can customize the defaults ones easily without ugly xpath or ugly css.
2016-07-04[IMP] web_editor,website: snippet options (parent & deletion)qsm-odoo
* Always allow to delete a part (and delete parent if empty) * Show parent options (by displaying the snippet name if any, "column" for col-* and "Block" otherwise) * ...
2016-07-04[IMP] website,web_editor: review style / contentqsm-odoo
* Mobile preview dialog * Add page dialog (allow to click anywhere to close the modal) * Change label for "auto resize" and "resize" options to "auto size" and "fixed size" and add a checkmark to the currently active one * Overlay border / Options dialog content * Hide the odoo navbar after a delay when the editor starts
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_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
2016-01-13[FIX] website: editor: enable/disable save/undo/redo button when resize snippetChristophe Matthieu
2015-10-26[IMP] web_editor: move picture options from snippet to summernote barChristophe Matthieu
Difficulty for the user to understand how to change the images. Some options summernote being in the bar and the other in the snippets editor. Need to merge this options.
2015-08-24[MERGE] forward port of branch saas-6 up to e16d495Christophe Simonis
2015-08-21[FIX] website: can't add a slide in bannerChristophe Matthieu
2015-08-21[FIX] website: two sliders or galleries can have the same idChristophe Matthieu
(because the user can edit separate part like footer or using versioning)
2015-08-21[FIX] website: manage css margin for resizingNicolas Lempereur
In some case margin could be applied via CSS and not via mb* classes (e.g several themes with different aspects but a shared snippet). This commit allow this if custom CSS margin matches a CSS mb* class value (currently 0, 4, 8, 16, 32, 48, 92 and 128).
2015-08-21[FIX] website: edge case for slider backgroundNicolas Lempereur
Update the snippet option background "target" and cached "background data" each time another slide is shown.
2015-08-21[FIX] website: improve font awesome iconsNicolas Lempereur
* don't duplicate fa classes needlessly, * keep img-* classes which may be used on icons with a background, * copy overlay when we transform a tag to a span
2015-08-21[FIX] website: snippet editor call on_clone & on_remove on childrenChristophe Matthieu
2015-08-15[MERGE] forward port of branch saas-6 up to 8d95f6dChristophe Simonis
2015-08-11[FIX] website: background of the bannerGoffin Simon
";" is not always in the background style of the banner. opw:647083
2015-08-11[FIX] website: editor - duplicate the slide from snippetJeremy Kersten
Since saas-6, all snippets should start by a s_, so we can know exactly what is the current snippet, and retrieve the slide from the drop-snippets bar. If none snippet match, we use the old method which consists to find the snippet which have the biggest intersection of class betwwen dropped snippet, and all snippets in drop-snippets bar. A other way without update the JS code will be to had many fake class in the snippet declaration and in the snippet code to be sure that it match the right snippet.
2015-07-16[FIX] website: editor don't save content if change only the background colorChristophe Matthieu
2015-07-15[FIX] website: allow change banner once custom img has been selectedJeremy Kersten
2015-07-10[FIX] website: Fix background optionJeremy Kersten
Add oe_dark in color list for 'background color', else end user cannot change the color Force background-color and not background, else background-size from oe_img is overrided and so the background is displayed with a size:auto instead of cover