From 3f56c80f569c1a1cde9367c7d1131e37d8dc4f85 Mon Sep 17 00:00:00 2001 From: David Cormier Date: Sun, 13 Oct 2013 14:49:38 -0400 Subject: [PATCH] plugins: warn the user that content may not be safe for work --- index.html | 2 +- js/plugins.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index ad9a766..61b7b8d 100644 --- a/index.html +++ b/index.html @@ -129,7 +129,7 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
- Show additional content + Show additional content (possibly nsfw)
diff --git a/js/plugins.js b/js/plugins.js index 56624f2..350a697 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -57,16 +57,18 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) var content = []; for (var i = 0; i < plugins.length; i++) { + var nsfw = false; var visible = true; - if (message.match(nsfwRegexp)) { + var nsfw = true; var visible = false; } var pluginContent = plugins[i].contentForMessage(message); if (pluginContent) { var pluginContent = {'visible': visible, - 'content': $sce.trustAsHtml(pluginContent) } + 'content': $sce.trustAsHtml(pluginContent), + 'nsfw': nsfw } content.push(pluginContent);