Skip to content
Permalink
Browse files

Get rid of angular-sanitize module

  • Loading branch information...
Andreas Gruenbacher
Andreas Gruenbacher committed Jan 19, 2019
1 parent d9a44dc commit 4a06f4509e0df7d94c8603044c390a4e3ffc5fd0
Showing with 11 additions and 14 deletions.
  1. +0 −1 Makefile
  2. +1 −2 htdocs/admin/index.html
  3. +7 −10 htdocs/admin/serie/results/controller.js
  4. +3 −1 htdocs/admin/serie/results/view.html
@@ -17,7 +17,6 @@ DOWNLOAD_FILES = \
htdocs/js/angular-$(ANGULAR_VERSION)/angular.min.js.map \
htdocs/js/angular-$(ANGULAR_VERSION)/angular-route.js \
htdocs/js/angular-$(ANGULAR_VERSION)/angular-cookies.js \
htdocs/js/angular-$(ANGULAR_VERSION)/angular-sanitize.js \
htdocs/js/angular-$(ANGULAR_VERSION)/angular-locale_de-at.js \
htdocs/js/json-diff.js

@@ -19,7 +19,6 @@
<script src="../js/angular/angular-locale_de-at.js"></script>
<script src="../js/angular/angular-route.js"></script>
<script src="../js/angular/angular-cookies.js"></script>
<script src="../js/angular/angular-sanitize.js"></script>
<script src="../js/ng-attr.js"></script>
<script src="../js/json-diff.js"></script>
<script src="../js/directives.js"></script>
@@ -40,7 +39,7 @@
<script src="import/controller.js"></script>
<script>
var application = angular.module('application', ['ngRoute', 'ngCookies', 'ngSanitize', 'argshook.ngAttr']);
var application = angular.module('application', ['ngRoute', 'ngCookies', 'argshook.ngAttr']);
application.directive('isoDate', isoDateDirective);
application.directive('isoTime', isoTimeDirective);
@@ -1,8 +1,8 @@
'use strict;'

var serieResultsController = [
'$scope', '$sce', '$route', '$location', '$timeout', '$http', '$q', '$sanitize', 'fractional', 'results',
function ($scope, $sce, $route, $location, $timeout, $http, $q, $sanitize, fractional, results) {
'$scope', '$sce', '$route', '$location', '$timeout', '$http', '$q', 'fractional', 'results',
function ($scope, $sce, $route, $location, $timeout, $http, $q, fractional, results) {
$scope.config = config;
$scope.show = {
fields: [],
@@ -363,19 +363,16 @@ var serieResultsController = [
$scope.$watch('fold.settings', hide_settings_later);
$scope.$watch('show', hide_settings_later, true);

$scope.event_heading = (function() {
$scope.events = (function() {
let events = results.events.reduce(function(events, event) {
events[event.id] = event;
return events;
}, {});

return function(id) {
let event = events[id];
let date = event.date;
return $sce.trustAsHtml(
'<span title="' + $sanitize(event.name) + '">' +
$scope.$eval('date | date:"d.<br>M."', {date: event.date}) +
'</span>');
return function(ids) {
return ids.map(function(id) {
return events[id];
});
};
})();

@@ -107,7 +107,9 @@ <h3>{{class_ranking.class.name}}</h3>
<thead>
<th style="text-align:center" ng-bind-html="class_symbol(class_ranking.class)" adjust-width="rank"></th>
<th ng-repeat="field in fields track by $index" ng-attr="field.attr" ng-style="field.style" ng-bind-html="field.heading"></th>
<th style="text-align:right" ng-repeat="event in class_ranking.events track by $index" adjust-width="score" ng-bind-html="event_heading(event)"></th>
<th style="text-align:right" ng-repeat="event in events(class_ranking.events) track by $index" adjust-width="score">
<span title="{{event.name}}">{{event.date | date:"d."}}<br>{{event.date | date:"M."}}</span>
</th>
<th style="text-align:right" ng-if="have_drop_score(class_ranking)" adjust-width="total-score"><span title="Streichpunkte">Str</span></th><!-- XXX Hide when always empty! -->
<th style="text-align:right" adjust-width="total-score"><span title="Gesamtpunkte">Ges</span></th>
</thead>

0 comments on commit 4a06f45

Please sign in to comment.
You can’t perform that action at this time.