Browse Source

misc: remove dead code 🔥🔥🔥 (#2844)

- old toolbox actions
- chat command processor
- room subject handling
j8
Saúl Ibarra Corretgé 7 years ago
parent
commit
2861d8d24e

+ 0
- 7
conference.js View File

2124
             room.toggleRecording(options);
2124
             room.toggleRecording(options);
2125
         });
2125
         });
2126
 
2126
 
2127
-        APP.UI.addListener(UIEvents.SUBJECT_CHANGED, topic => {
2128
-            room.setSubject(topic);
2129
-        });
2130
-        room.on(JitsiConferenceEvents.SUBJECT_CHANGED, subject => {
2131
-            APP.UI.setSubject(subject);
2132
-        });
2133
-
2134
         APP.UI.addListener(UIEvents.AUTH_CLICKED, () => {
2127
         APP.UI.addListener(UIEvents.AUTH_CLICKED, () => {
2135
             AuthHandler.authenticate(room);
2128
             AuthHandler.authenticate(room);
2136
         });
2129
         });

+ 0
- 6
modules/UI/UI.js View File

444
  */
444
  */
445
 UI.removeRemoteStream = track => VideoLayout.onRemoteStreamRemoved(track);
445
 UI.removeRemoteStream = track => VideoLayout.onRemoteStreamRemoved(track);
446
 
446
 
447
-/**
448
- * Update chat subject.
449
- * @param {string} subject new chat subject
450
- */
451
-UI.setSubject = subject => Chat.setSubject(subject);
452
-
453
 /**
447
 /**
454
  * Setup and show Etherpad.
448
  * Setup and show Etherpad.
455
  * @param {string} name etherpad id
449
  * @param {string} name etherpad id

+ 4
- 26
modules/UI/side_pannels/chat/Chat.js View File

1
 /* global APP, $ */
1
 /* global APP, $ */
2
 
2
 
3
-import { processReplacements, linkify } from './Replacement';
4
-import CommandsProcessor from './Commands';
3
+import { processReplacements } from './Replacement';
5
 import VideoLayout from '../../videolayout/VideoLayout';
4
 import VideoLayout from '../../videolayout/VideoLayout';
6
 
5
 
7
 import UIUtil from '../../util/UIUtil';
6
 import UIUtil from '../../util/UIUtil';
12
 import { addMessage, markAllRead } from '../../../../react/features/chat';
11
 import { addMessage, markAllRead } from '../../../../react/features/chat';
13
 import {
12
 import {
14
     dockToolbox,
13
     dockToolbox,
15
-    getToolboxHeight,
16
-    setSubject
14
+    getToolboxHeight
17
 } from '../../../../react/features/toolbox';
15
 } from '../../../../react/features/toolbox';
18
 
16
 
19
 let unreadMessages = 0;
17
 let unreadMessages = 0;
235
 
233
 
236
                 usermsg.val('').trigger('autosize.resize');
234
                 usermsg.val('').trigger('autosize.resize');
237
                 this.focus();// eslint-disable-line no-invalid-this
235
                 this.focus();// eslint-disable-line no-invalid-this
238
-                const command = new CommandsProcessor(value, eventEmitter);
239
 
236
 
240
-                if (command.isCommand()) {
241
-                    command.processCommand();
242
-                } else {
243
-                    const message = UIUtil.escapeHtml(value);
237
+                const message = UIUtil.escapeHtml(value);
244
 
238
 
245
-                    eventEmitter.emit(UIEvents.MESSAGE_CREATED, message);
246
-                }
239
+                eventEmitter.emit(UIEvents.MESSAGE_CREATED, message);
247
             }
240
             }
248
         });
241
         });
249
 
242
 
351
             { scrollTop: $('#chatconversation')[0].scrollHeight }, 1000);
344
             { scrollTop: $('#chatconversation')[0].scrollHeight }, 1000);
352
     },
345
     },
353
 
346
 
354
-    /**
355
-     * Sets the subject to the UI
356
-     * @param subject the subject
357
-     */
358
-    setSubject(subject) {
359
-        if (subject) {
360
-            // eslint-disable-next-line no-param-reassign
361
-            subject = subject.trim();
362
-        }
363
-
364
-        const html = linkify(UIUtil.escapeHtml(subject));
365
-
366
-        APP.store.dispatch(setSubject(html));
367
-    },
368
-
369
     /**
347
     /**
370
      * Sets the chat conversation mode.
348
      * Sets the chat conversation mode.
371
      * Conversation mode is the normal chat mode, non conversation mode is
349
      * Conversation mode is the normal chat mode, non conversation mode is

+ 0
- 94
modules/UI/side_pannels/chat/Commands.js View File

1
-import UIUtil from '../../util/UIUtil';
2
-import UIEvents from '../../../../service/UI/UIEvents';
3
-
4
-/**
5
- * List with supported commands. The keys are the names of the commands and
6
- * the value is the function that processes the message.
7
- * @type {{String: function}}
8
- */
9
-const commands = {
10
-    'topic': processTopic
11
-};
12
-
13
-/**
14
- * Extracts the command from the message.
15
- * @param message the received message
16
- * @returns {string} the command
17
- */
18
-function getCommand(message) {
19
-    if (message) {
20
-        for (const command in commands) {
21
-            if (message.indexOf(`/${command}`) === 0) {
22
-                return command;
23
-            }
24
-        }
25
-    }
26
-
27
-    return '';
28
-}
29
-
30
-/**
31
- * Processes the data for topic command.
32
- * @param commandArguments the arguments of the topic command.
33
- */
34
-function processTopic(commandArguments, emitter) {
35
-    const topic = UIUtil.escapeHtml(commandArguments);
36
-
37
-    emitter.emit(UIEvents.SUBJECT_CHANGED, topic);
38
-}
39
-
40
-/**
41
- * Constructs a new CommandProccessor instance from a message that
42
- * handles commands received via chat messages.
43
- * @param message the message
44
- * @constructor
45
- */
46
-function CommandsProcessor(message, emitter) {
47
-    const command = getCommand(message);
48
-
49
-    this.emitter = emitter;
50
-
51
-    /**
52
-     * Returns the name of the command.
53
-     * @returns {String} the command
54
-     */
55
-    this.getCommand = function() {
56
-        return command;
57
-    };
58
-
59
-
60
-    const messageArgument = message.substr(command.length + 2);
61
-
62
-    /**
63
-     * Returns the arguments of the command.
64
-     * @returns {string}
65
-     */
66
-    this.getArgument = function() {
67
-        return messageArgument;
68
-    };
69
-}
70
-
71
-/**
72
- * Checks whether this instance is valid command or not.
73
- * @returns {boolean}
74
- */
75
-CommandsProcessor.prototype.isCommand = function() {
76
-    if (this.getCommand()) {
77
-        return true;
78
-    }
79
-
80
-    return false;
81
-};
82
-
83
-/**
84
- * Processes the command.
85
- */
86
-CommandsProcessor.prototype.processCommand = function() {
87
-    if (!this.isCommand()) {
88
-        return;
89
-    }
90
-
91
-    commands[this.getCommand()](this.getArgument(), this.emitter);
92
-};
93
-
94
-export default CommandsProcessor;

+ 0
- 32
react/features/toolbox/actionTypes.js View File

18
  */
18
  */
19
 export const FULL_SCREEN_CHANGED = Symbol('FULL_SCREEN_CHANGED');
19
 export const FULL_SCREEN_CHANGED = Symbol('FULL_SCREEN_CHANGED');
20
 
20
 
21
-/**
22
- * The type of the action which sets the default toolbar buttons of the Toolbox.
23
- *
24
- * {
25
- *     type: SET_DEFAULT_TOOLBOX_BUTTONS,
26
- *     primaryToolbarButtons: Map,
27
- *     secondaryToolbarButtons: Map
28
- * }
29
- */
30
-export const SET_DEFAULT_TOOLBOX_BUTTONS
31
-    = Symbol('SET_DEFAULT_TOOLBOX_BUTTONS');
32
-
33
 /**
21
 /**
34
  * The type of (redux) action which requests full screen mode be entered or
22
  * The type of (redux) action which requests full screen mode be entered or
35
  * exited.
23
  * exited.
41
  */
29
  */
42
 export const SET_FULL_SCREEN = Symbol('SET_FULL_SCREEN');
30
 export const SET_FULL_SCREEN = Symbol('SET_FULL_SCREEN');
43
 
31
 
44
-/**
45
- * The type of the action which sets the conference subject.
46
- *
47
- * {
48
- *     type: SET_SUBJECT,
49
- *     subject: string
50
- * }
51
- */
52
-export const SET_SUBJECT = Symbol('SET_SUBJECT');
53
-
54
-/**
55
- * The type of the action which sets the subject slide in.
56
- *
57
- * {
58
- *     type: SET_SUBJECT_SLIDE_IN,
59
- *     subjectSlideIn: boolean
60
- * }
61
- */
62
-export const SET_SUBJECT_SLIDE_IN = Symbol('SET_SUBJECT_SLIDE_IN');
63
-
64
 /**
32
 /**
65
  * The type of the action which sets the indicator which determiens whether a
33
  * The type of the action which sets the indicator which determiens whether a
66
  * fToolbar in the Toolbox is hovered.
34
  * fToolbar in the Toolbox is hovered.

+ 0
- 32
react/features/toolbox/actions.native.js View File

2
 
2
 
3
 import {
3
 import {
4
     CLEAR_TOOLBOX_TIMEOUT,
4
     CLEAR_TOOLBOX_TIMEOUT,
5
-    SET_SUBJECT,
6
-    SET_SUBJECT_SLIDE_IN,
7
     SET_TOOLBAR_HOVERED,
5
     SET_TOOLBAR_HOVERED,
8
     SET_TOOLBOX_ALWAYS_VISIBLE,
6
     SET_TOOLBOX_ALWAYS_VISIBLE,
9
     SET_TOOLBOX_ENABLED,
7
     SET_TOOLBOX_ENABLED,
26
     };
24
     };
27
 }
25
 }
28
 
26
 
29
-/**
30
- * Signals that value of conference subject should be changed.
31
- *
32
- * @param {string} subject - Conference subject string.
33
- * @returns {Object}
34
- */
35
-export function setSubject(subject: string): Object {
36
-    return {
37
-        type: SET_SUBJECT,
38
-        subject
39
-    };
40
-}
41
-
42
-/**
43
- * Signals that toolbox subject slide in value should be changed.
44
- *
45
- * @param {boolean} subjectSlideIn - True if the subject is shown; otherwise,
46
- * false.
47
- * @returns {{
48
- *     type: SET_SUBJECT_SLIDE_IN,
49
- *     subjectSlideIn: boolean
50
- * }}
51
- */
52
-export function setSubjectSlideIn(subjectSlideIn: boolean): Object {
53
-    return {
54
-        type: SET_SUBJECT_SLIDE_IN,
55
-        subjectSlideIn
56
-    };
57
-}
58
-
59
 /**
27
 /**
60
  * Signals that toolbar is hovered value should be changed.
28
  * Signals that toolbar is hovered value should be changed.
61
  *
29
  *

+ 0
- 3
react/features/toolbox/actions.web.js View File

5
 
5
 
6
 import {
6
 import {
7
     clearToolboxTimeout,
7
     clearToolboxTimeout,
8
-    setSubjectSlideIn,
9
     setToolboxTimeout,
8
     setToolboxTimeout,
10
     setToolboxTimeoutMS,
9
     setToolboxTimeoutMS,
11
     setToolboxVisible
10
     setToolboxVisible
98
                     timeoutMS));
97
                     timeoutMS));
99
         } else {
98
         } else {
100
             dispatch(setToolboxVisible(false));
99
             dispatch(setToolboxVisible(false));
101
-            dispatch(setSubjectSlideIn(false));
102
         }
100
         }
103
     };
101
     };
104
 }
102
 }
137
 
135
 
138
         if (enabled && !visible) {
136
         if (enabled && !visible) {
139
             dispatch(setToolboxVisible(true));
137
             dispatch(setToolboxVisible(true));
140
-            dispatch(setSubjectSlideIn(true));
141
 
138
 
142
             // If the Toolbox is always visible, there's no need for a timeout
139
             // If the Toolbox is always visible, there's no need for a timeout
143
             // to toggle its visibility.
140
             // to toggle its visibility.

+ 1
- 57
react/features/toolbox/reducer.js View File

5
 import {
5
 import {
6
     CLEAR_TOOLBOX_TIMEOUT,
6
     CLEAR_TOOLBOX_TIMEOUT,
7
     FULL_SCREEN_CHANGED,
7
     FULL_SCREEN_CHANGED,
8
-    SET_DEFAULT_TOOLBOX_BUTTONS,
9
-    SET_SUBJECT,
10
-    SET_SUBJECT_SLIDE_IN,
11
     SET_TOOLBAR_HOVERED,
8
     SET_TOOLBAR_HOVERED,
12
     SET_TOOLBOX_ALWAYS_VISIBLE,
9
     SET_TOOLBOX_ALWAYS_VISIBLE,
13
     SET_TOOLBOX_ENABLED,
10
     SET_TOOLBOX_ENABLED,
24
  * @private
21
  * @private
25
  * @returns {{
22
  * @returns {{
26
  *     alwaysVisible: boolean,
23
  *     alwaysVisible: boolean,
24
+ *     enabled: boolean,
27
  *     hovered: boolean,
25
  *     hovered: boolean,
28
- *     primaryToolbarButtons: Map,
29
- *     secondaryToolbarButtons: Map,
30
- *     subject: string,
31
- *     subjectSlideIn: boolean,
32
  *     timeoutID: number,
26
  *     timeoutID: number,
33
  *     timeoutMS: number,
27
  *     timeoutMS: number,
34
  *     visible: boolean
28
  *     visible: boolean
68
          */
62
          */
69
         hovered: false,
63
         hovered: false,
70
 
64
 
71
-        /**
72
-         * A Map of the default buttons of the PrimaryToolbar.
73
-         *
74
-         * @type {Map}
75
-         */
76
-        primaryToolbarButtons: new Map(),
77
-
78
-        /**
79
-         * A Map of the default buttons of the SecondaryToolbar.
80
-         *
81
-         * @type {Map}
82
-         */
83
-        secondaryToolbarButtons: new Map(),
84
-
85
-        /**
86
-         * The text of the conference subject.
87
-         *
88
-         * @type {string}
89
-         */
90
-        subject: '',
91
-
92
-        /**
93
-         * The indicator which determines whether the subject is sliding in.
94
-         *
95
-         * @type {boolean}
96
-         */
97
-        subjectSlideIn: false,
98
-
99
         /**
65
         /**
100
          * A number, non-zero value which identifies the timer created by a call
66
          * A number, non-zero value which identifies the timer created by a call
101
          * to setTimeout() with timeoutMS.
67
          * to setTimeout() with timeoutMS.
137
                 fullScreen: action.fullScreen
103
                 fullScreen: action.fullScreen
138
             };
104
             };
139
 
105
 
140
-        case SET_DEFAULT_TOOLBOX_BUTTONS: {
141
-            const { primaryToolbarButtons, secondaryToolbarButtons } = action;
142
-
143
-            return {
144
-                ...state,
145
-                primaryToolbarButtons,
146
-                secondaryToolbarButtons
147
-            };
148
-        }
149
-
150
-        case SET_SUBJECT:
151
-            return {
152
-                ...state,
153
-                subject: action.subject
154
-            };
155
-
156
-        case SET_SUBJECT_SLIDE_IN:
157
-            return {
158
-                ...state,
159
-                subjectSlideIn: action.subjectSlideIn
160
-            };
161
-
162
         case SET_TOOLBAR_HOVERED:
106
         case SET_TOOLBAR_HOVERED:
163
             return {
107
             return {
164
                 ...state,
108
                 ...state,

+ 0
- 1
service/UI/UIEvents.js View File

70
     HANGUP: 'UI.hangup',
70
     HANGUP: 'UI.hangup',
71
     LOGOUT: 'UI.logout',
71
     LOGOUT: 'UI.logout',
72
     RECORDING_TOGGLED: 'UI.recording_toggled',
72
     RECORDING_TOGGLED: 'UI.recording_toggled',
73
-    SUBJECT_CHANGED: 'UI.subject_changed',
74
     VIDEO_DEVICE_CHANGED: 'UI.video_device_changed',
73
     VIDEO_DEVICE_CHANGED: 'UI.video_device_changed',
75
     AUDIO_DEVICE_CHANGED: 'UI.audio_device_changed',
74
     AUDIO_DEVICE_CHANGED: 'UI.audio_device_changed',
76
     AUDIO_OUTPUT_DEVICE_CHANGED: 'UI.audio_output_device_changed',
75
     AUDIO_OUTPUT_DEVICE_CHANGED: 'UI.audio_output_device_changed',

Loading…
Cancel
Save