aboutsummaryrefslogtreecommitdiff
path: root/phttps __www.pcspecialist.co.uk.json
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 /phttps __www.pcspecialist.co.uk.json
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
Diffstat (limited to 'phttps __www.pcspecialist.co.uk.json')
-rw-r--r--phttps __www.pcspecialist.co.uk.json1
1 files changed, 1 insertions, 0 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}}]