aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjahoti <jahoti@tilde.team>2021-08-01 00:00:00 +0000
committerjahoti <jahoti@tilde.team>2021-08-01 00:00:00 +0000
commit100530f79b3c94db87a337c798c74eed896574af (patch)
tree98aca9504e38640cde653ce446d6adec6dd7ee6e
parent73e4d5a57a49066469a7444dde21b5be87f1bbbc (diff)
downloadhachette_fixes_tmp-100530f79b3c94db87a337c798c74eed896574af.tar.gz
hachette_fixes_tmp-100530f79b3c94db87a337c798c74eed896574af.zip
Add a fix for PC Specialist UK and tinker with the SParse layout script
-rw-r--r--phttps __www.pcspecialist.co.uk.json1
-rw-r--r--phttps___stallman.org_.json2
-rw-r--r--phttps___www.abc.net.au_.json2
3 files changed, 3 insertions, 2 deletions
diff --git a/phttps __www.pcspecialist.co.uk.json b/phttps __www.pcspecialist.co.uk.json
new file mode 100644
index 0000000..2137cb6
--- /dev/null
+++ b/phttps __www.pcspecialist.co.uk.json
@@ -0,0 +1 @@
+[{"sPC Specialist UK- Cookie Banner":{"url":"","hash":"","text":"/*\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nconst jbc = document.querySelector('.cc-policy');\n\njbc.querySelector('.cc-buttons').onclick = () => jbc.parentNode.removeChild(jbc);"}},{"sPC Specialist UK- Display Prices":{"url":"","hash":"","text":"/*\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nconst formId = document.querySelector('input[name=\"page_id\"]').value;\nconst form = document.querySelector('form[name=\"specbuilder\"]');\nconst noVat = document.getElementById('running_total_ex');\nconst incVat = document.getElementById('running_total_inc');\n\nfunction updatePrice() {\n\tconst xhr = new XMLHttpRequest();\n\t\n\tvar names = [], values = [];\n\tfor (var inputElement of form.querySelectorAll('select, input[type=\"radio\"]')) {\n\t\tif (inputElement.name && (inputElement.checked || inputElement.tagName === 'SELECT')) {\n\t\t\tnames.push(inputElement.name);\n\t\t\tvalues.push(inputElement.value);\n\t\t}\n\t}\n\t\n\tconst url = 'https://www.pcspecialist.co.uk/ajax/running_total.php?categories=' + names.join('%2C') +\n\t\t '%2C&products=' + values.join('%2C') + '%2C&q=' + form.querySelector('input[name=\"q\"]').value + '&form_id=' + formId;\n\t\n\txhr.onreadystatechange = priceUpdated;\n\txhr.open('GET', url, true);\n\txhr.send();\n}\n\nfunction priceUpdated() {\n\tif (this.readyState === 4) {\n\t\tif (this.status === 200) {\n\t\t\tconst parts = this.responseText.split(\"'\");\n\t\t\tnoVat.innerText = parts[parts.length - 6];\n\t\t\tincVat.innerText = parts[parts.length - 2];\n\t\t}\n\t\telse alert('Failed to get data: HTTP status code ' + this.status);\n\t}\n}\n\nconst button = document.createElement('button');\nbutton.innerText = 'Update Prices';\nbutton.onclick = updatePrice;\ndocument.querySelector('.price-holder.price-finance-holder').append(button);"}},{"phttps://www.pcspecialist.co.uk/view/*":{"components":["s","PC Specialist UK- Display Prices"],"allow":false}},{"phttps://www.pcspecialist.co.uk/***":{"components":["s","PC Specialist UK- Cookie Banner"],"allow":false}}]
diff --git a/phttps___stallman.org_.json b/phttps___stallman.org_.json
index 62c0026..94d28e6 100644
--- a/phttps___stallman.org_.json
+++ b/phttps___stallman.org_.json
@@ -1 +1 @@
-[{"sSParse layout generator":{"url":"","hash":"","text":"/*\n\tGenerate simple yet clean single-page site(oids)\n\t\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nfunction Sparse(navItems, opts) {\n\topts = opts || {};\n\tvar width = opts.width || 10,\n\t text = opts.text || 'black',\n\t bg = opts.bgcolor || opts.background || 'yellow',\n\t pagebg = opts.tabcolor || 'white';\n\t gap = opts.gap || '10px';\n\t\n\tvar body = document.createElement('body'),\n\t nav = document.createElement('nav'),\n\t style = document.createElement('style');\n\t\n\tvar link, activeLink, paneWidths;\n\t\n\tstyle.innerText = `\n\tbody {\n\t\tdisplay: grid;\n\t\tgrid-column-gap: ${gap};\n\t\tcolumn-gap: ${gap};\n\t\tgrid-template-columns: ${width}%;\n\t}\n\t\n\tnav {\n\t\tgrid-column: 1;\n\t\tposition: sticky;\n\t\ttop: 0;\n\t}\n\t\n\tnav > a:not([href]) {\n\t\tcolor: ${text};\n\t\tfont-weight: bold;\n\t}\n\t\n\tbody, nav { background-color: ${bg}; }\n\tbody > * { grid-row: 1; }\n\tbody > *:not(nav) { background-color: ${pagebg} }\n\t`\n\t\n\tbody.append(style);\n\tbody.append(nav);\n\t\n\tfunction onLinkClick(e) {\n\t\tvar link;\n\t\tif (activeLink) {\n\t\t\tlink = activeLink.inactive\n\t\t\tnav.replaceChild(link, activeLink);\n\t\t\tfor (pane of link.panes) body.removeChild(pane);\n\t\t\t\n\t\t\tdelete activeLink.inactive;\n\t\t}\n\t\t\n\t\tlink = e.target;\n\t\tactiveLink = document.createElement('span');\n\t\tactiveLink.innerText = link.textContent;\n\t\tactiveLink.inactive = link;\n\t\tnav.replaceChild(activeLink, link);\n\t\t\n\t\tlink.panes.forEach((pane, i) => {\n\t\t\tpane.style.gridColumn = (i + 2).toString();\n\t\t\tbody.append(pane);\n\t\t});\n\t}\n\t\n\tfor (var item of navItems) {\n\t\tlink = document.createElement('a');\n\t\tif (typeof item === 'string') link.innerText = item;\n\t\telse {\n\t\t\tlink.innerText = item.shift();\n\t\t\tif (typeof item[0] === 'string') link.href = item[0];\n\t\t\telse {\n\t\t\t\tlink.onclick = onLinkClick;\n\t\t\t\tlink.href = '#';\n\t\t\t\tlink.panes = item;\n\t\t\t}\n\t\t\t\n\t\t\tif (link.textContent.startsWith('* ')) {\n\t\t\t\tlink.innerText = link.textContent.substr(2);\n\t\t\t\t\n\t\t\t\tvar bullet = document.createElement('a');\n\t\t\t\tbullet.innerText = '• ';\n\t\t\t\tnav.append(bullet);\n\t\t\t}\n\t\t}\n\t\t\n\t\tnav.append(link);\n\t\tnav.append(document.createElement('br'));\n\t}\n\t\n\tdocument.body.parentNode.replaceChild(body, document.body);\n\tnav.querySelector('a[href]').click();\n}"}},{"sstallman.org":{"url":"","hash":"","text":"/*\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nvar div1 = document.querySelector('.column1'),\n div2 = document.querySelector('.column2'),\n div3 = document.querySelector('.column3'),\n rest = document.querySelector('.rest'),\n head = document.body;\n\nhead.removeChild(div1);\nhead.removeChild(div2);\nhead.removeChild(div3);\nhead.removeChild(rest);\n\nvar wrapper, chaseHeader = div1.querySelector('#urgent');\nvar urgent = chaseHeader.parentNode.nextElementSibling;\nchaseHeader.parentNode.removeChild(chaseHeader);\nurgent.parentNode.removeChild(urgent);\n\nwrapper = document.createElement('div');\nchaseHeader = document.createElement('h3');\nchaseHeader.innerText = 'Urgent action items';\nwrapper.append(chaseHeader);\nwrapper.append(urgent);\nurgent = wrapper;\n\nvar chaseHeader = div1.querySelector('#oughttobe');\nvar oughttobe = chaseHeader.parentNode.nextElementSibling;\nvar oughttobe_more = oughttobe.nextElementSibling;\nchaseHeader.parentNode.removeChild(chaseHeader);\noughttobe.parentNode.removeChild(oughttobe)\noughttobe_more.parentNode.removeChild(oughttobe_more)\n\nwrapper = document.createElement('div');\nchaseHeader = document.createElement('h3');\noughttobe_more.innerText = 'There Ought to Be a Law';\nchaseHeader.append(oughttobe_more);\nwrapper.append(chaseHeader);\nwrapper.append(oughttobe);\noughttobe = wrapper;\n\ndiv1.style.width = '100%';\n\nvar polnotes = div2.querySelector('iframe');\npolnotes.parentNode.removeChild(polnotes);\n\nSparse([\n\t'stallman.org',\n\t['Home', urgent, polnotes],\n\t['* Urgent Action', urgent],\n\t['* Political Notes', polnotes],\n\t['Needed Laws', oughttobe],\n\t['Miscellaneous', div1],\n\t'Miscellaneous',\n\t['* Misc. 2', div2],\n\t['* Misc. 3', div3],\n\t['* Misc. 4', rest],\n\t['* Misc. 5', head]\n]);"}},{"bstallman.org":[["s","SParse layout generator"],["s","stallman.org"]]},{"phttps://stallman.org/":{"components":["b","stallman.org"],"allow":false}}] \ No newline at end of file
+[{"sSParse layout generator":{"url":"","hash":"","text":"/*\n\tGenerate simple yet clean single-page site(oids)\n\t\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nfunction Sparse(navItems, opts) {\n\topts = opts || {};\n\tvar width = opts.width || 20,\n\t text = opts.text || 'black',\n\t bg = opts.bgcolor || opts.background || 'yellow',\n\t pagebg = opts.tabcolor || 'white';\n\t gap = opts.gap || '10px';\n\t\n\tvar body = document.createElement('body'),\n\t nav = document.createElement('nav'),\n\t style = document.createElement('style');\n\t\n\tvar link, activeLink, title;\n\t\n\tstyle.innerText = `\n\tbody {\n\t\tdisplay: grid;\n\t\tgrid-column-gap: ${gap};\n\t\tcolumn-gap: ${gap};\n\t\tgrid-template-columns: ${width}%;\n\t}\n\t\n\tnav {\n\t\tgrid-column: 1;\n\t\tposition: sticky;\n\t\ttop: 0;\n\t}\n\t\n\tnav > a:not([href]) {\n\t\tcolor: ${text};\n\t\tfont-weight: bold;\n\t}\n\t\n\tbody, nav { background-color: ${bg}; }\n\tbody > * { grid-row: 1; }\n\tbody > *:not(nav) { background-color: ${pagebg} }\n\t`\n\t\n\tbody.append(style);\n\tbody.append(nav);\n\t\n\tfunction onLinkClick(e) {\n\t\tvar link, section, title;\n\t\tif (activeLink) {\n\t\t\tlink = activeLink.inactive\n\t\t\tnav.replaceChild(link, activeLink);\n\t\t\tfor (pane of link.panes) body.removeChild(pane.parentNode);\n\t\t\t\n\t\t\tdelete activeLink.inactive;\n\t\t}\n\t\t\n\t\tlink = e.target;\n\t\tactiveLink = document.createElement('span');\n\t\tactiveLink.innerText = link.textContent;\n\t\tactiveLink.inactive = link;\n\t\tnav.replaceChild(activeLink, link);\n\t\t\n\t\tlink.panes.forEach((pane, i) => {\n\t\t\tsection = document.createElement('article');\n\t\t\ttitle = document.createElement('h1');\n\t\t\t\n\t\t\ttitle.innerText = pane.docTitle;\n\t\t\tsection.style.gridColumn = (i + 2).toString();\n\t\t\t\n\t\t\tif (pane.docTitleLink) {\n\t\t\t\tlet titleLink = document.createElement('a');\n\t\t\t\t\n\t\t\t\ttitleLink.href = pane.docTitleLink;\n\t\t\t\ttitleLink.append(title);\n\t\t\t\ttitle = titleLink;\n\t\t\t}\n\t\t\t\n\t\t\tsection.append(title);\n\t\t\tsection.append(pane);\n\t\t\tbody.append(section);\n\t\t});\n\t}\n\t\n\tdocument.title = navItems[0];\n\t\n\tfor (var item of navItems) {\n\t\tlink = document.createElement('a');\n\t\tif (typeof item === 'string') link.innerText = item;\n\t\telse {\n\t\t\tlink.innerText = item.shift();\n\t\t\tif (link.textContent.startsWith('* ')) {\n\t\t\t\tlink.innerText = link.textContent.substr(2);\n\t\t\t\tlink.style.fontSize = '80%';\n\t\t\t}\n\t\t\t\n\t\t\tif (typeof item[0] === 'string' && item.length === 1) link.href = item[0];\n\t\t\telse {\n\t\t\t\tlink.onclick = onLinkClick;\n\t\t\t\tlink.href = '#';\n\t\t\t\tif (item.length === 2 && typeof item[1] === 'string') {\n\t\t\t\t\t// Add a title link (if applicable)\n\t\t\t\t\titem[0].docTitleLink = item.pop();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlink.panes = item;\n\t\t\t\t\n\t\t\t\t// Add the title info\n\t\t\t\tif (item.length === 1) item[0].docTitle = link.textContent;\n\t\t\t}\n\t\t}\n\t\t\n\t\tnav.append(link);\n\t\tnav.append(document.createElement('br'));\n\t}\n\t\n\tactiveLink = null;\n\tdocument.body.parentNode.replaceChild(body, document.body);\n\tnav.querySelector('a[href]').click();\n}"}},{"sstallman.org":{"url":"","hash":"","text":"/*\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nvar div1 = document.querySelector('.column1'),\n div2 = document.querySelector('.column2'),\n div3 = document.querySelector('.column3'),\n rest = document.querySelector('.rest'),\n head = document.body;\n\nhead.removeChild(div1);\nhead.removeChild(div2);\nhead.removeChild(div3);\nhead.removeChild(rest);\n\nvar wrapper, chaseHeader = div1.querySelector('#urgent');\nvar urgent = chaseHeader.parentNode.nextElementSibling;\nchaseHeader.parentNode.removeChild(chaseHeader);\nurgent.parentNode.removeChild(urgent);\n\nvar chaseHeader = div1.querySelector('#oughttobe');\nvar oughttobe = chaseHeader.parentNode.nextElementSibling;\nvar oughttobe_more = oughttobe.nextElementSibling;\nchaseHeader.parentNode.removeChild(chaseHeader);\noughttobe.parentNode.removeChild(oughttobe)\noughttobe_more.parentNode.removeChild(oughttobe_more)\n\ndiv1.style.width = '100%';\n\nvar polnotes = div2.querySelector('iframe');\npolnotes.parentNode.removeChild(polnotes);\n\nvar trailing = ['More'];\nvar current, text, node;\nfor (var child of rest.children) if (child.tagName === 'HR') chaseHeader = child;\nwhile (node = rest.firstChild) {\n\trest.removeChild(node);\n\t\n\tif (node === chaseHeader) text = 'Footer';\n\telse if (node.tagName === 'HR') continue;\n\telse if (/H\\d/.test(node.tagName)) text = '* ' + node.textContent.trim();\n\t\n\tif (text) {\n\t\tif (current && !current.children.length) trailing[trailing.length - 1].splice(1, 1);\n\t\t\n\t\tif (text === '* Media/Press/Bios') {\n\t\t\ttext = current = undefined;\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tcurrent = document.createElement('div');\n\t\tif (node.children.length && node.firstElementChild.tagName === 'A' && !node.firstElementChild.href.startsWith('#')) {\n\t\t\ttrailing.push([text, current, node.firstElementChild.href]);\n\t\t}\n\t\telse trailing.push([text, current]);\n\t\t\n\t\ttext = undefined;\n\t}\n\telse current && current.append(node);\n}\n\n\n// Build the nav index, and then render the page\n\nSparse([\n\t'stallman.org',\n\t['Home', urgent, polnotes],\n\t['* Urgent action items', urgent],\n\t['* Political Notes', polnotes, div2.firstElementChild.querySelector('a').href],\n\t['There Ought to Be a Law', oughttobe, oughttobe_more.href],\n\t['Media/Press/Bios', 'https://stallman.org/media.html']\n].concat(\n\ttrailing\n).concat([\n\t['Miscellaneous', div1, div2],\n\t'Miscellaneous',\n\t['* Misc. 1', div3],\n\t['* Misc. 2', head]\n]));"}},{"bstallman.org":[["s","SParse layout generator"],["s","stallman.org"]]},{"phttps://stallman.org/":{"components":["b","stallman.org"],"allow":false}}] \ No newline at end of file
diff --git a/phttps___www.abc.net.au_.json b/phttps___www.abc.net.au_.json
index ada3bc8..3a62a9a 100644
--- a/phttps___www.abc.net.au_.json
+++ b/phttps___www.abc.net.au_.json
@@ -1 +1 @@
-[{"sSParse layout generator":{"url":"","hash":"","text":"/*\n\tGenerate simple yet clean single-page site(oids)\n\t\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nfunction Sparse(navItems, opts) {\n\topts = opts || {};\n\tvar width = opts.width || 10,\n\t text = opts.text || 'black',\n\t bg = opts.bgcolor || opts.background || 'yellow',\n\t pagebg = opts.tabcolor || 'white';\n\t gap = opts.gap || '10px';\n\t\n\tvar body = document.createElement('body'),\n\t nav = document.createElement('nav'),\n\t style = document.createElement('style');\n\t\n\tvar link, activeLink, paneWidths;\n\t\n\tstyle.innerText = `\n\tbody {\n\t\tdisplay: grid;\n\t\tgrid-column-gap: ${gap};\n\t\tcolumn-gap: ${gap};\n\t\tgrid-template-columns: ${width}%;\n\t}\n\t\n\tnav {\n\t\tgrid-column: 1;\n\t\tposition: sticky;\n\t\ttop: 0;\n\t}\n\t\n\tnav > a:not([href]) {\n\t\tcolor: ${text};\n\t\tfont-weight: bold;\n\t}\n\t\n\tbody, nav { background-color: ${bg}; }\n\tbody > * { grid-row: 1; }\n\tbody > *:not(nav) { background-color: ${pagebg} }\n\t`\n\t\n\tbody.append(style);\n\tbody.append(nav);\n\t\n\tfunction onLinkClick(e) {\n\t\tvar link;\n\t\tif (activeLink) {\n\t\t\tlink = activeLink.inactive\n\t\t\tnav.replaceChild(link, activeLink);\n\t\t\tfor (pane of link.panes) body.removeChild(pane);\n\t\t\t\n\t\t\tdelete activeLink.inactive;\n\t\t}\n\t\t\n\t\tlink = e.target;\n\t\tactiveLink = document.createElement('span');\n\t\tactiveLink.innerText = link.textContent;\n\t\tactiveLink.inactive = link;\n\t\tnav.replaceChild(activeLink, link);\n\t\t\n\t\tlink.panes.forEach((pane, i) => {\n\t\t\tpane.style.gridColumn = (i + 2).toString();\n\t\t\tbody.append(pane);\n\t\t});\n\t}\n\t\n\tfor (var item of navItems) {\n\t\tlink = document.createElement('a');\n\t\tif (typeof item === 'string') link.innerText = item;\n\t\telse {\n\t\t\tlink.innerText = item.shift();\n\t\t\tif (typeof item[0] === 'string') link.href = item[0];\n\t\t\telse {\n\t\t\t\tlink.onclick = onLinkClick;\n\t\t\t\tlink.href = '#';\n\t\t\t\tlink.panes = item;\n\t\t\t}\n\t\t\t\n\t\t\tif (link.textContent.startsWith('* ')) {\n\t\t\t\tlink.innerText = link.textContent.substr(2);\n\t\t\t\t\n\t\t\t\tvar bullet = document.createElement('a');\n\t\t\t\tbullet.innerText = '• ';\n\t\t\t\tnav.append(bullet);\n\t\t\t}\n\t\t}\n\t\t\n\t\tnav.append(link);\n\t\tnav.append(document.createElement('br'));\n\t}\n\t\n\tdocument.body.parentNode.replaceChild(body, document.body);\n\tnav.querySelector('a[href]').click();\n}"}},{"sABC Aus":{"url":"","hash":"","text":"/*\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nvar pages = [], home = ['Home'], comp,\n comps = document.getElementById('content').children;\n\npages.push(home);\nfor (i = 0; i < comps.length; i++) {\n\tcomp = comps[i];\n\tif (!comp.dataset.component) continue;\n\t\n\tvar section = document.createElement('div'),\n\t wrapper = document.createElement('h3'),\n\t heading = comp.querySelector(\n\t\t'[data-component=\"Heading\"], [data-component=\"CollectionHeading\"]'\n\t );\n\t\n\theading = heading ? heading.innerText : 'Featured';\n\twrapper.innerText = heading;\n\tsection.append(wrapper);\n\t\n\tvar cards = comp.querySelectorAll('[data-component$=Card]');\n\tif (!cards.length) continue;\n\t\n\tfor (var card of cards) {\n\t\tvar text = card.innerHTML.replace(/<[^<]*>/g, '\\n').replace(/\\n\\n+/g, '\\n').replace(/^\\n/, ''),\n\t\t link = card.querySelector('a');\n\t\t\n\t\twrapper = document.createElement('a');\n\t\twrapper.href = link.href;\n\t\twrapper.style.display = 'block';\n\t\twrapper.style.fontWeight = 'bold';\n\t\tsection.append(wrapper);\n\t\t\n\t\tvar index = text.indexOf('\\n');\n\t\tif (index === -1) wrapper.innerText = text;\n\t\telse {\n\t\t\twrapper.innerText = text.substr(0, index);\n\t\t\twrapper = document.createElement('p');\n\t\t\twrapper.innerText = text.substr(index + 1);\n\t\t\tsection.append(wrapper);\n\t\t}\n\t}\n\t\n\tif (heading === 'Moments in History') heading = 'Historical';\n\telse if (heading === 'Top Stories from ABC News') heading = 'Top';\n\t\n\tpages.push(['* ' + heading, section])\n\tif (i < 3) home.push(section);\n}\n\npages.push(['Just in', '/news/justin']);\npages.push(['Ed. Standards', 'https://about.abc.net.au/how-the-abc-is-run/what-guides-us/abc-editorial-standards/'])\npages.push(['Footer', document.querySelector('[data-component=\"Footer\"]')]);\nSparse(pages, {bgcolor: 'pink'});"}},{"bABC Aus":[["s","SParse layout generator"],["s","ABC Aus"]]},{"phttps://abc.net.au/":{"components":["b","ABC Aus"],"allow":false}},{"phttps://www.abc.net.au/":{"components":["b","ABC Aus"],"allow":false}}]
+[{"sSParse layout generator":{"url":"","hash":"","text":"/*\n\tGenerate simple yet clean single-page site(oids)\n\t\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nfunction Sparse(navItems, opts) {\n\topts = opts || {};\n\tvar width = opts.width || 20,\n\t text = opts.text || 'black',\n\t bg = opts.bgcolor || opts.background || 'yellow',\n\t pagebg = opts.tabcolor || 'white';\n\t gap = opts.gap || '10px';\n\t\n\tvar body = document.createElement('body'),\n\t nav = document.createElement('nav'),\n\t style = document.createElement('style');\n\t\n\tvar link, activeLink, title;\n\t\n\tstyle.innerText = `\n\tbody {\n\t\tdisplay: grid;\n\t\tgrid-column-gap: ${gap};\n\t\tcolumn-gap: ${gap};\n\t\tgrid-template-columns: ${width}%;\n\t}\n\t\n\tnav {\n\t\tgrid-column: 1;\n\t\tposition: sticky;\n\t\ttop: 0;\n\t}\n\t\n\tnav > a:not([href]) {\n\t\tcolor: ${text};\n\t\tfont-weight: bold;\n\t}\n\t\n\tbody, nav { background-color: ${bg}; }\n\tbody > * { grid-row: 1; }\n\tbody > *:not(nav) { background-color: ${pagebg} }\n\t`\n\t\n\tbody.append(style);\n\tbody.append(nav);\n\t\n\tfunction onLinkClick(e) {\n\t\tvar link, section, title;\n\t\tif (activeLink) {\n\t\t\tlink = activeLink.inactive\n\t\t\tnav.replaceChild(link, activeLink);\n\t\t\tfor (pane of link.panes) body.removeChild(pane.parentNode);\n\t\t\t\n\t\t\tdelete activeLink.inactive;\n\t\t}\n\t\t\n\t\tlink = e.target;\n\t\tactiveLink = document.createElement('span');\n\t\tactiveLink.innerText = link.textContent;\n\t\tactiveLink.inactive = link;\n\t\tnav.replaceChild(activeLink, link);\n\t\t\n\t\tlink.panes.forEach((pane, i) => {\n\t\t\tsection = document.createElement('article');\n\t\t\ttitle = document.createElement('h1');\n\t\t\t\n\t\t\ttitle.innerText = pane.docTitle;\n\t\t\tsection.style.gridColumn = (i + 2).toString();\n\t\t\t\n\t\t\tif (pane.docTitleLink) {\n\t\t\t\tlet titleLink = document.createElement('a');\n\t\t\t\t\n\t\t\t\ttitleLink.href = pane.docTitleLink;\n\t\t\t\ttitleLink.append(title);\n\t\t\t\ttitle = titleLink;\n\t\t\t}\n\t\t\t\n\t\t\tsection.append(title);\n\t\t\tsection.append(pane);\n\t\t\tbody.append(section);\n\t\t});\n\t}\n\t\n\tdocument.title = navItems[0];\n\t\n\tfor (var item of navItems) {\n\t\tlink = document.createElement('a');\n\t\tif (typeof item === 'string') link.innerText = item;\n\t\telse {\n\t\t\tlink.innerText = item.shift();\n\t\t\tif (link.textContent.startsWith('* ')) {\n\t\t\t\tlink.innerText = link.textContent.substr(2);\n\t\t\t\tlink.style.fontSize = '80%';\n\t\t\t}\n\t\t\t\n\t\t\tif (typeof item[0] === 'string' && item.length === 1) link.href = item[0];\n\t\t\telse {\n\t\t\t\tlink.onclick = onLinkClick;\n\t\t\t\tlink.href = '#';\n\t\t\t\tif (item.length === 2 && typeof item[1] === 'string') {\n\t\t\t\t\t// Add a title link (if applicable)\n\t\t\t\t\titem[0].docTitleLink = item.pop();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlink.panes = item;\n\t\t\t\t\n\t\t\t\t// Add the title info\n\t\t\t\tif (item.length === 1) item[0].docTitle = link.textContent;\n\t\t\t}\n\t\t}\n\t\t\n\t\tnav.append(link);\n\t\tnav.append(document.createElement('br'));\n\t}\n\t\n\tactiveLink = null;\n\tdocument.body.parentNode.replaceChild(body, document.body);\n\tnav.querySelector('a[href]').click();\n}"}},{"sABC Aus":{"url":"","hash":"","text":"/*\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nvar pages = ['ABC News'], comp, wrapper, heading, section, cards, card, text,\n home = ['Home'], comps = document.getElementById('content').children;\n\npages.push(home);\nfor (i = 0; i < comps.length; i++) {\n\tcomp = comps[i];\n\tcard = undefined;\n\tif (!comp.dataset.component) continue;\n\t\n\theading = comp.querySelector('[data-component=\"Heading\"], [data-component=\"CollectionHeading\"]');\n\theading = heading ? heading.innerText : 'Featured';\n\tif (heading === 'Top Stories from ABC News') heading = 'Top Stories';\n\t\n\twrapper = document.createElement('div');\n\tpages.push(['* ' + heading, wrapper])\n\t\n\tfor (card of comp.querySelectorAll('[data-component$=Card]')) {\n\t\ttext = card.innerText; //HTML.replace(/<[^<]*>/g, '\\n').replace(/\\n\\n+/g, '\\n').replace(/^\\n/, '');\n\t\tsection = document.createElement('section');\n\t\twrapper.append(section);\n\t\t\n\t\theading = document.createElement('a');\n\t\theading.href = card.querySelector('a').href;\n\t\theading.style.display = 'block';\n\t\theading.style.fontWeight = 'bold';\n\t\tsection.append(heading);\n\t\t\n\t\tvar index = text.indexOf('\\n');\n\t\tif (index === -1) wrapper.innerText = text;\n\t\telse {\n\t\t\theading.innerText = text.substr(0, index);\n\t\t\tlink = document.createElement('p'); // Reuse or abuse?\n\t\t\tlink.innerText = text.substr(index + 1);\n\t\t\tsection.append(link);\n\t\t}\n\t}\n\t\n\tif (!card) pages.pop();\n\telse if (i < 3) home.push(wrapper);\n}\n\npages.push(['Just in', '/news/justin']);\npages.push(['Ed. Standards', 'https://about.abc.net.au/how-the-abc-is-run/what-guides-us/abc-editorial-standards/'])\npages.push(['Footer', document.querySelector('[data-component=\"Footer\"]')]);\nSparse(pages, {bgcolor: 'pink'});"}},{"bABC Aus":[["s","SParse layout generator"],["s","ABC Aus"]]},{"phttps://abc.net.au/":{"components":["b","ABC Aus"],"allow":false}},{"phttps://www.abc.net.au/":{"components":["b","ABC Aus"],"allow":false}}]