summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/user_custom_javascript.js
diff options
context:
space:
mode:
authorRobot Odoo <xmo+roboto@odoo.com>2019-02-06 02:13:10 +0100
committerGitHub <noreply@github.com>2019-02-06 02:13:10 +0100
commit88e76a7ff1da49b96df239b0a14df43614390912 (patch)
tree5f7f277f9544f9d12578e61a6040364e22b1c972 /addons/website/static/src/js/user_custom_javascript.js
parent8f3eff13fb76e71c881c8aae8e21b79cfad0cce2 (diff)
parentfc61305f51f3dad08e0a2d7d5c65cbee76203b38 (diff)
[MERGE] website, *: improve CSS edition usability + add JS edition
* web, web_editor See sub-commits for details. Currently, when an user wants to edit the css of its website, he has access to lots of files and, in debug mode, to even more files. While the feature is nice for people who know what they are doing, a lambda person can easily break its website by changing the wrong files. Also, nothing warns the user that the files that are edited will never receive updates anymore (unless if they are reset). The goal is to prevent those behavior while still allowing the add custom css. Another goal is to be able to *add* custom javascript. Custom files created for the user: SCSS: user_custom_rules.scss, user_custom_bootstrap_overridden.scss JS: user_custom_javascript.js task-1919350 closes odoo/odoo#29999
Diffstat (limited to 'addons/website/static/src/js/user_custom_javascript.js')
-rw-r--r--addons/website/static/src/js/user_custom_javascript.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/addons/website/static/src/js/user_custom_javascript.js b/addons/website/static/src/js/user_custom_javascript.js
new file mode 100644
index 00000000000..928fb0a7b9f
--- /dev/null
+++ b/addons/website/static/src/js/user_custom_javascript.js
@@ -0,0 +1,24 @@
+//
+// 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);
+ },
+})
+});
+*/