summaryrefslogtreecommitdiff
path: root/addons/website_forum/static/src/js/tours
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/website_forum/static/src/js/tours
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/website_forum/static/src/js/tours')
-rw-r--r--addons/website_forum/static/src/js/tours/website_forum.js67
1 files changed, 67 insertions, 0 deletions
diff --git a/addons/website_forum/static/src/js/tours/website_forum.js b/addons/website_forum/static/src/js/tours/website_forum.js
new file mode 100644
index 00000000..55f57457
--- /dev/null
+++ b/addons/website_forum/static/src/js/tours/website_forum.js
@@ -0,0 +1,67 @@
+odoo.define("website_forum.tour_forum", function (require) {
+ "use strict";
+
+ var core = require("web.core");
+ var tour = require("web_tour.tour");
+
+ var _t = core._t;
+
+ tour.register("question", {
+ url: "/forum/1",
+ }, [{
+ trigger: ".o_forum_ask_btn",
+ position: "left",
+ content: _t("Create a new post in this forum by clicking on the button."),
+ }, {
+ trigger: "input[name=post_name]",
+ position: "top",
+ content: _t("Give your post title."),
+ }, {
+ trigger: ".note-editable p",
+ extra_trigger: "input[name=post_name]:not(:propValue(\"\"))",
+ content: _t("Put your question here."),
+ position: "bottom",
+ run: "text",
+ }, {
+ trigger: ".select2-choices",
+ extra_trigger: ".note-editable p:not(:containsExact(\"<br>\"))",
+ content: _t("Insert tags related to your question."),
+ position: "top",
+ run: function (actions) {
+ actions.auto("input[id=s2id_autogen2]");
+ },
+ }, {
+ trigger: "button:contains(\"Post\")",
+ extra_trigger: "input[id=s2id_autogen2]:not(:propValue(\"Tags\"))",
+ content: _t("Click to post your question."),
+ position: "bottom",
+ }, {
+ extra_trigger: 'div.modal.modal_shown',
+ trigger: ".modal-header button.close",
+ auto: true,
+ },
+ {
+ trigger: "a:contains(\"Answer\").collapsed",
+ content: _t("Click to answer."),
+ position: "bottom",
+ },
+ {
+ trigger: ".note-editable p",
+ content: _t("Put your answer here."),
+ position: "bottom",
+ run: "text",
+ }, {
+ trigger: "button:contains(\"Post Answer\")",
+ extra_trigger: ".note-editable p:not(:containsExact(\"<br>\"))",
+ content: _t("Click to post your answer."),
+ position: "bottom",
+ }, {
+ extra_trigger: 'div.modal.modal_shown',
+ trigger: ".modal-header button.close",
+ auto: true,
+ }, {
+ trigger: ".o_wforum_validate_toggler[data-karma=\"20\"]:first",
+ content: _t("Click here to accept this answer."),
+ position: "right",
+ }]);
+});