aboutsummaryrefslogtreecommitdiff
[{"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}}]