Bladeren bron

Merge branch 'task/dropdown-aui-changes' of https://github.com/kkrisstoff/jitsi-meet into kkrisstoff-task/dropdown-aui-changes

master
Lyubomir Marinov 8 jaren geleden
bovenliggende
commit
572fb20dd4
7 gewijzigde bestanden met toevoegingen van 192 en 86 verwijderingen
  1. 1
    0
      .gitignore
  2. 17
    21
      css/_side_toolbar_container.scss
  3. 10
    1
      css/_variables.scss
  4. 46
    0
      css/aui-components/dropdown.scss
  5. 1
    0
      css/main.scss
  6. 43
    35
      index.html
  7. 74
    29
      modules/UI/side_pannels/settings/SettingsMenu.js

+ 1
- 0
.gitignore Bestand weergeven

@@ -4,6 +4,7 @@ deploy-local.sh
4 4
 libs/
5 5
 all.css
6 6
 *css.map
7
+*js.map
7 8
 unsupported_browser.css
8 9
 .remote-sync.json
9 10
 .sync-config.cson

+ 17
- 21
css/_side_toolbar_container.scss Bestand weergeven

@@ -2,9 +2,8 @@
2 2
  * Toolbar side panel main container element.
3 3
  */
4 4
 #sideToolbarContainer {
5
-    display: inline-block;
6
-    position:absolute;
7
-    top: 0px;
5
+    position: absolute;
6
+    top: 0;
8 7
     left: $defaultToolbarSize;
9 8
     width: 0;
10 9
     background-color: rgba(0,0,0,0.8);
@@ -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: inline-block;
29 28
         margin-top: 15px;
@@ -45,17 +44,20 @@
45 44
      * Specify styling of elements inside a block.
46 45
      */
47 46
     .sideToolbarBlock {
48
-        input, label, button, a, select {
47
+        input, button, a, select {
49 48
             margin-top: 5px;
50 49
             margin-left: 0;
51 50
             width: 100%;
52 51
         }
53
-
54
-        .startMutedLabel,
55
-        .followMeLabel {
52
+        input[type='checkbox'] {
53
+            width: auto !important;
56 54
             display: inline;
57
-            margin-top: 0;
55
+            > label {
56
+                margin-top: 5px;
57
+                width: 80%;
58
+            }
58 59
         }
60
+
59 61
     }
60 62
 
61 63
     /**
@@ -72,16 +74,16 @@
72 74
         /**
73 75
          * Titles and subtitles of inner containers.
74 76
          */
75
-        > div.title,
76
-          div.subTitle {
77
+         div.title,
78
+         div.subTitle {
77 79
             text-align: left;
78
-            margin: 10px 0px 10px 0px;
80
+            margin: 10px 0;
79 81
         }
80 82
 
81 83
         /**
82 84
          * Main title size.
83 85
          */
84
-        > div.title {
86
+        div.title {
85 87
             color: $defaultColor !important;
86 88
             text-align: center;
87 89
             font-size: 16px;
@@ -90,7 +92,7 @@
90 92
         /**
91 93
          * Subtitle specific properties.
92 94
          */
93
-        > div.subTitle {
95
+        div.subTitle {
94 96
             font-size: 11px;
95 97
             font-weight: 500;
96 98
             color: $defaultSideBarFontColor !important;
@@ -101,7 +103,7 @@
101 103
          * First element after a title.
102 104
          */
103 105
         .first {
104
-            margin-top: 0px !important;
106
+            margin-top: 0 !important;
105 107
         }
106 108
 
107 109
         /**
@@ -118,9 +120,3 @@
118 120
     width : auto !important;
119 121
     text-align: center;
120 122
 }
121
-
122
-#startAudioMuted,
123
-#startVideoMuted,
124
-#followMeCheckBox {
125
-    width: 13px !important;
126
-}

+ 10
- 1
css/_variables.scss Bestand weergeven

@@ -87,4 +87,13 @@ $auiPrimaryButtonBg: #3572b0;
87 87
 $auiPrimaryButtonHoverBg: #57647b;
88 88
 $auiPrimaryButtonColor: #fff;
89 89
 $auiIconColor: #707070;
90
-$inputControlEmColor: #f29424;
90
+$inputControlEmColor: #f29424;
91
+$linkFontColor: #489afe;
92
+$linkHoverFontColor: #287ade;
93
+
94
+/**
95
+ * Forms
96
+ */
97
+$inputBg: #505F79;
98
+$inputBgHover: #505F79;
99
+$inputFontColor: #ECEEF1;

+ 46
- 0
css/aui-components/dropdown.scss Bestand weergeven

@@ -0,0 +1,46 @@
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
+.aui-select2-drop{
27
+    z-index: 901;
28
+}
29
+.select2-drop-mask{
30
+    z-index: 900;
31
+}
32
+
33
+//Dark theme
34
+form.aui{
35
+    //Placeholder
36
+    .aui-select2-container.input-container-dark {
37
+        a.select2-choice {
38
+            text-shadow: none;
39
+        }
40
+    }
41
+}
42
+//
43
+.aui-dropdown2.aui-style-default.dropdown-dark{
44
+    background-color: $defaultBackground;
45
+    border-color: transparent;
46
+}

+ 1
- 0
css/main.scss Bestand weergeven

@@ -61,5 +61,6 @@
61 61
 @import 'shortcuts/main';
62 62
 @import 'buttons/button-control';
63 63
 @import "modals/invite/invite";
64
+@import 'aui-components/dropdown';
64 65
 
65 66
 /* Modules END */

+ 43
- 35
index.html Bestand weergeven

@@ -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"/>
@@ -179,37 +179,45 @@
179 179
                 </div>
180 180
                 <div id="settings_container" class="sideToolbarContainer__inner">
181 181
                     <div class="title" data-i18n="settings.title"></div>
182
-                    <select id="languages_selectbox" class="first hide"></select>
183
-                    <div id="deviceOptionsTitle" class="subTitle hide" data-i18n="settings.audioVideo"></div>
184
-                    <div id="devicesOptions" class="hide">
185
-                        <div class="sideToolbarBlock first">
186
-                            <label class="first" data-i18n="settings.selectCamera"></label>
187
-                            <select id="selectCamera"></select>
188
-                        </div>
189
-                        <div class="sideToolbarBlock">
190
-                            <label data-i18n="settings.selectMic"></label>
191
-                            <select  id="selectMic"></select>
182
+                    <form class="aui">
183
+                        <div id="languagesSelectWrapper" class="first hide">
184
+                            <select id="languagesSelect" style="width: 80%; margin-left: 10%"></select>
192 185
                         </div>
193
-                        <div class="sideToolbarBlock">
194
-                            <label data-i18n="settings.selectAudioOutput"></label>
195
-                            <select  id="selectAudioOutput"></select>
196
-                        </div>
197
-                    </div>
198
-                    <div id="moderatorOptionsTitle" class="subTitle hide" data-i18n="settings.moderator"></div>
199
-                    <div id = "startMutedOptions" class="hide">
200
-                        <div class="sideToolbarBlock first">
201
-                            <input type="checkbox" id="startAudioMuted">
202
-                            <label class="startMutedLabel" for="startAudioMuted" data-i18n="settings.startAudioMuted"></label>
186
+                        <div id="deviceOptionsWrapper" class="hide">
187
+                            <div id="deviceOptionsTitle" class="subTitle hide" data-i18n="settings.audioVideo"></div>
188
+                            <div class="sideToolbarBlock first">
189
+                                <label class="first" data-i18n="settings.selectCamera"></label>
190
+                                <select id="selectCamera"></select>
191
+                            </div>
192
+                            <div class="sideToolbarBlock">
193
+                                <label data-i18n="settings.selectMic"></label>
194
+                                <select id="selectMic"></select>
195
+                            </div>
196
+                            <div class="sideToolbarBlock">
197
+                                <label data-i18n="settings.selectAudioOutput"></label>
198
+                                <select id="selectAudioOutput"></select>
199
+                            </div>
203 200
                         </div>
204
-                        <div class="sideToolbarBlock">
205
-                            <input type="checkbox" id="startVideoMuted">
206
-                            <label class="startMutedLabel" for="startVideoMuted" data-i18n="settings.startVideoMuted"></label>
201
+                        <div id="moderatorOptionsWrapper" class="hide">
202
+                            <div id="moderatorOptionsTitle" class="subTitle hide" data-i18n="settings.moderator"></div>
203
+                            <div id="startMutedOptions" class="hide">
204
+                                <div class="sideToolbarBlock first">
205
+                                    <input type="checkbox" id="startAudioMuted">
206
+                                    <label class="startMutedLabel" for="startAudioMuted" data-i18n="settings.startAudioMuted"></label>
207
+                                </div>
208
+                                <div class="sideToolbarBlock">
209
+                                    <input type="checkbox" id="startVideoMuted">
210
+                                    <label class="startMutedLabel" for="startVideoMuted" data-i18n="settings.startVideoMuted"></label>
211
+                                </div>
212
+                            </div>
213
+                            <div id="followMeOptions" class="hide">
214
+                                <div class="sideToolbarBlock">
215
+                                    <input type="checkbox" id="followMeCheckBox">
216
+                                    <label class="followMeLabel" for="followMeCheckBox" data-i18n="settings.followMe"></label>
217
+                                </div>
218
+                            </div>
207 219
                         </div>
208
-                    </div>
209
-                    <div id="followMeOptions" class="sideToolbarBlock hide">
210
-                        <input type="checkbox" id="followMeCheckBox">
211
-                        <label class="followMeLabel" for="followMeCheckBox" data-i18n="settings.followMe"></label>
212
-                    </div>
220
+                    </form>
213 221
                 </div>
214 222
             </div>
215 223
         </div>

+ 74
- 29
modules/UI/side_pannels/settings/SettingsMenu.js Bestand weergeven

@@ -1,4 +1,5 @@
1
-/* global APP, $, JitsiMeetJS */
1
+/* global APP, $, JitsiMeetJS, interfaceConfig, AJS */
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
+        minimumResultsForSearch: Infinity,
74
+        dropdownCssClass: 'dropdown-dark',
75
+        containerCssClass: 'input-container-dark',
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,17 @@ export default {
106 143
             });
107 144
 
108 145
             // FOLLOW ME
109
-            $("#followMeOptions").change(function () {
110
-                let isFollowMeEnabled = $("#followMeCheckBox").is(":checked");
146
+            let followMeToggle = document.getElementById('followMeCheckBox');
147
+            followMeToggle.addEventListener('change', function() {
148
+                let isFollowMeEnabled = followMeToggle.checked;
149
+
111 150
                 emitter.emit(
112 151
                     UIEvents.FOLLOW_ME_ENABLED,
113 152
                     isFollowMeEnabled
114 153
                 );
115 154
             });
155
+
156
+            UIUtil.showElement(wrapperId);
116 157
         }
117 158
     },
118 159
 
@@ -147,7 +188,8 @@ export default {
147 188
     showStartMutedOptions (show) {
148 189
         if (show && UIUtil.isSettingEnabled('moderator')) {
149 190
             // Only show the subtitle if this isn't the only setting section.
150
-            if (!$("#moderatorOptionsTitle").is(":visible"))
191
+            if (!$("#moderatorOptionsTitle").is(":visible")
192
+                && interfaceConfig.SETTINGS_SECTIONS.length > 1)
151 193
                 UIUtil.showElement("moderatorOptionsTitle");
152 194
 
153 195
             UIUtil.showElement("startMutedOptions");
@@ -214,9 +256,9 @@ export default {
214 256
      * @param {{ deviceId, label, kind }[]} devices list of available devices
215 257
      */
216 258
     changeDevicesList (devices) {
217
-        let $selectCamera= $('#selectCamera'),
218
-            $selectMic = $('#selectMic'),
219
-            $selectAudioOutput = $('#selectAudioOutput'),
259
+        let $selectCamera= AJS.$('#selectCamera'),
260
+            $selectMic = AJS.$('#selectMic'),
261
+            $selectAudioOutput = AJS.$('#selectAudioOutput'),
220 262
             $selectAudioOutputParent = $selectAudioOutput.parent();
221 263
 
222 264
         let audio = devices.filter(device => device.kind === 'audioinput'),
@@ -241,6 +283,8 @@ export default {
241 283
                 videoPermissionGranted))
242 284
             .prop('disabled', !video.length || !videoPermissionGranted);
243 285
 
286
+        initSelect2($selectCamera);
287
+
244 288
         $selectMic
245 289
             .html(generateDevicesOptions(
246 290
                 audio,
@@ -248,6 +292,8 @@ export default {
248 292
                 audioPermissionGranted))
249 293
             .prop('disabled', !audio.length || !audioPermissionGranted);
250 294
 
295
+        initSelect2($selectMic);
296
+
251 297
         if (JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output')) {
252 298
             $selectAudioOutput
253 299
                 .html(generateDevicesOptions(
@@ -258,14 +304,13 @@ export default {
258 304
                     videoPermissionGranted || audioPermissionGranted))
259 305
                 .prop('disabled', !audioOutput.length ||
260 306
                     (!videoPermissionGranted && !audioPermissionGranted));
307
+            initSelect2($selectAudioOutput);
261 308
 
262 309
             $selectAudioOutputParent.show();
263 310
         } else {
264 311
             $selectAudioOutputParent.hide();
265 312
         }
266 313
 
267
-        $('#devicesOptions').show();
268
-
269 314
         APP.translation.translateElement($('#settings_container option'));
270 315
     }
271 316
 };

Laden…
Annuleren
Opslaan