fix: fix minimization of the client js

This commit is contained in:
tdurieux
2024-04-05 10:34:24 +01:00
parent 9e995a04db
commit c3a890dac7
2 changed files with 85 additions and 74 deletions
+15 -4
View File
@@ -196,7 +196,9 @@ angular
return capitalized.join(" "); return capitalized.join(" ");
}; };
}) })
.filter("diff", function ($sce) { .filter("diff", [
"$sce",
function ($sce) {
return function (str) { return function (str) {
if (!str) return str; if (!str) return str;
const lines = str.split("\n"); const lines = str.split("\n");
@@ -221,7 +223,8 @@ angular
} }
return $sce.trustAsHtml(o.join("\n")); return $sce.trustAsHtml(o.join("\n"));
}; };
}) },
])
.directive("markdown", [ .directive("markdown", [
"$location", "$location",
function ($location) { function ($location) {
@@ -394,7 +397,11 @@ angular
return { return {
restrict: "E", restrict: "E",
scope: { file: "=" }, scope: { file: "=" },
controller: function ($element, $scope, $http) { controller: [
"$element",
"$scope",
"$http",
function ($element, $scope, $http) {
function renderNotebookJSON(json) { function renderNotebookJSON(json) {
const notebook = nb.parse(json); const notebook = nb.parse(json);
try { try {
@@ -425,6 +432,7 @@ angular
}); });
render(); render();
}, },
],
}; };
}, },
]) ])
@@ -435,7 +443,9 @@ angular
scope: { stats: "=" }, scope: { stats: "=" },
template: template:
"<div class='lang' ng-repeat='lang in elements' title='{{lang.lang|title}}: {{lang.loc | number}} lines' data-toggle='tooltip' data-placement='bottom' style='width:{{lang.loc*100/total}}%;background:{{lang.color}};'></div>", "<div class='lang' ng-repeat='lang in elements' title='{{lang.lang|title}}: {{lang.loc | number}} lines' data-toggle='tooltip' data-placement='bottom' style='width:{{lang.loc*100/total}}%;background:{{lang.color}};'></div>",
controller: function ($scope) { controller: [
"$scope",
function ($scope) {
function render() { function render() {
$scope.elements = []; $scope.elements = [];
$scope.total = 0; $scope.total = 0;
@@ -461,6 +471,7 @@ angular
}); });
render(); render();
}, },
],
}; };
}, },
]) ])
+1 -1
View File
File diff suppressed because one or more lines are too long