From af458a25e698669df7912200a1322c4380988aa3 Mon Sep 17 00:00:00 2001 From: Florian Schmitt Date: Sun, 24 Mar 2024 00:28:18 +0300 Subject: [PATCH] feat(login): tooltip on login button --- javascripts/yeswiki-base.js | 1146 +++++++++-------- tools/login/lang/login_fr.inc.php | 5 +- tools/login/templates/modal.twig | 4 +- tools/templates/actions/buttondropdown.php | 28 +- .../templates/moteurrecherche_button.tpl.html | 10 +- 5 files changed, 625 insertions(+), 568 deletions(-) diff --git a/javascripts/yeswiki-base.js b/javascripts/yeswiki-base.js index 3b59f004e..4bc2a212e 100755 --- a/javascripts/yeswiki-base.js +++ b/javascripts/yeswiki-base.js @@ -2,110 +2,106 @@ const DATATABLE_OPTIONS = { // responsive: true, paging: false, language: { - sProcessing: _t('DATATABLES_PROCESSING'), - sSearch: _t('DATATABLES_SEARCH'), - sLengthMenu: _t('DATATABLES_LENGTHMENU'), - sInfo: _t('DATATABLES_INFO'), - sInfoEmpty: _t('DATATABLES_INFOEMPTY'), - sInfoFiltered: _t('DATATABLES_INFOFILTERED'), - sInfoPostFix: '', - sLoadingRecords: _t('DATATABLES_LOADINGRECORDS'), - sZeroRecords: _t('DATATABLES_ZERORECORD'), - sEmptyTable: _t('DATATABLES_EMPTYTABLE'), + sProcessing: _t("DATATABLES_PROCESSING"), + sSearch: _t("DATATABLES_SEARCH"), + sLengthMenu: _t("DATATABLES_LENGTHMENU"), + sInfo: _t("DATATABLES_INFO"), + sInfoEmpty: _t("DATATABLES_INFOEMPTY"), + sInfoFiltered: _t("DATATABLES_INFOFILTERED"), + sInfoPostFix: "", + sLoadingRecords: _t("DATATABLES_LOADINGRECORDS"), + sZeroRecords: _t("DATATABLES_ZERORECORD"), + sEmptyTable: _t("DATATABLES_EMPTYTABLE"), oPaginate: { - sFirst: _t('FIRST'), - sPrevious: _t('PREVIOUS'), - sNext: _t('NEXT'), - sLast: _t('LAST') + sFirst: _t("FIRST"), + sPrevious: _t("PREVIOUS"), + sNext: _t("NEXT"), + sLast: _t("LAST"), }, oAria: { - sSortAscending: _t('DATATABLES_SORTASCENDING'), - sSortDescending: _t('DATATABLES_SORTDESCENDING') - } + sSortAscending: _t("DATATABLES_SORTASCENDING"), + sSortDescending: _t("DATATABLES_SORTDESCENDING"), + }, }, fixedHeader: { header: true, - footer: false + footer: false, }, dom: - "<'row'<'col-sm-6'l><'col-sm-6'f>>" - + "<'row'<'col-sm-12'tr>>" - + "<'row'<'col-sm-6'i><'col-sm-6'<'pull-right'B>>>", + "<'row'<'col-sm-6'l><'col-sm-6'f>>" + + "<'row'<'col-sm-12'tr>>" + + "<'row'<'col-sm-6'i><'col-sm-6'<'pull-right'B>>>", buttons: [ { - extend: 'copy', - className: 'btn btn-default', - text: ` ${_t('COPY')}` + extend: "copy", + className: "btn btn-default", + text: ` ${_t("COPY")}`, }, { - extend: 'csv', - className: 'btn btn-default', - text: ' CSV' + extend: "csv", + className: "btn btn-default", + text: ' CSV', }, { - extend: 'print', - className: 'btn btn-default', - text: ` ${_t('PRINT')}` - } + extend: "print", + className: "btn btn-default", + text: ` ${_t("PRINT")}`, + }, // { // extend: 'colvis', // text: _t('DATATABLES_COLS_TO_DISPLAY') // }, - ] -} + ], +}; function toastMessage( message, duration = 3000, - toastClass = 'alert alert-secondary-1' + toastClass = "alert alert-secondary-1", ) { const $toast = $( - `
${ - message - }
` - ) - $('body').after($toast) - $toast.css('top', `${$('#yw-topnav').outerHeight(true) + 20}px`) - $toast.css('opacity', 1) + `
${message}
`, + ); + $("body").after($toast); + $toast.css("top", `${$("#yw-topnav").outerHeight(true) + 20}px`); + $toast.css("opacity", 1); setTimeout(() => { - $toast.css('opacity', 0) - }, duration) + $toast.css("opacity", 0); + }, duration); setTimeout(() => { - $toast.remove() - }, duration + 300) - $toast.addClass('visible') + $toast.remove(); + }, duration + 300); + $toast.addClass("visible"); } // polyfill placeholder -(function($) { +(function ($) { // gestion des classes actives pour les menus - $('a.active-link') + $("a.active-link") .parent() - .addClass('active-list') - .parents('ul') - .prev('a') - .addClass('active-parent-link') + .addClass("active-list") + .parents("ul") + .prev("a") + .addClass("active-parent-link") .parent() - .addClass('active-list') + .addClass("active-list"); // fenetres modales function openModal(e) { - e.stopPropagation() - e.preventDefault() - const $this = $(this) - let text = $this.attr('title') || '' - const size = ` ${$this.data('size')}` - const iframe = $this.data('iframe') + e.stopPropagation(); + e.preventDefault(); + const $this = $(this); + let text = $this.attr("title") || ""; + const size = ` ${$this.data("size")}`; + const iframe = $this.data("iframe"); if (text.length > 0) { - text = `

${$.trim(text)}

` + text = `

${$.trim(text)}

`; } else { - text = '

' + text = "

"; } - let $modal = $('#YesWikiModal') + let $modal = $("#YesWikiModal"); const yesWikiModalHtml = ` -