Remove empty entries from ITU Notification URLs field
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>spacecruft
parent
94b2594ee7
commit
aecfcda191
|
@ -417,7 +417,7 @@ CSP_SCRIPT_SRC = config(
|
|||
'https://*.google-analytics.com,'
|
||||
'https://kit-free.fontawesome.com,'
|
||||
'https://kit.fontawesome.com,'
|
||||
"'sha256-yCeVaKZLAqmSVRds/nIjWRwzlJK+K3lQOWM1wc5VP/M='," # transmitter_modal.js
|
||||
"'sha256-Vy9dSX2P6dXmQTianGTQqvTqBqiz2OrzoZiu6k9/CA8='," # transmitter_modal.js
|
||||
)
|
||||
CSP_IMG_SRC = config(
|
||||
'CSP_IMG_SRC',
|
||||
|
|
|
@ -78,6 +78,14 @@ $(function () {
|
|||
$('textarea[name=\'itu_notification_per_line\']').on('change click', function(){
|
||||
var itu_notification_json = $.parseJSON($('textarea[name=\'itu_notification\']').val());
|
||||
var new_itu_urls = $('textarea[name=\'itu_notification_per_line\']').val().split('\n');
|
||||
// Trim all entries and remove the empty ones
|
||||
new_itu_urls = new_itu_urls.map(function(url){
|
||||
return url.trim();
|
||||
}).filter(function (url){
|
||||
if (url.length !=0){
|
||||
return true;
|
||||
}
|
||||
});
|
||||
itu_notification_json['urls'] = new_itu_urls;
|
||||
$('textarea[name=\'itu_notification\']').val(JSON.stringify(itu_notification_json));
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue