Merge remote-tracking branch 'origin/develop' into rav/megolm_backup_ui
This commit is contained in:
commit
ebe6cddd21
26 changed files with 297 additions and 232 deletions
1
.eslintignore
Normal file
1
.eslintignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
src/component-index.js
|
|
@ -20,6 +20,7 @@ module.exports = {
|
||||||
TAB: 9,
|
TAB: 9,
|
||||||
ENTER: 13,
|
ENTER: 13,
|
||||||
SHIFT: 16,
|
SHIFT: 16,
|
||||||
|
ESCAPE: 27,
|
||||||
PAGE_UP: 33,
|
PAGE_UP: 33,
|
||||||
PAGE_DOWN: 34,
|
PAGE_DOWN: 34,
|
||||||
END: 35,
|
END: 35,
|
||||||
|
|
|
@ -32,17 +32,24 @@ module.exports = {
|
||||||
return whoIsTyping;
|
return whoIsTyping;
|
||||||
},
|
},
|
||||||
|
|
||||||
whoIsTypingString: function(room) {
|
whoIsTypingString: function(room, limit) {
|
||||||
var whoIsTyping = this.usersTypingApartFromMe(room);
|
const whoIsTyping = this.usersTypingApartFromMe(room);
|
||||||
|
const othersCount = limit === undefined ?
|
||||||
|
0 : Math.max(whoIsTyping.length - limit, 0);
|
||||||
if (whoIsTyping.length == 0) {
|
if (whoIsTyping.length == 0) {
|
||||||
return null;
|
return '';
|
||||||
} else if (whoIsTyping.length == 1) {
|
} else if (whoIsTyping.length == 1) {
|
||||||
return whoIsTyping[0].name + ' is typing';
|
return whoIsTyping[0].name + ' is typing';
|
||||||
} else {
|
}
|
||||||
var names = whoIsTyping.map(function(m) {
|
const names = whoIsTyping.map(function(m) {
|
||||||
return m.name;
|
return m.name;
|
||||||
});
|
});
|
||||||
var lastPerson = names.shift();
|
if (othersCount) {
|
||||||
|
const other = ' other' + (othersCount > 1 ? 's' : '');
|
||||||
|
return names.slice(0, limit).join(', ') + ' and ' +
|
||||||
|
othersCount + other + ' are typing';
|
||||||
|
} else {
|
||||||
|
const lastPerson = names.pop();
|
||||||
return names.join(', ') + ' and ' + lastPerson + ' are typing';
|
return names.join(', ') + ' and ' + lastPerson + ' are typing';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,8 @@ import views$create_room$Presets from './components/views/create_room/Presets';
|
||||||
views$create_room$Presets && (module.exports.components['views.create_room.Presets'] = views$create_room$Presets);
|
views$create_room$Presets && (module.exports.components['views.create_room.Presets'] = views$create_room$Presets);
|
||||||
import views$create_room$RoomAlias from './components/views/create_room/RoomAlias';
|
import views$create_room$RoomAlias from './components/views/create_room/RoomAlias';
|
||||||
views$create_room$RoomAlias && (module.exports.components['views.create_room.RoomAlias'] = views$create_room$RoomAlias);
|
views$create_room$RoomAlias && (module.exports.components['views.create_room.RoomAlias'] = views$create_room$RoomAlias);
|
||||||
|
import views$dialogs$BaseDialog from './components/views/dialogs/BaseDialog';
|
||||||
|
views$dialogs$BaseDialog && (module.exports.components['views.dialogs.BaseDialog'] = views$dialogs$BaseDialog);
|
||||||
import views$dialogs$ChatInviteDialog from './components/views/dialogs/ChatInviteDialog';
|
import views$dialogs$ChatInviteDialog from './components/views/dialogs/ChatInviteDialog';
|
||||||
views$dialogs$ChatInviteDialog && (module.exports.components['views.dialogs.ChatInviteDialog'] = views$dialogs$ChatInviteDialog);
|
views$dialogs$ChatInviteDialog && (module.exports.components['views.dialogs.ChatInviteDialog'] = views$dialogs$ChatInviteDialog);
|
||||||
import views$dialogs$DeactivateAccountDialog from './components/views/dialogs/DeactivateAccountDialog';
|
import views$dialogs$DeactivateAccountDialog from './components/views/dialogs/DeactivateAccountDialog';
|
||||||
|
@ -79,8 +81,6 @@ import views$dialogs$ErrorDialog from './components/views/dialogs/ErrorDialog';
|
||||||
views$dialogs$ErrorDialog && (module.exports.components['views.dialogs.ErrorDialog'] = views$dialogs$ErrorDialog);
|
views$dialogs$ErrorDialog && (module.exports.components['views.dialogs.ErrorDialog'] = views$dialogs$ErrorDialog);
|
||||||
import views$dialogs$InteractiveAuthDialog from './components/views/dialogs/InteractiveAuthDialog';
|
import views$dialogs$InteractiveAuthDialog from './components/views/dialogs/InteractiveAuthDialog';
|
||||||
views$dialogs$InteractiveAuthDialog && (module.exports.components['views.dialogs.InteractiveAuthDialog'] = views$dialogs$InteractiveAuthDialog);
|
views$dialogs$InteractiveAuthDialog && (module.exports.components['views.dialogs.InteractiveAuthDialog'] = views$dialogs$InteractiveAuthDialog);
|
||||||
import views$dialogs$LogoutPrompt from './components/views/dialogs/LogoutPrompt';
|
|
||||||
views$dialogs$LogoutPrompt && (module.exports.components['views.dialogs.LogoutPrompt'] = views$dialogs$LogoutPrompt);
|
|
||||||
import views$dialogs$NeedToRegisterDialog from './components/views/dialogs/NeedToRegisterDialog';
|
import views$dialogs$NeedToRegisterDialog from './components/views/dialogs/NeedToRegisterDialog';
|
||||||
views$dialogs$NeedToRegisterDialog && (module.exports.components['views.dialogs.NeedToRegisterDialog'] = views$dialogs$NeedToRegisterDialog);
|
views$dialogs$NeedToRegisterDialog && (module.exports.components['views.dialogs.NeedToRegisterDialog'] = views$dialogs$NeedToRegisterDialog);
|
||||||
import views$dialogs$QuestionDialog from './components/views/dialogs/QuestionDialog';
|
import views$dialogs$QuestionDialog from './components/views/dialogs/QuestionDialog';
|
||||||
|
|
|
@ -21,6 +21,7 @@ import KeyCode from '../../KeyCode';
|
||||||
import Notifier from '../../Notifier';
|
import Notifier from '../../Notifier';
|
||||||
import PageTypes from '../../PageTypes';
|
import PageTypes from '../../PageTypes';
|
||||||
import sdk from '../../index';
|
import sdk from '../../index';
|
||||||
|
import dis from '../../dispatcher';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is what our MatrixChat shows when we are logged in. The precise view is
|
* This is what our MatrixChat shows when we are logged in. The precise view is
|
||||||
|
|
|
@ -21,8 +21,6 @@ var WhoIsTyping = require("../../WhoIsTyping");
|
||||||
var MatrixClientPeg = require("../../MatrixClientPeg");
|
var MatrixClientPeg = require("../../MatrixClientPeg");
|
||||||
const MemberAvatar = require("../views/avatars/MemberAvatar");
|
const MemberAvatar = require("../views/avatars/MemberAvatar");
|
||||||
|
|
||||||
const TYPING_AVATARS_LIMIT = 2;
|
|
||||||
|
|
||||||
const HIDE_DEBOUNCE_MS = 10000;
|
const HIDE_DEBOUNCE_MS = 10000;
|
||||||
const STATUS_BAR_HIDDEN = 0;
|
const STATUS_BAR_HIDDEN = 0;
|
||||||
const STATUS_BAR_EXPANDED = 1;
|
const STATUS_BAR_EXPANDED = 1;
|
||||||
|
@ -53,6 +51,10 @@ module.exports = React.createClass({
|
||||||
// more interesting)
|
// more interesting)
|
||||||
hasActiveCall: React.PropTypes.bool,
|
hasActiveCall: React.PropTypes.bool,
|
||||||
|
|
||||||
|
// Number of names to display in typing indication. E.g. set to 3, will
|
||||||
|
// result in "X, Y, Z and 100 others are typing."
|
||||||
|
whoIsTypingLimit: React.PropTypes.number,
|
||||||
|
|
||||||
// callback for when the user clicks on the 'resend all' button in the
|
// callback for when the user clicks on the 'resend all' button in the
|
||||||
// 'unsent messages' bar
|
// 'unsent messages' bar
|
||||||
onResendAllClick: React.PropTypes.func,
|
onResendAllClick: React.PropTypes.func,
|
||||||
|
@ -77,10 +79,19 @@ module.exports = React.createClass({
|
||||||
onVisible: React.PropTypes.func,
|
onVisible: React.PropTypes.func,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getDefaultProps: function() {
|
||||||
|
return {
|
||||||
|
whoIsTypingLimit: 2,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
return {
|
return {
|
||||||
syncState: MatrixClientPeg.get().getSyncState(),
|
syncState: MatrixClientPeg.get().getSyncState(),
|
||||||
whoisTypingString: WhoIsTyping.whoIsTypingString(this.props.room),
|
whoisTypingString: WhoIsTyping.whoIsTypingString(
|
||||||
|
this.props.room,
|
||||||
|
this.props.whoIsTypingLimit
|
||||||
|
),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -127,7 +138,10 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
onRoomMemberTyping: function(ev, member) {
|
onRoomMemberTyping: function(ev, member) {
|
||||||
this.setState({
|
this.setState({
|
||||||
whoisTypingString: WhoIsTyping.whoIsTypingString(this.props.room),
|
whoisTypingString: WhoIsTyping.whoIsTypingString(
|
||||||
|
this.props.room,
|
||||||
|
this.props.whoIsTypingLimit
|
||||||
|
),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -194,7 +208,7 @@ module.exports = React.createClass({
|
||||||
if (wantPlaceholder) {
|
if (wantPlaceholder) {
|
||||||
return (
|
return (
|
||||||
<div className="mx_RoomStatusBar_typingIndicatorAvatars">
|
<div className="mx_RoomStatusBar_typingIndicatorAvatars">
|
||||||
{this._renderTypingIndicatorAvatars(TYPING_AVATARS_LIMIT)}
|
{this._renderTypingIndicatorAvatars(this.props.whoIsTypingLimit)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -722,15 +722,11 @@ module.exports = React.createClass({
|
||||||
if (!result.displayname) {
|
if (!result.displayname) {
|
||||||
var SetDisplayNameDialog = sdk.getComponent('views.dialogs.SetDisplayNameDialog');
|
var SetDisplayNameDialog = sdk.getComponent('views.dialogs.SetDisplayNameDialog');
|
||||||
var dialog_defer = q.defer();
|
var dialog_defer = q.defer();
|
||||||
var dialog_ref;
|
|
||||||
Modal.createDialog(SetDisplayNameDialog, {
|
Modal.createDialog(SetDisplayNameDialog, {
|
||||||
currentDisplayName: result.displayname,
|
currentDisplayName: result.displayname,
|
||||||
ref: (r) => {
|
onFinished: (submitted, newDisplayName) => {
|
||||||
dialog_ref = r;
|
|
||||||
},
|
|
||||||
onFinished: (submitted) => {
|
|
||||||
if (submitted) {
|
if (submitted) {
|
||||||
cli.setDisplayName(dialog_ref.getValue()).done(() => {
|
cli.setDisplayName(newDisplayName).done(() => {
|
||||||
dialog_defer.resolve();
|
dialog_defer.resolve();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1531,6 +1527,7 @@ module.exports = React.createClass({
|
||||||
onResize={this.onChildResize}
|
onResize={this.onChildResize}
|
||||||
onVisible={this.onStatusBarVisible}
|
onVisible={this.onStatusBarVisible}
|
||||||
onHidden={this.onStatusBarHidden}
|
onHidden={this.onStatusBarHidden}
|
||||||
|
whoIsTypingLimit={2}
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ var UserSettingsStore = require('../../UserSettingsStore');
|
||||||
var GeminiScrollbar = require('react-gemini-scrollbar');
|
var GeminiScrollbar = require('react-gemini-scrollbar');
|
||||||
var Email = require('../../email');
|
var Email = require('../../email');
|
||||||
var AddThreepid = require('../../AddThreepid');
|
var AddThreepid = require('../../AddThreepid');
|
||||||
var AccessibleButton = require('../views/elements/AccessibleButton');
|
import AccessibleButton from '../views/elements/AccessibleButton';
|
||||||
|
|
||||||
// if this looks like a release, use the 'version' from package.json; else use
|
// if this looks like a release, use the 'version' from package.json; else use
|
||||||
// the git sha.
|
// the git sha.
|
||||||
|
@ -229,8 +229,26 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onLogoutClicked: function(ev) {
|
onLogoutClicked: function(ev) {
|
||||||
var LogoutPrompt = sdk.getComponent('dialogs.LogoutPrompt');
|
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
this.logoutModal = Modal.createDialog(LogoutPrompt);
|
Modal.createDialog(QuestionDialog, {
|
||||||
|
title: "Sign out?",
|
||||||
|
description:
|
||||||
|
<div>
|
||||||
|
For security, logging out will delete any end-to-end encryption keys from this browser,
|
||||||
|
making previous encrypted chat history unreadable if you log back in.
|
||||||
|
In future this <a href="https://github.com/vector-im/riot-web/issues/2108">will be improved</a>,
|
||||||
|
but for now be warned.
|
||||||
|
</div>,
|
||||||
|
button: "Sign out",
|
||||||
|
onFinished: (confirmed) => {
|
||||||
|
if (confirmed) {
|
||||||
|
dis.dispatch({action: 'logout'});
|
||||||
|
if (this.props.onFinished) {
|
||||||
|
this.props.onFinished();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onPasswordChangeError: function(err) {
|
onPasswordChangeError: function(err) {
|
||||||
|
|
|
@ -87,12 +87,28 @@ module.exports = React.createClass({
|
||||||
this.showErrorDialog("New passwords must match each other.");
|
this.showErrorDialog("New passwords must match each other.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
|
Modal.createDialog(QuestionDialog, {
|
||||||
|
title: "Warning",
|
||||||
|
description:
|
||||||
|
<div>
|
||||||
|
Resetting password will currently reset any end-to-end encryption keys on all devices,
|
||||||
|
making encrypted chat history unreadable.
|
||||||
|
In future this <a href="https://github.com/vector-im/riot-web/issues/2671">may be improved</a>,
|
||||||
|
but for now be warned.
|
||||||
|
</div>,
|
||||||
|
button: "Continue",
|
||||||
|
onFinished: (confirmed) => {
|
||||||
|
if (confirmed) {
|
||||||
this.submitPasswordReset(
|
this.submitPasswordReset(
|
||||||
this.state.enteredHomeserverUrl, this.state.enteredIdentityServerUrl,
|
this.state.enteredHomeserverUrl, this.state.enteredIdentityServerUrl,
|
||||||
this.state.email, this.state.password
|
this.state.email, this.state.password
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onInputChanged: function(stateKey, ev) {
|
onInputChanged: function(stateKey, ev) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
@ -19,7 +19,7 @@ limitations under the License.
|
||||||
var React = require('react');
|
var React = require('react');
|
||||||
var AvatarLogic = require("../../../Avatar");
|
var AvatarLogic = require("../../../Avatar");
|
||||||
import sdk from '../../../index';
|
import sdk from '../../../index';
|
||||||
var AccessibleButton = require('../elements/AccessibleButton');
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
displayName: 'BaseAvatar',
|
displayName: 'BaseAvatar',
|
||||||
|
|
72
src/components/views/dialogs/BaseDialog.js
Normal file
72
src/components/views/dialogs/BaseDialog.js
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
/*
|
||||||
|
Copyright 2017 Vector Creations 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';
|
||||||
|
|
||||||
|
import * as KeyCode from '../../../KeyCode';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basic container for modal dialogs.
|
||||||
|
*
|
||||||
|
* Includes a div for the title, and a keypress handler which cancels the
|
||||||
|
* dialog on escape.
|
||||||
|
*/
|
||||||
|
export default React.createClass({
|
||||||
|
displayName: 'BaseDialog',
|
||||||
|
|
||||||
|
propTypes: {
|
||||||
|
// onFinished callback to call when Escape is pressed
|
||||||
|
onFinished: React.PropTypes.func.isRequired,
|
||||||
|
|
||||||
|
// callback to call when Enter is pressed
|
||||||
|
onEnterPressed: React.PropTypes.func,
|
||||||
|
|
||||||
|
// CSS class to apply to dialog div
|
||||||
|
className: React.PropTypes.string,
|
||||||
|
|
||||||
|
// Title for the dialog.
|
||||||
|
// (could probably actually be something more complicated than a string if desired)
|
||||||
|
title: React.PropTypes.string.isRequired,
|
||||||
|
|
||||||
|
// children should be the content of the dialog
|
||||||
|
children: React.PropTypes.node,
|
||||||
|
},
|
||||||
|
|
||||||
|
_onKeyDown: function(e) {
|
||||||
|
if (e.keyCode === KeyCode.ESCAPE) {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
this.props.onFinished();
|
||||||
|
} else if (e.keyCode === KeyCode.ENTER) {
|
||||||
|
if (this.props.onEnterPressed) {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
this.props.onEnterPressed(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function() {
|
||||||
|
return (
|
||||||
|
<div onKeyDown={this._onKeyDown} className={this.props.className}>
|
||||||
|
<div className='mx_Dialog_title'>
|
||||||
|
{ this.props.title }
|
||||||
|
</div>
|
||||||
|
{ this.props.children }
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
|
@ -24,7 +24,7 @@ var DMRoomMap = require('../../../utils/DMRoomMap');
|
||||||
var rate_limited_func = require("../../../ratelimitedfunc");
|
var rate_limited_func = require("../../../ratelimitedfunc");
|
||||||
var dis = require("../../../dispatcher");
|
var dis = require("../../../dispatcher");
|
||||||
var Modal = require('../../../Modal');
|
var Modal = require('../../../Modal');
|
||||||
var AccessibleButton = require('../elements/AccessibleButton');
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
|
||||||
const TRUNCATE_QUERY_LIST = 40;
|
const TRUNCATE_QUERY_LIST = 40;
|
||||||
|
|
||||||
|
@ -437,7 +437,8 @@ module.exports = React.createClass({
|
||||||
<div className="mx_Dialog_title">
|
<div className="mx_Dialog_title">
|
||||||
{this.props.title}
|
{this.props.title}
|
||||||
</div>
|
</div>
|
||||||
<AccessibleButton className="mx_ChatInviteDialog_cancel" onClick={this.onCancel} >
|
<AccessibleButton className="mx_ChatInviteDialog_cancel"
|
||||||
|
onClick={this.onCancel} >
|
||||||
<TintableSvg src="img/icons-close-button.svg" width="35" height="35" />
|
<TintableSvg src="img/icons-close-button.svg" width="35" height="35" />
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
<div className="mx_ChatInviteDialog_label">
|
<div className="mx_ChatInviteDialog_label">
|
||||||
|
|
|
@ -25,9 +25,10 @@ limitations under the License.
|
||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var React = require("react");
|
import React from 'react';
|
||||||
|
import sdk from '../../../index';
|
||||||
|
|
||||||
module.exports = React.createClass({
|
export default React.createClass({
|
||||||
displayName: 'ErrorDialog',
|
displayName: 'ErrorDialog',
|
||||||
propTypes: {
|
propTypes: {
|
||||||
title: React.PropTypes.string,
|
title: React.PropTypes.string,
|
||||||
|
@ -49,20 +50,11 @@ module.exports = React.createClass({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeyDown: function(e) {
|
|
||||||
if (e.keyCode === 27) { // escape
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
this.props.onFinished(false);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||||
return (
|
return (
|
||||||
<div className="mx_ErrorDialog" onKeyDown={ this.onKeyDown }>
|
<BaseDialog className="mx_ErrorDialog" onFinished={this.props.onFinished}
|
||||||
<div className="mx_Dialog_title">
|
title={this.props.title}>
|
||||||
{this.props.title}
|
|
||||||
</div>
|
|
||||||
<div className="mx_Dialog_content">
|
<div className="mx_Dialog_content">
|
||||||
{this.props.description}
|
{this.props.description}
|
||||||
</div>
|
</div>
|
||||||
|
@ -71,7 +63,7 @@ module.exports = React.createClass({
|
||||||
{this.props.button}
|
{this.props.button}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</BaseDialog>
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -111,21 +111,10 @@ export default React.createClass({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_onKeyDown: function(e) {
|
_onEnterPressed: function(e) {
|
||||||
if (e.keyCode === 27) { // escape
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
if (!this.state.busy) {
|
|
||||||
this._onCancel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (e.keyCode === 13) { // enter
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
if (this.state.submitButtonEnabled && !this.state.busy) {
|
if (this.state.submitButtonEnabled && !this.state.busy) {
|
||||||
this._onSubmit();
|
this._onSubmit();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_onSubmit: function() {
|
_onSubmit: function() {
|
||||||
|
@ -171,6 +160,7 @@ export default React.createClass({
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
const Loader = sdk.getComponent("elements.Spinner");
|
const Loader = sdk.getComponent("elements.Spinner");
|
||||||
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||||
|
|
||||||
let error = null;
|
let error = null;
|
||||||
if (this.state.errorText) {
|
if (this.state.errorText) {
|
||||||
|
@ -200,10 +190,11 @@ export default React.createClass({
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_InteractiveAuthDialog" onKeyDown={this._onKeyDown}>
|
<BaseDialog className="mx_InteractiveAuthDialog"
|
||||||
<div className="mx_Dialog_title">
|
onEnterPressed={this._onEnterPressed}
|
||||||
{this.props.title}
|
onFinished={this.props.onFinished}
|
||||||
</div>
|
title={this.props.title}
|
||||||
|
>
|
||||||
<div className="mx_Dialog_content">
|
<div className="mx_Dialog_content">
|
||||||
<p>This operation requires additional authentication.</p>
|
<p>This operation requires additional authentication.</p>
|
||||||
{this._renderCurrentStage()}
|
{this._renderCurrentStage()}
|
||||||
|
@ -213,7 +204,7 @@ export default React.createClass({
|
||||||
{submitButton}
|
{submitButton}
|
||||||
{cancelButton}
|
{cancelButton}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</BaseDialog>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright 2015, 2016 OpenMarket 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.
|
|
||||||
*/
|
|
||||||
var React = require('react');
|
|
||||||
var dis = require("../../../dispatcher");
|
|
||||||
|
|
||||||
module.exports = React.createClass({
|
|
||||||
displayName: 'LogoutPrompt',
|
|
||||||
|
|
||||||
propTypes: {
|
|
||||||
onFinished: React.PropTypes.func,
|
|
||||||
},
|
|
||||||
|
|
||||||
logOut: function() {
|
|
||||||
dis.dispatch({action: 'logout'});
|
|
||||||
if (this.props.onFinished) {
|
|
||||||
this.props.onFinished();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
cancelPrompt: function() {
|
|
||||||
if (this.props.onFinished) {
|
|
||||||
this.props.onFinished();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onKeyDown: function(e) {
|
|
||||||
if (e.keyCode === 27) { // escape
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
this.cancelPrompt();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div className="mx_Dialog_content">
|
|
||||||
Sign out?
|
|
||||||
</div>
|
|
||||||
<div className="mx_Dialog_buttons" onKeyDown={ this.onKeyDown }>
|
|
||||||
<button className="mx_Dialog_primary" autoFocus onClick={this.logOut}>Sign Out</button>
|
|
||||||
<button onClick={this.cancelPrompt}>Cancel</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
|
@ -23,8 +23,9 @@ limitations under the License.
|
||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var React = require("react");
|
import React from 'react';
|
||||||
var dis = require("../../../dispatcher");
|
import dis from '../../../dispatcher';
|
||||||
|
import sdk from '../../../index';
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
displayName: 'NeedToRegisterDialog',
|
displayName: 'NeedToRegisterDialog',
|
||||||
|
@ -54,11 +55,12 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||||
return (
|
return (
|
||||||
<div className="mx_NeedToRegisterDialog">
|
<BaseDialog className="mx_NeedToRegisterDialog"
|
||||||
<div className="mx_Dialog_title">
|
onFinished={this.props.onFinished}
|
||||||
{this.props.title}
|
title={this.props.title}
|
||||||
</div>
|
>
|
||||||
<div className="mx_Dialog_content">
|
<div className="mx_Dialog_content">
|
||||||
{this.props.description}
|
{this.props.description}
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,7 +72,7 @@ module.exports = React.createClass({
|
||||||
Register
|
Register
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</BaseDialog>
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,9 +14,10 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var React = require("react");
|
import React from 'react';
|
||||||
|
import sdk from '../../../index';
|
||||||
|
|
||||||
module.exports = React.createClass({
|
export default React.createClass({
|
||||||
displayName: 'QuestionDialog',
|
displayName: 'QuestionDialog',
|
||||||
propTypes: {
|
propTypes: {
|
||||||
title: React.PropTypes.string,
|
title: React.PropTypes.string,
|
||||||
|
@ -46,25 +47,13 @@ module.exports = React.createClass({
|
||||||
this.props.onFinished(false);
|
this.props.onFinished(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeyDown: function(e) {
|
|
||||||
if (e.keyCode === 27) { // escape
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
this.props.onFinished(false);
|
|
||||||
}
|
|
||||||
else if (e.keyCode === 13) { // enter
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
this.props.onFinished(true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||||
return (
|
return (
|
||||||
<div className="mx_QuestionDialog" onKeyDown={ this.onKeyDown }>
|
<BaseDialog className="mx_QuestionDialog" onFinished={this.props.onFinished}
|
||||||
<div className="mx_Dialog_title">
|
onEnterPressed={ this.onOk }
|
||||||
{this.props.title}
|
title={this.props.title}
|
||||||
</div>
|
>
|
||||||
<div className="mx_Dialog_content">
|
<div className="mx_Dialog_content">
|
||||||
{this.props.description}
|
{this.props.description}
|
||||||
</div>
|
</div>
|
||||||
|
@ -77,7 +66,7 @@ module.exports = React.createClass({
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</BaseDialog>
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,11 +14,16 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var React = require("react");
|
import React from 'react';
|
||||||
var sdk = require("../../../index.js");
|
import sdk from '../../../index';
|
||||||
var MatrixClientPeg = require("../../../MatrixClientPeg");
|
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||||
|
|
||||||
module.exports = React.createClass({
|
/**
|
||||||
|
* Prompt the user to set a display name.
|
||||||
|
*
|
||||||
|
* On success, `onFinished(true, newDisplayName)` is called.
|
||||||
|
*/
|
||||||
|
export default React.createClass({
|
||||||
displayName: 'SetDisplayNameDialog',
|
displayName: 'SetDisplayNameDialog',
|
||||||
propTypes: {
|
propTypes: {
|
||||||
onFinished: React.PropTypes.func.isRequired,
|
onFinished: React.PropTypes.func.isRequired,
|
||||||
|
@ -42,10 +47,6 @@ module.exports = React.createClass({
|
||||||
this.refs.input_value.select();
|
this.refs.input_value.select();
|
||||||
},
|
},
|
||||||
|
|
||||||
getValue: function() {
|
|
||||||
return this.state.value;
|
|
||||||
},
|
|
||||||
|
|
||||||
onValueChange: function(ev) {
|
onValueChange: function(ev) {
|
||||||
this.setState({
|
this.setState({
|
||||||
value: ev.target.value
|
value: ev.target.value
|
||||||
|
@ -54,16 +55,17 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
onFormSubmit: function(ev) {
|
onFormSubmit: function(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this.props.onFinished(true);
|
this.props.onFinished(true, this.state.value);
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||||
return (
|
return (
|
||||||
<div className="mx_SetDisplayNameDialog">
|
<BaseDialog className="mx_SetDisplayNameDialog"
|
||||||
<div className="mx_Dialog_title">
|
onFinished={this.props.onFinished}
|
||||||
Set a Display Name
|
title="Set a Display Name"
|
||||||
</div>
|
>
|
||||||
<div className="mx_Dialog_content">
|
<div className="mx_Dialog_content">
|
||||||
Your display name is how you'll appear to others when you speak in rooms.<br/>
|
Your display name is how you'll appear to others when you speak in rooms.<br/>
|
||||||
What would you like it to be?
|
What would you like it to be?
|
||||||
|
@ -79,7 +81,7 @@ module.exports = React.createClass({
|
||||||
<input className="mx_Dialog_primary" type="submit" value="Set" />
|
<input className="mx_Dialog_primary" type="submit" value="Set" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</BaseDialog>
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,9 +14,10 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var React = require("react");
|
import React from 'react';
|
||||||
|
import sdk from '../../../index';
|
||||||
|
|
||||||
module.exports = React.createClass({
|
export default React.createClass({
|
||||||
displayName: 'TextInputDialog',
|
displayName: 'TextInputDialog',
|
||||||
propTypes: {
|
propTypes: {
|
||||||
title: React.PropTypes.string,
|
title: React.PropTypes.string,
|
||||||
|
@ -27,7 +28,7 @@ module.exports = React.createClass({
|
||||||
value: React.PropTypes.string,
|
value: React.PropTypes.string,
|
||||||
button: React.PropTypes.string,
|
button: React.PropTypes.string,
|
||||||
focus: React.PropTypes.bool,
|
focus: React.PropTypes.bool,
|
||||||
onFinished: React.PropTypes.func.isRequired
|
onFinished: React.PropTypes.func.isRequired,
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps: function() {
|
getDefaultProps: function() {
|
||||||
|
@ -36,7 +37,7 @@ module.exports = React.createClass({
|
||||||
value: "",
|
value: "",
|
||||||
description: "",
|
description: "",
|
||||||
button: "OK",
|
button: "OK",
|
||||||
focus: true
|
focus: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -55,25 +56,13 @@ module.exports = React.createClass({
|
||||||
this.props.onFinished(false);
|
this.props.onFinished(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeyDown: function(e) {
|
|
||||||
if (e.keyCode === 27) { // escape
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
this.props.onFinished(false);
|
|
||||||
}
|
|
||||||
else if (e.keyCode === 13) { // enter
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
this.props.onFinished(true, this.refs.textinput.value);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||||
return (
|
return (
|
||||||
<div className="mx_TextInputDialog">
|
<BaseDialog className="mx_TextInputDialog" onFinished={this.props.onFinished}
|
||||||
<div className="mx_Dialog_title">
|
onEnterPressed={this.onOk}
|
||||||
{this.props.title}
|
title={this.props.title}
|
||||||
</div>
|
>
|
||||||
<div className="mx_Dialog_content">
|
<div className="mx_Dialog_content">
|
||||||
<div className="mx_TextInputDialog_label">
|
<div className="mx_TextInputDialog_label">
|
||||||
<label htmlFor="textinput"> {this.props.description} </label>
|
<label htmlFor="textinput"> {this.props.description} </label>
|
||||||
|
@ -90,7 +79,7 @@ module.exports = React.createClass({
|
||||||
{this.props.button}
|
{this.props.button}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</BaseDialog>
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,8 +17,12 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AccessibleButton is a generic wrapper for any element that should be treated as a button.
|
* AccessibleButton is a generic wrapper for any element that should be treated
|
||||||
* Identifies the element as a button, setting proper tab indexing and keyboard activation behavior.
|
* as a button. Identifies the element as a button, setting proper tab
|
||||||
|
* indexing and keyboard activation behavior.
|
||||||
|
*
|
||||||
|
* @param {Object} props react element properties
|
||||||
|
* @returns {Object} rendered react
|
||||||
*/
|
*/
|
||||||
export default function AccessibleButton(props) {
|
export default function AccessibleButton(props) {
|
||||||
const {element, onClick, children, ...restProps} = props;
|
const {element, onClick, children, ...restProps} = props;
|
||||||
|
@ -44,7 +48,7 @@ AccessibleButton.propTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
AccessibleButton.defaultProps = {
|
AccessibleButton.defaultProps = {
|
||||||
element: 'div'
|
element: 'div',
|
||||||
};
|
};
|
||||||
|
|
||||||
AccessibleButton.displayName = "AccessibleButton";
|
AccessibleButton.displayName = "AccessibleButton";
|
||||||
|
|
|
@ -20,7 +20,7 @@ var React = require('react');
|
||||||
|
|
||||||
var MatrixClientPeg = require('../../../MatrixClientPeg');
|
var MatrixClientPeg = require('../../../MatrixClientPeg');
|
||||||
var sdk = require('../../../index');
|
var sdk = require('../../../index');
|
||||||
var AccessibleButton = require('../elements/AccessibleButton');
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
|
||||||
|
|
||||||
var PRESENCE_CLASS = {
|
var PRESENCE_CLASS = {
|
||||||
|
|
|
@ -35,7 +35,7 @@ var DMRoomMap = require('../../../utils/DMRoomMap');
|
||||||
var Unread = require('../../../Unread');
|
var Unread = require('../../../Unread');
|
||||||
var Receipt = require('../../../utils/Receipt');
|
var Receipt = require('../../../utils/Receipt');
|
||||||
var WithMatrixClient = require('../../../wrappers/WithMatrixClient');
|
var WithMatrixClient = require('../../../wrappers/WithMatrixClient');
|
||||||
var AccessibleButton = require('../elements/AccessibleButton');
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
|
||||||
module.exports = WithMatrixClient(React.createClass({
|
module.exports = WithMatrixClient(React.createClass({
|
||||||
displayName: 'MemberInfo',
|
displayName: 'MemberInfo',
|
||||||
|
@ -636,20 +636,31 @@ module.exports = WithMatrixClient(React.createClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.can.kick) {
|
if (this.state.can.kick) {
|
||||||
kickButton = <AccessibleButton className="mx_MemberInfo_field" onClick={this.onKick}>
|
const membership = this.props.member.membership;
|
||||||
{ this.props.member.membership === "invite" ? "Disinvite" : "Kick" }
|
const kickLabel = membership === "invite" ? "Disinvite" : "Kick";
|
||||||
</AccessibleButton>;
|
kickButton = (
|
||||||
|
<AccessibleButton className="mx_MemberInfo_field"
|
||||||
|
onClick={this.onKick}>
|
||||||
|
{kickLabel}
|
||||||
|
</AccessibleButton>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (this.state.can.ban) {
|
if (this.state.can.ban) {
|
||||||
banButton = <AccessibleButton className="mx_MemberInfo_field" onClick={this.onBan}>
|
banButton = (
|
||||||
|
<AccessibleButton className="mx_MemberInfo_field"
|
||||||
|
onClick={this.onBan}>
|
||||||
Ban
|
Ban
|
||||||
</AccessibleButton>;
|
</AccessibleButton>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (this.state.can.mute) {
|
if (this.state.can.mute) {
|
||||||
var muteLabel = this.state.muted ? "Unmute" : "Mute";
|
const muteLabel = this.state.muted ? "Unmute" : "Mute";
|
||||||
muteButton = <AccessibleButton className="mx_MemberInfo_field" onClick={this.onMuteToggle}>
|
muteButton = (
|
||||||
|
<AccessibleButton className="mx_MemberInfo_field"
|
||||||
|
onClick={this.onMuteToggle}>
|
||||||
{muteLabel}
|
{muteLabel}
|
||||||
</AccessibleButton>;
|
</AccessibleButton>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (this.state.can.toggleMod) {
|
if (this.state.can.toggleMod) {
|
||||||
var giveOpLabel = this.state.isTargetMod ? "Revoke Moderator" : "Make Moderator";
|
var giveOpLabel = this.state.isTargetMod ? "Revoke Moderator" : "Make Moderator";
|
||||||
|
|
|
@ -26,7 +26,7 @@ var rate_limited_func = require('../../../ratelimitedfunc');
|
||||||
var linkify = require('linkifyjs');
|
var linkify = require('linkifyjs');
|
||||||
var linkifyElement = require('linkifyjs/element');
|
var linkifyElement = require('linkifyjs/element');
|
||||||
var linkifyMatrix = require('../../../linkify-matrix');
|
var linkifyMatrix = require('../../../linkify-matrix');
|
||||||
var AccessibleButton = require('../elements/AccessibleButton');
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
|
||||||
linkifyMatrix(linkify);
|
linkifyMatrix(linkify);
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ var sdk = require('../../../index');
|
||||||
var ContextualMenu = require('../../structures/ContextualMenu');
|
var ContextualMenu = require('../../structures/ContextualMenu');
|
||||||
var RoomNotifs = require('../../../RoomNotifs');
|
var RoomNotifs = require('../../../RoomNotifs');
|
||||||
var FormattingUtils = require('../../../utils/FormattingUtils');
|
var FormattingUtils = require('../../../utils/FormattingUtils');
|
||||||
var AccessibleButton = require('../elements/AccessibleButton');
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
var UserSettingsStore = require('../../../UserSettingsStore');
|
var UserSettingsStore = require('../../../UserSettingsStore');
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
|
|
|
@ -19,7 +19,7 @@ limitations under the License.
|
||||||
var React = require('react');
|
var React = require('react');
|
||||||
var sdk = require('../../../index');
|
var sdk = require('../../../index');
|
||||||
var dis = require("../../../dispatcher");
|
var dis = require("../../../dispatcher");
|
||||||
var AccessibleButton = require('../elements/AccessibleButton');
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A stripped-down room header used for things like the user settings
|
* A stripped-down room header used for things like the user settings
|
||||||
|
|
|
@ -18,8 +18,9 @@ limitations under the License.
|
||||||
|
|
||||||
var React = require('react');
|
var React = require('react');
|
||||||
var MatrixClientPeg = require("../../../MatrixClientPeg");
|
var MatrixClientPeg = require("../../../MatrixClientPeg");
|
||||||
|
var Modal = require("../../../Modal");
|
||||||
var sdk = require("../../../index");
|
var sdk = require("../../../index");
|
||||||
var AccessibleButton = require('../elements/AccessibleButton');
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
displayName: 'ChangePassword',
|
displayName: 'ChangePassword',
|
||||||
|
@ -66,6 +67,19 @@ module.exports = React.createClass({
|
||||||
changePassword: function(old_password, new_password) {
|
changePassword: function(old_password, new_password) {
|
||||||
var cli = MatrixClientPeg.get();
|
var cli = MatrixClientPeg.get();
|
||||||
|
|
||||||
|
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
|
Modal.createDialog(QuestionDialog, {
|
||||||
|
title: "Warning",
|
||||||
|
description:
|
||||||
|
<div>
|
||||||
|
Changing password will currently reset any end-to-end encryption keys on all devices,
|
||||||
|
making encrypted chat history unreadable.
|
||||||
|
This will be <a href="https://github.com/vector-im/riot-web/issues/2671">improved shortly</a>,
|
||||||
|
but for now be warned.
|
||||||
|
</div>,
|
||||||
|
button: "Continue",
|
||||||
|
onFinished: (confirmed) => {
|
||||||
|
if (confirmed) {
|
||||||
var authDict = {
|
var authDict = {
|
||||||
type: 'm.login.password',
|
type: 'm.login.password',
|
||||||
user: cli.credentials.userId,
|
user: cli.credentials.userId,
|
||||||
|
@ -86,6 +100,9 @@ module.exports = React.createClass({
|
||||||
phase: self.Phases.Edit
|
phase: self.Phases.Edit
|
||||||
});
|
});
|
||||||
}).done();
|
}).done();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onClickChange: function() {
|
onClickChange: function() {
|
||||||
|
@ -137,7 +154,8 @@ module.exports = React.createClass({
|
||||||
<input id="password2" type="password" ref="confirm_input" />
|
<input id="password2" type="password" ref="confirm_input" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<AccessibleButton className={buttonClassName} onClick={this.onClickChange}>
|
<AccessibleButton className={buttonClassName}
|
||||||
|
onClick={this.onClickChange}>
|
||||||
Change Password
|
Change Password
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue