Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
1271120d32
84 changed files with 872 additions and 759 deletions
|
@ -177,7 +177,7 @@ class MatrixClientPeg {
|
|||
userId: creds.userId,
|
||||
deviceId: creds.deviceId,
|
||||
timelineSupport: true,
|
||||
forceTURN: !SettingsStore.getValue('webRtcForcePeerToPeer', false),
|
||||
forceTURN: !SettingsStore.getValue('webRtcAllowPeerToPeer', false),
|
||||
verificationMethods: [verificationMethods.SAS]
|
||||
};
|
||||
|
||||
|
|
|
@ -114,10 +114,15 @@ export default class AutoHideScrollbar extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
getScrollTop() {
|
||||
return this.containerRef.scrollTop;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (<div
|
||||
ref={this._collectContainerRef}
|
||||
className={["mx_AutoHideScrollbar", this.props.className].join(" ")}
|
||||
onScroll={this.props.onScroll}
|
||||
>
|
||||
<div className="mx_AutoHideScrollbar_offset">
|
||||
{ this.props.children }
|
||||
|
|
|
@ -1157,7 +1157,6 @@ export default React.createClass({
|
|||
render: function() {
|
||||
const GroupAvatar = sdk.getComponent("avatars.GroupAvatar");
|
||||
const Spinner = sdk.getComponent("elements.Spinner");
|
||||
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
||||
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
|
||||
|
||||
if (this.state.summaryLoading && this.state.error === null || this.state.saving) {
|
||||
|
@ -1248,13 +1247,17 @@ export default React.createClass({
|
|||
if (this.state.editing) {
|
||||
rightButtons.push(
|
||||
<AccessibleButton className="mx_GroupView_textButton mx_RoomHeader_textButton"
|
||||
onClick={this._onSaveClick} key="_saveButton"
|
||||
key="_saveButton"
|
||||
onClick={this._onSaveClick}
|
||||
>
|
||||
{ _t('Save') }
|
||||
</AccessibleButton>,
|
||||
);
|
||||
rightButtons.push(
|
||||
<AccessibleButton className="mx_RoomHeader_cancelButton" onClick={this._onCancelClick} key="_cancelButton">
|
||||
<AccessibleButton className="mx_RoomHeader_cancelButton"
|
||||
key="_cancelButton"
|
||||
onClick={this._onCancelClick}
|
||||
>
|
||||
<img src={require("../../../res/img/cancel.svg")} className="mx_filterFlipColor"
|
||||
width="18" height="18" alt={_t("Cancel")} />
|
||||
</AccessibleButton>,
|
||||
|
@ -1262,16 +1265,20 @@ export default React.createClass({
|
|||
} else {
|
||||
if (summary.user && summary.user.membership === 'join') {
|
||||
rightButtons.push(
|
||||
<AccessibleButton className="mx_GroupHeader_button"
|
||||
onClick={this._onEditClick} title={_t("Community Settings")} key="_editButton"
|
||||
<AccessibleButton className="mx_GroupHeader_button mx_GroupHeader_editButton"
|
||||
key="_editButton"
|
||||
onClick={this._onEditClick}
|
||||
title={_t("Community Settings")}
|
||||
>
|
||||
<TintableSvg src={require("../../../res/img/icons-settings-room.svg")} width="16" height="16" />
|
||||
</AccessibleButton>,
|
||||
);
|
||||
}
|
||||
rightButtons.push(
|
||||
<AccessibleButton className="mx_GroupHeader_button" onClick={this._onShareClick} title={_t('Share Community')} key="_shareButton">
|
||||
<TintableSvg src={require("../../../res/img/icons-share.svg")} width="16" height="16" />
|
||||
<AccessibleButton className="mx_GroupHeader_button mx_GroupHeader_shareButton"
|
||||
key="_shareButton"
|
||||
onClick={this._onShareClick}
|
||||
title={_t('Share Community')}
|
||||
>
|
||||
</AccessibleButton>,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -59,6 +59,10 @@ export default class IndicatorScrollbar extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
getScrollTop() {
|
||||
return this._autoHideScrollbar.getScrollTop();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this._scrollElement) {
|
||||
this._scrollElement.removeEventListener("scroll", this.checkOverflow);
|
||||
|
|
|
@ -654,11 +654,9 @@ export default React.createClass({
|
|||
});
|
||||
break;
|
||||
}
|
||||
// case 'set_theme':
|
||||
// disable changing the theme for now
|
||||
// as other themes are not compatible with dharma
|
||||
// this._onSetTheme(payload.value);
|
||||
// break;
|
||||
case 'set_theme':
|
||||
this._onSetTheme(payload.value);
|
||||
break;
|
||||
case 'on_logging_in':
|
||||
// We are now logging in, so set the state to reflect that
|
||||
// NB. This does not touch 'ready' since if our dispatches
|
||||
|
|
|
@ -27,7 +27,8 @@ import IndicatorScrollbar from './IndicatorScrollbar';
|
|||
import { KeyCode } from '../../Keyboard';
|
||||
import { Group } from 'matrix-js-sdk';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import RoomTile from "../views/rooms/RoomTile";
|
||||
import LazyRenderList from "../views/elements/LazyRenderList";
|
||||
|
||||
// turn this on for drop & drag console debugging galore
|
||||
const debug = false;
|
||||
|
@ -60,6 +61,9 @@ const RoomSubList = React.createClass({
|
|||
getInitialState: function() {
|
||||
return {
|
||||
hidden: this.props.startAsHidden || false,
|
||||
// some values to get LazyRenderList starting
|
||||
scrollerHeight: 800,
|
||||
scrollTop: 0,
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -134,24 +138,21 @@ const RoomSubList = React.createClass({
|
|||
this.setState(this.state);
|
||||
},
|
||||
|
||||
makeRoomTiles: function() {
|
||||
const RoomTile = sdk.getComponent("rooms.RoomTile");
|
||||
return this.props.list.map((room, index) => {
|
||||
return <RoomTile
|
||||
room={room}
|
||||
roomSubList={this}
|
||||
tagName={this.props.tagName}
|
||||
key={room.roomId}
|
||||
collapsed={this.props.collapsed || false}
|
||||
unread={Unread.doesRoomHaveUnreadMessages(room)}
|
||||
highlight={room.getUnreadNotificationCount('highlight') > 0 || this.props.isInvite}
|
||||
notificationCount={room.getUnreadNotificationCount()}
|
||||
isInvite={this.props.isInvite}
|
||||
refreshSubList={this._updateSubListCount}
|
||||
incomingCall={null}
|
||||
onClick={this.onRoomTileClick}
|
||||
/>;
|
||||
});
|
||||
makeRoomTile: function(room) {
|
||||
return <RoomTile
|
||||
room={room}
|
||||
roomSubList={this}
|
||||
tagName={this.props.tagName}
|
||||
key={room.roomId}
|
||||
collapsed={this.props.collapsed || false}
|
||||
unread={Unread.doesRoomHaveUnreadMessages(room)}
|
||||
highlight={room.getUnreadNotificationCount('highlight') > 0 || this.props.isInvite}
|
||||
notificationCount={room.getUnreadNotificationCount()}
|
||||
isInvite={this.props.isInvite}
|
||||
refreshSubList={this._updateSubListCount}
|
||||
incomingCall={null}
|
||||
onClick={this.onRoomTileClick}
|
||||
/>;
|
||||
},
|
||||
|
||||
_onNotifBadgeClick: function(e) {
|
||||
|
@ -270,6 +271,29 @@ const RoomSubList = React.createClass({
|
|||
if (this.refs.subList) {
|
||||
this.refs.subList.style.height = `${height}px`;
|
||||
}
|
||||
this._updateLazyRenderHeight(height);
|
||||
},
|
||||
|
||||
_updateLazyRenderHeight: function(height) {
|
||||
this.setState({scrollerHeight: height});
|
||||
},
|
||||
|
||||
_onScroll: function() {
|
||||
this.setState({scrollTop: this.refs.scroller.getScrollTop()});
|
||||
},
|
||||
|
||||
_getRenderItems: function() {
|
||||
// try our best to not create a new array
|
||||
// because LazyRenderList rerender when the items prop
|
||||
// is not the same object as the previous value
|
||||
const {list, extraTiles} = this.props;
|
||||
if (!extraTiles || !extraTiles.length) {
|
||||
return list;
|
||||
}
|
||||
if (!list || list.length) {
|
||||
return extraTiles;
|
||||
}
|
||||
return list.concat(extraTiles);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
|
@ -287,12 +311,15 @@ const RoomSubList = React.createClass({
|
|||
{this._getHeaderJsx(isCollapsed)}
|
||||
</div>;
|
||||
} else {
|
||||
const tiles = this.makeRoomTiles();
|
||||
tiles.push(...this.props.extraTiles);
|
||||
return <div ref="subList" className={subListClasses}>
|
||||
{this._getHeaderJsx(isCollapsed)}
|
||||
<IndicatorScrollbar ref="scroller" className="mx_RoomSubList_scroll">
|
||||
{ tiles }
|
||||
<IndicatorScrollbar ref="scroller" className="mx_RoomSubList_scroll" onScroll={ this._onScroll }>
|
||||
<LazyRenderList
|
||||
scrollTop={this.state.scrollTop }
|
||||
height={ this.state.scrollerHeight }
|
||||
renderItem={ this.makeRoomTile }
|
||||
itemHeight={34}
|
||||
items={this._getRenderItems()} />
|
||||
</IndicatorScrollbar>
|
||||
</div>;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import { _t } from '../../languageHandler';
|
|||
import { KeyCode } from '../../Keyboard';
|
||||
import sdk from '../../index';
|
||||
import dis from '../../dispatcher';
|
||||
import { debounce } from 'lodash';
|
||||
import { throttle } from 'lodash';
|
||||
import AccessibleButton from '../../components/views/elements/AccessibleButton';
|
||||
|
||||
module.exports = React.createClass({
|
||||
|
@ -67,9 +67,9 @@ module.exports = React.createClass({
|
|||
this.onSearch();
|
||||
},
|
||||
|
||||
onSearch: debounce(function() {
|
||||
onSearch: throttle(function() {
|
||||
this.props.onSearch(this.refs.search.value);
|
||||
}, 200, {trailing: true}),
|
||||
}, 200, {trailing: true, leading: true}),
|
||||
|
||||
_onKeyDown: function(ev) {
|
||||
switch (ev.keyCode) {
|
||||
|
|
|
@ -64,6 +64,17 @@ module.exports = React.createClass({
|
|||
|
||||
getInitialState: function() {
|
||||
const customURLsAllowed = !SdkConfig.get()['disable_custom_urls'];
|
||||
let initialPhase = PHASE_SERVER_DETAILS;
|
||||
if (
|
||||
// if we have these two, skip to the good bit
|
||||
// (they could come in from the URL params in a
|
||||
// registration email link)
|
||||
(this.props.clientSecret && this.props.sessionId) ||
|
||||
// or if custom URLs aren't allowed, skip them
|
||||
!customURLsAllowed
|
||||
) {
|
||||
initialPhase = PHASE_REGISTRATION;
|
||||
}
|
||||
|
||||
return {
|
||||
busy: false,
|
||||
|
@ -87,7 +98,7 @@ module.exports = React.createClass({
|
|||
hsUrl: this.props.customHsUrl,
|
||||
isUrl: this.props.customIsUrl,
|
||||
// Phase of the overall registration dialog.
|
||||
phase: customURLsAllowed ? PHASE_SERVER_DETAILS : PHASE_REGISTRATION,
|
||||
phase: initialPhase,
|
||||
flows: null,
|
||||
};
|
||||
},
|
||||
|
@ -111,7 +122,7 @@ module.exports = React.createClass({
|
|||
});
|
||||
},
|
||||
|
||||
onServerTypeChange(type) {
|
||||
onServerTypeChange(type, initial) {
|
||||
this.setState({
|
||||
serverType: type,
|
||||
});
|
||||
|
@ -137,9 +148,15 @@ module.exports = React.createClass({
|
|||
hsUrl: this.props.defaultHsUrl,
|
||||
isUrl: this.props.defaultIsUrl,
|
||||
});
|
||||
this.setState({
|
||||
phase: PHASE_SERVER_DETAILS,
|
||||
});
|
||||
// if this is the initial value from the control and we're
|
||||
// already in the registration phase, don't go back to the
|
||||
// server details phase (but do if it's actually a change resulting
|
||||
// from user interaction).
|
||||
if (!initial || !this.state.phase === PHASE_REGISTRATION) {
|
||||
this.setState({
|
||||
phase: PHASE_SERVER_DETAILS,
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
@ -372,9 +389,12 @@ module.exports = React.createClass({
|
|||
// If we're on a different phase, we only show the server type selector,
|
||||
// which is always shown if we allow custom URLs at all.
|
||||
if (PHASES_ENABLED && this.state.phase !== PHASE_SERVER_DETAILS) {
|
||||
// if we've been given a custom HS URL we should actually pass that, so
|
||||
// that the appropriate section is selected at the start to match the
|
||||
// homeserver URL we're using
|
||||
return <div>
|
||||
<ServerTypeSelector
|
||||
defaultHsUrl={this.props.defaultHsUrl}
|
||||
defaultHsUrl={this.props.customHsUrl || this.props.defaultHsUrl}
|
||||
onChange={this.onServerTypeChange}
|
||||
/>
|
||||
</div>;
|
||||
|
|
|
@ -90,7 +90,11 @@ export default class ServerTypeSelector extends React.PureComponent {
|
|||
selected: type,
|
||||
};
|
||||
if (onChange) {
|
||||
onChange(type);
|
||||
// FIXME: Supply a second 'initial' param here to flag that this is
|
||||
// initialising the value rather than from user interaction
|
||||
// (which sometimes we'll want to ignore). Must be a better way
|
||||
// to do this.
|
||||
onChange(type, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,11 +20,15 @@ import { _t } from '../../../languageHandler';
|
|||
import LogoutDialog from "../dialogs/LogoutDialog";
|
||||
import Modal from "../../../Modal";
|
||||
import SdkConfig from '../../../SdkConfig';
|
||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||
|
||||
export class TopLeftMenu extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.viewHomePage = this.viewHomePage.bind(this);
|
||||
this.viewWelcomePage = this.viewWelcomePage.bind(this);
|
||||
this.openSettings = this.openSettings.bind(this);
|
||||
this.signIn = this.signIn.bind(this);
|
||||
this.signOut = this.signOut.bind(this);
|
||||
}
|
||||
|
||||
|
@ -41,6 +45,8 @@ export class TopLeftMenu extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const isGuest = MatrixClientPeg.get().isGuest();
|
||||
|
||||
let homePageSection = null;
|
||||
if (this.hasHomePage()) {
|
||||
homePageSection = <ul className="mx_TopLeftMenu_section">
|
||||
|
@ -48,14 +54,26 @@ export class TopLeftMenu extends React.Component {
|
|||
</ul>;
|
||||
}
|
||||
|
||||
let signInOutSection;
|
||||
if (isGuest) {
|
||||
signInOutSection = <ul className="mx_TopLeftMenu_section">
|
||||
<li className="mx_TopLeftMenu_icon_signin" onClick={this.signIn}>{_t("Sign in")}</li>
|
||||
</ul>;
|
||||
} else {
|
||||
signInOutSection = <ul className="mx_TopLeftMenu_section">
|
||||
<li className="mx_TopLeftMenu_icon_signout" onClick={this.signOut}>{_t("Sign out")}</li>
|
||||
</ul>;
|
||||
}
|
||||
|
||||
return <div className="mx_TopLeftMenu">
|
||||
{homePageSection}
|
||||
<ul className="mx_TopLeftMenu_section">
|
||||
<li className="mx_TopLeftMenu_icon_settings" onClick={this.openSettings}>{_t("Settings")}</li>
|
||||
<li className="mx_TopLeftMenu_icon_welcome" onClick={this.viewWelcomePage}>{_t("Welcome")}</li>
|
||||
</ul>
|
||||
<ul className="mx_TopLeftMenu_section">
|
||||
<li className="mx_TopLeftMenu_icon_signout" onClick={this.signOut}>{_t("Sign out")}</li>
|
||||
<li className="mx_TopLeftMenu_icon_settings" onClick={this.openSettings}>{_t("Settings")}</li>
|
||||
</ul>
|
||||
{signInOutSection}
|
||||
</div>;
|
||||
}
|
||||
|
||||
|
@ -64,11 +82,21 @@ export class TopLeftMenu extends React.Component {
|
|||
this.closeMenu();
|
||||
}
|
||||
|
||||
viewWelcomePage() {
|
||||
dis.dispatch({action: 'view_welcome_page'});
|
||||
this.closeMenu();
|
||||
}
|
||||
|
||||
openSettings() {
|
||||
dis.dispatch({action: 'view_user_settings'});
|
||||
this.closeMenu();
|
||||
}
|
||||
|
||||
signIn() {
|
||||
dis.dispatch({action: 'start_login'});
|
||||
this.closeMenu();
|
||||
}
|
||||
|
||||
signOut() {
|
||||
Modal.createTrackedDialog('Logout E2E Export', '', LogoutDialog);
|
||||
this.closeMenu();
|
||||
|
|
97
src/components/views/elements/LazyRenderList.js
Normal file
97
src/components/views/elements/LazyRenderList.js
Normal file
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
Copyright 2019 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
|
||||
const OVERFLOW_ITEMS = 20;
|
||||
const OVERFLOW_MARGIN = 5;
|
||||
|
||||
class ItemRange {
|
||||
constructor(topCount, renderCount, bottomCount) {
|
||||
this.topCount = topCount;
|
||||
this.renderCount = renderCount;
|
||||
this.bottomCount = bottomCount;
|
||||
}
|
||||
|
||||
contains(range) {
|
||||
return range.topCount >= this.topCount &&
|
||||
(range.topCount + range.renderCount) <= (this.topCount + this.renderCount);
|
||||
}
|
||||
|
||||
expand(amount) {
|
||||
const topGrow = Math.min(amount, this.topCount);
|
||||
const bottomGrow = Math.min(amount, this.bottomCount);
|
||||
return new ItemRange(
|
||||
this.topCount - topGrow,
|
||||
this.renderCount + topGrow + bottomGrow,
|
||||
this.bottomCount - bottomGrow,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default class LazyRenderList extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const renderRange = LazyRenderList.getVisibleRangeFromProps(props).expand(OVERFLOW_ITEMS);
|
||||
this.state = {renderRange};
|
||||
}
|
||||
|
||||
static getVisibleRangeFromProps(props) {
|
||||
const {items, itemHeight, scrollTop, height} = props;
|
||||
const length = items ? items.length : 0;
|
||||
const topCount = Math.max(0, Math.floor(scrollTop / itemHeight));
|
||||
const itemsAfterTop = length - topCount;
|
||||
const renderCount = Math.min(Math.ceil(height / itemHeight), itemsAfterTop);
|
||||
const bottomCount = itemsAfterTop - renderCount;
|
||||
return new ItemRange(topCount, renderCount, bottomCount);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(props) {
|
||||
const state = this.state;
|
||||
const range = LazyRenderList.getVisibleRangeFromProps(props);
|
||||
const intersectRange = range.expand(OVERFLOW_MARGIN);
|
||||
|
||||
const prevSize = this.props.items ? this.props.items.length : 0;
|
||||
const listHasChangedSize = props.items.length !== prevSize;
|
||||
// only update renderRange if the list has shrunk/grown and we need to adjust padding or
|
||||
// if the new range isn't contained by the old anymore
|
||||
if (listHasChangedSize || !state.renderRange || !state.renderRange.contains(intersectRange)) {
|
||||
this.setState({renderRange: range.expand(OVERFLOW_ITEMS)});
|
||||
}
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
const itemsChanged = nextProps.items !== this.props.items;
|
||||
const rangeChanged = nextState.renderRange !== this.state.renderRange;
|
||||
return itemsChanged || rangeChanged;
|
||||
}
|
||||
|
||||
render() {
|
||||
const {itemHeight, items, renderItem} = this.props;
|
||||
|
||||
const {renderRange} = this.state;
|
||||
const paddingTop = renderRange.topCount * itemHeight;
|
||||
const paddingBottom = renderRange.bottomCount * itemHeight;
|
||||
const renderedItems = (items || []).slice(
|
||||
renderRange.topCount,
|
||||
renderRange.topCount + renderRange.renderCount,
|
||||
);
|
||||
|
||||
return (<div style={{paddingTop: `${paddingTop}px`, paddingBottom: `${paddingBottom}px`}}>
|
||||
{ renderedItems.map(renderItem) }
|
||||
</div>);
|
||||
}
|
||||
}
|
|
@ -24,7 +24,6 @@ import ScalarMessaging from '../../../ScalarMessaging';
|
|||
import Modal from "../../../Modal";
|
||||
import { _t } from '../../../languageHandler';
|
||||
import AccessibleButton from './AccessibleButton';
|
||||
import TintableSvg from './TintableSvg';
|
||||
|
||||
export default class ManageIntegsButton extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -76,6 +75,7 @@ export default class ManageIntegsButton extends React.Component {
|
|||
if (this.scalarClient !== null) {
|
||||
const integrationsButtonClasses = classNames({
|
||||
mx_RoomHeader_button: true,
|
||||
mx_RoomHeader_manageIntegsButton: true,
|
||||
mx_ManageIntegsButton_error: !!this.state.scalarError,
|
||||
});
|
||||
|
||||
|
@ -94,8 +94,10 @@ export default class ManageIntegsButton extends React.Component {
|
|||
}
|
||||
|
||||
integrationsButton = (
|
||||
<AccessibleButton className={integrationsButtonClasses} onClick={this.onManageIntegrations} title={_t('Manage Integrations')}>
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/grid.svg")} width="20" height="20" />
|
||||
<AccessibleButton className={integrationsButtonClasses}
|
||||
onClick={this.onManageIntegrations}
|
||||
title={_t('Manage Integrations')}
|
||||
>
|
||||
{ integrationsWarningTriangle }
|
||||
{ integrationsErrorPopup }
|
||||
</AccessibleButton>
|
||||
|
|
|
@ -65,12 +65,14 @@ export default class GroupHeaderButtons extends HeaderButtons {
|
|||
];
|
||||
|
||||
return [
|
||||
<HeaderButton key="_groupMembersButton" title={_t('Members')} iconSrc={require("../../../../res/img/icons-people.svg")}
|
||||
<HeaderButton key="groupMembersButton" name="groupMembersButton"
|
||||
title={_t('Members')}
|
||||
isHighlighted={this.isPhase(groupPhases)}
|
||||
clickPhase={RightPanel.Phase.GroupMemberList}
|
||||
analytics={['Right Panel', 'Group Member List Button', 'click']}
|
||||
/>,
|
||||
<HeaderButton key="_roomsButton" title={_t('Rooms')} iconSrc={require("../../../../res/img/icons-room-nobg.svg")}
|
||||
<HeaderButton key="roomsButton" name="roomsButton"
|
||||
title={_t('Rooms')}
|
||||
isHighlighted={this.isPhase(roomPhases)}
|
||||
clickPhase={RightPanel.Phase.GroupRoomList}
|
||||
analytics={['Right Panel', 'Group Room List Button', 'click']}
|
||||
|
|
|
@ -23,7 +23,6 @@ import classNames from 'classnames';
|
|||
import dis from '../../../dispatcher';
|
||||
import Analytics from '../../../Analytics';
|
||||
import AccessibleButton from '../elements/AccessibleButton';
|
||||
import TintableSvg from '../elements/TintableSvg';
|
||||
|
||||
export default class HeaderButton extends React.Component {
|
||||
constructor() {
|
||||
|
@ -44,6 +43,7 @@ export default class HeaderButton extends React.Component {
|
|||
const classes = classNames({
|
||||
mx_RightPanel_headerButton: true,
|
||||
mx_RightPanel_headerButton_highlight: this.props.isHighlighted,
|
||||
[`mx_RightPanel_${this.props.name}`]: true,
|
||||
});
|
||||
|
||||
return <AccessibleButton
|
||||
|
@ -51,9 +51,8 @@ export default class HeaderButton extends React.Component {
|
|||
aria-expanded={this.props.isHighlighted}
|
||||
title={this.props.title}
|
||||
className={classes}
|
||||
onClick={this.onClick} >
|
||||
<TintableSvg src={this.props.iconSrc} width="20" height="20" />
|
||||
</AccessibleButton>;
|
||||
onClick={this.onClick}>
|
||||
</AccessibleButton>;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,14 +61,14 @@ HeaderButton.propTypes = {
|
|||
isHighlighted: PropTypes.bool.isRequired,
|
||||
// The phase to swap to when the button is clicked
|
||||
clickPhase: PropTypes.string.isRequired,
|
||||
// The source file of the icon to display
|
||||
iconSrc: PropTypes.string.isRequired,
|
||||
|
||||
// The badge to display above the icon
|
||||
badge: PropTypes.node,
|
||||
// The parameters to track the click event
|
||||
analytics: PropTypes.arrayOf(PropTypes.string).isRequired,
|
||||
|
||||
// Button name
|
||||
name: PropTypes.string.isRequired,
|
||||
// Button title
|
||||
title: PropTypes.string.isRequired,
|
||||
};
|
||||
|
|
|
@ -88,7 +88,7 @@ export default class HeaderButtons extends React.Component {
|
|||
|
||||
render() {
|
||||
// inline style as this will be swapped around in future commits
|
||||
return <div style={{display: 'flex'}}>
|
||||
return <div className="mx_HeaderButtons">
|
||||
{ this.renderButtons() }
|
||||
</div>;
|
||||
}
|
||||
|
|
|
@ -52,17 +52,20 @@ export default class RoomHeaderButtons extends HeaderButtons {
|
|||
];
|
||||
|
||||
return [
|
||||
<HeaderButton key="_membersButton" title={_t('Members')} iconSrc={require("../../../../res/img/feather-icons/user.svg")}
|
||||
<HeaderButton key="membersButton" name="membersButton"
|
||||
title={_t('Members')}
|
||||
isHighlighted={this.isPhase(membersPhases)}
|
||||
clickPhase={RightPanel.Phase.RoomMemberList}
|
||||
analytics={['Right Panel', 'Member List Button', 'click']}
|
||||
/>,
|
||||
<HeaderButton key="_filesButton" title={_t('Files')} iconSrc={require("../../../../res/img/feather-icons/files.svg")}
|
||||
<HeaderButton key="filesButton" name="filesButton"
|
||||
title={_t('Files')}
|
||||
isHighlighted={this.isPhase(RightPanel.Phase.FilePanel)}
|
||||
clickPhase={RightPanel.Phase.FilePanel}
|
||||
analytics={['Right Panel', 'File List Button', 'click']}
|
||||
/>,
|
||||
<HeaderButton key="_notifsButton" title={_t('Notifications')} iconSrc={require("../../../../res/img/feather-icons/notifications.svg")}
|
||||
<HeaderButton key="notifsButton" name="notifsButton"
|
||||
title={_t('Notifications')}
|
||||
isHighlighted={this.isPhase(RightPanel.Phase.NotificationPanel)}
|
||||
clickPhase={RightPanel.Phase.NotificationPanel}
|
||||
analytics={['Right Panel', 'Notification List Button', 'click']}
|
||||
|
|
|
@ -306,7 +306,6 @@ export default class MessageComposer extends React.Component {
|
|||
render() {
|
||||
const uploadInputStyle = {display: 'none'};
|
||||
const MemberStatusMessageAvatar = sdk.getComponent('avatars.MemberStatusMessageAvatar');
|
||||
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
||||
const MessageComposerInput = sdk.getComponent("rooms.MessageComposerInput");
|
||||
|
||||
const controls = [];
|
||||
|
@ -335,17 +334,26 @@ export default class MessageComposer extends React.Component {
|
|||
// Call buttons
|
||||
if (this.props.callState && this.props.callState !== 'ended') {
|
||||
hangupButton =
|
||||
<AccessibleButton key="controls_hangup" className="mx_MessageComposer_hangup" onClick={this.onHangupClick}>
|
||||
<img src={require("../../../../res/img/hangup.svg")} alt={_t('Hangup')} title={_t('Hangup')} width="25" height="25" />
|
||||
<AccessibleButton className="mx_MessageComposer_button mx_MessageComposer_hangup"
|
||||
key="controls_hangup"
|
||||
onClick={this.onHangupClick}
|
||||
title={_t('Hangup')}
|
||||
>
|
||||
</AccessibleButton>;
|
||||
} else {
|
||||
callButton =
|
||||
<AccessibleButton key="controls_call" className="mx_MessageComposer_voicecall" onClick={this.onVoiceCallClick} title={_t('Voice call')}>
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/phone.svg")} width="20" height="20" />
|
||||
<AccessibleButton className="mx_MessageComposer_button mx_MessageComposer_voicecall"
|
||||
key="controls_call"
|
||||
onClick={this.onVoiceCallClick}
|
||||
title={_t('Voice call')}
|
||||
>
|
||||
</AccessibleButton>;
|
||||
videoCallButton =
|
||||
<AccessibleButton key="controls_videocall" className="mx_MessageComposer_videocall" onClick={this.onCallClick} title={_t('Video call')}>
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/video.svg")} width="20" height="20" />
|
||||
<AccessibleButton className="mx_MessageComposer_button mx_MessageComposer_videocall"
|
||||
key="controls_videocall"
|
||||
onClick={this.onCallClick}
|
||||
title={_t('Video call')}
|
||||
>
|
||||
</AccessibleButton>;
|
||||
}
|
||||
|
||||
|
@ -385,9 +393,11 @@ export default class MessageComposer extends React.Component {
|
|||
// check separately for whether we can call, but this is slightly
|
||||
// complex because of conference calls.
|
||||
const uploadButton = (
|
||||
<AccessibleButton key="controls_upload" className="mx_MessageComposer_upload"
|
||||
onClick={this.onUploadClick} title={_t('Upload file')}>
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/paperclip.svg")} width="20" height="20" />
|
||||
<AccessibleButton className="mx_MessageComposer_button mx_MessageComposer_upload"
|
||||
key="controls_upload"
|
||||
onClick={this.onUploadClick}
|
||||
title={_t('Upload file')}
|
||||
>
|
||||
<input ref="uploadInput" type="file"
|
||||
style={uploadInputStyle}
|
||||
multiple
|
||||
|
|
|
@ -154,7 +154,6 @@ module.exports = React.createClass({
|
|||
|
||||
render: function() {
|
||||
const RoomAvatar = sdk.getComponent("avatars.RoomAvatar");
|
||||
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
||||
const EmojiText = sdk.getComponent('elements.EmojiText');
|
||||
|
||||
let searchStatus = null;
|
||||
|
@ -228,8 +227,10 @@ module.exports = React.createClass({
|
|||
|
||||
if (this.props.onSettingsClick) {
|
||||
settingsButton =
|
||||
<AccessibleButton className="mx_RoomHeader_button" onClick={this.props.onSettingsClick} title={_t("Settings")}>
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/settings.svg")} width="20" height="20" />
|
||||
<AccessibleButton className="mx_RoomHeader_button mx_RoomHeader_settingsButton"
|
||||
onClick={this.props.onSettingsClick}
|
||||
title={_t("Settings")}
|
||||
>
|
||||
</AccessibleButton>;
|
||||
}
|
||||
|
||||
|
@ -245,7 +246,6 @@ module.exports = React.createClass({
|
|||
<AccessibleButton className="mx_RoomHeader_button mx_RoomHeader_pinnedButton"
|
||||
onClick={this.props.onPinnedClick} title={_t("Pinned Messages")}>
|
||||
{ pinsIndicator }
|
||||
<TintableSvg src={require("../../../../res/img/icons-pin.svg")} width="16" height="16" />
|
||||
</AccessibleButton>;
|
||||
}
|
||||
|
||||
|
@ -260,24 +260,30 @@ module.exports = React.createClass({
|
|||
let forgetButton;
|
||||
if (this.props.onForgetClick) {
|
||||
forgetButton =
|
||||
<AccessibleButton className="mx_RoomHeader_button" onClick={this.props.onForgetClick} title={_t("Forget room")}>
|
||||
<TintableSvg src={require("../../../../res/img/leave.svg")} width="26" height="20" />
|
||||
<AccessibleButton className="mx_RoomHeader_button mx_RoomHeader_forgetButton"
|
||||
onClick={this.props.onForgetClick}
|
||||
title={_t("Forget room")}
|
||||
>
|
||||
</AccessibleButton>;
|
||||
}
|
||||
|
||||
let searchButton;
|
||||
if (this.props.onSearchClick && this.props.inRoom) {
|
||||
searchButton =
|
||||
<AccessibleButton className="mx_RoomHeader_button" onClick={this.props.onSearchClick} title={_t("Search")}>
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/search.svg")} width="20" height="20" />
|
||||
<AccessibleButton className="mx_RoomHeader_button mx_RoomHeader_searchButton"
|
||||
onClick={this.props.onSearchClick}
|
||||
title={_t("Search")}
|
||||
>
|
||||
</AccessibleButton>;
|
||||
}
|
||||
|
||||
let shareRoomButton;
|
||||
if (this.props.inRoom) {
|
||||
shareRoomButton =
|
||||
<AccessibleButton className="mx_RoomHeader_button" onClick={this.onShareRoomClick} title={_t('Share room')}>
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/share.svg")} width="20" height="20" />
|
||||
<AccessibleButton className="mx_RoomHeader_button mx_RoomHeader_shareButton"
|
||||
onClick={this.onShareRoomClick}
|
||||
title={_t('Share room')}
|
||||
>
|
||||
</AccessibleButton>;
|
||||
}
|
||||
|
||||
|
|
|
@ -322,7 +322,6 @@ export default class Stickerpicker extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
||||
const ContextualMenu = sdk.getComponent('structures.ContextualMenu');
|
||||
const GenericElementContextMenu = sdk.getComponent('context_menus.GenericElementContextMenu');
|
||||
let stickersButton;
|
||||
|
@ -348,11 +347,11 @@ export default class Stickerpicker extends React.Component {
|
|||
<AccessibleButton
|
||||
id='stickersButton'
|
||||
key="controls_hide_stickers"
|
||||
className="mx_MessageComposer_stickers mx_Stickers_hideStickers"
|
||||
className="mx_MessageComposer_button mx_MessageComposer_stickers mx_Stickers_hideStickers"
|
||||
onClick={this._onHideStickersClick}
|
||||
ref='target'
|
||||
title={_t("Hide Stickers")}>
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/face.svg")} width="20" height="20" />
|
||||
title={_t("Hide Stickers")}
|
||||
>
|
||||
</AccessibleButton>;
|
||||
} else {
|
||||
// Show show-stickers button
|
||||
|
@ -360,10 +359,10 @@ export default class Stickerpicker extends React.Component {
|
|||
<AccessibleButton
|
||||
id='stickersButton'
|
||||
key="controls_show_stickers"
|
||||
className="mx_MessageComposer_stickers"
|
||||
className="mx_MessageComposer_button mx_MessageComposer_stickers"
|
||||
onClick={this._onShowStickersClick}
|
||||
title={_t("Show Stickers")}>
|
||||
<TintableSvg src={require("../../../../res/img/feather-icons/face.svg")} width="20" height="20" />
|
||||
title={_t("Show Stickers")}
|
||||
>
|
||||
</AccessibleButton>;
|
||||
}
|
||||
return <div>
|
||||
|
|
|
@ -42,7 +42,7 @@ export default class KeyBackupPanel extends React.PureComponent {
|
|||
}
|
||||
|
||||
componentWillMount() {
|
||||
this._loadBackupStatus();
|
||||
this._checkKeyBackupStatus();
|
||||
|
||||
MatrixClientPeg.get().on('crypto.keyBackupStatus', this._onKeyBackupStatus);
|
||||
MatrixClientPeg.get().on(
|
||||
|
@ -70,9 +70,32 @@ export default class KeyBackupPanel extends React.PureComponent {
|
|||
}
|
||||
|
||||
_onKeyBackupStatus() {
|
||||
// This just loads the current backup status rather than forcing
|
||||
// a re-check otherwise we risk causing infinite loops
|
||||
this._loadBackupStatus();
|
||||
}
|
||||
|
||||
async _checkKeyBackupStatus() {
|
||||
try {
|
||||
const {backupInfo, trustInfo} = await MatrixClientPeg.get().checkKeyBackup();
|
||||
this.setState({
|
||||
backupInfo,
|
||||
backupSigStatus: trustInfo,
|
||||
error: null,
|
||||
loading: false,
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("Unable to fetch check backup status", e);
|
||||
if (this._unmounted) return;
|
||||
this.setState({
|
||||
error: e,
|
||||
backupInfo: null,
|
||||
backupSigStatus: null,
|
||||
loading: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async _loadBackupStatus() {
|
||||
this.setState({loading: true});
|
||||
try {
|
||||
|
@ -80,6 +103,7 @@ export default class KeyBackupPanel extends React.PureComponent {
|
|||
const backupSigStatus = await MatrixClientPeg.get().isKeyBackupTrusted(backupInfo);
|
||||
if (this._unmounted) return;
|
||||
this.setState({
|
||||
error: null,
|
||||
backupInfo,
|
||||
backupSigStatus,
|
||||
loading: false,
|
||||
|
@ -89,9 +113,10 @@ export default class KeyBackupPanel extends React.PureComponent {
|
|||
if (this._unmounted) return;
|
||||
this.setState({
|
||||
error: e,
|
||||
backupInfo: null,
|
||||
backupSigStatus: null,
|
||||
loading: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ export default class GeneralUserSettingsTab extends React.Component {
|
|||
if (this.state.theme === newTheme) return;
|
||||
|
||||
SettingsStore.setValue("theme", null, SettingLevel.ACCOUNT, newTheme);
|
||||
this.setState({theme: newTheme});
|
||||
dis.dispatch({action: 'set_theme', value: newTheme});
|
||||
};
|
||||
|
||||
|
@ -138,17 +139,14 @@ export default class GeneralUserSettingsTab extends React.Component {
|
|||
}
|
||||
|
||||
_renderThemeSection() {
|
||||
// TODO: Re-enable theme selection once the themes actually work
|
||||
const SettingsFlag = sdk.getComponent("views.elements.SettingsFlag");
|
||||
return (
|
||||
<div className="mx_SettingsTab_section mx_GeneralUserSettingsTab_themeSection">
|
||||
<span className="mx_SettingsTab_subheading">{_t("Theme")}</span>
|
||||
<Field id="theme" label={_t("Theme")} element="select" disabled={true}
|
||||
<Field id="theme" label={_t("Theme")} element="select"
|
||||
value={this.state.theme} onChange={this._onThemeChange}>
|
||||
<option value="light">{_t("Light theme")}</option>
|
||||
<option value="light">{_t("Default theme")}</option>
|
||||
<option value="dark">{_t("Dark theme")}</option>
|
||||
<option value="dharma">{_t("2018 theme")}</option>
|
||||
<option value="status">{_t("Status.im theme")}</option>
|
||||
</Field>
|
||||
<SettingsFlag name="useCompactLayout" level={SettingLevel.ACCOUNT} />
|
||||
</div>
|
||||
|
@ -164,7 +162,7 @@ export default class GeneralUserSettingsTab extends React.Component {
|
|||
{_t("Deactivating your account is a permanent action - be careful!")}
|
||||
</span>
|
||||
<AccessibleButton onClick={this._onDeactivateClicked} kind="danger">
|
||||
{_t("Close Account")}
|
||||
{_t("Deactivate Account")}
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -174,7 +174,7 @@ export default class VoiceSettingsTab extends React.Component {
|
|||
{microphoneDropdown}
|
||||
{webcamDropdown}
|
||||
<SettingsFlag name='VideoView.flipVideoHorizontally' level={SettingLevel.ACCOUNT} />
|
||||
<SettingsFlag name='webRtcForcePeerToPeer' level={SettingLevel.DEVICE} onChange={this._changeWebRtcMethod} />
|
||||
<SettingsFlag name='webRtcAllowPeerToPeer' level={SettingLevel.DEVICE} onChange={this._changeWebRtcMethod} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -1515,7 +1515,7 @@
|
|||
"2018 theme": "Тема 2018",
|
||||
"Account management": "Управление на акаунта",
|
||||
"Deactivating your account is a permanent action - be careful!": "Деактивирането на акаунта е необратимо действие - внимавайте!",
|
||||
"Close Account": "Затвори акаунта",
|
||||
"Deactivate Account": "Затвори акаунта",
|
||||
"For help with using Riot, click <a>here</a>.": "За помощ при използването на Riot, кликнете <a>тук</a>.",
|
||||
"For help with using Riot, click <a>here</a> or start a chat with our bot using the button below.": "За помощ при използването на Riot, кликнете <a>тук</a> или започнете чат с бота ни използвайки бутона по-долу.",
|
||||
"Chat with Riot Bot": "Чати с Riot Bot",
|
||||
|
|
|
@ -1516,7 +1516,7 @@
|
|||
"Theme": "Design",
|
||||
"2018 theme": "2018 Design",
|
||||
"Account management": "Benutzerkontenverwaltung",
|
||||
"Close Account": "Benutzerkonto schließen",
|
||||
"Deactivate Account": "Benutzerkonto schließen",
|
||||
"For help with using Riot, click <a>here</a>.": "Um Hilfe zur Benutzung von Riot zu erhalten, klicke <a>hier</a>.",
|
||||
"For help with using Riot, click <a>here</a> or start a chat with our bot using the button below.": "Um Hilfe zur Benutzung von Riot zu erhalten, klicke <a>hier</a> oder beginne einen Chat mit unserem Bot, indem du den unteren Button klickst.",
|
||||
"Chat with Riot Bot": "Chatte mit dem Riot Bot",
|
||||
|
|
|
@ -292,7 +292,7 @@
|
|||
"Automatically replace plain text Emoji": "Automatically replace plain text Emoji",
|
||||
"Mirror local video feed": "Mirror local video feed",
|
||||
"Enable Community Filter Panel": "Enable Community Filter Panel",
|
||||
"Disable Peer-to-Peer for 1:1 calls": "Disable Peer-to-Peer for 1:1 calls",
|
||||
"Allow Peer-to-Peer for 1:1 calls": "Allow Peer-to-Peer for 1:1 calls",
|
||||
"Send analytics data": "Send analytics data",
|
||||
"Never send encrypted messages to unverified devices from this device": "Never send encrypted messages to unverified devices from this device",
|
||||
"Never send encrypted messages to unverified devices in this room from this device": "Never send encrypted messages to unverified devices in this room from this device",
|
||||
|
@ -522,13 +522,11 @@
|
|||
"Phone numbers": "Phone numbers",
|
||||
"Language and region": "Language and region",
|
||||
"Theme": "Theme",
|
||||
"Light theme": "Light theme",
|
||||
"Default theme": "Default theme",
|
||||
"Dark theme": "Dark theme",
|
||||
"2018 theme": "2018 theme",
|
||||
"Status.im theme": "Status.im theme",
|
||||
"Account management": "Account management",
|
||||
"Deactivating your account is a permanent action - be careful!": "Deactivating your account is a permanent action - be careful!",
|
||||
"Close Account": "Close Account",
|
||||
"Deactivate Account": "Deactivate Account",
|
||||
"Legal": "Legal",
|
||||
"For help with using Riot, click <a>here</a>.": "For help with using Riot, click <a>here</a>.",
|
||||
"For help with using Riot, click <a>here</a> or start a chat with our bot using the button below.": "For help with using Riot, click <a>here</a> or start a chat with our bot using the button below.",
|
||||
|
@ -1053,7 +1051,6 @@
|
|||
"Continue With Encryption Disabled": "Continue With Encryption Disabled",
|
||||
"Unknown error": "Unknown error",
|
||||
"Incorrect password": "Incorrect password",
|
||||
"Deactivate Account": "Deactivate Account",
|
||||
"This will make your account permanently unusable. You will not be able to log in, and no one will be able to re-register the same user ID. This will cause your account to leave all rooms it is participating in, and it will remove your account details from your identity server. <b>This action is irreversible.</b>": "This will make your account permanently unusable. You will not be able to log in, and no one will be able to re-register the same user ID. This will cause your account to leave all rooms it is participating in, and it will remove your account details from your identity server. <b>This action is irreversible.</b>",
|
||||
"Deactivating your account <b>does not by default cause us to forget messages you have sent.</b> If you would like us to forget your messages, please tick the box below.": "Deactivating your account <b>does not by default cause us to forget messages you have sent.</b> If you would like us to forget your messages, please tick the box below.",
|
||||
"Message visibility in Matrix is similar to email. Our forgetting your messages means that messages you have sent will not be shared with any new or unregistered users, but registered users who already have access to these messages will still have access to their copy.": "Message visibility in Matrix is similar to email. Our forgetting your messages means that messages you have sent will not be shared with any new or unregistered users, but registered users who already have access to these messages will still have access to their copy.",
|
||||
|
@ -1205,6 +1202,7 @@
|
|||
"Quote": "Quote",
|
||||
"Source URL": "Source URL",
|
||||
"Collapse Reply Thread": "Collapse Reply Thread",
|
||||
"End-to-end encryption information": "End-to-end encryption information",
|
||||
"Failed to set Direct Message status of room": "Failed to set Direct Message status of room",
|
||||
"unknown error code": "unknown error code",
|
||||
"Failed to forget room %(errCode)s": "Failed to forget room %(errCode)s",
|
||||
|
@ -1222,6 +1220,8 @@
|
|||
"Set a new status...": "Set a new status...",
|
||||
"View Community": "View Community",
|
||||
"Hide": "Hide",
|
||||
"Sign in": "Sign in",
|
||||
"Welcome": "Welcome",
|
||||
"Login": "Login",
|
||||
"powered by Matrix": "powered by Matrix",
|
||||
"Robot check is currently unavailable on desktop - please use a <a>web browser</a>": "Robot check is currently unavailable on desktop - please use a <a>web browser</a>",
|
||||
|
@ -1252,7 +1252,6 @@
|
|||
"Username": "Username",
|
||||
"Mobile phone number": "Mobile phone number",
|
||||
"Not sure of your password? <a>Set a new one</a>": "Not sure of your password? <a>Set a new one</a>",
|
||||
"Sign in": "Sign in",
|
||||
"Sign in to %(serverName)s": "Sign in to %(serverName)s",
|
||||
"Change": "Change",
|
||||
"Sign in with": "Sign in with",
|
||||
|
@ -1475,7 +1474,6 @@
|
|||
"unencrypted": "unencrypted",
|
||||
"Decryption error": "Decryption error",
|
||||
"Session ID": "Session ID",
|
||||
"End-to-end encryption information": "End-to-end encryption information",
|
||||
"Event information": "Event information",
|
||||
"Sender device information": "Sender device information",
|
||||
"Passphrases must match": "Passphrases must match",
|
||||
|
@ -1536,7 +1534,6 @@
|
|||
"If you didn't set the new recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "If you didn't set the new recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.",
|
||||
"This device is encrypting history using the new recovery method.": "This device is encrypting history using the new recovery method.",
|
||||
"Go to Settings": "Go to Settings",
|
||||
"Setting up Secure Messages on this device will re-encrypt this device's message history with the new recovery method.": "Setting up Secure Messages on this device will re-encrypt this device's message history with the new recovery method.",
|
||||
"Set up Secure Messages": "Set up Secure Messages",
|
||||
"Recovery Method Removed": "Recovery Method Removed",
|
||||
"This device has detected that your recovery passphrase and key for Secure Messages have been removed.": "This device has detected that your recovery passphrase and key for Secure Messages have been removed.",
|
||||
|
|
|
@ -1586,7 +1586,7 @@
|
|||
"2018 theme": "2018ko itxura",
|
||||
"Account management": "Kontuen kudeaketa",
|
||||
"Deactivating your account is a permanent action - be careful!": "Kontua desgaitzea behin betiko ekintza bat da, kontuz ibili!",
|
||||
"Close Account": "Itxi kontua",
|
||||
"Deactivate Account": "Itxi kontua",
|
||||
"For help with using Riot, click <a>here</a>.": "Riot erabiltzeko laguntza behar baduzu, egin klik <a>hemen</a>.",
|
||||
"For help with using Riot, click <a>here</a> or start a chat with our bot using the button below.": "Riot erabiltzeko laguntza behar baduzu, egin klik <a>hemen</a> edo hasi txat bat gure botarekin beheko botoia sakatuz.",
|
||||
"Chat with Riot Bot": "Txateatu Riot botarekin",
|
||||
|
|
|
@ -1526,7 +1526,7 @@
|
|||
"2018 theme": "Thème 2018",
|
||||
"Account management": "Gestion du compte",
|
||||
"Deactivating your account is a permanent action - be careful!": "La désactivation du compte est une action permanente. Soyez prudent !",
|
||||
"Close Account": "Fermer le compte",
|
||||
"Deactivate Account": "Fermer le compte",
|
||||
"For help with using Riot, click <a>here</a>.": "Pour obtenir de l'aide sur l'utilisation de Riot, cliquez <a>ici</a>.",
|
||||
"For help with using Riot, click <a>here</a> or start a chat with our bot using the button below.": "Pour obtenir de l'aide sur l'utilisation de Riot, cliquez <a>ici</a> ou commencez une discussion avec notre bot en utilisant le bouton ci-dessous.",
|
||||
"Start a chat with Riot Bot": "Commencer une discussion avec le bot Riot",
|
||||
|
|
|
@ -1525,7 +1525,7 @@
|
|||
"2018 theme": "2018-as téma",
|
||||
"Account management": "Fiók menedzsment",
|
||||
"Deactivating your account is a permanent action - be careful!": "A fiók felfüggesztése végleges - légy óvatos!",
|
||||
"Close Account": "Fiók bezárása",
|
||||
"Deactivate Account": "Fiók bezárása",
|
||||
"For help with using Riot, click <a>here</a>.": "A Riot használatában való segítséghez kattints <a>ide</a>.",
|
||||
"For help with using Riot, click <a>here</a> or start a chat with our bot using the button below.": "A Riot használatában való segítségér kattints <a>ide</a> vagy kezdj beszélgetni a botunkkal az alábbi gombra kattintva.",
|
||||
"Start a chat with Riot Bot": "Csevegés kezdése a Riot Bottal",
|
||||
|
|
|
@ -300,10 +300,10 @@
|
|||
"Add rooms to the community": "コミュニティに部屋を追加します",
|
||||
"Room name or alias": "部屋名またはエイリアス",
|
||||
"Add to community": "コミュニティに追加",
|
||||
"Failed to invite the following users to %(groupId)s:": "次のユーザーを %(groupId)s に招待できませんでした:",
|
||||
"Failed to invite the following users to %(groupId)s:": "次のユーザーを %(groupId)s に招待できませんでした:",
|
||||
"Failed to invite users to community": "ユーザーをコミュニティに招待できませんでした",
|
||||
"Failed to invite users to %(groupId)s": "ユーザーを %(groupId)s に招待できませんでした",
|
||||
"Failed to add the following rooms to %(groupId)s:": "次の部屋を %(groupId)s に追加できませんでした:",
|
||||
"Failed to add the following rooms to %(groupId)s:": "次の部屋を %(groupId)s に追加できませんでした:",
|
||||
"Riot does not have permission to send you notifications - please check your browser settings": "Riotに通知を送信する権限がありません - ブラウザの設定を確認してください",
|
||||
"Riot was not given permission to send notifications - please try again": "Riotに通知を送信する権限がありませんでした。もう一度お試しください",
|
||||
"Unable to enable Notifications": "通知を有効にできません",
|
||||
|
@ -323,7 +323,7 @@
|
|||
"Send Invites": "招待状を送る",
|
||||
"Failed to invite user": "ユーザーを招待できませんでした",
|
||||
"Failed to invite": "招待できませんでした",
|
||||
"Failed to invite the following users to the %(roomName)s room:": "次のユーザーを %(roomName)s の部屋に招待できませんでした:",
|
||||
"Failed to invite the following users to the %(roomName)s room:": "次のユーザーを %(roomName)s の部屋に招待できませんでした:",
|
||||
"You need to be logged in.": "ログインする必要があります。",
|
||||
"You need to be able to invite users to do that.": "それをするためにユーザーを招待できる必要があります。",
|
||||
"Unable to create widget.": "ウィジェットを作成できません。",
|
||||
|
@ -363,9 +363,9 @@
|
|||
"Unknown (user, device) pair:": "不明な(ユーザー、端末) ペア:",
|
||||
"Device already verified!": "端末はすでに確認済みです!",
|
||||
"WARNING: Device already verified, but keys do NOT MATCH!": "警告:端末はすでに検証済みですが、キーは一致しません!",
|
||||
"WARNING: KEY VERIFICATION FAILED! The signing key for %(userId)s and device %(deviceId)s is \"%(fprint)s\" which does not match the provided key \"%(fingerprint)s\". This could mean your communications are being intercepted!": "警告: キー確認が失敗しました! %(userId)s と端末 %(deviceId)s の署名鍵は、提供された鍵 \"%(fingerprint)s\" と一致しない \"%(fprint)s\" です。 通信が傍受されている可能性があります!",
|
||||
"WARNING: KEY VERIFICATION FAILED! The signing key for %(userId)s and device %(deviceId)s is \"%(fprint)s\" which does not match the provided key \"%(fingerprint)s\". This could mean your communications are being intercepted!": "警告: キー確認が失敗しました! %(userId)s と端末 %(deviceId)s の署名鍵は、提供された鍵 \"%(fingerprint)s\" と一致しない \"%(fprint)s\" です。 通信が傍受されている可能性があります!",
|
||||
"Verified key": "確認済みのキー",
|
||||
"The signing key you provided matches the signing key you received from %(userId)s's device %(deviceId)s. Device marked as verified.": "指定した署名鍵は、%(userId)s の端末%(deviceId)s から受け取った署名鍵と一致します。端末を検証済みとしてマークしました。",
|
||||
"The signing key you provided matches the signing key you received from %(userId)s's device %(deviceId)s. Device marked as verified.": "指定した署名鍵は、%(userId)s の端末%(deviceId)s から受け取った署名鍵と一致します。端末を検証済みとしてマークしました。",
|
||||
"Displays action": "アクションを表示",
|
||||
"Forces the current outbound group session in an encrypted room to be discarded": "暗号化されたルーム内の現在のアウトバウンドグループセッションを強制的に破棄します",
|
||||
"Unrecognised command:": "認識できないコマンド:",
|
||||
|
@ -609,7 +609,7 @@
|
|||
"Replying": "返信中",
|
||||
"Failed to set avatar.": "アバターを設定できませんでした。",
|
||||
"Save": "保存",
|
||||
"(~%(count)s results)|other": "(~%(count)s 結果)",
|
||||
"(~%(count)s results)|other": "(~%(count)s 結果)",
|
||||
"(~%(count)s results)|one": "(~%(count)s 結果)",
|
||||
"Join Room": "部屋に入る",
|
||||
"Remove avatar": "アバターを削除",
|
||||
|
@ -641,7 +641,7 @@
|
|||
"Rejoin": "再参加",
|
||||
"You have been kicked from %(roomName)s by %(userName)s.": "あなたは %(userName)s により %(roomName)s から追放されました。",
|
||||
"You have been kicked from this room by %(userName)s.": "あなたは %(userName)s によりこの部屋から追放されました。",
|
||||
"You have been banned from %(roomName)s by %(userName)s.": "あなたは %(userName)s により %(roomName)s からブロックされました。",
|
||||
"You have been banned from %(roomName)s by %(userName)s.": "あなたは %(userName)s により %(roomName)s からブロックされました。",
|
||||
"You have been banned from this room by %(userName)s.": "あなたは %(userName)s によってこの部屋からブロックされました。",
|
||||
"This room": "この部屋",
|
||||
"%(roomName)s does not exist.": "%(roomName)s は存在しません。",
|
||||
|
|
|
@ -1393,7 +1393,7 @@
|
|||
"Developer options": "Параметры разработчика",
|
||||
"General": "Основной",
|
||||
"Set a new account password...": "Установить новый пароль учетной записи...",
|
||||
"Close Account": "Закрыть аккаунт",
|
||||
"Deactivate Account": "Закрыть аккаунт",
|
||||
"Legal": "Правовой",
|
||||
"At this time it is not possible to reply with an emote.": "В настоящее время невозможно ответить с помощью эмоции.",
|
||||
"Room avatar": "Аватар комнаты",
|
||||
|
|
|
@ -1490,7 +1490,7 @@
|
|||
"2018 theme": "Temë e 2018-s",
|
||||
"Account management": "Administrim llogarish",
|
||||
"Deactivating your account is a permanent action - be careful!": "Çaktivizimi i llogarisë tuaj është një veprim i pakthyeshëm - hapni sytë!",
|
||||
"Close Account": "Mbylleni Llogarinë",
|
||||
"Deactivate Account": "Mbylleni Llogarinë",
|
||||
"For help with using Riot, click <a>here</a>.": "Për ndihmë rreth përdorimit të Riot-it, klikoni <a>këtu</a>.",
|
||||
"For help with using Riot, click <a>here</a> or start a chat with our bot using the button below.": "Për ndihmë rreth përdorimit të Riot-it, klikoni <a>këtu</a>, ose nisni një fjalosje me robotin tonë duke përdorur butonin më poshtë.",
|
||||
"Help & About": "Ndihmë & Rreth",
|
||||
|
|
|
@ -1524,7 +1524,7 @@
|
|||
"Account management": "帳號管理",
|
||||
"2018 theme": "2018 主題",
|
||||
"Deactivating your account is a permanent action - be careful!": "停用您的帳號是永久動作,請小心!",
|
||||
"Close Account": "關閉帳號",
|
||||
"Deactivate Account": "關閉帳號",
|
||||
"For help with using Riot, click <a>here</a>.": "對於使用 Riot 的說明,點選<a>這裡</a>。",
|
||||
"For help with using Riot, click <a>here</a> or start a chat with our bot using the button below.": "對於使用 Riot 的說明,點選<a>這裡</a>或是使用下面的按鈕開始與我們的機器人聊天。",
|
||||
"Chat with Riot Bot": "與 Riot 機器人聊天",
|
||||
|
|
|
@ -22,6 +22,7 @@ import {
|
|||
NotificationsEnabledController,
|
||||
} from "./controllers/NotificationControllers";
|
||||
import CustomStatusController from "./controllers/CustomStatusController";
|
||||
import ThemeController from './controllers/ThemeController';
|
||||
|
||||
// These are just a bunch of helper arrays to avoid copy/pasting a bunch of times
|
||||
const LEVELS_ROOM_SETTINGS = ['device', 'room-device', 'room-account', 'account', 'config'];
|
||||
|
@ -231,12 +232,13 @@ export const SETTINGS = {
|
|||
invertedSettingName: 'TagPanel.disableTagPanel',
|
||||
},
|
||||
"theme": {
|
||||
supportedLevels: ['config'],
|
||||
default: "dharma",
|
||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||
default: "light",
|
||||
controller: new ThemeController(),
|
||||
},
|
||||
"webRtcForcePeerToPeer": {
|
||||
"webRtcAllowPeerToPeer": {
|
||||
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
|
||||
displayName: _td('Disable Peer-to-Peer for 1:1 calls'),
|
||||
displayName: _td('Allow Peer-to-Peer for 1:1 calls'),
|
||||
default: true,
|
||||
invertedSettingName: 'webRtcForceTURN',
|
||||
},
|
||||
|
|
33
src/settings/controllers/ThemeController.js
Normal file
33
src/settings/controllers/ThemeController.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
Copyright 2019 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import SettingController from "./SettingController";
|
||||
|
||||
const SUPPORTED_THEMES = [
|
||||
"light",
|
||||
"dark",
|
||||
];
|
||||
|
||||
export default class ThemeController extends SettingController {
|
||||
getValueOverride(level, roomId, calculatedValue, calculatedAtLevel) {
|
||||
// Override in case some no longer supported theme is stored here
|
||||
if (!SUPPORTED_THEMES.includes(calculatedValue)) {
|
||||
return "light";
|
||||
}
|
||||
|
||||
return null; // no override
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
Copyright 2017 Travis Ralston
|
||||
Copyright 2019 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -27,7 +28,7 @@ export default class ConfigSettingsHandler extends SettingsHandler {
|
|||
|
||||
// Special case themes
|
||||
if (settingName === "theme") {
|
||||
return "dharma"; // config["default_theme"];
|
||||
return config["default_theme"];
|
||||
}
|
||||
|
||||
const settingsConfig = config["settingDefaults"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue