Merge branch 'develop' into travis/ft-sep1620/04-jitsi-hangup
This commit is contained in:
commit
a5569303d1
9 changed files with 52 additions and 12 deletions
|
@ -160,8 +160,8 @@ yarn link matrix-js-sdk
|
||||||
yarn install
|
yarn install
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [help for `yarn link`](https://yarnpkg.com/docs/cli/link) for more
|
See the [help for `yarn link`](https://classic.yarnpkg.com/docs/cli/link) for
|
||||||
details about this.
|
more details about this.
|
||||||
|
|
||||||
Running tests
|
Running tests
|
||||||
=============
|
=============
|
||||||
|
|
|
@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$MiniAppTileHeight: 114px;
|
$MiniAppTileHeight: 200px;
|
||||||
|
|
||||||
.mx_AppsDrawer {
|
.mx_AppsDrawer {
|
||||||
margin: 5px 5px 5px 18px;
|
margin: 5px 5px 5px 18px;
|
||||||
|
@ -220,9 +220,10 @@ $MiniAppTileHeight: 114px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_AppTileBody_mini {
|
.mx_AppTileBody_mini {
|
||||||
height: 112px;
|
height: $MiniAppTileHeight;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_AppTile .mx_AppTileBody,
|
.mx_AppTile .mx_AppTileBody,
|
||||||
|
|
|
@ -23,9 +23,16 @@ limitations under the License.
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08);
|
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 {
|
.mx_CallPreview {
|
||||||
|
pointer-events: initial; // restore pointer events so the user can leave/interact
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
.mx_VideoView {
|
.mx_VideoView {
|
||||||
width: 350px;
|
width: 350px;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +44,7 @@ limitations under the License.
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_AppTile_persistedWrapper div {
|
.mx_AppTile_persistedWrapper div {
|
||||||
min-width: 300px;
|
min-width: 350px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_IncomingCallBox {
|
.mx_IncomingCallBox {
|
||||||
|
@ -45,6 +52,9 @@ limitations under the License.
|
||||||
background-color: $primary-bg-color;
|
background-color: $primary-bg-color;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
|
||||||
|
pointer-events: initial; // restore pointer events so the user can accept/decline
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
.mx_IncomingCallBox_CallerInfo {
|
.mx_IncomingCallBox_CallerInfo {
|
||||||
display: flex;
|
display: flex;
|
||||||
direction: row;
|
direction: row;
|
||||||
|
|
|
@ -117,7 +117,9 @@ export default class SetPasswordDialog extends React.Component {
|
||||||
autoFocusNewPasswordInput={true}
|
autoFocusNewPasswordInput={true}
|
||||||
shouldAskForEmail={true}
|
shouldAskForEmail={true}
|
||||||
onError={this._onPasswordChangeError}
|
onError={this._onPasswordChangeError}
|
||||||
onFinished={this._onPasswordChanged} />
|
onFinished={this._onPasswordChanged}
|
||||||
|
buttonLabel={_t("Set Password")}
|
||||||
|
/>
|
||||||
<div className="error">
|
<div className="error">
|
||||||
{ this.state.error }
|
{ this.state.error }
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -82,6 +82,7 @@ export default class PersistentApp extends React.Component {
|
||||||
showDelete={false}
|
showDelete={false}
|
||||||
showMinimise={false}
|
showMinimise={false}
|
||||||
miniMode={true}
|
miniMode={true}
|
||||||
|
showMenubar={false}
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -619,13 +619,14 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
|
||||||
}
|
}
|
||||||
|
|
||||||
private onFormatAction = (action: Formatting) => {
|
private onFormatAction = (action: Formatting) => {
|
||||||
const range = getRangeForSelection(
|
const range = getRangeForSelection(this.editorRef.current, this.props.model, document.getSelection());
|
||||||
this.editorRef.current,
|
// trim the range as we want it to exclude leading/trailing spaces
|
||||||
this.props.model,
|
range.trim();
|
||||||
document.getSelection());
|
|
||||||
if (range.length === 0) {
|
if (range.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.historyManager.ensureLastChangesPushed(this.props.model);
|
this.historyManager.ensureLastChangesPushed(this.props.model);
|
||||||
this.modifiedFlag = true;
|
this.modifiedFlag = true;
|
||||||
switch (action) {
|
switch (action) {
|
||||||
|
|
|
@ -35,6 +35,7 @@ export default class ChangePassword extends React.Component {
|
||||||
rowClassName: PropTypes.string,
|
rowClassName: PropTypes.string,
|
||||||
buttonClassName: PropTypes.string,
|
buttonClassName: PropTypes.string,
|
||||||
buttonKind: PropTypes.string,
|
buttonKind: PropTypes.string,
|
||||||
|
buttonLabel: PropTypes.string,
|
||||||
confirm: PropTypes.bool,
|
confirm: PropTypes.bool,
|
||||||
// Whether to autoFocus the new password input
|
// Whether to autoFocus the new password input
|
||||||
autoFocusNewPasswordInput: PropTypes.bool,
|
autoFocusNewPasswordInput: PropTypes.bool,
|
||||||
|
@ -271,7 +272,7 @@ export default class ChangePassword extends React.Component {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<AccessibleButton className={buttonClassName} kind={this.props.buttonKind} onClick={this.onClickChange}>
|
<AccessibleButton className={buttonClassName} kind={this.props.buttonKind} onClick={this.onClickChange}>
|
||||||
{ _t('Change Password') }
|
{ this.props.buttonLabel || _t('Change Password') }
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
|
|
@ -18,6 +18,10 @@ import EditorModel from "./model";
|
||||||
import DocumentPosition, {Predicate} from "./position";
|
import DocumentPosition, {Predicate} from "./position";
|
||||||
import {Part} from "./parts";
|
import {Part} from "./parts";
|
||||||
|
|
||||||
|
const whitespacePredicate: Predicate = (index, offset, part) => {
|
||||||
|
return part.text[offset].trim() === "";
|
||||||
|
};
|
||||||
|
|
||||||
export default class Range {
|
export default class Range {
|
||||||
private _start: DocumentPosition;
|
private _start: DocumentPosition;
|
||||||
private _end: 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) {
|
expandBackwardsWhile(predicate: Predicate) {
|
||||||
this._start = this._start.backwardsWhile(this.model, predicate);
|
this._start = this._start.backwardsWhile(this.model, predicate);
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,4 +88,19 @@ describe('editor/range', function() {
|
||||||
expect(model.parts[1].text).toBe("man");
|
expect(model.parts[1].text).toBe("man");
|
||||||
expect(model.parts.length).toBe(2);
|
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");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue