Move plugin to it's own directive

This commit is contained in:
David Cormier 2014-02-06 20:59:50 -05:00
parent 6605a49f7c
commit 6b12926887
3 changed files with 32 additions and 8 deletions

17
directives/plugin.html Normal file
View File

@ -0,0 +1,17 @@
<div ng-show="data.visible">
<button class="btn btn-primary btn-sm pull-right"
ng-click="data.visible = false">
Hide {{ data.name }}
</button>
<div ng-bind-html="data.content"></div>
</div>
<div ng-hide="data.visible">
<button class="btn btn-sm pull-right"
bo-class="{
'btn-warning': data.nsfw,
'btn-primary': !data.nsfw}"
ng-click="data.visible = true">
Show {{ data.name }}
</button>
</div>

View File

@ -291,14 +291,7 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
<td class="prefix"><span ng-repeat="part in bufferline.prefix" bo-class="part.classes" bo-html="part.text"></span></td>
<td class="message">
<div ng-repeat="metadata in bufferline.metadata">
<div ng-show="metadata.visible">
<button class="btn btn-primary btn-sm pull-right" ng-click="metadata.visible = false">Hide {{ metadata.name }}</button>
<div ng-bind-html="metadata.content"></div>
</div>
<div ng-hide="metadata.visible">
<button class="btn btn-sm pull-right" bo-class="{'btn-warning': metadata.nsfw, 'btn-primary': !metadata.nsfw}" ng-click="metadata.visible = true">Show {{ metadata.name }}</button>
</div>
<div plugin data="metadata">allo</div>
</div>
<span ng-repeat="part in bufferline.content" class="text" bo-class="part.classes" bo-html="part.text|linky:'_blank'"></span>

View File

@ -762,6 +762,20 @@ weechat.config(['$routeProvider',
}
]);
weechat.directive('plugin', function() {
return {
templateUrl: 'directives/plugin.html',
scope: {
data: '=data',
},
}
});
weechat.directive('inputBar', function() {
return {