Browse Source

aui select and checkbox added

master
Kostiantyn Pashura 8 years ago
parent
commit
8118b4aea1

+ 1
- 0
.gitignore View File

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

+ 10
- 21
css/_side_toolbar_container.scss View File

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

+ 10
- 1
css/_variables.scss View File

87
 $auiPrimaryButtonHoverBg: #57647b;
87
 $auiPrimaryButtonHoverBg: #57647b;
88
 $auiPrimaryButtonColor: #fff;
88
 $auiPrimaryButtonColor: #fff;
89
 $auiIconColor: #707070;
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 View File

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 View File

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

+ 40
- 28
index.html View File

179
                 </div>
179
                 </div>
180
                 <div id="settings_container" class="sideToolbarContainer__inner">
180
                 <div id="settings_container" class="sideToolbarContainer__inner">
181
                     <div class="title" data-i18n="settings.title"></div>
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
                         </div>
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
                         </div>
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
                         </div>
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
                 </div>
225
                 </div>
214
             </div>
226
             </div>
215
         </div>
227
         </div>

+ 68
- 29
modules/UI/side_pannels/settings/SettingsMenu.js View File

1
-/* global APP, $, JitsiMeetJS */
1
+/* global APP, $, JitsiMeetJS, interfaceConfig, AJS */
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
+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
 export default {
76
 export default {
66
     init (emitter) {
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
         if (UIUtil.isSettingEnabled('devices')) {
107
         if (UIUtil.isSettingEnabled('devices')) {
68
-            // DEVICES LIST
108
+            const wrapperId = 'deviceOptionsWrapper';
109
+
69
             JitsiMeetJS.mediaDevices.isDeviceListAvailable()
110
             JitsiMeetJS.mediaDevices.isDeviceListAvailable()
70
                 .then((isDeviceListAvailable) => {
111
                 .then((isDeviceListAvailable) => {
71
                     if (isDeviceListAvailable &&
112
                     if (isDeviceListAvailable &&
73
                         this._initializeDeviceSelectionSettings(emitter);
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
         if (UIUtil.isSettingEnabled('moderator')) {
124
         if (UIUtil.isSettingEnabled('moderator')) {
125
+            const wrapperId = 'moderatorOptionsWrapper';
126
+
97
             // START MUTED
127
             // START MUTED
98
             $("#startMutedOptions").change(function () {
128
             $("#startMutedOptions").change(function () {
99
                 let startAudioMuted = $("#startAudioMuted").is(":checked");
129
                 let startAudioMuted = $("#startAudioMuted").is(":checked");
100
                 let startVideoMuted = $("#startVideoMuted").is(":checked");
130
                 let startVideoMuted = $("#startVideoMuted").is(":checked");
131
+
101
                 emitter.emit(
132
                 emitter.emit(
102
                     UIEvents.START_MUTED_CHANGED,
133
                     UIEvents.START_MUTED_CHANGED,
103
                     startAudioMuted,
134
                     startAudioMuted,
106
             });
137
             });
107
 
138
 
108
             // FOLLOW ME
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
                 emitter.emit(
144
                 emitter.emit(
112
                     UIEvents.FOLLOW_ME_ENABLED,
145
                     UIEvents.FOLLOW_ME_ENABLED,
113
                     isFollowMeEnabled
146
                     isFollowMeEnabled
114
                 );
147
                 );
115
             });
148
             });
149
+
150
+            UIUtil.showElement(wrapperId);
116
         }
151
         }
117
     },
152
     },
118
 
153
 
147
     showStartMutedOptions (show) {
182
     showStartMutedOptions (show) {
148
         if (show && UIUtil.isSettingEnabled('moderator')) {
183
         if (show && UIUtil.isSettingEnabled('moderator')) {
149
             // Only show the subtitle if this isn't the only setting section.
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
                 UIUtil.showElement("moderatorOptionsTitle");
187
                 UIUtil.showElement("moderatorOptionsTitle");
152
 
188
 
153
             UIUtil.showElement("startMutedOptions");
189
             UIUtil.showElement("startMutedOptions");
214
      * @param {{ deviceId, label, kind }[]} devices list of available devices
250
      * @param {{ deviceId, label, kind }[]} devices list of available devices
215
      */
251
      */
216
     changeDevicesList (devices) {
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
             $selectAudioOutputParent = $selectAudioOutput.parent();
256
             $selectAudioOutputParent = $selectAudioOutput.parent();
221
 
257
 
222
         let audio = devices.filter(device => device.kind === 'audioinput'),
258
         let audio = devices.filter(device => device.kind === 'audioinput'),
241
                 videoPermissionGranted))
277
                 videoPermissionGranted))
242
             .prop('disabled', !video.length || !videoPermissionGranted);
278
             .prop('disabled', !video.length || !videoPermissionGranted);
243
 
279
 
280
+        initSelect2($selectCamera);
281
+
244
         $selectMic
282
         $selectMic
245
             .html(generateDevicesOptions(
283
             .html(generateDevicesOptions(
246
                 audio,
284
                 audio,
248
                 audioPermissionGranted))
286
                 audioPermissionGranted))
249
             .prop('disabled', !audio.length || !audioPermissionGranted);
287
             .prop('disabled', !audio.length || !audioPermissionGranted);
250
 
288
 
289
+        initSelect2($selectMic);
290
+
251
         if (JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output')) {
291
         if (JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output')) {
252
             $selectAudioOutput
292
             $selectAudioOutput
253
                 .html(generateDevicesOptions(
293
                 .html(generateDevicesOptions(
258
                     videoPermissionGranted || audioPermissionGranted))
298
                     videoPermissionGranted || audioPermissionGranted))
259
                 .prop('disabled', !audioOutput.length ||
299
                 .prop('disabled', !audioOutput.length ||
260
                     (!videoPermissionGranted && !audioPermissionGranted));
300
                     (!videoPermissionGranted && !audioPermissionGranted));
301
+            initSelect2($selectAudioOutput);
261
 
302
 
262
             $selectAudioOutputParent.show();
303
             $selectAudioOutputParent.show();
263
         } else {
304
         } else {
264
             $selectAudioOutputParent.hide();
305
             $selectAudioOutputParent.hide();
265
         }
306
         }
266
 
307
 
267
-        $('#devicesOptions').show();
268
-
269
         APP.translation.translateElement($('#settings_container option'));
308
         APP.translation.translateElement($('#settings_container option'));
270
     }
309
     }
271
 };
310
 };

Loading…
Cancel
Save