diff options
| author | qsm-odoo <qsm@odoo.com> | 2019-01-31 13:20:29 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-02-05 14:28:29 +0000 |
| commit | fc61305f51f3dad08e0a2d7d5c65cbee76203b38 (patch) | |
| tree | 5f7f277f9544f9d12578e61a6040364e22b1c972 /addons/website/static/src/js/user_custom_javascript.js | |
| parent | 515e7bc50f07c983eb932825d763753978346e66 (diff) | |
[IMP] website: improve documentation of user custom files
See https://github.com/odoo/odoo/pull/29999
Diffstat (limited to 'addons/website/static/src/js/user_custom_javascript.js')
| -rw-r--r-- | addons/website/static/src/js/user_custom_javascript.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/addons/website/static/src/js/user_custom_javascript.js b/addons/website/static/src/js/user_custom_javascript.js index 7849f0a9d2a..928fb0a7b9f 100644 --- a/addons/website/static/src/js/user_custom_javascript.js +++ b/addons/website/static/src/js/user_custom_javascript.js @@ -1 +1,24 @@ -// Here, you can add your custom JavaScript code. +// +// This file is meant to regroup your javascript code. You can either copy/past +// any code that should be executed on each page loading or write your own +// taking advantage of the Odoo framework to create new behaviors or modify +// existing ones. For example, doing this will greet any visitor with a 'Hello, +// world !' message in a popup: +// +/* +odoo.define('website.user_custom_code', function (require) { +'use strict'; + +var Dialog = require('web.Dialog'); +var sAnimations = require('website.content.snippets.animation'); + +sAnimations.registry.HelloWorldPopup = sAnimations.Class.extend({ + selector: '#wrapwrap', + + start: function () { + Dialog.alert(this, "Hello, world!"); + return this._super.apply(this, arguments); + }, +}) +}); +*/ |
