make permalinkst work

This commit is contained in:
Matthew Hodgson 2016-05-09 13:57:16 +01:00
parent 7ecda36e14
commit 97f1cf2bd5
3 changed files with 13 additions and 6 deletions

View file

@ -141,3 +141,8 @@ body {
.mxt_HomePage_info {
}
.mxt_Footer {
text-align: center;
font-size: 12px;
}

View file

@ -21,6 +21,7 @@ export default React.createClass({
render() {
return (
<div className="mxt_Footer">
Copyright 2016 <a href="https://matrix.org">Matrix.org</a>
</div>
);
}

View file

@ -171,17 +171,19 @@ export default React.createClass({
// XXX: cargo-culted from matrix-react-sdk
isAliasValid(alias) {
// XXX: FIXME SPEC-1
return (alias.match(/^#([^\/:,]+?):(.+)$/) && encodeURI(alias) === alias);
return (alias.match(/^#([^\/:]+?):(.+)$/) && encodeURI(alias) === alias);
},
isUserIdValid(userId) {
// XXX: FIXME SPEC-1
return (userId.match(/^@([^\/:,]+?):(.+)$/) && encodeURI(userId) === userId);
return (userId.match(/^@([^\/:]+?):(.+)$/) && encodeURI(userId) === userId);
},
isMsglinkValid(msglink) {
// XXX: FIXME SPEC-1
return (msglink.match(/^(\!#)([^\/:,]+?):(.+)\/\$[^\/:,]+?:(.+)$/) && encodeURI(msglink) === msglink);
console.log(msglink);
console.log(encodeURI(msglink));
return (msglink.match(/^[\!#]([^\/:]+?):(.+?)\/\$([^\/:]+?):(.+?)$/) && encodeURI(msglink) === msglink);
},
render() {
@ -216,7 +218,7 @@ export default React.createClass({
Matrix is an ecosystem for open and interoperable communication.
</p>
<p>
To connect to <b>{ this.state.entity }</b>, please select an app:
To connect to <b>{ isMsg ? "this message" : this.state.entity }</b>, please select an app:
</p>
</div>
@ -236,7 +238,7 @@ export default React.createClass({
Maturity
</div>
<div className="mxt_HomePage_link_link">
Access to <b>{ this.state.entity }</b>
Access to <b>{ isMsg ? "message" : this.state.entity }</b>
</div>
</div>
@ -253,7 +255,6 @@ export default React.createClass({
}
if (!link) return <div key={ client.name }/>;
var link = isRoom ? client.room_url + this.state.entity : client.user_url + this.state.entity;
return (
<div key={ client.name } className="mxt_HomePage_link">
<div className="mxt_HomePage_link_logo">