weekly release 4.0dev
[moodle.git] / mod / forum / amd / src / selectors.js
CommitLineData
2646e9d6
RW
1// This file is part of Moodle - http://moodle.org/
2//
3// Moodle is free software: you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// Moodle is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
15
16/**
17 * Common CSS selectors for the forum UI.
18 *
19 * @module mod_forum/selectors
2646e9d6
RW
20 * @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
21 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22 */
23define([], function() {
24 return {
25 subscription: {
26 toggle: "[data-type='subscription-toggle'][data-action='toggle']",
e564ae86 27 },
da04a0a9
P
28 summary: {
29 actions: "[data-container='discussion-summary-actions']"
30 },
e564ae86
RW
31 post: {
32 post: '[data-region="post"]',
33 action: '[data-region="post-action"]',
9b4f09ba 34 actionsContainer: '[data-region="post-actions-container"]',
38d96b65 35 authorName: '[data-region="author-name"]',
9b4f09ba
P
36 forumCoreContent: "[data-region-content='forum-post-core']",
37 forumContent: "[data-content='forum-post']",
a0c9b6af 38 forumSubject: "[data-region-content='forum-post-core-subject']",
902c8f58 39 inpageReplyButton: "button",
9b4f09ba 40 inpageReplyLink: "[data-action='collapsible-link']",
38d96b65
RW
41 inpageReplyCancelButton: "[data-action='cancel-inpage-reply']",
42 inpageReplyCreateButton: "[data-action='create-inpage-reply']",
43 inpageReplyContainer: '[data-region="inpage-reply-container"]',
9b4f09ba
P
44 inpageReplyContent: "[data-content='inpage-reply-content']",
45 inpageReplyForm: "form[data-content='inpage-reply-form']",
46 inpageSubmitBtn: "[data-action='forum-inpage-submit']",
902c8f58
RW
47 inpageSubmitBtnText: "[data-region='submit-text']",
48 loadingIconContainer: "[data-region='loading-icon-container']",
9b4f09ba 49 repliesContainer: "[data-region='replies-container']",
7902e4dc
RW
50 replyCount: '[data-region="reply-count"]',
51 modeSelect: "select[name='mode']",
52 showReplies: '[data-action="show-replies"]',
53 hideReplies: '[data-action="hide-replies"]',
54 repliesVisibilityToggleContainer: '[data-region="replies-visibility-toggle-container"]'
2893812e
P
55 },
56 lock: {
57 toggle: "[data-action='toggle'][data-type='lock-toggle']",
da04a0a9 58 icon: "[data-region='locked-icon']"
99bda8a7
P
59 },
60 favourite: {
61 toggle: "[data-type='favorite-toggle'][data-action='toggle']",
24962ee1
P
62 },
63 pin: {
64 toggle: "[data-type='pin-toggle'][data-action='toggle']",
65 },
7902e4dc 66 discussion: {
1a9e5cb2
JP
67 tools: '[data-container="discussion-tools"]',
68 item: '[data-region="discussion-list-item"]',
69 lockedLabel: "[data-region='locked-label']",
70 subscribedLabel: "[data-region='subscribed-label']",
a78070aa 71 timedLabel: "[data-region='timed-label']",
1a9e5cb2 72 },
2646e9d6
RW
73 };
74});