From 1176c52ae72e5b9de98466dca4036c411f7229da Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sun, 13 Sep 2020 19:12:21 +0200 Subject: [PATCH] Add input to hilight texts in responses --- htdocs/js/atsebayt.js | 11 +++++++++++ htdocs/views/correction.html | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/htdocs/js/atsebayt.js b/htdocs/js/atsebayt.js index 56c6547..b9e2b02 100644 --- a/htdocs/js/atsebayt.js +++ b/htdocs/js/atsebayt.js @@ -287,6 +287,17 @@ angular.module("AtsebaytApp") .controller("QuestionController", function($scope, Survey, SurveyQuest, SurveyQuest, AllResponses, CorrectionTemplate, $http, $routeParams) { $scope.notCorrected = true + $scope.highlight = '' + + $scope.chHilight = function () { + var words = $scope.highlight.split(',').join('|') + + $('.card-text').each(function (k, i) { + var e = $(i) + e.html(e.text().replace(new RegExp('(' + words + ')', 'g'), '$1')) + }) + } + $scope.survey = Survey.get({ surveyId: $routeParams.surveyId }); $scope.survey.$promise.then(function(survey) { survey.start_availability = Date.parse(survey.start_availability) diff --git a/htdocs/views/correction.html b/htdocs/views/correction.html index b039c40..a97af1f 100644 --- a/htdocs/views/correction.html +++ b/htdocs/views/correction.html @@ -1,8 +1,11 @@ -
+
+
+ +

{{ survey.title }}