weekly release 4.0dev
[moodle.git] / mod / forum / amd / src / selectors.js
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/>.
16 /**
17  * Common CSS selectors for the forum UI.
18  *
19  * @module     mod_forum/selectors
20  * @package    mod_forum
21  * @copyright  2019 Andrew Nicols <andrew@nicols.co.uk>
22  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23  */
24 define([], function() {
25     return {
26         subscription: {
27             toggle: "[data-type='subscription-toggle'][data-action='toggle']",
28         },
29         summary: {
30             actions: "[data-container='discussion-summary-actions']"
31         },
32         post: {
33             post: '[data-region="post"]',
34             action: '[data-region="post-action"]',
35             actionsContainer: '[data-region="post-actions-container"]',
36             authorName: '[data-region="author-name"]',
37             forumCoreContent: "[data-region-content='forum-post-core']",
38             forumContent: "[data-content='forum-post']",
39             forumSubject: "[data-region-content='forum-post-core-subject']",
40             inpageReplyButton: "button",
41             inpageReplyLink: "[data-action='collapsible-link']",
42             inpageReplyCancelButton: "[data-action='cancel-inpage-reply']",
43             inpageReplyCreateButton: "[data-action='create-inpage-reply']",
44             inpageReplyContainer: '[data-region="inpage-reply-container"]',
45             inpageReplyContent: "[data-content='inpage-reply-content']",
46             inpageReplyForm: "form[data-content='inpage-reply-form']",
47             inpageSubmitBtn: "[data-action='forum-inpage-submit']",
48             inpageSubmitBtnText: "[data-region='submit-text']",
49             loadingIconContainer: "[data-region='loading-icon-container']",
50             repliesContainer: "[data-region='replies-container']",
51             replyCount: '[data-region="reply-count"]',
52             modeSelect: "select[name='mode']",
53             showReplies: '[data-action="show-replies"]',
54             hideReplies: '[data-action="hide-replies"]',
55             repliesVisibilityToggleContainer: '[data-region="replies-visibility-toggle-container"]'
56         },
57         lock: {
58             toggle: "[data-action='toggle'][data-type='lock-toggle']",
59             icon: "[data-region='locked-icon']"
60         },
61         favourite: {
62             toggle: "[data-type='favorite-toggle'][data-action='toggle']",
63         },
64         pin: {
65             toggle: "[data-type='pin-toggle'][data-action='toggle']",
66         },
67         discussion: {
68             tools: '[data-container="discussion-tools"]',
69             item: '[data-region="discussion-list-item"]',
70             lockedLabel: "[data-region='locked-label']",
71             subscribedLabel: "[data-region='subscribed-label']",
72             timedLabel: "[data-region='timed-label']",
73         },
74     };
75 });