From ba213db493668e2bb0cd0d702dd6323a88ab2786 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sun, 7 Jan 2024 13:24:52 +0100 Subject: [PATCH 1/3] [CHANGE] Update `filterDropDown` JS for Bootstrap 5 --- .../js/filterDropDown/filterDropDown.js | 322 ++++++++++-------- .../js/filterDropDown/filterDropDown.min.js | 3 +- .../filterDropDown/filterDropDown.min.js.map | 1 + 3 files changed, 178 insertions(+), 148 deletions(-) create mode 100644 allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js.map diff --git a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.js b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.js index c01ca649..c41415b2 100644 --- a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.js +++ b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.js @@ -1,4 +1,4 @@ -/* +/** * filterDropDown.js * * Copyright (C) 2017-18 Erik Kalkoken @@ -6,234 +6,262 @@ * Extension for the jQuery plug-in DataTables (developed and tested with v1.10.15) * * Version 0.4.0 - * -**/ + **/ +(($) => { + 'use strict'; -(function ($) { - - // parse initialization array and returns filterDef array to faster and easy use - // also sets defaults for properties that are not set - function parseInitArray(initArray) { - // initialization and setting defaults - let filterDef = { - "columns": [], - "columnsIdxList": [], - "bootstrap": false, - "autoSize": true, - "ajax": null, - "label": "Filter " + /** + * Parse initialization array and returns filterDef array to faster and easy use, + * also sets defaults for properties that are not set + * + * @param initArray + * @returns {{autoSize: boolean, bootstrap_version: number, columnsIdxList: *[], columns: *[], bootstrap: boolean, label: string, ajax: null}} + */ + const parseInitArray = (initArray) => { + /** + * Default filter definition + * + * @type {{autoSize: boolean, bootstrap_version: number, columnsIdxList: *[], columns: *[], bootstrap: boolean, label: string, ajax: null}} + */ + const filterDef = { + 'columns': [], + 'columnsIdxList': [], + 'bootstrap': false, + 'bootstrap_version': 3, + 'autoSize': true, + 'ajax': null, + 'label': 'Filter ' }; - // set filter properties if they have been defined - // otherwise the defaults will be used - if (("bootstrap" in initArray) && (typeof initArray.bootstrap === 'boolean')) { + // Set filter properties if they have been defined otherwise the defaults will be used + if (('bootstrap' in initArray) && (typeof initArray.bootstrap === 'boolean')) { filterDef.bootstrap = initArray.bootstrap; } - if (("autoSize" in initArray) && (typeof initArray.autoSize === 'boolean')) { + if (('bootstrap_version' in initArray) && (typeof initArray.bootstrap_version === 'number')) { + filterDef.bootstrap_version = initArray.bootstrap_version; + } + + if (('autoSize' in initArray) && (typeof initArray.autoSize === 'boolean')) { filterDef.autoSize = initArray.autoSize; } - if (("ajax" in initArray) && (typeof initArray.ajax === 'string')) { + if (('ajax' in initArray) && (typeof initArray.ajax === 'string')) { filterDef.ajax = initArray.ajax; } - if (("label" in initArray) && (typeof initArray.label === 'string')) { + if (('label' in initArray) && (typeof initArray.label === 'string')) { filterDef.label = initArray.label; } - // add definition for each column - if ("columns" in initArray) { - initArray.columns.forEach(function (initColumn) { - if (("idx" in initColumn) && (typeof initColumn.idx === 'number')) { - // initialize column - let idx = initColumn.idx; - filterDef['columns'][idx] = { - "title": null, - "maxWidth": null, - "autoSize": true + // Add definition for each column + if ('columns' in initArray) { + initArray.columns.forEach((initColumn) => { + if (('idx' in initColumn) && (typeof initColumn.idx === 'number')) { + // Initialize column + const idx = initColumn.idx; + + filterDef.columns[idx] = { + 'title': null, + 'maxWidth': null, + 'autoSize': true }; - // add to list of indices in same order they appear in the init array - filterDef['columnsIdxList'].push(idx); + // Add to a list of indices in the same order they appear in the init array + filterDef.columnsIdxList.push(idx); - // set column properties if they have been defined - // otherwise the defaults will be used - if (('title' in initColumn) - && (typeof initColumn.title === 'string') - ) { - filterDef['columns'][idx].title = initColumn.title; + // Set column properties if they have been defined otherwise the defaults will be used + if (('title' in initColumn) && (typeof initColumn.title === 'string')) { + filterDef.columns[idx].title = initColumn.title; } - if (('maxWidth' in initColumn) - && (typeof initColumn.maxWidth === 'string') - ) { - filterDef['columns'][idx].maxWidth = initColumn.maxWidth; + if (('maxWidth' in initColumn) && (typeof initColumn.maxWidth === 'string')) { + filterDef.columns[idx].maxWidth = initColumn.maxWidth; } - if (('autoSize' in initColumn) - && (typeof initColumn.autoSize === 'boolean') - ) { - filterDef['columns'][idx].autoSize = initColumn.autoSize; + if (('autoSize' in initColumn) && (typeof initColumn.autoSize === 'boolean')) { + filterDef.columns[idx].autoSize = initColumn.autoSize; } } }); } + return filterDef; - } + }; - // Add option d to given select object - function addOption(select, d) { - if (d != "") { - select.append(''); + /** + * Add option d to the given select object + * + * @param select + * @param d + */ + const addOption = (select, d) => { + if (d !== '') { + select.append(``); } - } + }; - // initalizing select for current column and applying event to react to changes - function initSelectForColumn(id, column) { - let select = $("#" + id + "_filterSelect" + column.index()); - select.on('change', function () { - let val = $.fn.dataTable.util.escapeRegex($(this).val()); - column - .search(val ? '^' + val + '$' : '', true, false) - .draw(); + /** + * Initialize the select element for given column and apply event to react to changes + * + * @param id + * @param column + * @returns {*|jQuery|HTMLElement} + */ + const initSelectForColumn = (id, column) => { + const select = $(`#${id}_filterSelect${column.index()}`); + + $(select).change(() => { + const val = $.fn.dataTable.util.escapeRegex($(select).val()); + + column.search(val ? `^${val}$` : '', true, false).draw(); }); - return select - } - // Add filterDropDown container div, draw select elements with default options - // use preInit so that elements are created and correctly shown before data is loaded - $(document).on('preInit.dt', function (e, settings) { - if (e.namespace !== 'dt') return; + return select; + }; - // get api object for current dt table - var api = new $.fn.dataTable.Api(settings); + // Add filterDropDown container div, draw select elements with default options. + // Use preInit so that elements are created and correctly shown before data is loaded + $(document).on('preInit.dt', (e, settings) => { + if (e.namespace !== 'dt') { + return; + } - // get id of current table - var id = api.table().node().id; + // Get the api object for the current dt table + const api = new $.fn.dataTable.Api(settings); - // get initialization object for current table to retrieve custom settings - var initObj = api.init(); + // Get the id of the current table + const id = api.table().node().id; - // only proceed if filter has been defined in current table, otherwise don't do anything. - if (!("filterDropDown" in initObj)) return; + // Get the initialization object for the current table to retrieve custom settings + const initObj = api.init(); - // get current filter definition from init array - var filterDef = parseInitArray(initObj.filterDropDown); + // Only proceed if the filter has been defined in the current table, + // otherwise don't do anything. + if (!('filterDropDown' in initObj)) { + return; + } + + // Get the current filter definition from the init array + const filterDef = parseInitArray(initObj.filterDropDown); // only proceed if there are any columns defined - if (filterDef.columns.length == 0) return; + if (filterDef.columns.length === 0) { + return; + } - // get container div for current data table to add new elements to - var container = api.table().container(); + // Get container div for the current data table to add new elements to + const container = api.table().container(); + + // Add filter elements to DOM + const filterWrapperId = `${id}_filterWrapper`; + + // Set CSS classes for the filter wrapper div depending on bootstrap setting + let divCssClass = `${filterWrapperId} ${(filterDef.bootstrap) ? 'form-inline' : ''}`; + if (filterDef.bootstrap && filterDef.bootstrap_version === 5) { + divCssClass = `${filterWrapperId} input-group my-3`; + } - // add filter elements to DOM - var filterWrapperId = id + "_filterWrapper"; - var divCssClass = filterWrapperId + " " + ( - (filterDef.bootstrap) - ? "form-inline" - : "" - ); $(container).prepend( - '
' - + filterDef.label - + '
' + `
${filterDef.label}
` ); api.columns(filterDef.columnsIdxList).every(function () { - let idx = this.index(); + const idx = this.index(); // set title of current column let colName = (filterDef.columns[idx].title !== null) ? filterDef.columns[idx].title : $(this.header()).html(); - if (colName == "") colName = 'column ' + (idx + 1); + if (colName === '') { + colName = `column ${idx + 1}`; + } - // adding select element for current column to container - let selectId = id + "_filterSelect" + idx; - $('#' + filterWrapperId).append( - '' - ); + // Adding the select element for current column to container + const selectId = `${id}_filterSelect${idx}`; - // initalizing select for current column and applying event to react to changes - let select = $("#" + selectId).empty() - .append(''); + // Set CSS classes for the select element depending on bootstrap setting + let selectMarkup = ``; + if (filterDef.bootstrap && filterDef.bootstrap_version === 5) { + selectMarkup = ``; + } - // set max width of select elements to current width (which is defined by the size of the title) - // turn off on for very small screens for responsive design or if autoSize has been set to false + $('#' + filterWrapperId).append(selectMarkup); + + // Initializing select for current column and applying event to react to changes + const select = $('#' + selectId) + .empty() + .append(``); + + // Set max width of select elements to current width (which is defined by the size of the title) + // Turn off on for very small screens for responsive design, or if autoSize has been set to false if (filterDef.autoSize && filterDef.columns[idx].autoSize && (screen.width > 768)) { select.css('max-width', select.outerWidth()); } - // apply optional css style if defined in init array - // will override automatic max width setting + // Apply optional css style if defined in the init array will override automatic max width setting if (filterDef.columns[idx].maxWidth !== null) { select.css('max-width', filterDef.columns[idx].maxWidth); } }); - }); - // filter table and add available options to dropDowns - $(document).on('init.dt', function (e, settings) { - if (e.namespace !== 'dt') return; + // Filter table and add available options to dropDowns + $(document).on('init.dt', (e, settings) => { + if (e.namespace !== 'dt') { + return; + } - // get api object for current dt table - var api = new $.fn.dataTable.Api(settings); + // Get api object for current dt table + const api = new $.fn.dataTable.Api(settings); - // get id of current table - var id = api.table().node().id; + // Get id of current table + const id = api.table().node().id; - // get initialization object for current table to retrieve custom settings - var initObj = api.init(); + // Get the initialization object for current table to retrieve custom settings + const initObj = api.init(); - // only proceed if filter has been defined in current table, otherwise don't do anything. - if (!("filterDropDown" in initObj)) return; + // Only proceed if a filter has been defined in the current table, otherwise don't do anything. + if (!('filterDropDown' in initObj)) { + return; + } - // get current filter definition - var filterDef = parseInitArray(initObj.filterDropDown); + // Get current filter definition + const filterDef = parseInitArray(initObj.filterDropDown); if (filterDef.ajax == null) { api.columns(filterDef.columnsIdxList).every(function () { - let column = this - let select = initSelectForColumn(id, column); - column.data().unique().sort().each(function (d) { - addOption(select, d) + const column = this; + const select = initSelectForColumn(id, column); + + column.data().unique().sort().each((d) => { + addOption(select, d); }); }); } else { - // fetch column options from server for server side processing - let columnsQuery = ( - "columns=" - + encodeURIComponent( + // Fetch column options from server for server side processing + const columnsQuery = ( + `columns=${encodeURIComponent( api.columns(filterDef.columnsIdxList).dataSrc().join() - ) - ) - $.getJSON(filterDef.ajax + "?" + columnsQuery, function (columnsOptions) { + )}` + ); + + $.getJSON(`${filterDef.ajax}?${columnsQuery}`, (columnsOptions) => { api.columns(filterDef.columnsIdxList).every(function () { - let column = this; - let select = initSelectForColumn(id, column); - let columnName = column.dataSrc() + const column = this; + const select = initSelectForColumn(id, column); + const columnName = column.dataSrc(); + if (columnName in columnsOptions) { - columnsOptions[columnName].forEach(function (d) { - addOption(select, d) + columnsOptions[columnName].forEach((d) => { + addOption(select, d); }); } else { - console.warn( - "Missing column '" + columnName + "' in ajax response." - ) + console.warn(`Missing column '${columnName}' in ajax response.`); } }); }); } }); - -}(jQuery)); +})(jQuery); diff --git a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js index f4ac8527..2e304a4e 100644 --- a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js +++ b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js @@ -1 +1,2 @@ -!function(t){function n(t){let n={columns:[],columnsIdxList:[],bootstrap:!1,autoSize:!0,ajax:null,label:"Filter "};return"bootstrap"in t&&"boolean"==typeof t.bootstrap&&(n.bootstrap=t.bootstrap),"autoSize"in t&&"boolean"==typeof t.autoSize&&(n.autoSize=t.autoSize),"ajax"in t&&"string"==typeof t.ajax&&(n.ajax=t.ajax),"label"in t&&"string"==typeof t.label&&(n.label=t.label),"columns"in t&&t.columns.forEach(function(t){if("idx"in t&&"number"==typeof t.idx){let e=t.idx;n.columns[e]={title:null,maxWidth:null,autoSize:!0},n.columnsIdxList.push(e),"title"in t&&"string"==typeof t.title&&(n.columns[e].title=t.title),"maxWidth"in t&&"string"==typeof t.maxWidth&&(n.columns[e].maxWidth=t.maxWidth),"autoSize"in t&&"boolean"==typeof t.autoSize&&(n.columns[e].autoSize=t.autoSize)}}),n}function e(t,n){""!=n&&t.append('")}function i(n,e){let i=t("#"+n+"_filterSelect"+e.index());return i.on("change",function(){let n=t.fn.dataTable.util.escapeRegex(t(this).val());e.search(n?"^"+n+"$":"",!0,!1).draw()}),i}t(document).on("preInit.dt",function(e,i){if("dt"===e.namespace){var o=new t.fn.dataTable.Api(i),l=o.table().node().id,a=o.init();if("filterDropDown"in a){var u=n(a.filterDropDown);if(0!=u.columns.length){var s=o.table().container(),c=l+"_filterWrapper",r=c+" "+(u.bootstrap?"form-inline":"");t(s).prepend('
'+u.label+"
"),o.columns(u.columnsIdxList).every(function(){let n=this.index(),e=null!==u.columns[n].title?u.columns[n].title:t(this.header()).html();""==e&&(e="column "+(n+1));let i=l+"_filterSelect"+n;t("#"+c).append('');let o=t("#"+i).empty().append('");u.autoSize&&u.columns[n].autoSize&&screen.width>768&&o.css("max-width",o.outerWidth()),null!==u.columns[n].maxWidth&&o.css("max-width",u.columns[n].maxWidth)})}}}}),t(document).on("init.dt",function(o,l){if("dt"===o.namespace){var a=new t.fn.dataTable.Api(l),u=a.table().node().id,s=a.init();if("filterDropDown"in s){var c=n(s.filterDropDown);if(null==c.ajax)a.columns(c.columnsIdxList).every(function(){let t=i(u,this);this.data().unique().sort().each(function(n){e(t,n)})});else{let n="columns="+encodeURIComponent(a.columns(c.columnsIdxList).dataSrc().join());t.getJSON(c.ajax+"?"+n,function(t){a.columns(c.columnsIdxList).every(function(){let n=i(u,this),o=this.dataSrc();o in t?t[o].forEach(function(t){e(n,t)}):console.warn("Missing column '"+o+"' in ajax response.")})})}}}})}(jQuery); \ No newline at end of file +(c=>{"use strict";const r=t=>{const e={columns:[],columnsIdxList:[],bootstrap:!1,bootstrap_version:3,autoSize:!0,ajax:null,label:"Filter "};return"bootstrap"in t&&"boolean"==typeof t.bootstrap&&(e.bootstrap=t.bootstrap),"bootstrap_version"in t&&"number"==typeof t.bootstrap_version&&(e.bootstrap_version=t.bootstrap_version),"autoSize"in t&&"boolean"==typeof t.autoSize&&(e.autoSize=t.autoSize),"ajax"in t&&"string"==typeof t.ajax&&(e.ajax=t.ajax),"label"in t&&"string"==typeof t.label&&(e.label=t.label),"columns"in t&&t.columns.forEach(t=>{if("idx"in t&&"number"==typeof t.idx){const o=t.idx;e.columns[o]={title:null,maxWidth:null,autoSize:!0},e.columnsIdxList.push(o),"title"in t&&"string"==typeof t.title&&(e.columns[o].title=t.title),"maxWidth"in t&&"string"==typeof t.maxWidth&&(e.columns[o].maxWidth=t.maxWidth),"autoSize"in t&&"boolean"==typeof t.autoSize&&(e.columns[o].autoSize=t.autoSize)}}),e},l=(t,o)=>{""!==o&&t.append(``)},u=(t,o)=>{const e=c(`#${t}_filterSelect`+o.index());return c(e).change(()=>{const t=c.fn.dataTable.util.escapeRegex(c(e).val());o.search(t?`^${t}$`:"",!0,!1).draw()}),e};c(document).on("preInit.dt",(t,o)=>{if("dt"===t.namespace){const e=new c.fn.dataTable.Api(o),s=e.table().node().id,n=e.init();if("filterDropDown"in n){const a=r(n.filterDropDown);if(0!==a.columns.length){const i=e.table().container(),l=s+"_filterWrapper";let t=l+" "+(a.bootstrap?"form-inline":"");a.bootstrap&&5===a.bootstrap_version&&(t=l+" input-group my-3"),c(i).prepend(`
${a.label}
`),e.columns(a.columnsIdxList).every(function(){const t=this.index();let o=null!==a.columns[t].title?a.columns[t].title:c(this.header()).html();""===o&&(o="column "+(t+1));const e=s+"_filterSelect"+t;let n=``;a.bootstrap&&5===a.bootstrap_version&&(n=``),c("#"+l).append(n);const i=c("#"+e).empty().append(``);a.autoSize&&a.columns[t].autoSize&&768{if("dt"===t.namespace){const e=new c.fn.dataTable.Api(o),i=e.table().node().id,n=e.init();if("filterDropDown"in n){const s=r(n.filterDropDown);if(null==s.ajax)e.columns(s.columnsIdxList).every(function(){const t=this,o=u(i,t);t.data().unique().sort().each(t=>{l(o,t)})});else{const a="columns="+encodeURIComponent(e.columns(s.columnsIdxList).dataSrc().join());c.getJSON(s.ajax+"?"+a,n=>{e.columns(s.columnsIdxList).every(function(){const t=this,o=u(i,t),e=t.dataSrc();e in n?n[e].forEach(t=>{l(o,t)}):console.warn(`Missing column '${e}' in ajax response.`)})})}}}})})(jQuery); +//# sourceMappingURL=filterDropDown.min.js.map \ No newline at end of file diff --git a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js.map b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js.map new file mode 100644 index 00000000..75a7a2f6 --- /dev/null +++ b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["filterDropDown.js"],"names":["parseInitArray","filterDef","columns","columnsIdxList","bootstrap","bootstrap_version","autoSize","ajax","label","initArray","forEach","initColumn","idx","title","maxWidth","push","addOption","select","d","append","initSelectForColumn","id","column","$","index","change","val","fn","dataTable","util","escapeRegex","search","draw","document","on","e","settings","namespace","api","Api","table","node","initObj","init","filterDropDown","length","container","filterWrapperId","let","divCssClass","prepend","every","this","colName","header","html","selectId","selectMarkup","empty","screen","width","css","outerWidth","data","unique","sort","each","columnsQuery","encodeURIComponent","dataSrc","join","getJSON","columnName","columnsOptions","console","warn","jQuery"],"mappings":"CASC,IACG,aASA,MAAMA,EAAiB,IAMnB,MAAMC,EAAY,CACdC,QAAW,GACXC,eAAkB,GAClBC,UAAa,CAAA,EACbC,kBAAqB,EACrBC,SAAY,CAAA,EACZC,KAAQ,KACRC,MAAS,SACb,EAuDA,MApDK,cAAeC,GAA8C,WAA/B,OAAOA,EAAUL,YAChDH,EAAUG,UAAYK,EAAUL,WAG/B,sBAAuBK,GAAsD,UAAvC,OAAOA,EAAUJ,oBACxDJ,EAAUI,kBAAoBI,EAAUJ,mBAGvC,aAAcI,GAA6C,WAA9B,OAAOA,EAAUH,WAC/CL,EAAUK,SAAWG,EAAUH,UAG9B,SAAUG,GAAyC,UAA1B,OAAOA,EAAUF,OAC3CN,EAAUM,KAAOE,EAAUF,MAG1B,UAAWE,GAA0C,UAA3B,OAAOA,EAAUD,QAC5CP,EAAUO,MAAQC,EAAUD,OAI5B,YAAaC,GACbA,EAAUP,QAAQQ,QAAQ,IACtB,GAAK,QAASC,GAA0C,UAA1B,OAAOA,EAAWC,IAAmB,CAE/D,MAAMA,EAAMD,EAAWC,IAEvBX,EAAUC,QAAQU,GAAO,CACrBC,MAAS,KACTC,SAAY,KACZR,SAAY,CAAA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E,cAAc,EAEvD,GAAsB,MAAlB3C,EAAUM,KACV+B,EAAIpC,QAAQD,EAAUE,cAAc,EAAEgD,MAAM,WACxC,MAAM7B,EAAS8B,KACTnC,EAASG,EAAoBC,EAAIC,CAAM,EAE7CA,EAAOyC,KAAK,EAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,IAC/BlD,EAAUC,EAAQC,CAAC,CACvB,CAAC,CACL,CAAC,MACE,CAEH,MAAMiD,EAAe,WACNC,mBACP9B,EAAIpC,QAAQD,EAAUE,cAAc,EAAEkE,QAAQ,EAAEC,KAAK,CACzD,EAGJ/C,EAAEgD,QAAWtE,EAAUM,KAAb,IAAqB4D,EAAgB,IAC3C7B,EAAIpC,QAAQD,EAAUE,cAAc,EAAEgD,MAAM,WACxC,MAAM7B,EAAS8B,KACTnC,EAASG,EAAoBC,EAAIC,CAAM,EACvCkD,EAAalD,EAAO+C,QAAQ,EAE9BG,KAAcC,EACdA,EAAeD,GAAY9D,QAAQ,IAC/BM,EAAUC,EAAQC,CAAC,CACvB,CAAC,EAEDwD,QAAQC,wBAAwBH,sBAA+B,CAEvE,CAAC,CACL,CAAC,CACL,CArCA,CAdA,CAoDJ,CAAC,CACJ,GAAEI,MAAM"} \ No newline at end of file From 5cd5180a913072600e48753f5be671922acc529c Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Thu, 25 Jan 2024 18:46:26 +0100 Subject: [PATCH 2/3] [CHANGE] Use the now official release version --- .../js/filterDropDown/filterDropDown.js | 131 +++++++++++------- .../js/filterDropDown/filterDropDown.min.js | 3 +- .../filterDropDown/filterDropDown.min.js.map | 1 - 3 files changed, 81 insertions(+), 54 deletions(-) delete mode 100644 allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js.map diff --git a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.js b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.js index c41415b2..4be8a415 100644 --- a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.js +++ b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.js @@ -1,14 +1,14 @@ /** * filterDropDown.js * - * Copyright (C) 2017-18 Erik Kalkoken + * Copyright (C) 2017-24 Erik Kalkoken * - * Extension for the jQuery plug-in DataTables (developed and tested with v1.10.15) + * Extension for the jQuery plug-in DataTables (developed and tested with v1.13.7) * - * Version 0.4.0 + * Version 0.5.0 **/ (($) => { - 'use strict'; + "use strict"; /** * Parse initialization array and returns filterDef array to faster and easy use, @@ -24,62 +24,80 @@ * @type {{autoSize: boolean, bootstrap_version: number, columnsIdxList: *[], columns: *[], bootstrap: boolean, label: string, ajax: null}} */ const filterDef = { - 'columns': [], - 'columnsIdxList': [], - 'bootstrap': false, - 'bootstrap_version': 3, - 'autoSize': true, - 'ajax': null, - 'label': 'Filter ' + columns: [], + columnsIdxList: [], + bootstrap: false, + bootstrap_version: 3, + autoSize: true, + ajax: null, + label: "Filter ", }; // Set filter properties if they have been defined otherwise the defaults will be used - if (('bootstrap' in initArray) && (typeof initArray.bootstrap === 'boolean')) { + if ( + "bootstrap" in initArray && + typeof initArray.bootstrap === "boolean" + ) { filterDef.bootstrap = initArray.bootstrap; } - if (('bootstrap_version' in initArray) && (typeof initArray.bootstrap_version === 'number')) { + if ( + "bootstrap_version" in initArray && + typeof initArray.bootstrap_version === "number" + ) { filterDef.bootstrap_version = initArray.bootstrap_version; } - if (('autoSize' in initArray) && (typeof initArray.autoSize === 'boolean')) { + if ( + "autoSize" in initArray && + typeof initArray.autoSize === "boolean" + ) { filterDef.autoSize = initArray.autoSize; } - if (('ajax' in initArray) && (typeof initArray.ajax === 'string')) { + if ("ajax" in initArray && typeof initArray.ajax === "string") { filterDef.ajax = initArray.ajax; } - if (('label' in initArray) && (typeof initArray.label === 'string')) { + if ("label" in initArray && typeof initArray.label === "string") { filterDef.label = initArray.label; } // Add definition for each column - if ('columns' in initArray) { + if ("columns" in initArray) { initArray.columns.forEach((initColumn) => { - if (('idx' in initColumn) && (typeof initColumn.idx === 'number')) { + if ("idx" in initColumn && typeof initColumn.idx === "number") { // Initialize column const idx = initColumn.idx; filterDef.columns[idx] = { - 'title': null, - 'maxWidth': null, - 'autoSize': true + title: null, + maxWidth: null, + autoSize: true, }; // Add to a list of indices in the same order they appear in the init array filterDef.columnsIdxList.push(idx); // Set column properties if they have been defined otherwise the defaults will be used - if (('title' in initColumn) && (typeof initColumn.title === 'string')) { + if ( + "title" in initColumn && + typeof initColumn.title === "string" + ) { filterDef.columns[idx].title = initColumn.title; } - if (('maxWidth' in initColumn) && (typeof initColumn.maxWidth === 'string')) { + if ( + "maxWidth" in initColumn && + typeof initColumn.maxWidth === "string" + ) { filterDef.columns[idx].maxWidth = initColumn.maxWidth; } - if (('autoSize' in initColumn) && (typeof initColumn.autoSize === 'boolean')) { + if ( + "autoSize" in initColumn && + typeof initColumn.autoSize === "boolean" + ) { filterDef.columns[idx].autoSize = initColumn.autoSize; } } @@ -96,7 +114,7 @@ * @param d */ const addOption = (select, d) => { - if (d !== '') { + if (d !== "") { select.append(``); } }; @@ -114,7 +132,7 @@ $(select).change(() => { const val = $.fn.dataTable.util.escapeRegex($(select).val()); - column.search(val ? `^${val}$` : '', true, false).draw(); + column.search(val ? `^${val}$` : "", true, false).draw(); }); return select; @@ -122,8 +140,8 @@ // Add filterDropDown container div, draw select elements with default options. // Use preInit so that elements are created and correctly shown before data is loaded - $(document).on('preInit.dt', (e, settings) => { - if (e.namespace !== 'dt') { + $(document).on("preInit.dt", (e, settings) => { + if (e.namespace !== "dt") { return; } @@ -138,7 +156,7 @@ // Only proceed if the filter has been defined in the current table, // otherwise don't do anything. - if (!('filterDropDown' in initObj)) { + if (!("filterDropDown" in initObj)) { return; } @@ -157,7 +175,9 @@ const filterWrapperId = `${id}_filterWrapper`; // Set CSS classes for the filter wrapper div depending on bootstrap setting - let divCssClass = `${filterWrapperId} ${(filterDef.bootstrap) ? 'form-inline' : ''}`; + let divCssClass = `${filterWrapperId} ${ + filterDef.bootstrap ? "form-inline" : "" + }`; if (filterDef.bootstrap && filterDef.bootstrap_version === 5) { divCssClass = `${filterWrapperId} input-group my-3`; } @@ -170,11 +190,12 @@ const idx = this.index(); // set title of current column - let colName = (filterDef.columns[idx].title !== null) - ? filterDef.columns[idx].title - : $(this.header()).html(); + let colName = + filterDef.columns[idx].title !== null + ? filterDef.columns[idx].title + : $(this.header()).html(); - if (colName === '') { + if (colName === "") { colName = `column ${idx + 1}`; } @@ -187,29 +208,33 @@ selectMarkup = ``; } - $('#' + filterWrapperId).append(selectMarkup); + $("#" + filterWrapperId).append(selectMarkup); // Initializing select for current column and applying event to react to changes - const select = $('#' + selectId) + const select = $("#" + selectId) .empty() .append(``); // Set max width of select elements to current width (which is defined by the size of the title) // Turn off on for very small screens for responsive design, or if autoSize has been set to false - if (filterDef.autoSize && filterDef.columns[idx].autoSize && (screen.width > 768)) { - select.css('max-width', select.outerWidth()); + if ( + filterDef.autoSize && + filterDef.columns[idx].autoSize && + screen.width > 768 + ) { + select.css("max-width", select.outerWidth()); } // Apply optional css style if defined in the init array will override automatic max width setting if (filterDef.columns[idx].maxWidth !== null) { - select.css('max-width', filterDef.columns[idx].maxWidth); + select.css("max-width", filterDef.columns[idx].maxWidth); } }); }); // Filter table and add available options to dropDowns - $(document).on('init.dt', (e, settings) => { - if (e.namespace !== 'dt') { + $(document).on("init.dt", (e, settings) => { + if (e.namespace !== "dt") { return; } @@ -223,7 +248,7 @@ const initObj = api.init(); // Only proceed if a filter has been defined in the current table, otherwise don't do anything. - if (!('filterDropDown' in initObj)) { + if (!("filterDropDown" in initObj)) { return; } @@ -235,17 +260,19 @@ const column = this; const select = initSelectForColumn(id, column); - column.data().unique().sort().each((d) => { - addOption(select, d); - }); + column + .data() + .unique() + .sort() + .each((d) => { + addOption(select, d); + }); }); } else { // Fetch column options from server for server side processing - const columnsQuery = ( - `columns=${encodeURIComponent( - api.columns(filterDef.columnsIdxList).dataSrc().join() - )}` - ); + const columnsQuery = `columns=${encodeURIComponent( + api.columns(filterDef.columnsIdxList).dataSrc().join() + )}`; $.getJSON(`${filterDef.ajax}?${columnsQuery}`, (columnsOptions) => { api.columns(filterDef.columnsIdxList).every(function () { @@ -258,7 +285,9 @@ addOption(select, d); }); } else { - console.warn(`Missing column '${columnName}' in ajax response.`); + console.warn( + `Missing column '${columnName}' in ajax response.` + ); } }); }); diff --git a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js index 2e304a4e..bb36e1fc 100644 --- a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js +++ b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js @@ -1,2 +1 @@ -(c=>{"use strict";const r=t=>{const e={columns:[],columnsIdxList:[],bootstrap:!1,bootstrap_version:3,autoSize:!0,ajax:null,label:"Filter "};return"bootstrap"in t&&"boolean"==typeof t.bootstrap&&(e.bootstrap=t.bootstrap),"bootstrap_version"in t&&"number"==typeof t.bootstrap_version&&(e.bootstrap_version=t.bootstrap_version),"autoSize"in t&&"boolean"==typeof t.autoSize&&(e.autoSize=t.autoSize),"ajax"in t&&"string"==typeof t.ajax&&(e.ajax=t.ajax),"label"in t&&"string"==typeof t.label&&(e.label=t.label),"columns"in t&&t.columns.forEach(t=>{if("idx"in t&&"number"==typeof t.idx){const o=t.idx;e.columns[o]={title:null,maxWidth:null,autoSize:!0},e.columnsIdxList.push(o),"title"in t&&"string"==typeof t.title&&(e.columns[o].title=t.title),"maxWidth"in t&&"string"==typeof t.maxWidth&&(e.columns[o].maxWidth=t.maxWidth),"autoSize"in t&&"boolean"==typeof t.autoSize&&(e.columns[o].autoSize=t.autoSize)}}),e},l=(t,o)=>{""!==o&&t.append(``)},u=(t,o)=>{const e=c(`#${t}_filterSelect`+o.index());return c(e).change(()=>{const t=c.fn.dataTable.util.escapeRegex(c(e).val());o.search(t?`^${t}$`:"",!0,!1).draw()}),e};c(document).on("preInit.dt",(t,o)=>{if("dt"===t.namespace){const e=new c.fn.dataTable.Api(o),s=e.table().node().id,n=e.init();if("filterDropDown"in n){const a=r(n.filterDropDown);if(0!==a.columns.length){const i=e.table().container(),l=s+"_filterWrapper";let t=l+" "+(a.bootstrap?"form-inline":"");a.bootstrap&&5===a.bootstrap_version&&(t=l+" input-group my-3"),c(i).prepend(`
${a.label}
`),e.columns(a.columnsIdxList).every(function(){const t=this.index();let o=null!==a.columns[t].title?a.columns[t].title:c(this.header()).html();""===o&&(o="column "+(t+1));const e=s+"_filterSelect"+t;let n=``;a.bootstrap&&5===a.bootstrap_version&&(n=``),c("#"+l).append(n);const i=c("#"+e).empty().append(``);a.autoSize&&a.columns[t].autoSize&&768{if("dt"===t.namespace){const e=new c.fn.dataTable.Api(o),i=e.table().node().id,n=e.init();if("filterDropDown"in n){const s=r(n.filterDropDown);if(null==s.ajax)e.columns(s.columnsIdxList).every(function(){const t=this,o=u(i,t);t.data().unique().sort().each(t=>{l(o,t)})});else{const a="columns="+encodeURIComponent(e.columns(s.columnsIdxList).dataSrc().join());c.getJSON(s.ajax+"?"+a,n=>{e.columns(s.columnsIdxList).every(function(){const t=this,o=u(i,t),e=t.dataSrc();e in n?n[e].forEach(t=>{l(o,t)}):console.warn(`Missing column '${e}' in ajax response.`)})})}}}})})(jQuery); -//# sourceMappingURL=filterDropDown.min.js.map \ No newline at end of file +($=>{"use strict";const parseInitArray=initArray=>{const filterDef={columns:[],columnsIdxList:[],bootstrap:false,bootstrap_version:3,autoSize:true,ajax:null,label:"Filter "};if("bootstrap"in initArray&&typeof initArray.bootstrap==="boolean"){filterDef.bootstrap=initArray.bootstrap}if("bootstrap_version"in initArray&&typeof initArray.bootstrap_version==="number"){filterDef.bootstrap_version=initArray.bootstrap_version}if("autoSize"in initArray&&typeof initArray.autoSize==="boolean"){filterDef.autoSize=initArray.autoSize}if("ajax"in initArray&&typeof initArray.ajax==="string"){filterDef.ajax=initArray.ajax}if("label"in initArray&&typeof initArray.label==="string"){filterDef.label=initArray.label}if("columns"in initArray){initArray.columns.forEach(initColumn=>{if("idx"in initColumn&&typeof initColumn.idx==="number"){const idx=initColumn.idx;filterDef.columns[idx]={title:null,maxWidth:null,autoSize:true};filterDef.columnsIdxList.push(idx);if("title"in initColumn&&typeof initColumn.title==="string"){filterDef.columns[idx].title=initColumn.title}if("maxWidth"in initColumn&&typeof initColumn.maxWidth==="string"){filterDef.columns[idx].maxWidth=initColumn.maxWidth}if("autoSize"in initColumn&&typeof initColumn.autoSize==="boolean"){filterDef.columns[idx].autoSize=initColumn.autoSize}}})}return filterDef};const addOption=(select,d)=>{if(d!==""){select.append(``)}};const initSelectForColumn=(id,column)=>{const select=$(`#${id}_filterSelect${column.index()}`);$(select).change(()=>{const val=$.fn.dataTable.util.escapeRegex($(select).val());column.search(val?`^${val}$`:"",true,false).draw()});return select};$(document).on("preInit.dt",(e,settings)=>{if(e.namespace!=="dt"){return}const api=new $.fn.dataTable.Api(settings);const id=api.table().node().id;const initObj=api.init();if(!("filterDropDown"in initObj)){return}const filterDef=parseInitArray(initObj.filterDropDown);if(filterDef.columns.length===0){return}const container=api.table().container();const filterWrapperId=`${id}_filterWrapper`;let divCssClass=`${filterWrapperId} ${filterDef.bootstrap?"form-inline":""}`;if(filterDef.bootstrap&&filterDef.bootstrap_version===5){divCssClass=`${filterWrapperId} input-group my-3`}$(container).prepend(`
${filterDef.label}
`);api.columns(filterDef.columnsIdxList).every(function(){const idx=this.index();let colName=filterDef.columns[idx].title!==null?filterDef.columns[idx].title:$(this.header()).html();if(colName===""){colName=`column ${idx+1}`}const selectId=`${id}_filterSelect${idx}`;let selectMarkup=``;if(filterDef.bootstrap&&filterDef.bootstrap_version===5){selectMarkup=``}$("#"+filterWrapperId).append(selectMarkup);const select=$("#"+selectId).empty().append(``);if(filterDef.autoSize&&filterDef.columns[idx].autoSize&&screen.width>768){select.css("max-width",select.outerWidth())}if(filterDef.columns[idx].maxWidth!==null){select.css("max-width",filterDef.columns[idx].maxWidth)}})});$(document).on("init.dt",(e,settings)=>{if(e.namespace!=="dt"){return}const api=new $.fn.dataTable.Api(settings);const id=api.table().node().id;const initObj=api.init();if(!("filterDropDown"in initObj)){return}const filterDef=parseInitArray(initObj.filterDropDown);if(filterDef.ajax==null){api.columns(filterDef.columnsIdxList).every(function(){const column=this;const select=initSelectForColumn(id,column);column.data().unique().sort().each(d=>{addOption(select,d)})})}else{const columnsQuery=`columns=${encodeURIComponent(api.columns(filterDef.columnsIdxList).dataSrc().join())}`;$.getJSON(`${filterDef.ajax}?${columnsQuery}`,columnsOptions=>{api.columns(filterDef.columnsIdxList).every(function(){const column=this;const select=initSelectForColumn(id,column);const columnName=column.dataSrc();if(columnName in columnsOptions){columnsOptions[columnName].forEach(d=>{addOption(select,d)})}else{console.warn(`Missing column '${columnName}' in ajax response.`)}})})}})})(jQuery); diff --git a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js.map b/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js.map deleted file mode 100644 index 75a7a2f6..00000000 --- a/allianceauth/static/allianceauth/js/filterDropDown/filterDropDown.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["filterDropDown.js"],"names":["parseInitArray","filterDef","columns","columnsIdxList","bootstrap","bootstrap_version","autoSize","ajax","label","initArray","forEach","initColumn","idx","title","maxWidth","push","addOption","select","d","append","initSelectForColumn","id","column","$","index","change","val","fn","dataTable","util","escapeRegex","search","draw","document","on","e","settings","namespace","api","Api","table","node","initObj","init","filterDropDown","length","container","filterWrapperId","let","divCssClass","prepend","every","this","colName","header","html","selectId","selectMarkup","empty","screen","width","css","outerWidth","data","unique","sort","each","columnsQuery","encodeURIComponent","dataSrc","join","getJSON","columnName","columnsOptions","console","warn","jQuery"],"mappings":"CASC,IACG,aASA,MAAMA,EAAiB,IAMnB,MAAMC,EAAY,CACdC,QAAW,GACXC,eAAkB,GAClBC,UAAa,CAAA,EACbC,kBAAqB,EACrBC,SAAY,CAAA,EACZC,KAAQ,KACRC,MAAS,SAC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EAEDwD,QAAQC,wBAAwBH,sBAA+B,CAEvE,CAAC,CACL,CAAC,CACL,CArCA,CAdA,CAoDJ,CAAC,CACJ,GAAEI,MAAM"} \ No newline at end of file From 3ebf11308cb06d44a9290c71aa62c5559cb2e579 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sun, 4 Feb 2024 13:40:48 +0100 Subject: [PATCH 3/3] [CHANGE] Re-enable filterDropdown JS --- .../groupmanagement/templates/groupmanagement/audit.html | 5 +++-- .../permissions_tool/templates/permissions_tool/audit.html | 5 +++-- .../templates/permissions_tool/overview.html | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/allianceauth/groupmanagement/templates/groupmanagement/audit.html b/allianceauth/groupmanagement/templates/groupmanagement/audit.html index 0a6ed580..12d6550d 100644 --- a/allianceauth/groupmanagement/templates/groupmanagement/audit.html +++ b/allianceauth/groupmanagement/templates/groupmanagement/audit.html @@ -71,7 +71,7 @@ {% block extra_javascript %} {% include 'bundles/datatables-js-bs5.html' %} {% include 'bundles/moment-js.html' with locale=True %} -{# {% include 'bundles/filterdropdown-js.html' %}#} + {% include 'bundles/filterdropdown-js.html' %}