From d3b8df8bb0c413c720093f889d84ccd93102722a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sat, 23 Aug 2014 11:46:05 +0100 Subject: [PATCH 1/3] Don't watch for changes on existing lines How did we miss this angular 1.3 feature? It appears to be a bit similar to bindonce, but also works in ng-repeat! See https://docs.angularjs.org/guide/expression#one-time-binding --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 598da74..3ccfa8a 100644 --- a/index.html +++ b/index.html @@ -259,10 +259,10 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel :: - + -
- +
+ From 2cb6b054983758e86a22218764d45feb8babbac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sat, 23 Aug 2014 12:03:13 +0100 Subject: [PATCH 2/3] Wrap inlinecolour filter in $sce.trustAsHtml This is required because bo-html is unsafe whereas ng-bind-html requires "safe" HTML (ng-bind-html-unsafe is deprecated since 1.2) --- js/glowingbear.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index ac4cd1e..f88e85d 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -49,7 +49,7 @@ weechat.filter('irclinky', ['$filter', function($filter) { }; }]); -weechat.filter('inlinecolour', function() { +weechat.filter('inlinecolour', ['$sce', function($sce) { 'use strict'; return function(text) { @@ -61,9 +61,9 @@ weechat.filter('inlinecolour', function() { var hexColourRegex = /(^|[^&])\#([0-9a-f]{6})($|[^\w'"])/gmi; var substitute = '$1#$2
$3'; - return text.replace(hexColourRegex, substitute); + return $sce.trustAsHtml(text.replace(hexColourRegex, substitute)); }; -}); +}]); weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', function($rootScope, $log, models, plugins) { From 4cdf86ed14824413d5917be8d2214ad072cd98b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sat, 23 Aug 2014 12:23:47 +0100 Subject: [PATCH 3/3] Remove bindonce for Angular 1.3 One-Time Bindings --- directives/plugin.html | 8 ++++---- index.html | 15 +++++++-------- js/glowingbear.js | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/directives/plugin.html b/directives/plugin.html index 657692a..67cb8fa 100644 --- a/directives/plugin.html +++ b/directives/plugin.html @@ -1,18 +1,18 @@
-
+
diff --git a/index.html b/index.html index 3ccfa8a..c187d30 100644 --- a/index.html +++ b/index.html @@ -27,7 +27,6 @@ - @@ -220,7 +219,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel -