From 9e301843d2dd6c2539b5f31c3a0e8294b3568740 Mon Sep 17 00:00:00 2001 From: khlieng Date: Tue, 17 Feb 2015 01:27:02 +0100 Subject: [PATCH] Linkify URLs in messages --- client/gulpfile.js | 4 ++-- client/package.json | 5 +++-- client/src/css/style.css | 3 ++- client/src/js/components/MessageBox.jsx | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/gulpfile.js b/client/gulpfile.js index 23d654dc..b3618c93 100644 --- a/client/gulpfile.js +++ b/client/gulpfile.js @@ -88,9 +88,9 @@ gulp.task('gzip:watch', function() { }); gulp.task('watch', ['default'], function() { - gulp.watch('./dist/*.{html,css,js}', ['gzip:watch']) + gulp.watch('./dist/**/*.{html,css,js}', ['gzip:watch']) gulp.watch('./src/*.html', ['html']); - gulp.watch('./src/*.css', ['css']); + gulp.watch('./src/css/*.css', ['css']); return js(true); }); diff --git a/client/package.json b/client/package.json index 4d2d4e5b..903f7059 100644 --- a/client/package.json +++ b/client/package.json @@ -24,6 +24,7 @@ "reflux": "0.2.5", "react-router": "0.12.0", "react": "0.12.2", - "react-infinite": "0.2.3" + "react-infinite": "0.2.3", + "autolinker": "~0.15.2" } -} \ No newline at end of file +} diff --git a/client/src/css/style.css b/client/src/css/style.css index b7a861d5..6bbececa 100644 --- a/client/src/css/style.css +++ b/client/src/css/style.css @@ -216,7 +216,7 @@ i[class^="icon-"]:before, i[class*=" icon-"]:before { .messagebox > div { padding: 10px 15px; - overflow: auto !important; + overflow-y: auto !important; } .message { @@ -266,6 +266,7 @@ i[class^="icon-"]:before, i[class*=" icon-"]:before { } .userlist > div { + overflow-y: auto !important; padding: 10px 0px; } diff --git a/client/src/js/components/MessageBox.jsx b/client/src/js/components/MessageBox.jsx index 115998a9..cf90e6e8 100644 --- a/client/src/js/components/MessageBox.jsx +++ b/client/src/js/components/MessageBox.jsx @@ -2,6 +2,7 @@ var React = require('react'); var Reflux = require('reflux'); var _ = require('lodash'); var Infinite = require('react-infinite'); +var Autolinker = require('autolinker'); var util = require('../util'); var messageLineStore = require('../stores/messageLine'); @@ -84,7 +85,7 @@ var MessageBox = React.createClass({ } var lines = _.map(this.state.lines, function(line) { - return

{line}

; + return

; }); if (lines.length !== 1) {