/** * Steuerung des "globalen, modalen" Dialogfensters ;-) * * @param dTitle string Title des Dialogfensters * @param dMessage string Nachricht des Dialogs = body * @param dTitleClass string (optional) Klasse des Titels falls mehr als modal-header * @param dFooter string (optional) Inhalt des Footers falls mehr als nur Close Button */ function portal_dialogShow(dTitle, dMessage, dTitleClass = '', dFooter = '') { $('#dialog .modal-header').removeClass().addClass('modal-header ' + dTitleClass); $('#dialogTitle').html(dTitle); $('#dialogBody').html(dMessage); if(dFooter != '') { $('#dialogFooter').html(dFooter); } $('#dialog').modal('show'); } /** * Logout: Dialog mit Frage nach wirklich und ggf. anschliessendem Logout */ function portal_dialogLogout() { portal_dialogShow( 'Logout', 'Wollen Sie sich wirklich abmelden?', 'bg-primary text-white', '' + '' ); } /** * Steuert die Anzeige der -div id="#message"-. * * @param class string Klasse des bootstrap alerts * @param msg string Anzuzeigende Nachricht */ function portal_messageShow(alertClass, alertMessage) { $('#message').html(alertMessage).removeClass().addClass('alert ' + alertClass).show(); } /** * Ändert bei einem Passwort-Feld die Sichtbarkeit durch "klick" auf das Auge. * *
* * * * *
* * $('.passeye').click(function() { tg_passEye($(this)); }); * * @param das geklickte span Element mit dem Augen Icon */ function tg_passEye(thisItem) { input = thisItem.parent().parent().find('input').first(); nextState = 'password'; eyeIcon = 'bi-eye'; if(input.attr('type') === 'password') { nextState = 'text'; eyeIcon = 'bi-eye-slash'; } input.attr('type', nextState); thisItem.find('i').first().attr('class', 'bi ' + eyeIcon); } /** * Erstellt einen "copy to clipboard" Button * * @param string Text fürs Clipboard * @return string Button */ function tg_clipboard(cpvalue) { return ''; }