瀏覽代碼

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

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

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

@@ -92,4 +92,13 @@ $auiPrimaryButtonBg: #3572b0;
92 92
 $auiPrimaryButtonHoverBg: #57647b;
93 93
 $auiPrimaryButtonColor: #fff;
94 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 查看文件

@@ -0,0 +1,48 @@
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,5 +62,6 @@
62 62
 @import 'buttons/button-control';
63 63
 @import "modals/invite/invite";
64 64
 @import "connection-info";
65
+@import 'aui-components/dropdown';
65 66
 
66
-/* Modules END */
67
+/* Modules END */

+ 43
- 35
index.html 查看文件

@@ -30,15 +30,15 @@
30 30
             <a class="poweredby" href="http://jitsi.org" target="_new" ><span data-i18n="poweredby"></span> jitsi.org</a>
31 31
 
32 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 40
                     </div>
41
+                </div>
42 42
             </div>
43 43
             <div id="brand_header"></div>
44 44
             <input type='checkbox' name='checkbox' id="disable_welcome"/>
@@ -180,37 +180,45 @@
180 180
                 </div>
181 181
                 <div id="settings_container" class="sideToolbarContainer__inner">
182 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 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 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 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 222
                 </div>
215 223
             </div>
216 224
         </div>

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

@@ -1,4 +1,5 @@
1
-/* global APP, $, JitsiMeetJS */
1
+/* global $, APP, AJS, interfaceConfig, JitsiMeetJS */
2
+
2 3
 import UIUtil from "../../util/UIUtil";
3 4
 import UIEvents from "../../../../service/UI/UIEvents";
4 5
 import languages from "../../../../service/translation/languages";
@@ -24,7 +25,7 @@ function generateLanguagesOptions(items, currentLang) {
24 25
 
25 26
         let attrsStr = UIUtil.attrsToString(attrs);
26 27
         return `<option ${attrsStr}></option>`;
27
-    }).join('\n');
28
+    }).join('');
28 29
 }
29 30
 
30 31
 /**
@@ -61,11 +62,57 @@ function generateDevicesOptions(items, selectedId, permissionGranted) {
61 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 82
 export default {
66 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 113
         if (UIUtil.isSettingEnabled('devices')) {
68
-            // DEVICES LIST
114
+            const wrapperId = 'deviceOptionsWrapper';
115
+
69 116
             JitsiMeetJS.mediaDevices.isDeviceListAvailable()
70 117
                 .then((isDeviceListAvailable) => {
71 118
                     if (isDeviceListAvailable &&
@@ -73,31 +120,21 @@ export default {
73 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 130
         if (UIUtil.isSettingEnabled('moderator')) {
131
+            const wrapperId = 'moderatorOptionsWrapper';
132
+
97 133
             // START MUTED
98 134
             $("#startMutedOptions").change(function () {
99 135
                 let startAudioMuted = $("#startAudioMuted").is(":checked");
100 136
                 let startVideoMuted = $("#startVideoMuted").is(":checked");
137
+
101 138
                 emitter.emit(
102 139
                     UIEvents.START_MUTED_CHANGED,
103 140
                     startAudioMuted,
@@ -106,13 +143,13 @@ export default {
106 143
             });
107 144
 
108 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,7 +184,8 @@ export default {
147 184
     showStartMutedOptions (show) {
148 185
         if (show && UIUtil.isSettingEnabled('moderator')) {
149 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 189
                 UIUtil.showElement("moderatorOptionsTitle");
152 190
 
153 191
             UIUtil.showElement("startMutedOptions");
@@ -214,9 +252,9 @@ export default {
214 252
      * @param {{ deviceId, label, kind }[]} devices list of available devices
215 253
      */
216 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 258
             $selectAudioOutputParent = $selectAudioOutput.parent();
221 259
 
222 260
         let audio = devices.filter(device => device.kind === 'audioinput'),
@@ -241,6 +279,8 @@ export default {
241 279
                 videoPermissionGranted))
242 280
             .prop('disabled', !video.length || !videoPermissionGranted);
243 281
 
282
+        initSelect2($selectCamera);
283
+
244 284
         $selectMic
245 285
             .html(generateDevicesOptions(
246 286
                 audio,
@@ -248,6 +288,8 @@ export default {
248 288
                 audioPermissionGranted))
249 289
             .prop('disabled', !audio.length || !audioPermissionGranted);
250 290
 
291
+        initSelect2($selectMic);
292
+
251 293
         if (JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output')) {
252 294
             $selectAudioOutput
253 295
                 .html(generateDevicesOptions(
@@ -258,14 +300,13 @@ export default {
258 300
                     videoPermissionGranted || audioPermissionGranted))
259 301
                 .prop('disabled', !audioOutput.length ||
260 302
                     (!videoPermissionGranted && !audioPermissionGranted));
303
+            initSelect2($selectAudioOutput);
261 304
 
262 305
             $selectAudioOutputParent.show();
263 306
         } else {
264 307
             $selectAudioOutputParent.hide();
265 308
         }
266 309
 
267
-        $('#devicesOptions').show();
268
-
269 310
         APP.translation.translateElement($('#settings_container option'));
270 311
     }
271 312
 };

Loading…
取消
儲存