Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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
 * Constant values for the conversation page in the message drawer.
18
 *
19
 * @module     core_message/message_drawer_view_conversation_constants
20
 * @copyright  2018 Ryan Wyllie <ryan@moodle.com>
21
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22
 */
23
define([], function() {
24
 
25
    var SELECTORS = {
26
        ACTION_ACCEPT_CONTACT_REQUEST: '[data-action="accept-contact-request"]',
27
        ACTION_CANCEL_CONFIRM: '[data-action="cancel-confirm"]',
28
        ACTION_OKAY_CONFIRM: '[data-action="okay-confirm"]',
29
        ACTION_CANCEL_EDIT_MODE: '[data-action="cancel-edit-mode"]',
30
        ACTION_CONFIRM_ADD_CONTACT: '[data-action="confirm-add-contact"]',
31
        ACTION_CONFIRM_BLOCK: '[data-action="confirm-block"]',
32
        ACTION_CONFIRM_DELETE_SELECTED_MESSAGES: '[data-action="confirm-delete-selected-messages"]',
33
        ACTION_CONFIRM_DELETE_CONVERSATION: '[data-action="confirm-delete-conversation"]',
34
        ACTION_CONFIRM_FAVOURITE: '[data-action="confirm-favourite"]',
35
        ACTION_CONFIRM_MUTE: '[data-action="confirm-mute"]',
36
        ACTION_CONFIRM_UNFAVOURITE: '[data-action="confirm-unfavourite"]',
37
        ACTION_CONFIRM_REMOVE_CONTACT: '[data-action="confirm-remove-contact"]',
38
        ACTION_CONFIRM_UNBLOCK: '[data-action="confirm-unblock"]',
39
        ACTION_CONFIRM_UNMUTE: '[data-action="confirm-unmute"]',
40
        ACTION_DECLINE_CONTACT_REQUEST: '[data-action="decline-contact-request"]',
41
        ACTION_REQUEST_ADD_CONTACT: '[data-action="request-add-contact"]',
42
        ACTION_REQUEST_BLOCK: '[data-action="request-block"]',
43
        ACTION_REQUEST_DELETE_CONVERSATION: '[data-action="request-delete-conversation"]',
44
        ACTION_REQUEST_DELETE_SELECTED_MESSAGES: '[data-action="delete-selected-messages"]',
45
        ACTION_REQUEST_REMOVE_CONTACT: '[data-action="request-remove-contact"]',
46
        ACTION_REQUEST_UNBLOCK: '[data-action="request-unblock"]',
47
        ACTION_VIEW_CONTACT: '[data-action="view-contact"]',
48
        ACTION_VIEW_GROUP_INFO: '[data-action="view-group-info"]',
49
        CAN_RECEIVE_FOCUS: 'input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]',
50
        CONFIRM_DIALOGUE: '[data-region="confirm-dialogue"]',
51
        CONFIRM_DIALOGUE_BUTTON_TEXT: '[data-region="dialogue-button-text"]',
52
        CONFIRM_DIALOGUE_CANCEL_BUTTON: '[data-action="cancel-confirm"]',
53
        CONFIRM_DIALOGUE_CONTAINER: '[data-region="confirm-dialogue-container"]',
54
        CONFIRM_DIALOGUE_HEADER: '[data-region="dialogue-header"]',
55
        CONFIRM_DIALOGUE_OKAY_BUTTON: '[data-action="okay-confirm"]',
56
        CONFIRM_DIALOGUE_TEXT: '[data-region="dialogue-text"]',
57
        CONTACT_REQUEST_SENT_MESSAGE_CONTAINER: '[data-region="contact-request-sent-message-container"]',
58
        CONTENT_PLACEHOLDER_CONTAINER: '[data-region="content-placeholder"]',
59
        CONTENT_CONTAINER: '[data-region="content-container"]',
60
        CONTENT_MESSAGES_CONTAINER: '[data-region="content-message-container"]',
61
        CONTENT_MESSAGES_FOOTER_CONTAINER: '[data-region="content-messages-footer-container"]',
62
        CONTENT_MESSAGES_FOOTER_EDIT_MODE_CONTAINER: '[data-region="content-messages-footer-edit-mode-container"]',
63
        CONTENT_MESSAGES_FOOTER_REQUIRE_CONTACT_CONTAINER: '[data-region="content-messages-footer-require-contact-container"]',
64
        CONTENT_MESSAGES_FOOTER_REQUIRE_UNBLOCK_CONTAINER: '[data-region="content-messages-footer-require-unblock-container"]',
65
        CONTENT_MESSAGES_FOOTER_UNABLE_TO_MESSAGE_CONTAINER: '[data-region="content-messages-footer-unable-to-message"]',
66
        DAY_MESSAGES_CONTAINER: '[data-region="day-messages-container"]',
67
        DELETE_MESSAGES_FOR_ALL_USERS_TOGGLE: '[data-region="delete-messages-for-all-users-toggle"]',
68
        DELETE_MESSAGES_FOR_ALL_USERS_TOGGLE_CONTAINER: '[data-region="delete-messages-for-all-users-toggle-container"]',
69
        EMOJI_AUTO_COMPLETE_CONTAINER: '[data-region="emoji-auto-complete-container"]',
70
        EMOJI_PICKER_CONTAINER: '[data-region="emoji-picker-container"]',
71
        EMOJI_PICKER: '[data-region="emoji-picker"]',
72
        EMOJI_PICKER_SEARCH_INPUT: '[data-region="search-input"]',
73
        ERROR_MESSAGE_CONTAINER: '[data-region="error-message-container"]',
74
        ERROR_MESSAGE: '[data-region="error-message"]',
75
        FAVOURITE_ICON_CONTAINER: '[data-region="favourite-icon-container"]',
76
        FOOTER_CONTAINER: '[data-region="content-messages-footer-container"]',
77
        HEADER: '[data-region="header-content"]',
78
        HEADER_EDIT_MODE: '[data-region="header-edit-mode"]',
79
        HEADER_PLACEHOLDER_CONTAINER: '[data-region="header-placeholder"]',
80
        LOADING_ICON_CONTAINER: '[data-region="loading-icon-container"]',
81
        MESSAGE: '[data-region="message"]',
82
        MESSAGE_NOT_SELECTED: '[data-region="message"][aria-checked="false"]',
83
        MESSAGE_NOT_SELECTED_ICON: '[data-region="not-selected-icon"]',
84
        MESSAGE_SELECTED_ICON: '[data-region="selected-icon"]',
85
        MESSAGES: '[data-region="content-message-container"]',
86
        MESSAGES_CONTAINER: '[data-region="content-message-container"]',
87
        MESSAGES_SELECTED_COUNT: '[data-region="message-selected-court"]',
88
        MESSAGE_TEXT_AREA: '[data-region="send-message-txt"]',
89
        MORE_MESSAGES_LOADING_ICON_CONTAINER: '[data-region="more-messages-loading-icon-container"]',
90
        MUTED_ICON_CONTAINER: '[data-region="muted-icon-container"]',
91
        PLACEHOLDER_CONTAINER: '[data-region="placeholder-container"]',
92
        RETRY_SEND: '[data-region="retry-send"]',
93
        SELF_CONVERSATION_MESSAGE_CONTAINER: '[data-region="self-conversation-message-container"]',
94
        SEND_MESSAGE_BUTTON: '[data-action="send-message"]',
95
        SEND_MESSAGE_ICON_CONTAINER: '[data-region="send-icon-container"]',
96
        TEXT: '[data-region="text"]',
97
        TEXT_CONTAINER: '[data-region="text-container"]',
98
        TIME_CREATED: '[data-region="time-created"]',
99
        TITLE: '[data-region="title"]',
100
        TOGGLE_EMOJI_PICKER_BUTTON: '[data-action="toggle-emoji-picker"]'
101
    };
102
 
103
    var TEMPLATES = {
104
        HEADER_PRIVATE: 'core_message/message_drawer_view_conversation_header_content_type_private',
105
        HEADER_PRIVATE_NO_CONTROLS: 'core_message/message_drawer_view_conversation_header_content_type_private_no_controls',
106
        HEADER_PUBLIC: 'core_message/message_drawer_view_conversation_header_content_type_public',
107
        HEADER_SELF: 'core_message/message_drawer_view_conversation_header_content_type_self',
108
        DAY: 'core_message/message_drawer_view_conversation_body_day',
109
        MESSAGE: 'core_message/message_drawer_view_conversation_body_message',
110
        MESSAGES: 'core_message/message_drawer_view_conversation_body_messages'
111
    };
112
 
113
    // Conversation types. They must have the same values defined in \core_message\api.
114
    var CONVERSATION_TYPES = {
115
        PRIVATE: 1,
116
        PUBLIC: 2,
117
        SELF: 3
118
    };
119
 
120
    return {
121
        SELECTORS: SELECTORS,
122
        TEMPLATES: TEMPLATES,
123
        CONVERSATION_TYPES: CONVERSATION_TYPES,
124
        NEWEST_MESSAGES_FIRST: true,
125
        LOAD_MESSAGE_LIMIT: 100,
126
        MILLISECONDS_IN_SEC: 1000
127
    };
128
});