Widget: DCTList: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 437: Line 437:
             })
             })
             document.getElementById('data-source-filter').innerHTML = dataSourceFilterHtml;
             document.getElementById('data-source-filter').innerHTML = dataSourceFilterHtml;
            // TODO: Fetch from server?
            const FREE_KEY = 'Freeware', FREE_PLAN_KEY = 'Free plan available';
            const bModels = [FREE_KEY, FREE_PLAN_KEY, 'Subscription', 'Other'];
            let bModelFilterHtml = bModels.reduce((acc, curr) => {
                const identifier = escapeAttr(curr);
                return acc +
                    + '<div><input type="checkbox" checked id="bm-filter-' + identifier
                    + '" value="' + curr + '">'
                    + '<label for="bm-filter-' + identifier + '">' + curr
                    + (curr === FREE_KEY ? '<svg class="bm-icon"><use href="#freeware-icon"/></svg>' : '')
                    + (curr === FREE_PLAN_KEY ? '<svg class="bm-icon"><use href="#free-plan-icon"/></svg>' : '')
                    + '</label></div>'
            }, '');
            document.getElementById('business-model-filter').innerHTML = bModelFilterHtml;


             // Set up table.
             // Set up table.
Line 610: Line 625:
         <defs>
         <defs>
             <symbol id="freeware-icon" viewBox="0 0 96 96">
             <symbol id="freeware-icon" viewBox="0 0 96 96">
                 <clipPath id="a">
                 <clipPath id="x">
                     <path d="M204 216h96v96h-96z" />
                     <path d="M204 216h96v96h-96z" />
                 </clipPath>
                 </clipPath>
                 <g clip-path="url(#a)" transform="translate(-204 -216)">
                 <g clip-path="url(#x)" transform="translate(-204 -216)">
                     <path
                     <path
                         d="M237 255c-2.2 0-4-1.8-4-4 0-1.4.8-2.7 1.9-3.4 0 .7.1 1.5.1 2.4 0 1.1.9 2 2 2s2-.9 2-2c0-.9 0-1.7-.1-2.5 1.2.7 2.1 2 2.1 3.5 0 2.2-1.8 4-4 4Zm49.2 17.2-28-28c-.8-.8-1.8-1.2-2.8-1.2h-17.2c-1.1-3.5-3.2-5.3-6.8-6-1.3-.2-2.4-.4-3.5-.6-5.7-.8-6.9-1-6.9-7.4 0-1.1-.9-2-2-2s-2 .9-2 2c0 9.4 3.7 10.4 10.3 11.4 1 .2 2.1.3 3.4.6 1.3.3 2.7.5 3.5 2.6-3 1.2-5.1 4.1-5.1 7.5v18.3c0 1.1.4 2.1 1.2 2.8l28 28c.7.8 1.7 1.1 2.7 1.1 1 0 2-.4 2.8-1.2l22.3-22.3c1.6-1.5 1.6-4.1.1-5.6Z" />
                         d="M237 255c-2.2 0-4-1.8-4-4 0-1.4.8-2.7 1.9-3.4 0 .7.1 1.5.1 2.4 0 1.1.9 2 2 2s2-.9 2-2c0-.9 0-1.7-.1-2.5 1.2.7 2.1 2 2.1 3.5 0 2.2-1.8 4-4 4Zm49.2 17.2-28-28c-.8-.8-1.8-1.2-2.8-1.2h-17.2c-1.1-3.5-3.2-5.3-6.8-6-1.3-.2-2.4-.4-3.5-.6-5.7-.8-6.9-1-6.9-7.4 0-1.1-.9-2-2-2s-2 .9-2 2c0 9.4 3.7 10.4 10.3 11.4 1 .2 2.1.3 3.4.6 1.3.3 2.7.5 3.5 2.6-3 1.2-5.1 4.1-5.1 7.5v18.3c0 1.1.4 2.1 1.2 2.8l28 28c.7.8 1.7 1.1 2.7 1.1 1 0 2-.4 2.8-1.2l22.3-22.3c1.6-1.5 1.6-4.1.1-5.6Z" />
Line 620: Line 635:


             <symbol id="free-plan-icon" viewBox="0 0 96 96">
             <symbol id="free-plan-icon" viewBox="0 0 96 96">
                 <clipPath id="b">
                 <clipPath id="y">
                     <path d="M592 312h96v96h-96z" />
                     <path d="M592 312h96v96h-96z" />
                 </clipPath>
                 </clipPath>
                 <g clip-path="url(#b)" transform="translate(-592 -312)">
                 <g clip-path="url(#y)" transform="translate(-592 -312)">
                     <path
                     <path
                         d="m674.6 368.212-28.334-28.326a3.99 3.99 0 0 0-2.833-1.214h-18.617c-.254 0-.5.015-.752.038a6.974 6.974 0 0 0-5.064-4.143l-6.764-1.352a4.992 4.992 0 0 1-4-4.359l-.515-4.633a1 1 0 1 0-1.988.221l.515 4.633a6.984 6.984 0 0 0 5.592 6.1l6.763 1.352a4.99 4.99 0 0 1 3.472 2.632 8.118 8.118 0 0 0-5.359 7.605v18.512a3.676 3.676 0 0 0 1.214 2.833l28.33 28.327a4.03 4.03 0 0 0 5.767 0l22.573-22.56a4.094 4.094 0 0 0 0-5.666Zm-1.414 4.251-22.567 22.56a2.032 2.032 0 0 1-2.939 0L619.35 366.7l-.05-.05-.05-.044a1.722 1.722 0 0 1-.531-1.328v-18.513a6.116 6.116 0 0 1 3.939-5.692l.492 2.457c-.322.173-.618.39-.88.645A4 4 0 1 0 625.1 343h-.015l-.465-2.324c.065 0 .129-.009.194-.009h18.619c.538.009 1.05.236 1.418.628l28.33 28.327a2.1 2.1 0 0 1 0 2.836Zm-47.691-27.421a2.017 2.017 0 1 1-1.906.667l.164.821a1 1 0 0 0 1.179.781.999.999 0 0 0 .784-1.177Z" />
                         d="m674.6 368.212-28.334-28.326a3.99 3.99 0 0 0-2.833-1.214h-18.617c-.254 0-.5.015-.752.038a6.974 6.974 0 0 0-5.064-4.143l-6.764-1.352a4.992 4.992 0 0 1-4-4.359l-.515-4.633a1 1 0 1 0-1.988.221l.515 4.633a6.984 6.984 0 0 0 5.592 6.1l6.763 1.352a4.99 4.99 0 0 1 3.472 2.632 8.118 8.118 0 0 0-5.359 7.605v18.512a3.676 3.676 0 0 0 1.214 2.833l28.33 28.327a4.03 4.03 0 0 0 5.767 0l22.573-22.56a4.094 4.094 0 0 0 0-5.666Zm-1.414 4.251-22.567 22.56a2.032 2.032 0 0 1-2.939 0L619.35 366.7l-.05-.05-.05-.044a1.722 1.722 0 0 1-.531-1.328v-18.513a6.116 6.116 0 0 1 3.939-5.692l.492 2.457c-.322.173-.618.39-.88.645A4 4 0 1 0 625.1 343h-.015l-.465-2.324c.065 0 .129-.009.194-.009h18.619c.538.009 1.05.236 1.418.628l28.33 28.327a2.1 2.1 0 0 1 0 2.836Zm-47.691-27.421a2.017 2.017 0 1 1-1.906.667l.164.821a1 1 0 0 0 1.179.781.999.999 0 0 0 .784-1.177Z" />
Line 703: Line 718:
                     </div>
                     </div>
                     <div class="filter-content" id="data-source-filter"></div>
                     <div class="filter-content" id="data-source-filter"></div>
                </div>
                <div class="filter-wrapper">
                    <h3>Business Model</h3>
                    <div class="filter-button-wrapper">
                        <button type="button" onclick="selectAll('#business-model-filter')">Select all</button> |
                        <button type="button" onclick="deselectAll('#business-model-filter')">Deselect all</button>
                    </div>
                    <div class="filter-content" id="business-model-filter"></div>
                 </div>
                 </div>
             </div>
             </div>

Revision as of 14:26, 12 September 2022

Development verstion of the DCT List.
Not ready for production!