parent
7ad1974d12
commit
703fcb1668
2 changed files with 13 additions and 1 deletions
|
@ -1343,6 +1343,12 @@ weechat.directive('plugin', function($rootScope) {
|
|||
* Actual plugin content is only fetched when
|
||||
* content is shown.
|
||||
*/
|
||||
|
||||
// If the plugin is asynchronous / lazy, execute it now and store
|
||||
// the result. This ensures that the callback is executed only once
|
||||
if ($scope.plugin.content instanceof Function) {
|
||||
$scope.plugin.content = $scope.plugin.content();
|
||||
}
|
||||
$scope.displayedContent = $scope.plugin.content;
|
||||
$scope.plugin.visible = true;
|
||||
|
||||
|
|
|
@ -60,8 +60,14 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) {
|
|||
if (num) {
|
||||
pluginName += " " + num;
|
||||
}
|
||||
|
||||
// If content isn't a callback, it's HTML
|
||||
if (!(content instanceof Function)) {
|
||||
content = $sce.trustAsHtml(content);
|
||||
}
|
||||
|
||||
message.metadata.push({
|
||||
'content': $sce.trustAsHtml(content),
|
||||
'content': content,
|
||||
'nsfw': nsfw,
|
||||
'name': pluginName
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue