plugins: let plugins name their content

This commit is contained in:
David Cormier 2013-10-13 14:57:54 -04:00
parent 41b0684c82
commit b2ee67707b
2 changed files with 5 additions and 3 deletions

View file

@ -124,12 +124,12 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
<div ng-repeat="metadata in bufferline.metadata">
<div ng-show="metadata.visible">
<div ng-bind-html="metadata.content"></div>
<button class="btn btn-primary" ng-click="metadata.visible = false">Hide additional content</button>
<button class="btn btn-primary" ng-click="metadata.visible = false">Hide {{ metadata.name }}</button>
</div>
<div ng-hide="metadata.visible">
<button class="btn" ng-class="{'btn-warning': metadata.nsfw, 'btn-primary': !metadata.nsfw}" ng-click="metadata.visible = true">Show additional content</button>
<button class="btn" ng-class="{'btn-warning': metadata.nsfw, 'btn-primary': !metadata.nsfw}" ng-click="metadata.visible = true">Show {{ metadata.name }}</button>
</div>
</div>
</td>

View file

@ -15,6 +15,7 @@ var Plugin = function(contentForMessage) {
return {
contentForMessage: contentForMessage,
exclusive: false,
name: "additional content"
}
}
@ -68,7 +69,8 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce)
if (pluginContent) {
var pluginContent = {'visible': visible,
'content': $sce.trustAsHtml(pluginContent),
'nsfw': nsfw }
'nsfw': nsfw,
'name': plugins[i].name }
content.push(pluginContent);