瀏覽代碼

Merge branch 'kkrisstoff-task/dropdown-aui-changes'

 the commit.
master
Lyubomir Marinov 9 年之前
父節點
當前提交
e1c5ea11bc
共有 6 個檔案被更改,包括 203 行新增102 行删除
  1. 26
    32
      css/_side_toolbar_container.scss
  2. 10
    1
      css/_variables.scss
  3. 48
    0
      css/aui-components/dropdown.scss
  4. 2
    1
      css/main.scss
  5. 43
    35
      index.html
  6. 74
    33
      modules/UI/side_pannels/settings/SettingsMenu.js

+ 26
- 32
css/_side_toolbar_container.scss 查看文件

2
  * Toolbar side panel main container element.
2
  * Toolbar side panel main container element.
3
  */
3
  */
4
 #sideToolbarContainer {
4
 #sideToolbarContainer {
5
-    display: inline-block;
6
-    position:absolute;
7
-    top: 0px;
8
-    left: $defaultToolbarSize;
9
-    width: 0;
10
     background-color: rgba(0,0,0,0.8);
5
     background-color: rgba(0,0,0,0.8);
11
     height: 100%;
6
     height: 100%;
7
+    left: $defaultToolbarSize;
12
     max-width: $sidebarWidth;
8
     max-width: $sidebarWidth;
13
-    z-index: 800;
14
     overflow: hidden;
9
     overflow: hidden;
10
+    position: absolute;
11
+    top: 0;
12
+    width: 0;
13
+    z-index: 800;
15
 
14
 
16
     /**
15
     /**
17
      * Labels inside the side panel.
16
      * Labels inside the side panel.
23
     /**
22
     /**
24
      * Form elements and blocks.
23
      * Form elements and blocks.
25
      */
24
      */
26
-    input, label, select, a,
25
+    input, select, a,
27
     .sideToolbarBlock, .input-control, .button-control {
26
     .sideToolbarBlock, .input-control, .button-control {
28
         display: block;
27
         display: block;
29
         margin-top: 15px;
28
         margin-top: 15px;
34
     /**
33
     /**
35
      * Specify colors for edit elements.
34
      * Specify colors for edit elements.
36
      */
35
      */
37
-    select, input[type="button"], input[type="text"],
38
-    input[type="reset"], input[type="submit"] {
36
+    select, input[type="button"], input[type="text"], input[type="reset"],
37
+    input[type="submit"] {
39
         color: $inputColor;
38
         color: $inputColor;
40
         background: $inputBackground;
39
         background: $inputBackground;
41
         border: none;
40
         border: none;
45
      * Specify styling of elements inside a block.
44
      * Specify styling of elements inside a block.
46
      */
45
      */
47
     .sideToolbarBlock {
46
     .sideToolbarBlock {
48
-        input, label, button, a, select {
49
-            margin-top: 5px;
47
+        input, button, a, select {
50
             margin-left: 0;
48
             margin-left: 0;
49
+            margin-top: 5px;
51
             width: 100%;
50
             width: 100%;
52
         }
51
         }
53
-
54
-        .startMutedLabel,
55
-        .followMeLabel {
52
+        input[type='checkbox'] {
56
             display: inline;
53
             display: inline;
57
-            margin-top: 0;
54
+            width: auto !important;
55
+            > label {
56
+                margin-top: 5px;
57
+                width: 80%;
58
+            }
58
         }
59
         }
59
     }
60
     }
60
 
61
 
72
         /**
73
         /**
73
          * Titles and subtitles of inner containers.
74
          * Titles and subtitles of inner containers.
74
          */
75
          */
75
-        > div.title,
76
-          div.subTitle {
77
-            text-align: left;
78
-            margin: 10px 0px 10px 0px;
76
+        div.title, div.subTitle {
77
+            margin: 10px 0;
79
         }
78
         }
80
 
79
 
81
         /**
80
         /**
82
          * Main title size.
81
          * Main title size.
83
          */
82
          */
84
-        > div.title {
83
+        div.title {
85
             color: $defaultColor !important;
84
             color: $defaultColor !important;
86
-            text-align: center;
87
             font-size: 16px;
85
             font-size: 16px;
86
+            text-align: center;
88
         }
87
         }
89
 
88
 
90
         /**
89
         /**
91
          * Subtitle specific properties.
90
          * Subtitle specific properties.
92
          */
91
          */
93
-        > div.subTitle {
92
+        div.subTitle {
93
+            color: $defaultSideBarFontColor !important;
94
             font-size: 11px;
94
             font-size: 11px;
95
             font-weight: 500;
95
             font-weight: 500;
96
-            color: $defaultSideBarFontColor !important;
97
             margin-left: 10%;
96
             margin-left: 10%;
97
+            text-align: left;
98
         }
98
         }
99
 
99
 
100
         /**
100
         /**
101
          * First element after a title.
101
          * First element after a title.
102
          */
102
          */
103
         .first {
103
         .first {
104
-            margin-top: 0px !important;
104
+            margin-top: 0 !important;
105
         }
105
         }
106
 
106
 
107
         /**
107
         /**
119
     text-align: center;
119
     text-align: center;
120
 }
120
 }
121
 
121
 
122
-#startAudioMuted,
123
-#startVideoMuted,
124
-#followMeCheckBox {
125
-    width: 13px !important;
126
-}
127
-
128
 /**
122
 /**
129
  * Profile
123
  * Profile
130
  */
124
  */
135
         li {
129
         li {
136
             list-style-type: none;
130
             list-style-type: none;
137
 
131
 
138
-            a.authButton{
132
+            a.authButton {
139
                 width: 160px;
133
                 width: 160px;
140
                 margin: 10px 20px;
134
                 margin: 10px 20px;
141
                 padding: 3px 29px;
135
                 padding: 3px 29px;
149
             }
143
             }
150
         }
144
         }
151
     }
145
     }
152
-}
146
+}

+ 10
- 1
css/_variables.scss 查看文件

92
 $auiPrimaryButtonHoverBg: #57647b;
92
 $auiPrimaryButtonHoverBg: #57647b;
93
 $auiPrimaryButtonColor: #fff;
93
 $auiPrimaryButtonColor: #fff;
94
 $auiIconColor: #707070;
94
 $auiIconColor: #707070;
95
-$inputControlEmColor: #f29424;
95
+$inputControlEmColor: #f29424;
96
+$linkFontColor: #489afe;
97
+$linkHoverFontColor: #287ade;
98
+
99
+/**
100
+ * Forms
101
+ */
102
+$inputBg: #505F79;
103
+$inputBgHover: #505F79;
104
+$inputFontColor: #ECEEF1;

+ 48
- 0
css/aui-components/dropdown.scss 查看文件

1
+form.aui {
2
+    .aui-select2-container {
3
+        background-color: transparent;
4
+
5
+        > a {
6
+            margin: 0 auto !important;
7
+            width: 100% !important;
8
+        }
9
+    }
10
+}
11
+
12
+.select2-results{
13
+    &::-webkit-scrollbar {
14
+        background-color: transparent;
15
+    }
16
+    &::-webkit-scrollbar-track {
17
+        background-color: transparent;
18
+    }
19
+    &::-webkit-scrollbar-track-piece {
20
+        background-color: transparent;
21
+    }
22
+    &::-webkit-scrollbar-thumb {
23
+        background-color: #3572b0;
24
+    }
25
+}
26
+
27
+.aui-select2-drop {
28
+    z-index: 901;
29
+}
30
+
31
+.select2-drop-mask {
32
+    z-index: 900;
33
+}
34
+
35
+//Dark theme
36
+form.aui{
37
+    //Placeholder
38
+    .aui-select2-container.input-container-dark {
39
+        a.select2-choice {
40
+            text-shadow: none;
41
+        }
42
+    }
43
+}
44
+
45
+.aui-dropdown2.aui-style-default.dropdown-dark {
46
+    background-color: $defaultBackground;
47
+    border-color: transparent;
48
+}

+ 2
- 1
css/main.scss 查看文件

62
 @import 'buttons/button-control';
62
 @import 'buttons/button-control';
63
 @import "modals/invite/invite";
63
 @import "modals/invite/invite";
64
 @import "connection-info";
64
 @import "connection-info";
65
+@import 'aui-components/dropdown';
65
 
66
 
66
-/* Modules END */
67
+/* Modules END */

+ 43
- 35
index.html 查看文件

30
             <a class="poweredby" href="http://jitsi.org" target="_new" ><span data-i18n="poweredby"></span> jitsi.org</a>
30
             <a class="poweredby" href="http://jitsi.org" target="_new" ><span data-i18n="poweredby"></span> jitsi.org</a>
31
 
31
 
32
             <div id="enter_room_container">
32
             <div id="enter_room_container">
33
-                    <div id="enter_room_form" >
34
-                        <div id="domain_name"></div>
35
-                        <div id="enter_room">
36
-                            <input id="enter_room_field" type="text" autofocus/>
37
-                            <div class="icon-reload" id="reload_roomname"></div>
38
-                            <input id="enter_room_button" type="button" data-i18n="[value]welcomepage.go" value="GO" />
33
+                <div id="enter_room_form" >
34
+                    <div id="domain_name"></div>
35
+                    <div id="enter_room">
36
+                        <input id="enter_room_field" type="text" autofocus/>
37
+                        <div class="icon-reload" id="reload_roomname"></div>
38
+                        <input id="enter_room_button" type="button" data-i18n="[value]welcomepage.go" value="GO" />
39
 
39
 
40
-                        </div>
41
                     </div>
40
                     </div>
41
+                </div>
42
             </div>
42
             </div>
43
             <div id="brand_header"></div>
43
             <div id="brand_header"></div>
44
             <input type='checkbox' name='checkbox' id="disable_welcome"/>
44
             <input type='checkbox' name='checkbox' id="disable_welcome"/>
180
                 </div>
180
                 </div>
181
                 <div id="settings_container" class="sideToolbarContainer__inner">
181
                 <div id="settings_container" class="sideToolbarContainer__inner">
182
                     <div class="title" data-i18n="settings.title"></div>
182
                     <div class="title" data-i18n="settings.title"></div>
183
-                    <select id="languages_selectbox" class="first hide"></select>
184
-                    <div id="deviceOptionsTitle" class="subTitle hide" data-i18n="settings.audioVideo"></div>
185
-                    <div id="devicesOptions" class="hide">
186
-                        <div class="sideToolbarBlock first">
187
-                            <label class="first" data-i18n="settings.selectCamera"></label>
188
-                            <select id="selectCamera"></select>
189
-                        </div>
190
-                        <div class="sideToolbarBlock">
191
-                            <label data-i18n="settings.selectMic"></label>
192
-                            <select  id="selectMic"></select>
183
+                    <form class="aui">
184
+                        <div id="languagesSelectWrapper" class="first hide">
185
+                            <select id="languagesSelect" style="width: 80%; margin-left: 10%"></select>
193
                         </div>
186
                         </div>
194
-                        <div class="sideToolbarBlock">
195
-                            <label data-i18n="settings.selectAudioOutput"></label>
196
-                            <select  id="selectAudioOutput"></select>
197
-                        </div>
198
-                    </div>
199
-                    <div id="moderatorOptionsTitle" class="subTitle hide" data-i18n="settings.moderator"></div>
200
-                    <div id = "startMutedOptions" class="hide">
201
-                        <div class="sideToolbarBlock first">
202
-                            <input type="checkbox" id="startAudioMuted">
203
-                            <label class="startMutedLabel" for="startAudioMuted" data-i18n="settings.startAudioMuted"></label>
187
+                        <div id="deviceOptionsWrapper" class="hide">
188
+                            <div id="deviceOptionsTitle" class="subTitle hide" data-i18n="settings.audioVideo"></div>
189
+                            <div class="sideToolbarBlock first">
190
+                                <label class="first" data-i18n="settings.selectCamera"></label>
191
+                                <select id="selectCamera"></select>
192
+                            </div>
193
+                            <div class="sideToolbarBlock">
194
+                                <label data-i18n="settings.selectMic"></label>
195
+                                <select id="selectMic"></select>
196
+                            </div>
197
+                            <div class="sideToolbarBlock">
198
+                                <label data-i18n="settings.selectAudioOutput"></label>
199
+                                <select id="selectAudioOutput"></select>
200
+                            </div>
204
                         </div>
201
                         </div>
205
-                        <div class="sideToolbarBlock">
206
-                            <input type="checkbox" id="startVideoMuted">
207
-                            <label class="startMutedLabel" for="startVideoMuted" data-i18n="settings.startVideoMuted"></label>
202
+                        <div id="moderatorOptionsWrapper" class="hide">
203
+                            <div id="moderatorOptionsTitle" class="subTitle hide" data-i18n="settings.moderator"></div>
204
+                            <div id="startMutedOptions" class="hide">
205
+                                <div class="sideToolbarBlock first">
206
+                                    <input type="checkbox" id="startAudioMuted">
207
+                                    <label class="startMutedLabel" for="startAudioMuted" data-i18n="settings.startAudioMuted"></label>
208
+                                </div>
209
+                                <div class="sideToolbarBlock">
210
+                                    <input type="checkbox" id="startVideoMuted">
211
+                                    <label class="startMutedLabel" for="startVideoMuted" data-i18n="settings.startVideoMuted"></label>
212
+                                </div>
213
+                            </div>
214
+                            <div id="followMeOptions" class="hide">
215
+                                <div class="sideToolbarBlock">
216
+                                    <input type="checkbox" id="followMeCheckBox">
217
+                                    <label class="followMeLabel" for="followMeCheckBox" data-i18n="settings.followMe"></label>
218
+                                </div>
219
+                            </div>
208
                         </div>
220
                         </div>
209
-                    </div>
210
-                    <div id="followMeOptions" class="sideToolbarBlock hide">
211
-                        <input type="checkbox" id="followMeCheckBox">
212
-                        <label class="followMeLabel" for="followMeCheckBox" data-i18n="settings.followMe"></label>
213
-                    </div>
221
+                    </form>
214
                 </div>
222
                 </div>
215
             </div>
223
             </div>
216
         </div>
224
         </div>

+ 74
- 33
modules/UI/side_pannels/settings/SettingsMenu.js 查看文件

1
-/* global APP, $, JitsiMeetJS */
1
+/* global $, APP, AJS, interfaceConfig, JitsiMeetJS */
2
+
2
 import UIUtil from "../../util/UIUtil";
3
 import UIUtil from "../../util/UIUtil";
3
 import UIEvents from "../../../../service/UI/UIEvents";
4
 import UIEvents from "../../../../service/UI/UIEvents";
4
 import languages from "../../../../service/translation/languages";
5
 import languages from "../../../../service/translation/languages";
24
 
25
 
25
         let attrsStr = UIUtil.attrsToString(attrs);
26
         let attrsStr = UIUtil.attrsToString(attrs);
26
         return `<option ${attrsStr}></option>`;
27
         return `<option ${attrsStr}></option>`;
27
-    }).join('\n');
28
+    }).join('');
28
 }
29
 }
29
 
30
 
30
 /**
31
 /**
61
     return options.join('');
62
     return options.join('');
62
 }
63
 }
63
 
64
 
65
+/**
66
+ * Replace html select element to select2 custom dropdown
67
+ *
68
+ * @param {jQueryElement} $el native select element
69
+ * @param {function} onSelectedCb fired if item is selected
70
+ */
71
+function initSelect2($el, onSelectedCb) {
72
+    $el.auiSelect2({
73
+        containerCssClass: 'input-container-dark',
74
+        dropdownCssClass: 'dropdown-dark',
75
+        minimumResultsForSearch: Infinity
76
+    });
77
+    if (typeof onSelectedCb === 'function') {
78
+        $el.change(onSelectedCb);
79
+    }
80
+}
64
 
81
 
65
 export default {
82
 export default {
66
     init (emitter) {
83
     init (emitter) {
84
+        //LANGUAGES BOX
85
+        if (UIUtil.isSettingEnabled('language')) {
86
+            const wrapperId = 'languagesSelectWrapper';
87
+            const selectId = 'languagesSelect';
88
+            const selectEl = AJS.$(`#${selectId}`);
89
+            let selectInput;
90
+
91
+            selectEl.html(generateLanguagesOptions(
92
+                languages.getLanguages(),
93
+                APP.translation.getCurrentLanguage()
94
+            ));
95
+            initSelect2(selectEl, () => {
96
+                const val = selectEl.val();
97
+
98
+                selectInput[0].dataset.i18n = `languages:${val}`;
99
+                APP.translation.translateElement(selectInput);
100
+                emitter.emit(UIEvents.LANG_CHANGED, val);
101
+            });
102
+            //find new selectInput element
103
+            selectInput = $(`#s2id_${selectId} .select2-chosen`);
104
+            //first select fix for languages options
105
+            selectInput[0].dataset.i18n =
106
+                `languages:${APP.translation.getCurrentLanguage()}`;
107
+
108
+            APP.translation.translateElement(selectEl);
109
+
110
+            UIUtil.showElement(wrapperId);
111
+        }
112
+        // DEVICES LIST
67
         if (UIUtil.isSettingEnabled('devices')) {
113
         if (UIUtil.isSettingEnabled('devices')) {
68
-            // DEVICES LIST
114
+            const wrapperId = 'deviceOptionsWrapper';
115
+
69
             JitsiMeetJS.mediaDevices.isDeviceListAvailable()
116
             JitsiMeetJS.mediaDevices.isDeviceListAvailable()
70
                 .then((isDeviceListAvailable) => {
117
                 .then((isDeviceListAvailable) => {
71
                     if (isDeviceListAvailable &&
118
                     if (isDeviceListAvailable &&
73
                         this._initializeDeviceSelectionSettings(emitter);
120
                         this._initializeDeviceSelectionSettings(emitter);
74
                     }
121
                     }
75
                 });
122
                 });
123
+            // Only show the subtitle if this isn't the only setting section.
124
+            if (interfaceConfig.SETTINGS_SECTIONS.length > 1)
125
+                UIUtil.showElement("deviceOptionsTitle");
76
 
126
 
77
-            UIUtil.showElement("deviceOptionsTitle");
78
-            UIUtil.showElement("devicesOptions");
79
-        }
80
-
81
-        if (UIUtil.isSettingEnabled('language')) {
82
-            //LANGUAGES BOX
83
-            let languagesBox = $("#languages_selectbox");
84
-            languagesBox.html(generateLanguagesOptions(
85
-                languages.getLanguages(),
86
-                APP.translation.getCurrentLanguage()
87
-            ));
88
-            APP.translation.translateElement(languagesBox);
89
-            languagesBox.change(function () {
90
-                emitter.emit(UIEvents.LANG_CHANGED, languagesBox.val());
91
-            });
92
-
93
-            UIUtil.showElement("languages_selectbox");
127
+            UIUtil.showElement(wrapperId);
94
         }
128
         }
95
-
129
+        // MODERATOR
96
         if (UIUtil.isSettingEnabled('moderator')) {
130
         if (UIUtil.isSettingEnabled('moderator')) {
131
+            const wrapperId = 'moderatorOptionsWrapper';
132
+
97
             // START MUTED
133
             // START MUTED
98
             $("#startMutedOptions").change(function () {
134
             $("#startMutedOptions").change(function () {
99
                 let startAudioMuted = $("#startAudioMuted").is(":checked");
135
                 let startAudioMuted = $("#startAudioMuted").is(":checked");
100
                 let startVideoMuted = $("#startVideoMuted").is(":checked");
136
                 let startVideoMuted = $("#startVideoMuted").is(":checked");
137
+
101
                 emitter.emit(
138
                 emitter.emit(
102
                     UIEvents.START_MUTED_CHANGED,
139
                     UIEvents.START_MUTED_CHANGED,
103
                     startAudioMuted,
140
                     startAudioMuted,
106
             });
143
             });
107
 
144
 
108
             // FOLLOW ME
145
             // FOLLOW ME
109
-            $("#followMeOptions").change(function () {
110
-                let isFollowMeEnabled = $("#followMeCheckBox").is(":checked");
111
-                emitter.emit(
112
-                    UIEvents.FOLLOW_ME_ENABLED,
113
-                    isFollowMeEnabled
114
-                );
146
+            const followMeToggle = document.getElementById('followMeCheckBox');
147
+            followMeToggle.addEventListener('change', () => {
148
+                const isFollowMeEnabled = followMeToggle.checked;
149
+                emitter.emit(UIEvents.FOLLOW_ME_ENABLED, isFollowMeEnabled);
115
             });
150
             });
151
+
152
+            UIUtil.showElement(wrapperId);
116
         }
153
         }
117
     },
154
     },
118
 
155
 
147
     showStartMutedOptions (show) {
184
     showStartMutedOptions (show) {
148
         if (show && UIUtil.isSettingEnabled('moderator')) {
185
         if (show && UIUtil.isSettingEnabled('moderator')) {
149
             // Only show the subtitle if this isn't the only setting section.
186
             // Only show the subtitle if this isn't the only setting section.
150
-            if (!$("#moderatorOptionsTitle").is(":visible"))
187
+            if (!$("#moderatorOptionsTitle").is(":visible")
188
+                    && interfaceConfig.SETTINGS_SECTIONS.length > 1)
151
                 UIUtil.showElement("moderatorOptionsTitle");
189
                 UIUtil.showElement("moderatorOptionsTitle");
152
 
190
 
153
             UIUtil.showElement("startMutedOptions");
191
             UIUtil.showElement("startMutedOptions");
214
      * @param {{ deviceId, label, kind }[]} devices list of available devices
252
      * @param {{ deviceId, label, kind }[]} devices list of available devices
215
      */
253
      */
216
     changeDevicesList (devices) {
254
     changeDevicesList (devices) {
217
-        let $selectCamera= $('#selectCamera'),
218
-            $selectMic = $('#selectMic'),
219
-            $selectAudioOutput = $('#selectAudioOutput'),
255
+        let $selectCamera= AJS.$('#selectCamera'),
256
+            $selectMic = AJS.$('#selectMic'),
257
+            $selectAudioOutput = AJS.$('#selectAudioOutput'),
220
             $selectAudioOutputParent = $selectAudioOutput.parent();
258
             $selectAudioOutputParent = $selectAudioOutput.parent();
221
 
259
 
222
         let audio = devices.filter(device => device.kind === 'audioinput'),
260
         let audio = devices.filter(device => device.kind === 'audioinput'),
241
                 videoPermissionGranted))
279
                 videoPermissionGranted))
242
             .prop('disabled', !video.length || !videoPermissionGranted);
280
             .prop('disabled', !video.length || !videoPermissionGranted);
243
 
281
 
282
+        initSelect2($selectCamera);
283
+
244
         $selectMic
284
         $selectMic
245
             .html(generateDevicesOptions(
285
             .html(generateDevicesOptions(
246
                 audio,
286
                 audio,
248
                 audioPermissionGranted))
288
                 audioPermissionGranted))
249
             .prop('disabled', !audio.length || !audioPermissionGranted);
289
             .prop('disabled', !audio.length || !audioPermissionGranted);
250
 
290
 
291
+        initSelect2($selectMic);
292
+
251
         if (JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output')) {
293
         if (JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output')) {
252
             $selectAudioOutput
294
             $selectAudioOutput
253
                 .html(generateDevicesOptions(
295
                 .html(generateDevicesOptions(
258
                     videoPermissionGranted || audioPermissionGranted))
300
                     videoPermissionGranted || audioPermissionGranted))
259
                 .prop('disabled', !audioOutput.length ||
301
                 .prop('disabled', !audioOutput.length ||
260
                     (!videoPermissionGranted && !audioPermissionGranted));
302
                     (!videoPermissionGranted && !audioPermissionGranted));
303
+            initSelect2($selectAudioOutput);
261
 
304
 
262
             $selectAudioOutputParent.show();
305
             $selectAudioOutputParent.show();
263
         } else {
306
         } else {
264
             $selectAudioOutputParent.hide();
307
             $selectAudioOutputParent.hide();
265
         }
308
         }
266
 
309
 
267
-        $('#devicesOptions').show();
268
-
269
         APP.translation.translateElement($('#settings_container option'));
310
         APP.translation.translateElement($('#settings_container option'));
270
     }
311
     }
271
 };
312
 };

Loading…
取消
儲存