Merge pull request #854 from lorenzhs/plugin-dedup
Plugins: don't show plugin repeatedly for same URL in same message
This commit is contained in:
commit
b29dc42a4a
2 changed files with 2 additions and 1 deletions
|
@ -33,7 +33,7 @@ var urlRegexp = /(?:(?:https?|ftp):\/\/|www\.|ftp\.)\S*[^\s.;,(){}<>]/g;
|
||||||
var UrlPlugin = function(name, urlCallback) {
|
var UrlPlugin = function(name, urlCallback) {
|
||||||
return {
|
return {
|
||||||
contentForMessage: function(message) {
|
contentForMessage: function(message) {
|
||||||
var urls = message.match(urlRegexp);
|
var urls = _.uniq(message.match(urlRegexp));
|
||||||
var content = [];
|
var content = [];
|
||||||
|
|
||||||
for (var i = 0; urls && i < urls.length; i++) {
|
for (var i = 0; urls && i < urls.length; i++) {
|
||||||
|
|
|
@ -9,6 +9,7 @@ module.exports = function(config){
|
||||||
'bower_components/angular-mocks/angular-mocks.js',
|
'bower_components/angular-mocks/angular-mocks.js',
|
||||||
'bower_components/angular-sanitize/angular-sanitize.js',
|
'bower_components/angular-sanitize/angular-sanitize.js',
|
||||||
'bower_components/angular-touch/angular-touch.js',
|
'bower_components/angular-touch/angular-touch.js',
|
||||||
|
'bower_components/underscore/underscore.js',
|
||||||
'js/localstorage.js',
|
'js/localstorage.js',
|
||||||
'js/weechat.js',
|
'js/weechat.js',
|
||||||
'js/irc-utils.js',
|
'js/irc-utils.js',
|
||||||
|
|
Loading…
Reference in a new issue