Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stylistic improvements and bug fixes #839

Merged
merged 3 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 0 additions & 70 deletions background.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

<script type='text/x-tmpl-mustache' id='two-column'>
<div id='session-toast-container'></div>
<div id='session-confirm-container'></div>
<div class='gutter'>
<div class='network-status-container'></div>
<div class='left-pane-placeholder'></div>
Expand Down Expand Up @@ -156,75 +155,6 @@ <h4>{{ title }}</h4>
</div>
</div>
</script>
<script type='text/x-tmpl-mustache' id='password-change-dialog'>
<div class="content">
{{ #title }}
<h4>{{ title }}</h4>
{{ /title }}
<input type='password' id='old-password' placeholder='Old password' autofocus>
<input type='password' id='new-password' placeholder='New password' autofocus>
<input type='password' id='new-password-confirmation' placeholder='Type in your new password again' autofocus>
<div class='error'></div>
<div class='buttons'>
<button class='cancel' tabindex='2'>{{ cancel }}</button>
<button class='ok' tabindex='1'>{{ ok }}</button>
</div>
</div>
</script>
<script type='text/x-tmpl-mustache' id='nickname-dialog'>
<div class="content">
{{ #title }}
<h4>{{ title }}</h4>
{{ /title }}
<input type='text' name='name' class='name' placeholder='Type a name' autofocus maxlength='25'>
{{ #message }}
<div class='message'>{{ message }}</div>
{{ /message }}
<div class='buttons'>
<button class='cancel' tabindex='2'>{{ cancel }}</button>
<button class='ok' tabindex='1'>{{ ok }}</button>
</div>
</div>
</script>

<script type='text/x-tmpl-mustache' id='device-pairing-words-dialog'>
<div class="content">
<h4>{{ title }}</h4>
<p>{{ secretWords }}</p>
<button id='close'>{{ closeText }}</button>
</div>
</script>

<script type='text/x-tmpl-mustache' id='connecting-to-server-template'>
<div class="content">
{{ #title }}
<h4>{{ title }}</h4>
{{ /title }}
<div class='buttons'>
<button class='cancel' tabindex='2'>{{ cancel }}</button>
</div>
</div>
</script>
<script type='text/x-tmpl-mustache' id='add-server-template'>
<div class="content">
{{ #title }}
<h4>{{ title }}</h4>
{{ /title }}
<input type='text' id='server-url' placeholder='Server Url' autofocus>
<div class='error'></div>
<div class='buttons'>
<button class='cancel' tabindex='2'>{{ cancel }}</button>
<button class='ok' tabindex='1'>{{ ok }}</button>
</div>
</div>
</script>
<script type='text/x-tmpl-mustache' id='qr-code-template'>
<div class="content">
<div id="qr">
</div>
<button class='ok' tabindex='1'>{{ ok }}</button>
</div>
</script>
<script type='text/x-tmpl-mustache' id='identicon-svg'>
<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'>
<circle cx='50' cy='50' r='40' fill='{{ color }}' />
Expand Down
4 changes: 2 additions & 2 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@

window.confirmationDialog = params => {
const confirmDialog = new Whisper.SessionConfirmView({
el: $('#session-confirm-container'),
el: $('body'),
title: params.title,
message: params.message,
messageSub: params.messageSub || undefined,
Expand Down Expand Up @@ -969,7 +969,7 @@
window.toasts.set(
toastID,
new Whisper.SessionToastView({
el: $('#session-toast-container'),
el: $('body'),
})
);

Expand Down
4 changes: 3 additions & 1 deletion js/modules/loki_app_dot_net_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,9 @@ class LokiAppDotNetServerAPI {
`serverRequest ${mode} error`,
e.code,
e.message,
`json: ${txtResponse}`, 'attempting connection to', url
`json: ${txtResponse}`,
'attempting connection to',
url
);
} else {
log.info(
Expand Down
17 changes: 8 additions & 9 deletions js/views/app_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@
},
showEditProfileDialog(options) {
const dialog = new Whisper.EditProfileDialogView(options);
this.el.append(dialog.el);
this.el.prepend(dialog.el);
},
showUserDetailsDialog(options) {
const dialog = new Whisper.UserDetailsDialogView(options);
this.el.append(dialog.el);
this.el.prepend(dialog.el);
},
showNicknameDialog({ pubKey, title, message, nickname, onOk, onCancel }) {
const _title = title || `Change nickname for ${pubKey}`;
Expand All @@ -196,16 +196,16 @@
resolve: onOk,
reject: onCancel,
});
this.el.append(dialog.el);
this.el.prepend(dialog.el);
dialog.focusInput();
},
showPasswordDialog(options) {
const dialog = new Whisper.PasswordDialogView(options);
this.el.append(dialog.el);
this.el.prepend(dialog.el);
},
showSeedDialog() {
const dialog = new Whisper.SeedDialogView();
this.el.append(dialog.el);
this.el.prepend(dialog.el);
},
showQRDialog(string) {
const dialog = new Whisper.QRDialogView({
Expand All @@ -215,12 +215,11 @@
},
showDevicePairingDialog(options) {
const dialog = new Whisper.DevicePairingDialogView(options);

this.el.append(dialog.el);
this.el.prepend(dialog.el);
},
showDevicePairingWordsDialog() {
const dialog = new Whisper.DevicePairingWordsDialogView();
this.el.append(dialog.el);
this.el.prepend(dialog.el);
},
showCreateGroup() {
// TODO: make it impossible to open 2 dialogs as once
Expand All @@ -231,7 +230,7 @@
},
showUpdateGroupDialog(groupConvo) {
const dialog = new Whisper.UpdateGroupDialogView(groupConvo);
this.el.append(dialog.el);
this.el.prepend(dialog.el);
},
showSessionRestoreConfirmation(options) {
const dialog = new Whisper.ConfirmSessionResetView(options);
Expand Down
4 changes: 2 additions & 2 deletions js/views/session_confirm_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
this.$('.session-confirm-wrapper').remove();

this.confirmView = new Whisper.ReactWrapperView({
className: 'session-confirm-wrapper',
className: 'loki-dialog modal session-confirm-wrapper',
Component: window.Signal.Components.SessionConfirm,
props: this.props,
});

this.$el.append(this.confirmView.el);
this.$el.prepend(this.confirmView.el);
},

ok() {
Expand Down
2 changes: 1 addition & 1 deletion js/views/session_toast_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
props: this.props,
});

this.$el.append(this.toastView.el);
this.$el.prepend(this.toastView.el);
},

update(options) {
Expand Down
5 changes: 2 additions & 3 deletions preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ window.CONSTANTS = {
MAX_GROUP_NAME_LENGTH: 64,
DEFAULT_PUBLIC_CHAT_URL: appConfig.get('defaultPublicChatServer'),
MAX_CONNECTION_DURATION: 5000,
// Limited due to the proof-of-work requirement
SMALL_GROUP_SIZE_LIMIT: 10,
};

window.versionInfo = {
Expand Down Expand Up @@ -492,9 +494,6 @@ window.shortenPubkey = pubkey => `(...${pubkey.substring(pubkey.length - 6)})`;

window.pubkeyPattern = /@[a-fA-F0-9]{64,66}\b/g;

// Limited due to the proof-of-work requirement
window.SMALL_GROUP_SIZE_LIMIT = 10;

// TODO: activate SealedSender once it is ready on all platforms
window.lokiFeatureFlags = {
multiDeviceUnpairing: true,
Expand Down
4 changes: 3 additions & 1 deletion stylesheets/_mentions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@

.friend-selection-list {
max-height: 240px;
overflow-y: scroll;
overflow-y: auto;
margin: 4px;
border-top: 1px solid #2f2f2f;
border-bottom: 1px solid #2f2f2f;

.check-mark {
float: right;
Expand Down
35 changes: 28 additions & 7 deletions stylesheets/_session.scss
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ $session-font-h3: 20px;
$session-font-h4: 16px;

$session-search-input-height: 34px;
$main-view-header-height: 85px;
$main-view-header-height: 63px;
$session-left-pane-width: 300px;
$session-left-pane-sections-container-width: 80px;

Expand All @@ -134,6 +134,12 @@ div.spacer-lg {
color: rgba($color, 0.6);
}

// Blur for modals
.loki-dialog ~ .index.inbox {
filter: blur(1px);
transition: filter 0.1s;
}

.text-subtle {
opacity: 0.6;
}
Expand Down Expand Up @@ -224,7 +230,7 @@ $session_message-container-border-radius: 5px;
pointer-events: none;
}
.overlay {
display: block !important;
display: flex !important;
z-index: 1;
}

Expand Down Expand Up @@ -572,12 +578,15 @@ label {
.message-selection-overlay {
display: none;
position: absolute;
right: $session-margin-sm;
left: $session-margin-md;
left: 0px;
right: 0px;
margin: 0px $session-margin-sm;
align-items: center;
justify-content: space-between;
height: 48px;

.close-button {
float: left;
margin: 17px 0px 0px 0px;
}
}
.message-selection-overlay div[role='button'] {
Expand All @@ -586,7 +595,6 @@ label {

.message-selection-overlay .button-group {
float: right;
margin-top: 13.5px;
}

.hidden {
Expand All @@ -597,7 +605,7 @@ label {
cursor: pointer;
}

#session-toast-container {
.session-toast-wrapper {
position: fixed;
right: $session-margin-lg;
bottom: $session-margin-lg;
Expand Down Expand Up @@ -1285,7 +1293,15 @@ label {
.module-message {
font-family: 'SF Pro Text';
border-radius: 5px;

&__text--incoming {
/* Add padding to large emojis in chat */
img.emoji.jumbo {
margin: $session-margin-sm 0px;
}
}
}

}

.bottom-bar {
Expand Down Expand Up @@ -1761,3 +1777,8 @@ input {
opacity: 0.8;
}
}

.invite-friends-container {
height: $session-icon-size-lg;
width: $session-icon-size-lg;
}
3 changes: 2 additions & 1 deletion stylesheets/_session_group_panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
margin: auto;
}

.session-icon-button {
.session-icon-button,
.invite-friends-container {
margin: 0 $session-margin-md;
}
}
Expand Down
15 changes: 12 additions & 3 deletions stylesheets/_session_left_pane.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $session-compose-margin: 20px;
}

.module-left-pane {
border-right: none !important;
border-right: 1px solid rgba($session-color-white, 0.1) !important;
width: $session-left-pane-width;
position: relative;
height: -webkit-fill-available;
Expand Down Expand Up @@ -213,6 +213,8 @@ $session-compose-margin: 20px;

&__list {
height: -webkit-fill-available;
border-top: 1px solid rgba(255,255,255,0.05);

&-popup {
width: -webkit-fill-available;
height: -webkit-fill-available;
Expand Down Expand Up @@ -485,6 +487,8 @@ $session-compose-margin: 20px;
flex-grow: 1;

.module-conversation-list-item {
background-color: $session-shade-4;

&--has-friend-request {
&:first-child {
border-top: none !important;
Expand All @@ -496,6 +500,11 @@ $session-compose-margin: 20px;
.module-conversation__user__profile-name {
font-size: 13px !important;
}

}

&__header__date, &__message {
display: none;
}

&__buttons {
Expand Down Expand Up @@ -550,11 +559,11 @@ $session-compose-margin: 20px;
}

&.active {
background-color: $session-shade-9;
background-color: $session-shade-5;
}

&:hover {
background-color: $session-shade-7;
background-color: $session-shade-6;
}

&__buttons {
Expand Down
4 changes: 2 additions & 2 deletions ts/components/conversation/CreateGroupDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ export class CreateGroupDialog extends React.Component<Props, State> {

if (
updatedFriends.filter(d => d.checkmarked).length >
window.SMALL_GROUP_SIZE_LIMIT - 1
window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT - 1
) {
const msg = `${this.props.i18n('maxGroupMembersError')} ${
window.SMALL_GROUP_SIZE_LIMIT
window.CONSTANTS.SMALL_GROUP_SIZE_LIMIT
}`;
this.onShowError(msg);

Expand Down