js: allow plugins to declare themselves as exclusive handlers

with-route-provider
Tristan Matthews 12 years ago committed by David Cormier
parent 5168b833cb
commit 1a66d18537
  1. 10
      js/websockets.js

@ -118,6 +118,10 @@ weechat.factory('pluginManager', ['youtubePlugin', 'urlPlugin', 'imagePlugin', f
if (pluginContent) { if (pluginContent) {
var pluginContent = {'visible': false, 'content': pluginContent } var pluginContent = {'visible': false, 'content': pluginContent }
content.push(pluginContent); content.push(pluginContent);
if (plugins[i].exclusive) {
break;
}
} }
} }
@ -143,7 +147,8 @@ weechat.factory('youtubePlugin', [function() {
} }
return { return {
contentForMessage: contentForMessage contentForMessage: contentForMessage,
exclusive: true
} }
}]); }]);
@ -158,7 +163,8 @@ weechat.factory('urlPlugin', [function() {
} }
return { return {
contentForMessage: contentForMessage contentForMessage: contentForMessage,
exclusive: false
} }
}]); }]);

Loading…
Cancel
Save