{"id":257,"date":"2020-09-26T19:15:00","date_gmt":"2020-09-26T18:15:00","guid":{"rendered":"https:\/\/lead.uab.pt\/?page_id=257"},"modified":"2024-09-17T17:07:21","modified_gmt":"2024-09-17T17:07:21","slug":"projects-and-network","status":"publish","type":"page","link":"https:\/\/lead.uab.pt\/en\/projects-and-network\/","title":{"rendered":"Projects &amp; Networks"},"content":{"rendered":"\n<div id=\"gbcm-_df6324-8a\" class=\"wp-block-c3-framew-gutenbergblocks-contentsmenublock gbcm\" role=\"navigation\" aria-label=\"\" data-expand-menu-label=\"\" data-collapse-menu-label=\"\"><div class=\"gbcm-menu-wrapper\"><div id=\"gbcm-_df6324-8a-menu-container\" class=\"gbcm-menu-container\"><div class=\"gbcm-title\" id=\"gbcm-_df6324-8a-title\">Go to:<\/div><ul aria-describedby=\"gbcm-_df6324-8a-title\" class=\"gbcm-menuitems\"><li><a href=\"#projetos\">Projects<\/a><\/li><li class=\"gbcm-scroll-to-top-wrapper\"><a class=\"gbcm-scroll-to-top\" href=\"#top\">Top<\/a><\/li><\/ul><\/div><\/div><\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-1 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:67%\">\n<h2 class=\"wp-block-heading has-text-align-center has-text-color has-link-color has-large-font-size wp-elements-ecd8fb6b1030fb87bf669d41dee25f4c\" id=\"projetos\" style=\"color:#2f7675\"><strong>Projects<\/strong><\/h2>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>LE@D coordinates and participates in several research projects, both externally funded and self-funded, involving integrated researchers, associated and external researchers, doctoral students and master&#8217;s students supervised by the Centre&#8217;s members.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:20px\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"492\" height=\"492\" src=\"https:\/\/lead.uab.pt\/en\/wp-content\/uploads\/sites\/2\/2023\/12\/projetos-1-lead.jpg\" alt=\"\" class=\"wp-image-15466\" srcset=\"https:\/\/lead.uab.pt\/en\/wp-content\/uploads\/sites\/2\/2023\/12\/projetos-1-lead.jpg 492w, https:\/\/lead.uab.pt\/en\/wp-content\/uploads\/sites\/2\/2023\/12\/projetos-1-lead-300x300.jpg 300w, https:\/\/lead.uab.pt\/en\/wp-content\/uploads\/sites\/2\/2023\/12\/projetos-1-lead-150x150.jpg 150w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n\n\n    \n    \n    \n\n    <section >\n                <form id=\"projects-search\" name=\"projects-search\" class=\"projects-as-grid\" data-api-url=\"https:\/\/lead.uab.pt\/en\/wp-json\/wp\/v2\" aria-controls=\"projects-list\">\n            <div class=\"container\">\n                <div class=\"row gap-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm  p-0 pr-sm-2 mb-1\">\n\t\t\t\t\t\t\t\t<label for=\"project_year\" class=\"visually-hidden\">Year: <\/label>\n\t\t\t\t\t\t\t\t<select id=\"project_year\" name=\"project_year\" class=\"form-select project-taxonomy-filter disabled-filter\" data-api-url=\"${apiUrl}\/${taxonomy}?type=project\" data-include=\"\" data-exclude=\"\"  data-order=\"asc\" data-orderby=\"name\" data-hide_empty=\"true\" style=\"-webkit-appearance: none;-moz-appearance: none; appearance: none;\">\n\t\t\t\t\t\t\t\t\t<option value=\"\" class=\"font-weight-bold taxonomy-label\">Year<\/option>\n\t\t\t\t\t\t\t\t<\/select>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm  p-0 pr-sm-2 mb-1\">\n\t\t\t\t\t\t\t\t<label for=\"project_funding\" class=\"visually-hidden\">Funding: <\/label>\n\t\t\t\t\t\t\t\t<select id=\"project_funding\" name=\"project_funding\" class=\"form-select project-taxonomy-filter disabled-filter\" data-api-url=\"${apiUrl}\/${taxonomy}?type=project\" data-include=\"\" data-exclude=\"\"  data-order=\"asc\" data-orderby=\"name\" data-hide_empty=\"true\" style=\"-webkit-appearance: none;-moz-appearance: none; appearance: none;\">\n\t\t\t\t\t\t\t\t\t<option value=\"\" class=\"font-weight-bold taxonomy-label\">Funding<\/option>\n\t\t\t\t\t\t\t\t<\/select>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-sm  p-0 pr-sm-2 mb-1\">\n\t\t\t\t\t\t\t\t<label for=\"project_status\" class=\"visually-hidden\">Type: <\/label>\n\t\t\t\t\t\t\t\t<select id=\"project_status\" name=\"project_status\" class=\"form-select project-taxonomy-filter disabled-filter\" data-api-url=\"${apiUrl}\/${taxonomy}?type=project\" data-include=\"\" data-exclude=\"\" data-selected=\"internal-projects\" data-order=\"asc\" data-orderby=\"name\" data-hide_empty=\"true\" style=\"-webkit-appearance: none;-moz-appearance: none; appearance: none;\">\n\t\t\t\t\t\t\t\t\t<option value=\"\" class=\"font-weight-bold taxonomy-label\">Type<\/option>\n\t\t\t\t\t\t\t\t<\/select>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t                    \n                    <div class=\"align-items-stretch col-sm d-flex flex-sm-grow-0 justify-content-center mb-1 p-0\">\n                        <div class=\"input-group flex-nowrap projects-layout-btn-group\" role=\"radiogroup\" aria-label=\"Layout\">\n                            <button type=\"button\" role=\"radio\" aria-checked=\"true\" id=\"projects-as-grid\" class=\"projects-layout-btn btn btn-sm btn-outline-secondary d-flex align-items-center active\" title=\"Grid\" aria-label=\"Grid\">\n                                <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" height=\"100%\" width=\"100%\" viewBox=\"0 -256 1800 1800\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M0-56h519.593v400H0zm640.407 0H1160v400H640.407zM1280-56h519.593v400H1280zM0 464h519.593v400H0zm640.407 0H1160v400H640.407zM1280 464h519.593v400H1280zM0 984h519.593v400H0zm640.407 0H1160v400H640.407zM1280 984h519.593v400H1280z\"\/><\/svg>\n\t\t\t\t\t\t\t<\/button>\n                            <button type=\"button\" role=\"radio\" aria-checked=\"false\" id=\"projects-as-list\" class=\"projects-layout-btn btn btn-light btn-sm btn-outline-secondary d-flex align-items-center \" title=\"List\" aria-label=\"List\">\n                                <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" height=\"100%\" width=\"100%\" viewBox=\"0 -256 1800 1800\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M0 984h1800v400H0zm0-520h1800v400H0zM0-56h1800v400H0z\"\/><\/svg>\n\t\t\t\t\t\t\t<\/button>\n                        <\/div>\n\t\t\t\t\t\t<input type=\"hidden\" name=\"projects-layout\" id=\"projects-layout\" value=\"projects-as-grid\">\n                    <\/div>\n                <\/div><div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input id=\"search-field\" type=\"text\" class=\"projects-search-input form-control form-control-xs mt-2 mb-5 project-search-filter disabled-filter\" name=\"search\" value=\"\" placeholder=\"Search...\" data-api-url=\"${apiUrl}\/project\" title=\"Search Field\">\n\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<input style=\"display: none;\" type=\"submit\" value=\"Submit Search\"><\/div>\n            \n            <div id=\"projects-container\">\n                <div id=\"projects-list\" class=\"\" aria-live=\"polite\" >\n                    <div class=\"container\">Loading&#8230;<\/div>\n                <\/div>\n                <div>\n                    <div class=\"wp-block-button is-style-theme-button-solid mt-4 mt-lg-0 text-center\">\n                        <button id=\"loading-button\" class=\"hide-if-no-js wp-block-button__link\"><span class=\"loading-label\">Show More<\/span>\u00a0<\/button>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/form>\n    <\/section>\n    <script>\n        (function(isSupported){\n        'use strict';\n        \n        document.head.insertAdjacentHTML(\"beforeend\", `\n            <style>\n                #projects-search .project-search-filter,\n                #projects-search .project-taxonomy-filter{\n                    transition: opacity 0.5s;\n                    font-size: 1rem;\n                    text-transform: uppercase;\n                }\n                #projects-search .disabled-filter{\n                    visibility: hidden;\n                    opacity: 0;\n                }\n                #projects-search .enabled-filter{\n                    visibility: visible;\n                    opacity: 1;\n                }\n               \n                #projects-search .projects-layout-btn svg{;\n                    height: calc(1.5em - 0.25rem);\n                    width: auto;\n                    pointer-events: none;\n                }\n                #projects-search .btn-light:not(:disabled):not(.disabled):active, \n                #projects-search .show>.btn-light.dropdown-toggle {\n                    color: #FFFFFF;\n                    background-color: #030303;\n                    border-color: #000000;\n                }\n                \n                #projects-search .btn-light:not(:disabled):not(.disabled):active svg{\n                }\n                \n                #projects-search .projects-list-title{\n                    background-color: #f2f2f2;\n                    color: #666666;\n                    vertical-align: middle;\n                    padding: .75rem;\n                    font-size: 1rem;\n                    margin: 40px 0 30px;\n                }#projects-list{\n                    min-height: 60px;\n                }\n                .loading{\n                    position: relative;\n                }\n                                .loading:after {\n                    content: '';\n                    display: inline-block;\n                    width: 1.5rem;\n                    height: 1.5rem;\n                    vertical-align: text-bottom;\n                    border: .25em solid currentColor;\n                    border-right-color: transparent;\n                    border-radius: 50%;\n                    animation: spinner-border .75s linear infinite;\n                    position: absolute;\n                    z-index: 3;\n                    left: calc(50% - 0.75rem);\n                    top: 0.75rem;\n                }\n                \n                .projects-layout-btn{\n                    border-color: transparent;\n                }\n                \n                #loading-button{\n                    line-height: 1.3rem;\n    \t\t\t\tborder: none;\n                }.taxonomy-tags-label,\n\t\t.taxonomy-tags-value{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.post-date-value {\n\t\t\ttext-transform: capitalize;\n\t\t}\n\t\t.projects-as-list .entry-thumbnail-wrapper{\n\t\t\tmax-width: 100px;\n\t\t}\n\t\t.loading:after{\n\t\t\tposition: static;\n\t\t}<\/style>\n        `);\n        \n        const taxonomiesInfo = {};\n        \n        const getForm = () => {\n            return document.querySelector('form#projects-search');\n        };\n        \n        const getContainer = ()=>{\n            const form = getForm();\n            return !!form?form.querySelector('#projects-list'):null;\n        };\n        \n        const getLoading = () => {\n            const form = getForm();\n            return !!form?form.querySelector('#loading-button'):null;\n        };\n        \n        const enableLoading = (loading=false) => {\n            const loadingButton = getLoading();\n            if(loadingButton){\n                const loadingLabel = loadingButton.querySelector('.loading-label');\n                if(!!loadingLabel){\n                    loadingLabel.style.display = loading?'none':'initial';\n                }\n                if(loading){\n                    loadingButton.classList.add(\"loading\");\n                    loadingButton.style.display = 'inline-block';\n                }else{\n                    if(ofPages()<=currentPage()){\n                        loadingButton.style.display = 'none';\n                    }\n                    loadingButton.classList.remove(\"loading\");\n                }\n                loadingButton.setAttribute(\"aria-busy\", Boolean(loading));\n                loadingButton.dataset.loading =  Boolean(loading);\n            }\n        };\n        \n        const isLoading = () => {\n            const loadingButton = getLoading();\n            return !!loadingButton && String(loadingButton.dataset.loading).toLowerCase() === \"true\";\n        };\n        \n        const currentPage = () => {\n            const loadingButton = getLoading();\n            return !!loadingButton && !!loadingButton.dataset.page ? parseInt(loadingButton.dataset.page) : 0 ;\n        };\n        \n        const ofPages = () => {\n            const loadingButton = getLoading();\n            return !!loadingButton && !!loadingButton.dataset.totalPages ? loadingButton.dataset.totalPages : 0 ;\n        };\n        \n        const doGetApiRequest = (url, page=1, allPages=false) => {\n            let totalPages = 0;\n            \n            const loadingButton = getLoading();\n            if(loadingButton && !allPages){\n                loadingButton.dataset.page = page;\n            }\n            \n            return fetch( url, {\n                \/*credentials: 'omit',*\/\n                mode: 'cors',\n\t\t\t\theaders: new Headers({'content-type': 'application\/json'}),\n            })\n            .then( response => {\n                if (response.status === 200) {\n                    const contentType = response.headers.get('content-type');\n                    totalPages = response.headers.get('X-WP-TotalPages');\n                    if(loadingButton && !allPages){\n                        loadingButton.dataset.totalPages = totalPages;\n                    }\n                    if (!contentType || !contentType.includes('application\/json')) {\n                        throw new TypeError(\"Invalid JSON response\");\n                    }\n                    return response.json();\n                }\n            })\n            .then( response => {\n                if (page>1 || totalPages<=1) {\n                    return response;\n                }else if(allPages){\n                    let pageUrl = new URL(url);\n                    let params = new URLSearchParams(url.search);\n                    const requests = Array.from({length:(totalPages-1)},(v,k)=>k+1+1).map(page=>{\n                        params.set('page', page);\n                        pageUrl.search = params.toString();\n                        return doGetApiRequest(pageUrl.toString(), page, allPages);\n                    });\n                    return Promise.all(requests)\n                        .then(responses => {\n                            return response.concat(responses.flat());\n                        });\n                }\n                return response;\n            })\n            .catch(err => {\n                \/*console.error('Error: ', err);*\/\n                const container = document.getElementById('projects-list');\n                if(!!container){\n                    container.innerHTML = `Error`;\n                }\n                enableLoading(false);\n                return err;\n            });\n        };\n        \n        \n        const syncState = () => {\n            const form = getForm();\n            history.replaceState({ 'projectSearch': Object.fromEntries(new FormData(form)) }, '');\n        };\n\t\t\t\t\t\t\t\t \t\t\t\t\t\t \n        const triggerViewUpdate = () => {\n            const form = getForm();\n            form.dispatchEvent(new Event('form view update'));\n        };\n        \n        const doSearch = (page=1) => {\n            const form = getForm();\n            const input = form.querySelector('.projects-search-input');\n            const container = getContainer();\n            const url = new URL(input.dataset.apiUrl.replace(\/\\${apiUrl}\/,form.dataset.apiUrl));\n            const taxonomies = Object.keys(taxonomiesInfo);\n            const urlSearchParameters = new URLSearchParams({\n\t\t\t\t'_fields': 'title,content,date,link,_links,_embedded.wp:featuredmedia,meta.meta.custompostfields_post-test_slug,'+taxonomies.join(\",\"),\n                '_embed':'wp:term,wp:featuredmedia',\n                'context': 'view',\n                'per_page': 100,\n                'page': page,\n                'orderby': 'date',\n                'order': 'desc',\n            });\n            \n            enableLoading(true);\n            syncState();\n            \n            const formData = new FormData(form);\n            for (let [key, value] of formData.entries()) { \n                if(!!value && value.length>0){\n                    urlSearchParameters.append(key, value);\n                }\n            }\n            url.search = urlSearchParameters.toString();\n            \n            if(page<=1){\n                container.innerHTML = '<ul class=\"projects-list-items-container list-unstyled news_list row as-list_col as-grid_row\" role=\"group\" aria-describedby=\"projects-list-title\"><\/ul>';\n            }\n            \n            return doGetApiRequest(url, page).then(posts => {\n                if(!posts || typeof posts[Symbol.iterator] !== 'function'){\n                    if(page<=1){\n                        container.innerHTML = '';\n                    }\n                    return posts;\n                }\n                if(posts.length<=0){\n                    container.innerHTML = 'No data to show.';\n                }else{\n                    const itemsContainer = container.querySelector('.projects-list-items-container');\n                    if(!!itemsContainer){\n                        let output = '';\n                        let postType = '';\n                        let postTypeSlug = '';\n                        \n                        const metaExcludeTaxonomy = [\n                            'resource_status'\n                        ];\n                        \n                        for ( let post of posts ) {let meta = `<div class=\"border-top d-flex flex-row flex-nowrap post-metadata mt-3 pt-2 px-3 small\"><dl title=\"More info:\" class=\"post-category m-0 flex-grow-1 flex-shrink-1 text-ellipsis-parent d-flex flex-row justify-content-between\">`;\n\t\t\tmeta += taxonomies.map(taxonomy=>{\n\t\t\t\tif(metaExcludeTaxonomy.includes(taxonomy)){\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\tconst hideTaxonomies = ['project_year'];\n\n\t\t\tlet info =  (Array.isArray(post[taxonomy]) && taxonomiesInfo[taxonomy])?post[taxonomy].filter(id=>!hideTaxonomies.includes(taxonomiesInfo[taxonomy][id].taxonomy)).map(id=>{\n\t\t\t\treturn (taxonomiesInfo[taxonomy][id] && taxonomiesInfo[taxonomy][id].name && taxonomiesInfo[taxonomy][id].name.length>0)?taxonomiesInfo[taxonomy][id].name:'';\n\t\t\t}).join('<span class=\"taxonomy-separator\">, <\/span>'):false;\n\n\t\t\treturn (info && taxonomiesInfo[taxonomy].label && taxonomiesInfo[taxonomy].label.length>0) ? (`\n\t\t\t<dt class=\"taxonomy taxonomy-label taxonomy-${taxonomy} taxonomy-${taxonomy}-label post-category-label visually-hidden m-0\">${taxonomiesInfo[taxonomy].label}<\/dt> \n\t\t\t\t<dd class=\"taxonomy taxonomy-value taxonomy-${taxonomy}-value post-category-value m-0 text-ellipsis-expand text-ellipsis\">${info}<\/dd>`):'';\n\t\t\t}).join('');\n\t\t\tmeta += '<\/dl>';\n\t\t\t\t\t\t\n\t\t\tmeta += '<\/div>';\n\n\t\t\tlet featuredMedia = '';\n\t\t\tconst featuredMediaInfo = (post._embedded && Array.isArray(post._embedded[\"wp:featuredmedia\"]) && post._embedded[\"wp:featuredmedia\"].length>0)?post._embedded[\"wp:featuredmedia\"].shift():null;\n\t\t\tif(featuredMediaInfo && featuredMediaInfo.source_url){\n\t\t\t\tconst srcSet = [];\n\t\t\t\tconst sizes = '';\n\t\t\t\tif(featuredMediaInfo.media_details && typeof featuredMediaInfo.media_details.sizes === 'object' && featuredMediaInfo.media_details.sizes !== null){\n\t\t\t\t\tfor (let [key, size] of Object.entries(featuredMediaInfo.media_details.sizes)) {\n\t\t\t\t\t\tif(size.source_url && size.width){\n\t\t\t\t\t\t\tsrcSet.push(`${size.source_url} ${size.width}w`);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(srcSet.length>0){\n\t\t\t\t\t\tfeaturedMedia += ` srcset=\"${srcSet.join(', ')}\"`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(featuredMediaInfo.media_details.width){\n\t\t\t\t\tfeaturedMedia +=` sizes=\"(max-width: ${featuredMediaInfo.media_details.width}px) 100vw, ${featuredMediaInfo.media_details.width}px\"`;\n\t\t\t\t}\n\t\t\t\tfeaturedMedia = `<div class=\"project-thumbnail-wrapper align-items-center d-flex entry-thumbnail-wrapper flex-grow-1 border-bottom as-grid_border-bottom as-grid_justify-content-center as-grid_flex-grow-1\"><img decoding=\"async\" class=\"project-thumbnail attachment-news-list-thumbnails-size size-news-list-thumbnails-size block entry-thumbnail img-fluid\" loading=\"lazy\" alt=\"\" src=\"${featuredMediaInfo.source_url}\" ${featuredMedia}><\/div>`;\n\t\t\t}\noutput += `\n<li class=\"col-12 col-lg-3 as-grid_col-lg-3 d-flex flex-column align-items-center news py-3\">\n\t<a href=\"${post.link}\" class=\"d-flex flex-column as-grid_flex-column as-list_flex-row h-100 text-decoration-none p-2 border w-100\">\n\t\t${featuredMedia}\n\t\t<div class=\"d-flex flex-column as-list_w-100 as-list_px-3\">\n\t\t\t<h3 class=\"title  px-3 fw-semibold mt-4 as-list_w-100\">${post.title.rendered}<span class=\"visually-hidden\">.\u00a0<\/span><\/h3>\n\t\t\t${meta}\n\t\t<\/div>\n\t<\/a>\n<\/li>\n`;}\n                        itemsContainer.insertAdjacentHTML(\"beforeend\", output);\n                    }\n                }\n\t\t\t\ttriggerViewUpdate();\n                enableLoading(false);\n                return posts;\n            });\n        };\n        \n        document.addEventListener('DOMContentLoaded', () => {\n            const form = getForm();\n            if(!isSupported || form===undefined || form.dataset.apiUrl===undefined){\n                return;\n            }\n            \n            enableLoading(true);if(!!form){\n\t\t\tform.addEventListener('form view update', (e) => { \n\t\t\t\tconst viewAsList = e.target.classList.contains('projects-as-list');\n\t\t\t\tconst container = document.querySelector(`#projects-list`);\n\t\t\t\tif(!!container){\n\t\t\t\t\tcontainer.querySelectorAll(`[class^=\"as-list_\"],[class*=\" as-list_\"],[class^=\"as-grid_\"],[class*=\" as-grid_\"]`).forEach(el=>{\n\t\t\t\t\t\tconst classList = el.classList.value;\n\t\t\t\t\t\tconst regex = \/(as-(?<type>grid|list)_(?<className>[^\\s]+))\/gm;\n\t\t\t\t\t\tlet m;\n\t\t\t\t\t\twhile ((m = regex.exec(classList)) !== null) {\n\t\t\t\t\t\t\tif (m.index === regex.lastIndex) {\n\t\t\t\t\t\t\t\tregex.lastIndex++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tel.classList.toggle(m.groups.className, m.groups.type==='list'?(viewAsList):!viewAsList);\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}, false);\n\t\t}if (form.querySelector('.projects-layout-btn')) {\n                form.querySelectorAll('.projects-layout-btn').forEach((button) => {\n                    button.addEventListener(\"click\", function(event) {\n                        const input = form.querySelector('#projects-layout');\n                        if(event.target.tagName === \"BUTTON\" && !form.classList.contains(event.target.id)){\n                            form.classList.remove(event.target.id===\"projects-as-grid\"?\"projects-as-list\":\"projects-as-grid\");\n                            form.classList.add(event.target.id);\n                            if(input){\n                                input.value = event.target.id;\n                            }\n                            form.querySelectorAll('.projects-layout-btn.active').forEach((button) => {\n                                button.classList.remove('active');\n                                button.setAttribute('aria-checked', 'false');\n                            });\n                            button.classList.add('active');\n                            button.setAttribute('aria-checked', 'true');\n\t\t\t\t\t\t\ttriggerViewUpdate();\n                        }\n                        syncState();\n                    });\n                });\n            }\n            \n            const loadingButton = getLoading();\n            if(loadingButton){\n                loadingButton.addEventListener(\"click\", function(event) {\n                    if(!isLoading() && (ofPages()>0 && ofPages()>currentPage())){\n                        doSearch(currentPage()+1).then(posts => {});\n                    }\n                    event.preventDefault();\n                });\n            }\n            \n            const container = document.getElementById('projects-list');\n            const taxonomiesRequests = Array.from(form.querySelectorAll(\".project-taxonomy-filter\")).map(taxonomy => {\n            \n                if(! \"apiUrl\" in taxonomy.dataset || ! \"taxonomy\" in taxonomy.dataset){\n                    return;\n                }\n                const taxonomySlug = taxonomy.getAttribute(\"name\");\n                const taxonomyLabel = taxonomy.querySelector(\".taxonomy-label\");\n                const taxonomySelected = taxonomy.dataset.selected||'';\n                const taxonomyInclude = taxonomy.dataset.include?taxonomy.dataset.include.split(','):[];\n                const taxonomyExclude = taxonomy.dataset.exclude?taxonomy.dataset.exclude.split(','):[];\n                taxonomiesInfo[taxonomySlug] = {};\n                \n                let url = new URL(taxonomy.dataset.apiUrl.replace(\/\\${apiUrl}\/, form.dataset.apiUrl).replace(\/\\${taxonomy}\/, taxonomySlug));\n                url.search = new URLSearchParams({\n                    '_fields': 'id,slug,name,taxonomy,link,description,count',\n                    'context': 'view',\n\t\t\t\t\t'order': taxonomy.dataset.order||'asc',\n\t\t\t\t\t'orderby': taxonomy.dataset.orderby||'name',\n\t\t\t\t\t'hide_empty': taxonomy.dataset.hide_empty||'true'\n                }).toString();\n                \n                return doGetApiRequest(url, 1, true).then(terms => {\n                    if(typeof terms[Symbol.iterator] !== 'function'){\n                        return;\n                    }\n                    if(taxonomyLabel && taxonomyLabel.text){\n                        taxonomiesInfo[taxonomySlug]['label'] = taxonomyLabel.text;\n                    }\n                    for ( let term of terms ) {\n                        if((taxonomyInclude.length>0 && !taxonomyInclude.includes(term.slug)) || (taxonomyExclude.length>0 && taxonomyExclude.includes(term.slug))){\n                            continue;\n                        }\n                        \n                        taxonomiesInfo[taxonomySlug][term.id] = term;\n                        \n                        let option = document.createElement(\"option\");\n                        option.text = term.name;\n                        option.value = term.id;\n                        option.id = `select-${taxonomySlug}-${term.slug}`;\n                        if(term.slug===taxonomySelected){\n                            option.selected = true;\n                            option.setAttribute('selected', 'selected');\n                        }\n                        taxonomy.appendChild(option);\n                    }\n                    \n                    taxonomy.addEventListener('change', ()=>doSearch());\n                    taxonomy.classList.replace(\"disabled-filter\", \"enabled-filter\");\n                });\n            });\n            \n            Promise.all(taxonomiesRequests).then(()=>{\n                form.addEventListener('submit',  event => {\n                    doSearch();\n                    \n                    event.preventDefault();\n                });\n                \n                \n                const input = form.querySelector('.projects-search-input');\n                input.timeout = null;\n                input.addEventListener('keyup', function (e) {\n                    clearTimeout(input.timeout);\n                \n                    input.timeout = setTimeout(()=>{\n                        doSearch();\n                    }, 350);\n                });\n                input.addEventListener('blur', function (e) {\n                    clearTimeout(input.timeout);\n                });\n                input.classList.replace(\"disabled-filter\", \"enabled-filter\");if(history.state && history.state.projectSearch){\n                    let formItem, formItemKey;\n                    for ( formItemKey in history.state.projectSearch ) {\n                        if(history.state.projectSearch[formItemKey] && history.state.projectSearch[formItemKey].length>0 && (formItem = form.querySelector(`[name=\"${formItemKey}\"]:not([data-selected])`) )){\n                            formItem.value = history.state.projectSearch[formItemKey];\n                        }\n                    }\n                    const input = form.querySelector('#projects-layout');\n                    if(input && input.value.length>0 && !form.classList.contains(input.value)){\n                        form.classList.remove(input.value===\"projects-as-grid\"?\"projects-as-list\":\"projects-as-grid\");\n                        form.classList.add(input.value);\n                        form.querySelectorAll('.projects-layout-btn').forEach((button) => {\n                            if(button.id == input.value){\n                                button.classList.add('active');\n                                button.setAttribute('aria-checked', 'true');\n                            }else{\n                                button.classList.remove('active');\n                                button.setAttribute('aria-checked', 'false');\n                            }\n                        });\n\t\t\t\t\t\ttriggerViewUpdate();\n                    }\n                }\n                doSearch().then(posts => {triggerViewUpdate();const loadingButton = getLoading();\n\t\t\t\t\t\tif(loadingButton){\n\t\t\t\t\t\t\t(new IntersectionObserver((targets)=>{\n\t\t\t\t\t\t\t\ttargets.forEach((target) => {\n\t\t\t\t\t\t\t\t\tif (target.isIntersecting && target.intersectionRatio >= 0.75 && !isLoading() && (ofPages()>0 && ofPages()>currentPage())) {\n\t\t\t\t\t\t\t\t\t\ttarget.target.dispatchEvent(new MouseEvent('click', {\n\t\t\t\t\t\t\t\t\t\t\tview: window,\n\t\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\t\tcancelable: true\n\t\t\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t  root: null,\n\t\t\t\t\t\t\t  rootMargin: '0px',\n\t\t\t\t\t\t\t  threshold: 1.0\n\t\t\t\t\t\t\t})).observe(loadingButton);\n\t\t\t\t\t\t}});\n            });\n        });\n    })(\n           \"fetch\" in window \n        && \"URL\" in window \n        && \"URLSearchParams\" in window \n        && \"FormData\" in window\n        && \"Promise\" in window\n        && \"history\" in window\n        && \"querySelector\" in document\n        && \"querySelectorAll\" in document\n        && \"includes\" in Array()\n        && \"from\" in Array\n        && (function(){\n            try{\n                Function(\"() => {};\"); \n                Function(\"class Feature {};\");\n                return true;\n            }catch(exception){\n                return false;\n            }\n        })()\n    );\n        <\/script>\n    <noscript>\n        JavaScript is not supported.\n        <a href=\"&#x2F;en&#x2F;wp-json&#x2F;wp&#x2F;v2&#x2F;pages&#x2F;257&#x3F;nojs&#x3D;true\" rel=\"alternate\">\n             Please visit an alternate version.\n        <\/a>\n    <\/noscript>\n\n\n\n<div style=\"height:80px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"Projects LE@D coordinates and participates in several research projects, both externally funded and self-funded, involving integrated researchers, associated and external researchers, doctoral students and master&#8217;s students supervised by the Centre&#8217;s members.","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":30,"comment_status":"closed","ping_status":"closed","template":"","meta":{"speak2many_translation":"","custompostfields_banners":"15233","custompostfields_title":"","custompostfields_subtitle":"","footnotes":""},"class_list":["post-257","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/lead.uab.pt\/en\/wp-json\/wp\/v2\/pages\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lead.uab.pt\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lead.uab.pt\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lead.uab.pt\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lead.uab.pt\/en\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":20,"href":"https:\/\/lead.uab.pt\/en\/wp-json\/wp\/v2\/pages\/257\/revisions"}],"predecessor-version":[{"id":20605,"href":"https:\/\/lead.uab.pt\/en\/wp-json\/wp\/v2\/pages\/257\/revisions\/20605"}],"wp:attachment":[{"href":"https:\/\/lead.uab.pt\/en\/wp-json\/wp\/v2\/media?parent=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}