Ver código fonte

aui select and checkbox added

master
Kostiantyn Pashura 8 anos atrás
pai
commit
8118b4aea1

+ 1
- 0
.gitignore Ver arquivo

@@ -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

+ 10
- 21
css/_side_toolbar_container.scss Ver arquivo

@@ -2,9 +2,10 @@
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;
7
+    //magic 10px for toolbar height. TODO: fix it
8
+    bottom: 10px;
8 9
     left: $defaultToolbarSize;
9 10
     width: 0;
10 11
     background-color: rgba(0,0,0,0.8);
@@ -50,12 +51,6 @@
50 51
             margin-left: 0;
51 52
             width: 100%;
52 53
         }
53
-
54
-        .startMutedLabel,
55
-        .followMeLabel {
56
-            display: inline;
57
-            margin-top: 0;
58
-        }
59 54
     }
60 55
 
61 56
     /**
@@ -72,16 +67,16 @@
72 67
         /**
73 68
          * Titles and subtitles of inner containers.
74 69
          */
75
-        > div.title,
76
-          div.subTitle {
70
+         div.title,
71
+         div.subTitle {
77 72
             text-align: left;
78
-            margin: 10px 0px 10px 0px;
73
+            margin: 10px 0;
79 74
         }
80 75
 
81 76
         /**
82 77
          * Main title size.
83 78
          */
84
-        > div.title {
79
+        div.title {
85 80
             color: $defaultColor !important;
86 81
             text-align: center;
87 82
             font-size: 16px;
@@ -90,7 +85,7 @@
90 85
         /**
91 86
          * Subtitle specific properties.
92 87
          */
93
-        > div.subTitle {
88
+        div.subTitle {
94 89
             font-size: 11px;
95 90
             font-weight: 500;
96 91
             color: $defaultSideBarFontColor !important;
@@ -101,7 +96,7 @@
101 96
          * First element after a title.
102 97
          */
103 98
         .first {
104
-            margin-top: 0px !important;
99
+            margin-top: 0 !important;
105 100
         }
106 101
 
107 102
         /**
@@ -118,9 +113,3 @@
118 113
     width : auto !important;
119 114
     text-align: center;
120 115
 }
121
-
122
-#startAudioMuted,
123
-#startVideoMuted,
124
-#followMeCheckBox {
125
-    width: 13px !important;
126
-}

+ 10
- 1
css/_variables.scss Ver arquivo

@@ -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;

+ 32
- 0
css/aui-components/dropdown.scss Ver arquivo

@@ -0,0 +1,32 @@
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
+.aui-select2-drop{
13
+    z-index: 901;
14
+}
15
+.select2-drop-mask{
16
+    z-index: 900;
17
+}
18
+
19
+//Dark theme
20
+form.aui{
21
+    //Placeholder
22
+    .aui-select2-container.input-container-dark {
23
+        a.select2-choice {
24
+            text-shadow: none;
25
+        }
26
+    }
27
+}
28
+//
29
+.aui-dropdown2.aui-style-default.dropdown-dark{
30
+    background-color: $defaultBackground;
31
+    border-color: transparent;
32
+}

+ 1
- 0
css/main.scss Ver arquivo

@@ -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 */

+ 40
- 28
index.html Ver arquivo

@@ -179,37 +179,49 @@
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>
182
+                    <form class="aui">
183
+                        <div id="languagesSelectWrapper" class="first hide">
184
+                            <select id="languagesSelect" style="width: 80%; margin-left: 10%"></select>
188 185
                         </div>
189
-                        <div class="sideToolbarBlock">
190
-                            <label data-i18n="settings.selectMic"></label>
191
-                            <select  id="selectMic"></select>
192
-                        </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
+                                    <aui-label for="startAudioMuted">
206
+                                        <p data-i18n="settings.startAudioMuted"></p>
207
+                                    </aui-label>
208
+                                    <aui-toggle id="startAudioMuted" label="Audio muted"></aui-toggle>
209
+                                </div>
210
+                                <div class="sideToolbarBlock">
211
+                                    <aui-label for="startVideoMuted" >
212
+                                        <p data-i18n="settings.startVideoMuted"></p>
213
+                                    </aui-label>
214
+                                    <aui-toggle id="startVideoMuted" label="Video muted"></aui-toggle>
215
+                                </div>
216
+                            </div>
217
+                            <div id="followMeOptions" class="sideToolbarBlock hide">
218
+                                <aui-label for="followMeCheckBox">
219
+                                    <p data-i18n="settings.followMe"></p>
220
+                                </aui-label>
221
+                                <aui-toggle id="followMeCheckBox" label="Follow Me"></aui-toggle>
222
+                            </div>
207 223
                         </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>
224
+                    </form>
213 225
                 </div>
214 226
             </div>
215 227
         </div>

+ 68
- 29
modules/UI/side_pannels/settings/SettingsMenu.js Ver arquivo

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

Carregando…
Cancelar
Salvar