From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- .../static/src/js/tours/website_forum.js | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 addons/website_forum/static/src/js/tours/website_forum.js (limited to 'addons/website_forum/static/src/js/tours') 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(\"
\"))", + 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(\"
\"))", + 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", + }]); +}); -- cgit v1.2.3