Widget: DevGuidelines: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Cschwentker (talk | contribs)
No edit summary
Cschwentker (talk | contribs)
No edit summary
Line 222: Line 222:


         const getQueryUrl = query => '/api.php?action=ask&format=json&query=' + encodeURIComponent(query);
         const getQueryUrl = query => '/api.php?action=ask&format=json&query=' + encodeURIComponent(query);
        const escapeAttr = text => text ? text.replace(/\W/g, '-') : text;


         const PHASE_PROP = 'Disaster Management Phase';
         const PHASE_PROP = 'Disaster Management Phase';
Line 238: Line 239:
             + '|?' + TA_PROP;
             + '|?' + TA_PROP;


           
         async function getGuidelines() {
         async function getGuidelines() {
             const guidelinesResponse = await fetch(getQueryUrl(guidelineQuery)).then(response => response.json());
             const guidelinesResponse = await fetch(getQueryUrl(guidelineQuery)).then(response => response.json());
Line 263: Line 265:
             const guidelines = data[0];
             const guidelines = data[0];


            consolel.log(guidelines);
             const table = new Tabulator('#guideline-tabulator', {
             const table = new Tabulator('#guideline-tabulator', {
                 data: guidelines,
                 data: guidelines,
Line 311: Line 314:
                 const summary = document.getElementById('filter-summary');
                 const summary = document.getElementById('filter-summary');
                 const filter = filters[0];
                 const filter = filters[0];
             });
             });



Revision as of 15:06, 22 November 2022

Development version of the List of Guidelines.
Not ready for production!