Merge branch 'develop' into travis/ft-sep1620/04-jitsi-hangup

pull/21833/head
Travis Ralston 2020-09-29 10:20:02 -06:00
commit a5569303d1
9 changed files with 52 additions and 12 deletions

View File

@ -160,8 +160,8 @@ yarn link matrix-js-sdk
yarn install
```
See the [help for `yarn link`](https://yarnpkg.com/docs/cli/link) for more
details about this.
See the [help for `yarn link`](https://classic.yarnpkg.com/docs/cli/link) for
more details about this.
Running tests
=============

View File

@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
$MiniAppTileHeight: 114px;
$MiniAppTileHeight: 200px;
.mx_AppsDrawer {
margin: 5px 5px 5px 18px;
@ -220,9 +220,10 @@ $MiniAppTileHeight: 114px;
}
.mx_AppTileBody_mini {
height: 112px;
height: $MiniAppTileHeight;
width: 100%;
overflow: hidden;
border-radius: 8px;
}
.mx_AppTile .mx_AppTileBody,

View File

@ -23,9 +23,16 @@ limitations under the License.
z-index: 100;
box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08);
cursor: pointer;
// Disable pointer events for Jitsi widgets to function. Direct
// calls have their own cursor and behaviour, but we need to make
// sure the cursor hits the iframe for Jitsi which will be at a
// different level.
pointer-events: none;
.mx_CallPreview {
pointer-events: initial; // restore pointer events so the user can leave/interact
cursor: pointer;
.mx_VideoView {
width: 350px;
}
@ -37,7 +44,7 @@ limitations under the License.
}
.mx_AppTile_persistedWrapper div {
min-width: 300px;
min-width: 350px;
}
.mx_IncomingCallBox {
@ -45,6 +52,9 @@ limitations under the License.
background-color: $primary-bg-color;
padding: 8px;
pointer-events: initial; // restore pointer events so the user can accept/decline
cursor: pointer;
.mx_IncomingCallBox_CallerInfo {
display: flex;
direction: row;

View File

@ -117,7 +117,9 @@ export default class SetPasswordDialog extends React.Component {
autoFocusNewPasswordInput={true}
shouldAskForEmail={true}
onError={this._onPasswordChangeError}
onFinished={this._onPasswordChanged} />
onFinished={this._onPasswordChanged}
buttonLabel={_t("Set Password")}
/>
<div className="error">
{ this.state.error }
</div>

View File

@ -82,6 +82,7 @@ export default class PersistentApp extends React.Component {
showDelete={false}
showMinimise={false}
miniMode={true}
showMenubar={false}
/>;
}
}

View File

@ -619,13 +619,14 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
}
private onFormatAction = (action: Formatting) => {
const range = getRangeForSelection(
this.editorRef.current,
this.props.model,
document.getSelection());
const range = getRangeForSelection(this.editorRef.current, this.props.model, document.getSelection());
// trim the range as we want it to exclude leading/trailing spaces
range.trim();
if (range.length === 0) {
return;
}
this.historyManager.ensureLastChangesPushed(this.props.model);
this.modifiedFlag = true;
switch (action) {

View File

@ -35,6 +35,7 @@ export default class ChangePassword extends React.Component {
rowClassName: PropTypes.string,
buttonClassName: PropTypes.string,
buttonKind: PropTypes.string,
buttonLabel: PropTypes.string,
confirm: PropTypes.bool,
// Whether to autoFocus the new password input
autoFocusNewPasswordInput: PropTypes.bool,
@ -271,7 +272,7 @@ export default class ChangePassword extends React.Component {
/>
</div>
<AccessibleButton className={buttonClassName} kind={this.props.buttonKind} onClick={this.onClickChange}>
{ _t('Change Password') }
{ this.props.buttonLabel || _t('Change Password') }
</AccessibleButton>
</form>
);

View File

@ -18,6 +18,10 @@ import EditorModel from "./model";
import DocumentPosition, {Predicate} from "./position";
import {Part} from "./parts";
const whitespacePredicate: Predicate = (index, offset, part) => {
return part.text[offset].trim() === "";
};
export default class Range {
private _start: DocumentPosition;
private _end: DocumentPosition;
@ -35,6 +39,11 @@ export default class Range {
});
}
trim() {
this._start = this._start.forwardsWhile(this.model, whitespacePredicate);
this._end = this._end.backwardsWhile(this.model, whitespacePredicate);
}
expandBackwardsWhile(predicate: Predicate) {
this._start = this._start.backwardsWhile(this.model, predicate);
}

View File

@ -88,4 +88,19 @@ describe('editor/range', function() {
expect(model.parts[1].text).toBe("man");
expect(model.parts.length).toBe(2);
});
it('range trim spaces off both ends', () => {
const renderer = createRenderer();
const pc = createPartCreator();
const model = new EditorModel([
pc.plain("abc abc abc"),
], pc, renderer);
const range = model.startRange(
model.positionForOffset(3, false), // at end of first `abc`
model.positionForOffset(8, false), // at start of last `abc`
);
expect(range.parts[0].text).toBe(" abc ");
range.trim();
expect(range.parts[0].text).toBe("abc");
});
});