Commit Graph
52 Commits
Author SHA1 Message Date
Christophe Simonis df3b75a127 [MERGE] forward port branch saas-15 up to f1ae96e389 2018-05-15 18:58:20 +02:00
Christophe Simonis a50e7aa366 [MERGE] forward port branch 10.0 up to 13fc77daf4 2018-05-15 17:44:34 +02:00
Lucas Perais (lpe) eb6714f59b [FIX] website_slides: slide in fullscreen needs to have the navbar
Display a slide, enter fullscreen mode
Make the navigation bar appear.

Now, try to push on any button of the nav bar

Before this commit, none of the button work
This is because the fullscreen mode is handled by the browser, and won't let any non-fullscreen
elements be interactive

After this commit, the nav bar is part of the element that are in fullscreen
And the button work

OPW 1839503
closes #24522
2018-05-15 09:46:55 +02:00
Christophe Simonis d67b410dfc [MERGE] forward port branch saas-15 up to cb87388d72 2018-03-07 17:42:02 +01:00
Christophe Simonis ac89023155 [MERGE] forward port branch 10.0 up to 5e6bb745e8 2018-03-06 12:28:30 +01:00
Christophe Simonis 1bfe147f89 [MERGE] forward port branch 9.0 up to 0e881fcd3a 2018-03-05 15:00:56 +01:00
qsm-odoo 80f97fbd19 [FIX] website_slides: load viewer for app's iframes only
The website_slides JS was working on all iframe in all pages while it
should only affect its own ones, which contains a PDF document.
2018-03-02 18:13:22 +01:00
Christophe Simonis 5ad55264e4 [MERGE] forward port branch saas-15 up to b04c8eae6b 2018-03-01 18:02:30 +01:00
Christophe Simonis 153ae5e8b8 [MERGE] forward port branch 10.0 up to a6855b31c9 2018-03-01 16:51:37 +01:00
Christophe Simonis 0261d6d595 [MERGE] forward port branch 9.0 up to 239f4fec29 2018-02-28 13:41:04 +01:00
qsm-odoo 216d73d727 [FIX] website_slides: fix slide loading (function call with wrong this)
Strangelly, this worked in 9.0 as the `this` element refers to the
`window` which also contains the `$` function. This may still be
wrong in some cases though, so it is fixed here (even if reported for
10.0).

opw-(1)817789
2018-02-23 13:37:00 +01:00
Christophe Simonis 64dbc5fbb9 [MERGE] forward port branch 10.0 up to ef8cd11a6b 2018-01-16 13:55:47 +01:00
Nicolas Lempereur 06ebd7d6e5 [FIX] website_slides: display date in locale
In 10.0 since 52f268d0 some parts such as the date/datetime widget are
adapted to the current locale and not just displayed in english.

But the dates in the slides module are always in english because they
don't wait for the locale to be loaded.

To wait for the locale, this commit add a wait for WebsiteRoot.instance
ensuring that locale and other WebsiteRoot widgets are ready.

This may have been preferred to create a dummy child widget to
WebsiteRoot, this way only WebsiteRoot would need to be ready and this
would have been more extensible but this is a bigger change.

note: this fix is for 11.0, for previous version the fix is ef8cd11a6b

opw-804555
closes #22241
2018-01-15 17:00:12 +01:00
Nicolas Lempereur ef8cd11a6b [FIX] website{,_slides}: display date in locale
In 10.0 since 52f268d0 some parts such as the date/datetime widget are
adapted to the current locale and not just displayed in english.

But the dates in the slides module are always in english because they
don't wait for the locale to be loaded.

To wait for the locale, this commit also adds a reference localeDef on
the website.website module.

note: this fix is only for [10.0,11.0[, another fix must be done in 11.0

opw-804555
closes #22241
2018-01-15 16:31:19 +01:00
Christophe Simonis 10128fa7e8 [MERGE] forward port branch saas-16 up to dc2a6c6cd2 2017-10-20 19:27:04 +02:00
Christophe Simonis fbdda5437a [MERGE] forward port branch 10.0 up to cbca27d005 2017-10-17 12:09:58 +02:00
Raphael Collet 9882c93874 [FIX] website_slides: avoid NULL characters in text field
OPW 772560
2017-10-16 16:38:30 +02:00
qsm-odoo 2972976962 [REF] web_editor, website, *: complete refactoring
* 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 11:04:14 +02:00
Christophe Simonis a49f637102 [FIX] website_slides: recreate pdf file
PyPDF2 didn't like previous version and threw warnings.
2017-08-01 19:06:40 +02:00
jpr-odoo 9e26d875db [IMP] *: uniformize modals buttons: remove 'oe_link' class and 'or' between buttons 2016-11-09 15:27:01 +01:00
Christophe Simonis 8847519621 [MERGE] forward port branch 10.0 up to 0acd63d 2016-10-12 17:10:49 +02:00
qsm-odoo fb363b572b [FIX] *: adapt odoo interface violet
Change color #a24689 to #875A7B

Commit https://github.com/odoo/enterprise/commit/8ac1c19fac7615fecd51e670f798d13158a4e53c
changed the odoo interface violet by changing the main LESS variable
but forgot there was many direct occurences in XML/HTML/... (for
example for the mobile browser color).

Even if it's community the odoo interface violet is used at many places
(module description, XML demo data, ...).
2016-10-05 10:29:00 +02:00
Christophe Simonis c8cc54559b [MERGE] forward port branch 10.0 up to 91a1448 2016-09-30 17:23:30 +02:00
Jeremy Kersten 7134affc89 [FIX] website_slide: add image deleted by commit 2e9644d
This picture is used in python code and not in description.
2016-09-28 14:56:17 +02:00
Fabien Pinckaers 008c54c6c6 [IMP] website_slides: better demo data (recent presentations) 2016-09-09 11:04:57 +02:00
Christophe Simonis 9ad5f26b3f [MERGE] forward port branch saas-11 up to 3a2147d 2016-08-20 17:18:31 +02:00
Christophe Simonis bc1a0a32ca [MERGE] forward port branch 9.0 up to 58cbcba 2016-08-19 16:59:29 +02:00
Aristobulo Meneses 5e7d23f1be [FIX] website_slides: Set file size limit to 25MB to match web module limits
This commit closes #13223
This commit closes #13225
2016-08-19 15:34:58 +02:00
Adrien Dieudonne a9b0561106 [FIX] *: use new JS module to read from/write in localStorage
to prevent errors when the localStorage capacity is 0, which is the case e.g.
on private browsing with Safari.
2016-06-16 13:48:18 +02:00
Foram Shah 2e9644d10f updated the description of website_slides 2016-05-10 15:24:50 +02:00
Fabien Pinckaers 4c8e908b49 [IMP] Speed up app switcher loading: 645k --> 137k lossless compression for all icons 2016-02-26 11:39:38 +01:00
Christophe Matthieu 1a2b1e69dd [IMP] web: remove useless jQuery.timeago lib
Replace call by moment(date).fromNow()
2016-02-17 09:47:45 +01:00
Martin Trigaux 8b4f052a38 [MERGE] Forwardport of branch saas-6 up to c649bb0df 2016-01-05 18:28:06 +01:00
Nicolas Lempereur a2cb0e96e3 [IMP] website_slides: improve not pretty thumbnail
In 9.0 image_medium and image_thumb route are used to display thumbnail
of website_slides document.

These in 9.0 will scale the image, but also crop it so it has a good
aspect ratio.

In saas-6 this croping feature is not present and these thumbnail will
be scaled in diverse ugly way.

To improve a little the situation, this commit use some CSS (currently
not supported only by internet explorer) which give a similar aspect as
9.0's got.

opw-658957
2015-12-16 17:33:09 +01:00
Christophe Simonis d750206c49 [MERGE] forward port of branch saas-6 up to e9f1ee4 2015-10-01 15:16:59 +02:00
Nicolas Martinelli a4bc3c23aa [FIX] website_slides: fullscreen and previous/next
This solves 2 issues:

1) When the slide is set to fullscreen, on Firefox, the image was
stretched and the aspect ratio not respected. This is the default
behavior of Firefox for a canvas. By choosing the parentNode instead (a
div tag which only contains the canvas), the aspect ratio is respected.

2) Arrow key up/down has now the same behavior than arrow key
left/right.

opw-650174
2015-09-28 15:29:06 +02:00
Martin Trigaux 04ae8023f6 [FIX] *: various English errors
Unclear or incorrect sentenses.
Courtesy of Eric Geens
2015-09-14 12:14:06 +02:00
odoo-tac 6a4b8881b0 [FIX] website_slides : Fixing typos and cleaning methods for fullscreen footer and social sharing; code simplification 2015-09-07 13:37:50 +02:00
Dharmraj Jhala 36815037b8 [IMP] website_slides : usability improvements 2015-09-07 13:37:50 +02:00
qsm-odoo 5960d3cff8 [IMP] *: New icons 2015-08-11 14:31:10 +02:00
Christophe Matthieu 71732dceb6 [IMP] web: module can be asynchronous loaded if it return a deferred
Each module can return a deferred. In that case, the module is marked as loaded
only when the deferred is resolved, and its value is equal to the resolved value.
The module can be rejected (unloaded). This will be logged in the console as info.

Remove if_dom_contains from the website, the modules return a rejected deferred if
the DOM doesn't contains the seleted values.
2015-07-22 12:15:24 +02:00
Christophe Matthieu 9665882fba [IMP] web_editor: adapt css, js and xml to use web_editor 2015-07-10 17:00:12 +02:00
Christophe Simonis fe2b5f35a4 [MERGE] forward port of branch saas-6 up to bf1e999 2015-05-28 14:27:38 +02:00
David Monjoie 179c5a9908 [FIX] website_forum: wrapped sharing js inside if_dom_contains
To avoid loading unnecessary templates on every page
2015-05-18 16:47:06 +02:00
rsi-odoo 8de4ca04eb [IMP] website_slides : hide the navigation buttons (of the PDF Viewer) if the document has only one page 2015-04-22 09:32:10 +02:00
Jérome Maes 6a11f594a8 [IMP] website_slide, website : move the PDFJS library from slides to the website module to allow reusing it in website modules.
This huge library handle PDF file to display them, count their pages, ... Due to its size, the lib is declared in a separated optional bundle who should be called with a 't-call-assets' only on the page it is required.
2015-04-15 14:56:24 +02:00
Jérome Maes 73e855aee9 [FIX] website_slide : fix slide player by removing 'odoo.define()' since it is not a odoo js widget. This allow the player to be embedded on external web page without importing odoo js framework. 2015-03-24 11:48:42 +01:00
Géry Debongnie 4fdf74fe21 [IMP] web+addons: improvement to module system
The module system needs to know the dependencies of a given module
before executing the function.  This is why the dependencies were
defined once in an array, and then were described one more times in the
call to require.

But a trick can simplify this: the boot function can parse the string
representation of the module and extract the calls to require from it.
It is more work for the processor, but it leads to simpler module
definitions.
2015-03-18 09:23:37 +01:00
Géry Debongnie 65586f8ef3 [REF] website_slides: update to the new module system 2015-03-18 09:23:36 +01:00
Ravi Gadhia 98debe7820 [FIX] website_slides : hide popover to like/dislike, hidden upload button for public user, promote button only for employee, better error messages and ui improvements. 2015-02-06 11:50:38 +01:00