Parcourir la source

Merge pull request #1129 from BeatC/make-identical-text-input

Make identical text input
master
yanas il y a 8 ans
Parent
révision
686ee1111a

+ 16
- 78
css/_base.scss Voir le fichier

@@ -29,36 +29,6 @@ html, body, input, textarea, keygen, select, button {
29 29
     color: #636363;
30 30
 }
31 31
 
32
-input[type='text'], input[type='password'], textarea {
33
-    display: inline-block;
34
-    width: 100%;
35
-    padding: 5px 7px;
36
-    color: $inputColor;
37
-    border-radius: $borderRadius;
38
-    line-height: 32px;
39
-    height: 32px;
40
-    text-align: left;
41
-    border:1px solid $inputBorderColor;
42
-    background-color: $inputBackground;
43
-    outline: none; /* removes the default outline */
44
-    resize: none; /* prevents the user-resizing, adjust to taste */
45
-}
46
-
47
-@include placeholder {
48
-    color: $placeHolderColor;
49
-}
50
-
51
-textarea {
52
-    overflow: hidden;
53
-    word-wrap: break-word;
54
-    resize: none;
55
-    line-height: 1.5em;
56
-}
57
-
58
-button.no-icon {
59
-    padding: 0 1em;
60
-}
61
-
62 32
 button, input, select, textarea {
63 33
     margin: 0;
64 34
     vertical-align: baseline;
@@ -75,10 +45,26 @@ input[type="reset"], input[type="submit"] {
75 45
     cursor: pointer;
76 46
 }
77 47
 
48
+textarea {
49
+    overflow: hidden;
50
+    word-wrap: break-word;
51
+    resize: none;
52
+    line-height: 1.5em;
53
+}
54
+
55
+input[type='text'], input[type='password'], textarea {
56
+    outline: none; /* removes the default outline */
57
+    resize: none; /* prevents the user-resizing, adjust to taste */
58
+}
59
+
78 60
 button {
79 61
     color: #FFF;
80 62
     background-color: $buttonBackground;
81 63
     border-radius: $borderRadius;
64
+
65
+    &.no-icon {
66
+        padding: 0 1em;
67
+    }
82 68
 }
83 69
 
84 70
 button,
@@ -132,42 +118,6 @@ form {
132 118
     font-size: 12px;
133 119
 }
134 120
 
135
-/**
136
- * Hides an element.
137
- */
138
-.hide {
139
-    display: none !important;
140
-}
141
-
142
-/**
143
- * Shows an element.
144
- */
145
-.show {
146
-    display: block !important;
147
-}
148
-
149
-/**
150
- * Shows an inline element.
151
- */
152
-.show-inline {
153
-    display: inline-block !important;
154
-}
155
-
156
-.show-list-item {
157
-    display: list-item !important;
158
-}
159
-
160
-/**
161
- * Shows a flex element.
162
- */
163
-.show-flex {
164
-    display: -webkit-box !important;
165
-    display: -moz-box !important;
166
-    display: -ms-flexbox !important;
167
-    display: -webkit-flex !important;
168
-    display: flex !important;
169
-}
170
-
171 121
 /**
172 122
 * Tooltips
173 123
 **/
@@ -189,18 +139,6 @@ form {
189 139
     visibility: visible;
190 140
 }
191 141
 
192
-.link {
193
-    cursor: pointer;
194
-    color: $linkFontColor;
195
-    @include transition(color .1s ease-out);
196
-
197
-    &:hover {
198
-        color: $linkHoverFontColor;
199
-        text-decoration: underline;
200
-        @include transition(color .1s ease-in);
201
-    }
202
-}
203
-
204 142
 #inviteLinkRef {
205 143
     -webkit-user-select: text;
206 144
     user-select: text;

+ 1
- 11
css/_side_toolbar_container.scss Voir le fichier

@@ -23,23 +23,13 @@
23 23
      * Form elements and blocks.
24 24
      */
25 25
     input, select, a,
26
-    .sideToolbarBlock, .input-control, .button-control {
26
+    .sideToolbarBlock, .form-control, .button-control {
27 27
         display: block;
28 28
         margin-top: 15px;
29 29
         margin-left: 10%;
30 30
         width: 80%;
31 31
     }
32 32
 
33
-    /**
34
-     * Specify colors for edit elements.
35
-     */
36
-    select, input[type="button"], input[type="text"], input[type="reset"],
37
-    input[type="submit"] {
38
-        color: $inputColor;
39
-        background: $inputBackground;
40
-        border: none;
41
-    }
42
-
43 33
     /**
44 34
      * Specify styling of elements inside a block.
45 35
      */

+ 38
- 0
css/_utils.scss Voir le fichier

@@ -0,0 +1,38 @@
1
+/**
2
+ * Hides an element.
3
+ */
4
+.hide {
5
+    display: none !important;
6
+}
7
+
8
+/**
9
+ * Shows an element.
10
+ */
11
+.show {
12
+    display: block !important;
13
+}
14
+
15
+/**
16
+ * Shows an inline element.
17
+ */
18
+.show-inline {
19
+    display: inline-block !important;
20
+}
21
+
22
+/**
23
+* Shows as a list item
24
+**/
25
+.show-list-item {
26
+    display: list-item !important;
27
+}
28
+
29
+/**
30
+ * Shows a flex element.
31
+ */
32
+.show-flex {
33
+    display: -webkit-box !important;
34
+    display: -moz-box !important;
35
+    display: -ms-flexbox !important;
36
+    display: -webkit-flex !important;
37
+    display: flex !important;
38
+}

css/buttons/_button-control.scss → css/components/_button-control.scss Voir le fichier


css/input-control/_input-control.scss → css/components/_form-control.scss Voir le fichier

@@ -1,4 +1,4 @@
1
-.input-control {
1
+.form-control {
2 2
     padding: 16px 0;
3 3
 
4 4
     &:first-child {
@@ -19,24 +19,6 @@
19 19
         font-weight: $labelFontWeight;
20 20
     }
21 21
 
22
-    &__input {
23
-        margin-bottom: 8px;
24
-        @include transition(all .2s ease-in);
25
-
26
-        &:last-child {
27
-            margin-bottom: inherit;
28
-        }
29
-
30
-        &::selection {
31
-            background-color: $defaultDarkSelectionColor;
32
-        }
33
-
34
-        &.error {
35
-            color: $errorColor;
36
-            border-color: $errorColor;
37
-        }
38
-    }
39
-
40 22
     &__em {
41 23
         color: $inputControlEmColor;
42 24
     }

+ 32
- 0
css/components/_input-control.scss Voir le fichier

@@ -0,0 +1,32 @@
1
+.input-control {
2
+    @include transition(all .2s ease-in);
3
+    display: inline-block;
4
+    width: 100%;
5
+    padding: 5px 7px;
6
+    color: $inputColor;
7
+    border-radius: $borderRadius;
8
+    line-height: 32px;
9
+    height: 32px;
10
+    text-align: left;
11
+    border:1px solid $inputBorderColor;
12
+    background-color: $inputBackground;
13
+    margin-bottom: 8px;
14
+
15
+    &:last-child {
16
+        margin-bottom: inherit;
17
+    }
18
+
19
+    &::selection {
20
+        background-color: $defaultDarkSelectionColor;
21
+    }
22
+
23
+
24
+    &.error {
25
+        color: $errorColor;
26
+        border-color: $errorColor;
27
+    }
28
+}
29
+
30
+@include placeholder {
31
+    color: $placeHolderColor;
32
+}

+ 11
- 0
css/components/_link.scss Voir le fichier

@@ -0,0 +1,11 @@
1
+.link {
2
+    cursor: pointer;
3
+    color: $linkFontColor;
4
+    @include transition(color .1s ease-out);
5
+
6
+    &:hover {
7
+        color: $linkHoverFontColor;
8
+        text-decoration: underline;
9
+        @include transition(color .1s ease-in);
10
+    }
11
+}

+ 5
- 2
css/main.scss Voir le fichier

@@ -33,6 +33,7 @@
33 33
 
34 34
 @import 'toastr';
35 35
 @import 'base';
36
+@import 'utils';
36 37
 @import 'overlay/overlay';
37 38
 @import 'inlay';
38 39
 @import 'reload_overlay/reload_overlay';
@@ -55,9 +56,11 @@
55 56
 @import 'jquery.contextMenu';
56 57
 @import 'keyboard-shortcuts';
57 58
 @import 'redirect_page';
58
-@import 'input-control/input-control';
59
+@import 'components/form-control';
60
+@import 'components/link';
59 61
 @import 'shortcuts/main';
60
-@import 'buttons/button-control';
62
+@import 'components/button-control';
63
+@import 'components/_input-control.scss';
61 64
 @import "modals/invite/invite";
62 65
 @import "connection-info";
63 66
 @import 'aui-components/dropdown';

+ 1
- 1
css/modals/_dialog.scss Voir le fichier

@@ -72,7 +72,7 @@
72 72
         }
73 73
     }
74 74
 
75
-    .input-control:not(:last-child) {
75
+    .form-control:not(:last-child) {
76 76
         border-bottom: 1px solid $auiBorderColor;
77 77
     }
78 78
 }

+ 1
- 1
css/modals/feedback/_feedback.scss Voir le fichier

@@ -62,7 +62,7 @@
62 62
             text-align: center;
63 63
             padding: 10px 40px 20px 40px;
64 64
 
65
-            .input-control{
65
+            .form-control{
66 66
                 &__input {
67 67
                     background-color: $feedbackInputBg;
68 68
                     color: $feedbackInputTextColor;

+ 6
- 5
modules/UI/UI.js Voir le fichier

@@ -80,12 +80,11 @@ JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[TrackErrors.NO_DATA_FROM_SOURCE]
80 80
 function promptDisplayName() {
81 81
     let labelKey = 'dialog.enterDisplayName';
82 82
     let message = (
83
-        `<div class="input-control">
84
-            <label data-i18n="${labelKey}" class="input-control__label"></label>
83
+        `<div class="form-control">
84
+            <label data-i18n="${labelKey}" class="form-control__label"></label>
85 85
             <input name="displayName" type="text"
86 86
                data-i18n="[placeholder]defaultNickname"
87
-               class="input-control__input"
88
-               autofocus>
87
+               class="input-control" autofocus>
89 88
          </div>`
90 89
     );
91 90
 
@@ -742,9 +741,11 @@ UI.showLoginPopup = function(callback) {
742 741
 
743 742
     let message = (
744 743
         `<input name="username" type="text"
745
-                placeholder="user@domain.net" autofocus>
744
+                placeholder="user@domain.net"
745
+                class="input-control" autofocus>
746 746
          <input name="password" type="password"
747 747
                 data-i18n="[placeholder]dialog.userPassword"
748
+                class="input-control"
748 749
                 placeholder="user password">`
749 750
     );
750 751
 

+ 2
- 2
modules/UI/authentication/LoginDialog.js Voir le fichier

@@ -11,10 +11,10 @@ function getPasswordInputHtml() {
11 11
 
12 12
     return `
13 13
         <input name="username" type="text" 
14
-               class="input-control__input"
14
+               class="input-control"
15 15
                placeholder=${placeholder} autofocus>
16 16
         <input name="password" type="password"
17
-               class="input-control__input"
17
+               class="input-control"
18 18
                data-i18n="[placeholder]dialog.userPassword">`;
19 19
 }
20 20
 

+ 1
- 1
modules/UI/feedback/FeedbackWindow.js Voir le fichier

@@ -66,7 +66,7 @@ function createRateFeedbackHTML() {
66 66
                 </div>
67 67
             </div>
68 68
             <div class="details">
69
-                <textarea id="feedbackTextArea" class="input-control__input" 
69
+                <textarea id="feedbackTextArea" class="input-control" 
70 70
                     data-i18n="[placeholder]dialog.feedbackHelp"></textarea>
71 71
             </div>
72 72
         </form>`;

+ 18
- 17
modules/UI/invite/InviteDialogView.js Voir le fichier

@@ -120,20 +120,20 @@ export default class InviteDialogView {
120 120
     getShareLinkBlock() {
121 121
         let classes = 'button-control button-control_light copyInviteLink';
122 122
         return (
123
-            `<div class="input-control">
124
-                <label class="input-control__label" for="inviteLinkRef"
123
+            `<div class="form-control">
124
+                <label class="form-control__label" for="inviteLinkRef"
125 125
                     data-i18n="${this.dialog.titleKey}"></label>
126
-                <div class="input-control__container">
127
-                    <input class="input-control__input inviteLink"
126
+                <div class="form-control__container">
127
+                    <input class="input-control inviteLink"
128 128
                            id="inviteLinkRef" type="text"
129 129
                            ${this.inviteAttributes} readonly>
130 130
                     <button data-i18n="dialog.copy" class="${classes}"></button>
131 131
                 </div>
132
-                <p class="input-control__hint ${this.lockHint}">
132
+                <p class="form-control__hint ${this.lockHint}">
133 133
                    <span class="icon-security-locked"></span>
134 134
                    <span data-i18n="dialog.roomLocked"></span>
135 135
                 </p>
136
-                <p class="input-control__hint ${this.unlockHint}">
136
+                <p class="form-control__hint ${this.unlockHint}">
137 137
                    <span class="icon-security"></span>
138 138
                    <span data-i18n="roomUnlocked"></span>
139 139
                 </p>
@@ -150,12 +150,13 @@ export default class InviteDialogView {
150 150
 
151 151
         if (this.model.isModerator) {
152 152
             html = (`
153
-            <div class="input-control">
154
-                <label class="input-control__label"
153
+            <div class="form-control">
154
+                <label class="form-control__label"
155 155
                        for="newPasswordInput" data-i18n="dialog.addPassword">
156 156
                </label>
157
-                <div class="input-control__container">
158
-                    <input class="input-control__input" id="newPasswordInput"
157
+                <div class="form-control__container">
158
+                    <input class="input-control"
159
+                           id="newPasswordInput"
159 160
                            type="text" 
160 161
                            data-i18n="[placeholder]dialog.createPassword">
161 162
                     <button id="addPasswordBtn" id="inviteDialogAddPassword"
@@ -182,19 +183,19 @@ export default class InviteDialogView {
182 183
 
183 184
         if (isModerator) {
184 185
             return (`
185
-                <div class="input-control">
186
-                    <label class="input-control__label"
186
+                <div class="form-control">
187
+                    <label class="form-control__label"
187 188
                            data-i18n="dialog.passwordLabel"></label>
188
-                    <div class="input-control__container">
189
+                    <div class="form-control__container">
189 190
                         <p>
190
-                            <span class="input-control__text"
191
+                            <span class="form-control__text"
191 192
                                   data-i18n="dialog.currentPassword"></span>
192 193
                             <span id="inviteDialogPassword"
193
-                                  class="input-control__em">
194
+                                  class="form-control__em">
194 195
                                 ${password}
195 196
                             </span>
196 197
                         </p>
197
-                        <a class="link input-control__right"
198
+                        <a class="link form-control__right"
198 199
                            id="inviteDialogRemovePassword"
199 200
                            data-i18n="dialog.removePassword"></a>
200 201
                     </div>
@@ -202,7 +203,7 @@ export default class InviteDialogView {
202 203
             `);
203 204
         } else {
204 205
             return (`
205
-                <div class="input-control">
206
+                <div class="form-control">
206 207
                     <p>A participant protected this call with a password.</p>
207 208
                 </div>
208 209
             `);

+ 4
- 3
modules/UI/invite/RequirePasswordDialog.js Voir le fichier

@@ -33,13 +33,14 @@ export default class RequirePasswordDialog {
33 33
      */
34 34
     _getBodyMessage() {
35 35
         return (
36
-            `<div class="input-control">
36
+            `<div class="form-control">
37 37
                 <label class="input-control__label"
38 38
                        data-i18n="${this.labelKey}"></label>
39
-                <input class="input-control__input" name="lockKey" type="text"
39
+                <input class="input-control__input input-control"
40
+                       name="lockKey" type="text"
40 41
                    data-i18n="[placeholder]dialog.password"
41 42
                    autofocus id="${this.inputId}">
42
-                <p class="input-control__hint input-control__hint_error hide"
43
+                <p class="form-control__hint form-control__hint_error hide"
43 44
                    id="${this.errorId}"
44 45
                    data-i18n="${this.errorKey}"></p>
45 46
             </div>`

+ 3
- 1
modules/UI/recording/Recording.js Voir le fichier

@@ -55,7 +55,8 @@ function _requestLiveStreamId() {
55 55
             state0: {
56 56
                 titleKey: "dialog.liveStreaming",
57 57
                 html:
58
-                    `<input name="streamId" type="text"
58
+                    `<input  class="input-control"
59
+                    name="streamId" type="text"
59 60
                     data-i18n="[placeholder]dialog.streamKey"
60 61
                     autofocus>`,
61 62
                 persistent: false,
@@ -123,6 +124,7 @@ function _requestRecordingToken () {
123 124
     let messageString = (
124 125
         `<input name="recordingToken" type="text"
125 126
                 data-i18n="[placeholder]dialog.token"
127
+                class="input-control"
126 128
                 autofocus>`
127 129
     );
128 130
     return new Promise(function (resolve, reject) {

+ 1
- 0
modules/UI/shared_video/SharedVideo.js Voir le fichier

@@ -765,6 +765,7 @@ function requestVideoLink() {
765 765
                 titleKey: "dialog.shareVideoTitle",
766 766
                 html:  `
767 767
                     <input name="sharedVideoUrl" type="text"
768
+                           class="input-control"
768 769
                            data-i18n="[placeholder]defaultLink"
769 770
                            autofocus>`,
770 771
                 persistent: false,

+ 2
- 1
modules/UI/side_pannels/chat/Chat.js Voir le fichier

@@ -17,7 +17,8 @@ const htmlStr = `
17 17
         <div id="nickname">
18 18
             <span data-i18n="chat.nickname.title"></span>
19 19
             <form>
20
-                <input type='text' id="nickinput" autofocus 
20
+                <input type='text'
21
+                       class="input-control" id="nickinput" autofocus
21 22
                     data-i18n="[placeholder]chat.nickname.popover">
22 23
             </form>
23 24
         </div>

+ 1
- 1
modules/UI/side_pannels/contactlist/ContactListView.js Voir le fichier

@@ -136,7 +136,7 @@ var ContactListView = {
136 136
      * Adds layout for lock description
137 137
      */
138 138
     getLockDescriptionLayout(key) {
139
-        let classes = "input-control__hint input-control_full-width";
139
+        let classes = "form-control__hint form-control_full-width";
140 140
         let padlockSuffix = '';
141 141
         if (key === this.lockKey) {
142 142
             padlockSuffix = '-locked';

+ 2
- 2
modules/UI/side_pannels/profile/Profile.js Voir le fichier

@@ -10,12 +10,12 @@ const htmlStr = `
10 10
         <div class="sideToolbarBlock first">
11 11
             <label class="first" data-i18n="profile.setDisplayNameLabel">
12 12
             </label>
13
-            <input type="text" id="setDisplayName"
13
+            <input class="input-control" type="text" id="setDisplayName"
14 14
                 data-i18n="[placeholder]settings.name">
15 15
         </div>
16 16
         <div class="sideToolbarBlock">
17 17
             <label data-i18n="profile.setEmailLabel"></label>
18
-            <input id="setEmail" type="text" 
18
+            <input id="setEmail" type="text" class="input-control" 
19 19
                 data-i18n="[placeholder]profile.setEmailInput">
20 20
         </div>
21 21
         <div id="authenticationContainer" 

+ 2
- 1
modules/UI/toolbars/Toolbar.js Voir le fichier

@@ -311,7 +311,8 @@ function showSipNumberInput () {
311 311
         : '';
312 312
     let titleKey = "dialog.sipMsg";
313 313
     let msgString = (`
314
-            <input name="sipNumber" type="text"
314
+            <input class="input-control"
315
+                   name="sipNumber" type="text"
315 316
                    value="${defaultNumber}" autofocus>`);
316 317
 
317 318
     APP.UI.messageHandler.openTwoButtonDialog({

Chargement…
Annuler
Enregistrer