Browse Source

Linkify URLs

pull/1/head
David Baker 7 years ago
parent
commit
a00510c1ca
  1. 3
      package.json
  2. 2
      skins/base/views/molecules/MNoticeTile.js
  3. 2
      skins/base/views/molecules/MTextTile.js
  4. 5
      src/controllers/molecules/MNoticeTile.js
  5. 5
      src/controllers/molecules/MTextTile.js

3
package.json

@ -26,7 +26,8 @@
"matrix-js-sdk": "0.1.1",
"q": "^1.4.1",
"react": "^0.13.0",
"react-loader": "^1.4.0"
"react-loader": "^1.4.0",
"linkifyjs": "^2.0.0-beta.4"
},
"devDependencies": {
"catw": "^1.0.1",

2
skins/base/views/molecules/MNoticeTile.js

@ -27,7 +27,7 @@ module.exports = React.createClass({
render: function() {
var content = this.props.mxEvent.getContent();
return (
<span className="mx_MNoticeTile mx_messageTileType">
<span ref="content" className="mx_MNoticeTile mx_messageTileType">
{content.body}
</span>
);

2
skins/base/views/molecules/MTextTile.js

@ -27,7 +27,7 @@ module.exports = React.createClass({
render: function() {
var content = this.props.mxEvent.getContent();
return (
<span className="mx_MTextTile mx_messageTileType">
<span ref="content" className="mx_MTextTile mx_messageTileType">
{content.body}
</span>
);

5
src/controllers/molecules/MNoticeTile.js

@ -16,5 +16,10 @@ limitations under the License.
'use strict';
var linkifyElement = require('linkifyjs/element');
module.exports = {
componentDidMount: function() {
linkifyElement(this.refs.content.getDOMNode());
}
};

5
src/controllers/molecules/MTextTile.js

@ -16,6 +16,11 @@ limitations under the License.
'use strict';
var linkifyElement = require('linkifyjs/element');
module.exports = {
componentDidMount: function() {
linkifyElement(this.refs.content.getDOMNode());
}
};

Loading…
Cancel
Save