From cf3698576f2a4c316ce4a9c89afdeae381086905 Mon Sep 17 00:00:00 2001 From: Jaon EarlWolf Date: Fri, 16 Oct 2015 17:35:13 -0300 Subject: [PATCH] FS-8030 [verto_communicator] added ngSanitize as a dependency, vertoFilters module and picturify filter. --- html5/verto/verto_communicator/bower.json | 1 + html5/verto/verto_communicator/src/index.html | 13 ++++++---- .../verto_communicator/src/partials/chat.html | 8 +++--- .../src/vertoApp/vertoApp.module.js | 10 ++++--- .../src/vertoFilters/filters/picturify.js | 26 +++++++++++++++++++ .../src/vertoFilters/vertoFilters.module.js | 4 +++ 6 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 html5/verto/verto_communicator/src/vertoFilters/filters/picturify.js create mode 100644 html5/verto/verto_communicator/src/vertoFilters/vertoFilters.module.js diff --git a/html5/verto/verto_communicator/bower.json b/html5/verto/verto_communicator/bower.json index c69b4785d5..6a05c29a06 100644 --- a/html5/verto/verto_communicator/bower.json +++ b/html5/verto/verto_communicator/bower.json @@ -28,6 +28,7 @@ "bootstrap": "~3.3.4", "angular-toastr": "~1.4.1", "angular": "~1.3.15", + "angular-sanitize": "~1.3.15", "angular-route": "~1.3.15", "angular-prompt": "~1.1.1", "angular-animate": "~1.3.15", diff --git a/html5/verto/verto_communicator/src/index.html b/html5/verto/verto_communicator/src/index.html index a1594f8a7f..c450607c9f 100644 --- a/html5/verto/verto_communicator/src/index.html +++ b/html5/verto/verto_communicator/src/index.html @@ -56,7 +56,7 @@ - + @@ -66,6 +66,7 @@ + @@ -87,14 +88,14 @@ - + - + - + @@ -119,6 +120,9 @@ + + + @@ -133,4 +137,3 @@ - diff --git a/html5/verto/verto_communicator/src/partials/chat.html b/html5/verto/verto_communicator/src/partials/chat.html index 6fb10a878f..7e10b05db3 100644 --- a/html5/verto/verto_communicator/src/partials/chat.html +++ b/html5/verto/verto_communicator/src/partials/chat.html @@ -23,15 +23,15 @@

-
{{ member.name }}
+
{{ member.name }}
({{ member.number }}) - +
Floor
Presenter

- +
-

{{ message.body }}

+

diff --git a/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js b/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js index 0952ed1dce..966a7c1f7e 100644 --- a/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js +++ b/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js @@ -6,8 +6,10 @@ 'ngRoute', 'vertoControllers', 'vertoDirectives', + 'vertoFilters', 'ngStorage', 'ngAnimate', + 'ngSanitize', 'toastr', 'FBAngular', 'cgPrompt', @@ -56,17 +58,17 @@ vertoApp.run(['$rootScope', '$location', 'toastr', 'prompt', 'verto', function($rootScope, $location, toastr, prompt, verto) { - + $rootScope.$on( "$routeChangeStart", function(event, next, current) { if (!verto.data.connected) { if ( next.templateUrl === "partials/login.html") { - // pass + // pass } else { $location.path("/"); } } }); - + $rootScope.$on('$routeChangeSuccess', function(event, current, previous) { $rootScope.title = current.$$route.title; }); @@ -77,7 +79,7 @@ $rootScope.safeProtocol = true; } - + $rootScope.promptInput = function(title, message, label, callback) { var ret = prompt({ title: title, diff --git a/html5/verto/verto_communicator/src/vertoFilters/filters/picturify.js b/html5/verto/verto_communicator/src/vertoFilters/filters/picturify.js new file mode 100644 index 0000000000..2a09551030 --- /dev/null +++ b/html5/verto/verto_communicator/src/vertoFilters/filters/picturify.js @@ -0,0 +1,26 @@ +(function () { + 'use strict'; + + angular + .module('vertoFilters') + .filter('picturify', function() { + var regex = /\s*\S*<\/a>/i; + var regex64 = /data:image\/(\s*\S*);base64,((?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=))/g; + + return function (text, width, n) { + var i = 0; + width = width || 150; //default width + if(regex64.test(text)) { + text = text.replace(regex64, '') + } + + do { + text = text.replace(regex, ''); + } while((!n || (n && i++ < n)) && regex.test(text)); + + return text; + } + + }); + +})(); diff --git a/html5/verto/verto_communicator/src/vertoFilters/vertoFilters.module.js b/html5/verto/verto_communicator/src/vertoFilters/vertoFilters.module.js new file mode 100644 index 0000000000..f58933133b --- /dev/null +++ b/html5/verto/verto_communicator/src/vertoFilters/vertoFilters.module.js @@ -0,0 +1,4 @@ +(function() { + 'use strict'; + var vertoFilters = angular.module('vertoFilters', []); +})();