Made inputs identical

This commit is contained in:
Ilya Daynatovich 2016-11-09 18:46:58 +02:00
parent 12c1574f07
commit 5b0777d4db
17 changed files with 122 additions and 123 deletions

View File

@ -29,36 +29,6 @@ html, body, input, textarea, keygen, select, button {
color: #636363; color: #636363;
} }
input[type='text'], input[type='password'], textarea {
display: inline-block;
width: 100%;
padding: 5px 7px;
color: $inputColor;
border-radius: $borderRadius;
line-height: 32px;
height: 32px;
text-align: left;
border:1px solid $inputBorderColor;
background-color: $inputBackground;
outline: none; /* removes the default outline */
resize: none; /* prevents the user-resizing, adjust to taste */
}
@include placeholder {
color: $placeHolderColor;
}
textarea {
overflow: hidden;
word-wrap: break-word;
resize: none;
line-height: 1.5em;
}
button.no-icon {
padding: 0 1em;
}
button, input, select, textarea { button, input, select, textarea {
margin: 0; margin: 0;
vertical-align: baseline; vertical-align: baseline;
@ -75,10 +45,26 @@ input[type="reset"], input[type="submit"] {
cursor: pointer; cursor: pointer;
} }
textarea {
overflow: hidden;
word-wrap: break-word;
resize: none;
line-height: 1.5em;
}
input[type='text'], input[type='password'], textarea {
outline: none; /* removes the default outline */
resize: none; /* prevents the user-resizing, adjust to taste */
}
button { button {
color: #FFF; color: #FFF;
background-color: $buttonBackground; background-color: $buttonBackground;
border-radius: $borderRadius; border-radius: $borderRadius;
&.no-icon {
padding: 0 1em;
}
} }
button, button,
@ -132,42 +118,6 @@ form {
font-size: 12px; font-size: 12px;
} }
/**
* Hides an element.
*/
.hide {
display: none !important;
}
/**
* Shows an element.
*/
.show {
display: block !important;
}
/**
* Shows an inline element.
*/
.show-inline {
display: inline-block !important;
}
.show-list-item {
display: list-item !important;
}
/**
* Shows a flex element.
*/
.show-flex {
display: -webkit-box !important;
display: -moz-box !important;
display: -ms-flexbox !important;
display: -webkit-flex !important;
display: flex !important;
}
/** /**
* Tooltips * Tooltips
**/ **/
@ -189,18 +139,6 @@ form {
visibility: visible; visibility: visible;
} }
.link {
cursor: pointer;
color: $linkFontColor;
@include transition(color .1s ease-out);
&:hover {
color: $linkHoverFontColor;
text-decoration: underline;
@include transition(color .1s ease-in);
}
}
#inviteLinkRef { #inviteLinkRef {
-webkit-user-select: text; -webkit-user-select: text;
user-select: text; user-select: text;

View File

@ -30,16 +30,6 @@
width: 80%; width: 80%;
} }
/**
* Specify colors for edit elements.
*/
select, input[type="button"], input[type="text"], input[type="reset"],
input[type="submit"] {
color: $inputColor;
background: $inputBackground;
border: none;
}
/** /**
* Specify styling of elements inside a block. * Specify styling of elements inside a block.
*/ */

38
css/_utils.scss Normal file
View File

@ -0,0 +1,38 @@
/**
* Hides an element.
*/
.hide {
display: none !important;
}
/**
* Shows an element.
*/
.show {
display: block !important;
}
/**
* Shows an inline element.
*/
.show-inline {
display: inline-block !important;
}
/**
* Shows as a list item
**/
.show-list-item {
display: list-item !important;
}
/**
* Shows a flex element.
*/
.show-flex {
display: -webkit-box !important;
display: -moz-box !important;
display: -ms-flexbox !important;
display: -webkit-flex !important;
display: flex !important;
}

View File

@ -19,24 +19,6 @@
font-weight: $labelFontWeight; font-weight: $labelFontWeight;
} }
&__input {
margin-bottom: 8px;
@include transition(all .2s ease-in);
&:last-child {
margin-bottom: inherit;
}
&::selection {
background-color: $defaultDarkSelectionColor;
}
&.error {
color: $errorColor;
border-color: $errorColor;
}
}
&__em { &__em {
color: $inputControlEmColor; color: $inputControlEmColor;
} }

View File

@ -1,3 +1,32 @@
.input-control { .input-control {
@include transition(all .2s ease-in);
display: inline-block;
width: 100%;
padding: 5px 7px;
color: $inputColor;
border-radius: $borderRadius;
line-height: 32px;
height: 32px;
text-align: left;
border:1px solid $inputBorderColor;
background-color: $inputBackground;
margin-bottom: 8px;
&:last-child {
margin-bottom: inherit;
}
&::selection {
background-color: $defaultDarkSelectionColor;
}
&.error {
color: $errorColor;
border-color: $errorColor;
}
}
@include placeholder {
color: $placeHolderColor;
} }

11
css/components/_link.scss Normal file
View File

@ -0,0 +1,11 @@
.link {
cursor: pointer;
color: $linkFontColor;
@include transition(color .1s ease-out);
&:hover {
color: $linkHoverFontColor;
text-decoration: underline;
@include transition(color .1s ease-in);
}
}

View File

@ -33,6 +33,7 @@
@import 'toastr'; @import 'toastr';
@import 'base'; @import 'base';
@import 'utils';
@import 'overlay/overlay'; @import 'overlay/overlay';
@import 'inlay'; @import 'inlay';
@import 'reload_overlay/reload_overlay'; @import 'reload_overlay/reload_overlay';
@ -56,8 +57,10 @@
@import 'keyboard-shortcuts'; @import 'keyboard-shortcuts';
@import 'redirect_page'; @import 'redirect_page';
@import 'components/form-control'; @import 'components/form-control';
@import 'components/link';
@import 'shortcuts/main'; @import 'shortcuts/main';
@import 'components/button-control'; @import 'components/button-control';
@import 'components/_input-control.scss';
@import "modals/invite/invite"; @import "modals/invite/invite";
@import "connection-info"; @import "connection-info";
@import 'aui-components/dropdown'; @import 'aui-components/dropdown';

View File

@ -84,8 +84,7 @@ function promptDisplayName() {
<label data-i18n="${labelKey}" class="form-control__label"></label> <label data-i18n="${labelKey}" class="form-control__label"></label>
<input name="displayName" type="text" <input name="displayName" type="text"
data-i18n="[placeholder]defaultNickname" data-i18n="[placeholder]defaultNickname"
class="form-control__input" class="input-control" autofocus>
autofocus>
</div>` </div>`
); );
@ -742,9 +741,11 @@ UI.showLoginPopup = function(callback) {
let message = ( let message = (
`<input name="username" type="text" `<input name="username" type="text"
placeholder="user@domain.net" autofocus> placeholder="user@domain.net"
class="input-control" autofocus>
<input name="password" type="password" <input name="password" type="password"
data-i18n="[placeholder]dialog.userPassword" data-i18n="[placeholder]dialog.userPassword"
class="input-control"
placeholder="user password">` placeholder="user password">`
); );

View File

@ -11,10 +11,10 @@ function getPasswordInputHtml() {
return ` return `
<input name="username" type="text" <input name="username" type="text"
class="form-control__input" class="input-control"
placeholder=${placeholder} autofocus> placeholder=${placeholder} autofocus>
<input name="password" type="password" <input name="password" type="password"
class="form-control__input" class="input-control"
data-i18n="[placeholder]dialog.userPassword">`; data-i18n="[placeholder]dialog.userPassword">`;
} }

View File

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

View File

@ -124,7 +124,7 @@ export default class InviteDialogView {
<label class="form-control__label" for="inviteLinkRef" <label class="form-control__label" for="inviteLinkRef"
data-i18n="${this.dialog.titleKey}"></label> data-i18n="${this.dialog.titleKey}"></label>
<div class="form-control__container"> <div class="form-control__container">
<input class="form-control__input inviteLink" <input class="input-control inviteLink"
id="inviteLinkRef" type="text" id="inviteLinkRef" type="text"
${this.inviteAttributes} readonly> ${this.inviteAttributes} readonly>
<button data-i18n="dialog.copy" class="${classes}"></button> <button data-i18n="dialog.copy" class="${classes}"></button>
@ -155,7 +155,8 @@ export default class InviteDialogView {
for="newPasswordInput" data-i18n="dialog.addPassword"> for="newPasswordInput" data-i18n="dialog.addPassword">
</label> </label>
<div class="form-control__container"> <div class="form-control__container">
<input class="form-control__input" id="newPasswordInput" <input class="input-control"
id="newPasswordInput"
type="text" type="text"
data-i18n="[placeholder]dialog.createPassword"> data-i18n="[placeholder]dialog.createPassword">
<button id="addPasswordBtn" id="inviteDialogAddPassword" <button id="addPasswordBtn" id="inviteDialogAddPassword"

View File

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

View File

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

View File

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

View File

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

View File

@ -10,12 +10,12 @@ const htmlStr = `
<div class="sideToolbarBlock first"> <div class="sideToolbarBlock first">
<label class="first" data-i18n="profile.setDisplayNameLabel"> <label class="first" data-i18n="profile.setDisplayNameLabel">
</label> </label>
<input type="text" id="setDisplayName" <input class="input-control" type="text" id="setDisplayName"
data-i18n="[placeholder]settings.name"> data-i18n="[placeholder]settings.name">
</div> </div>
<div class="sideToolbarBlock"> <div class="sideToolbarBlock">
<label data-i18n="profile.setEmailLabel"></label> <label data-i18n="profile.setEmailLabel"></label>
<input id="setEmail" type="text" <input id="setEmail" type="text" class="input-control"
data-i18n="[placeholder]profile.setEmailInput"> data-i18n="[placeholder]profile.setEmailInput">
</div> </div>
<div id="authenticationContainer" <div id="authenticationContainer"

View File

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