diff options
Diffstat (limited to 'addons/web/static/src/js/services')
| -rw-r--r-- | addons/web/static/src/js/services/config.js | 8 | ||||
| -rw-r--r-- | addons/web/static/src/js/services/core.js | 10 | ||||
| -rw-r--r-- | addons/web/static/src/js/services/crash_manager.js | 16 | ||||
| -rw-r--r-- | addons/web/static/src/js/services/data_manager.js | 8 |
4 files changed, 30 insertions, 12 deletions
diff --git a/addons/web/static/src/js/services/config.js b/addons/web/static/src/js/services/config.js index 9b8d6c03e2f..f892801a593 100644 --- a/addons/web/static/src/js/services/config.js +++ b/addons/web/static/src/js/services/config.js @@ -16,23 +16,31 @@ var config = { /** * debug is a boolean flag. It is only considered true if the flag is set * in the url + * + * @type Boolean */ debug: ($.deparam($.param.querystring()).debug !== undefined), device: { /** * touch is a boolean, true if the device supports touch interaction + * + * @type Boolean */ touch: 'ontouchstart' in window || 'onmsgesturechange' in window, /** * size_class is an integer: 0, 1, 2 or 3, depending on the (current) * size of the device. This is a dynamic property, updated whenever the * browser is resized + * + * @type Number */ size_class: null, /** * A frequent use case is to have a different render in 'mobile' mode, * meaning when the screen is small. This flag (boolean) is true when * the size is not 3. It is also updated dynamically. + * + * @type Boolean */ isMobile: null, /** diff --git a/addons/web/static/src/js/services/core.js b/addons/web/static/src/js/services/core.js index 0a52da1c521..86937c0e2c5 100644 --- a/addons/web/static/src/js/services/core.js +++ b/addons/web/static/src/js/services/core.js @@ -7,6 +7,11 @@ var QWeb = require('web.QWeb'); var Registry = require('web.Registry'); var translation = require('web.translation'); +/** + * Whether the client is currently in "debug" mode + * + * @type Boolean + */ var debug = $.deparam($.param.querystring()).debug !== undefined; var bus = new Bus (); @@ -43,8 +48,11 @@ return { one2many_view_registry: new Registry(), search_filters_registry: new Registry(), search_widgets_registry: new Registry(), - + /** + * @type {String} + */ csrf_token: odoo.csrf_token, + a_thing: 42, }; }); diff --git a/addons/web/static/src/js/services/crash_manager.js b/addons/web/static/src/js/services/crash_manager.js index 533cac6f3ad..3ce280c3aa8 100644 --- a/addons/web/static/src/js/services/crash_manager.js +++ b/addons/web/static/src/js/services/crash_manager.js @@ -161,19 +161,19 @@ var CrashManager = core.Class.extend({ }); /** - An interface to implement to handle exceptions. Register implementation in instance.web.crash_manager_registry. + * An interface to implement to handle exceptions. Register implementation in instance.web.crash_manager_registry. */ var ExceptionHandler = { /** - @param parent The parent. - @param error The error object as returned by the JSON-RPC implementation. - */ + * @param parent The parent. + * @param error The error object as returned by the JSON-RPC implementation. + */ init: function(parent, error) {}, /** - Called to inform to display the widget, if necessary. A typical way would be to implement - this interface in a class extending instance.web.Dialog and simply display the dialog in this - method. - */ + * Called to inform to display the widget, if necessary. A typical way would be to implement + * this interface in a class extending instance.web.Dialog and simply display the dialog in this + * method. + */ display: function() {}, }; diff --git a/addons/web/static/src/js/services/data_manager.js b/addons/web/static/src/js/services/data_manager.js index 4bf1748fbab..22c7e86ba7d 100644 --- a/addons/web/static/src/js/services/data_manager.js +++ b/addons/web/static/src/js/services/data_manager.js @@ -64,9 +64,11 @@ return core.Class.extend({ * Loads various information concerning views: fields_view for each view, * the fields of the corresponding model, and optionally the filters. * - * @param {Object} [dataset] the dataset for which the views are loaded - * @param {Array} [views_descr] array of [view_id, view_type] - * @param {Object} [options] dictionnary of various options: + * @param {Object} params + * @param {String} params.model + * @param {Object} params.context + * @param {Array} params.views_descr array of [view_id, view_type] + * @param {Object} [options] dictionary of various options: * - options.load_filters: whether or not to load the filters, * - options.action_id: the action_id (required to load filters), * - options.toolbar: whether or not a toolbar will be displayed, |
