X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Ffrio%2Fjs%2Fmod_events.js;h=00e3f4fa9f129ff26cdf1750301b665ccbc96b02;hb=d09b3f5bdeae444f785f6283e55dbf2f61caadac;hp=4e900d06ca0e85dbb4b67746602af099329b279a;hpb=967c3b3deb89a88275e55f7f972516a07ab07391;p=friendica.git diff --git a/view/theme/frio/js/mod_events.js b/view/theme/frio/js/mod_events.js index 4e900d06ca..00e3f4fa9f 100644 --- a/view/theme/frio/js/mod_events.js +++ b/view/theme/frio/js/mod_events.js @@ -1,6 +1,6 @@ /** * @file view/theme/frio/js/mod_events.js - * @brief Initialization of the fullCalendar and format the output. + * Initialization of the fullCalendar and format the output. */ $(document).ready(function() { @@ -56,7 +56,7 @@ $(document).ready(function() { event.item['author-avatar'], event.item['author-name'], event.item.desc, - formatEventLocationText(event.item.location) + htmlToText(event.item.location) )); break; case "agendaDay": @@ -66,7 +66,7 @@ $(document).ready(function() { event.item['author-avatar'], event.item['author-name'], event.item.desc, - formatEventLocationText(event.item.location) + htmlToText(event.item.location) )); break; case "listMonth": @@ -82,6 +82,9 @@ $(document).ready(function() { trigger: "hover", placement: "auto", template: '
', + sanitizeFn: function (content) { + return DOMPurify.sanitize(content) + }, }); } @@ -127,17 +130,17 @@ function changeView(action, viewName) { function eventHoverBodyTemplate() { var template = '\
\ -
\ -
\ -
\ +
\ +
\ +
\ \ - {5}\ - {6}\ + {5}\ + {6}\ \
\
\ -
{2}
\ -
{4}{3}\ +
{2}
\ +
{4}{3}\ {1}\
\
\ @@ -150,14 +153,15 @@ function eventHoverBodyTemplate() { // The template for presenting the event location in the event hover-card function eventHoverLocationTemplate() { - var template = ' {0}
'; + var template = '\ + {0}
'; return template; } function eventHoverProfileNameTemplate() { var template = '\ -
\ - {1}\ +
\ + {1}\
'; return template; } @@ -203,7 +207,7 @@ function eventHoverHtmlContent(event) { // Get only template data if there exists location data if (event.item.location) { - var eventLocationText = formatEventLocationText(event.item.location); + var eventLocationText = htmlToText(event.item.location); // Get the the html template for formatting the location var eventLocationTemplate = eventHoverLocationTemplate(); // Format the event location data according to the the event location @@ -252,18 +256,3 @@ function formatListViewEvent(event) { return formatted; } - -// Format event location in pure text -function formatEventLocationText(location) { - // Friendica can store the event location as text or as html - // We need to check if the location is html. In this case we need - // to transform it into clean text - if (location.startsWith("", " "); - }; - - return eventLocationText; -} \ No newline at end of file