aboutsummaryrefslogtreecommitdiff
path: root/phttps___actions.sumofus.org_a__.json
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-07-30 18:17:54 +0200
committerWojtek Kosior <koszko@koszko.org>2021-07-30 18:17:54 +0200
commitb87b7351866e52f2b740162e6a3422d32e0dd380 (patch)
tree0404cc1854453ac000c56d2fe1c658ad0b4ed997 /phttps___actions.sumofus.org_a__.json
downloadhachette_fixes_tmp-b87b7351866e52f2b740162e6a3422d32e0dd380.tar.gz
hachette_fixes_tmp-b87b7351866e52f2b740162e6a3422d32e0dd380.zip
gather initial fixes
Diffstat (limited to 'phttps___actions.sumofus.org_a__.json')
-rw-r--r--phttps___actions.sumofus.org_a__.json1
1 files changed, 1 insertions, 0 deletions
diff --git a/phttps___actions.sumofus.org_a__.json b/phttps___actions.sumofus.org_a__.json
new file mode 100644
index 0000000..08998ad
--- /dev/null
+++ b/phttps___actions.sumofus.org_a__.json
@@ -0,0 +1 @@
+[{"ssumofus (sign petition)":{"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\nfunction submitFormItem() {\n\tvar name, val, queryString = '', xhr = new content.XMLHttpRequest();\n\tfor (var formItem of this.querySelectorAll('select, input:not([type=\"radio\"]):not([type=\"checkbox\"])' +\n\t\t':not([type=\"submit\"]):not([type=\"reset\"])')) {\n\t\tqueryString += (queryString && '&') + formItem.name + '=' + encodeURIComponent(formItem.value);\n\t}\n\t\n\txhr.onreadystatechange = function () {\n\t\tif (this.readyState === 4) {\n\t\t\tif (this.status === 200) location.href = JSON.parse(this.responseText).follow_up_url;\n\t\t\telse if (this.status === 422) {\n\t\t\t\tvar failMessage = [], response = JSON.parse(this.responseText);\n\t\t\t\tfor (field in response.errors) for (error of response.errors[field]) {\n\t\t\t\t\tfailMessage.push('Field \"' + field + '\" ' + error);\n\t\t\t\t}\n\t\t\t\talert(failMessage.join('\\n'));\n\t\t\t}\n\t\t\telse alert('Submission failed: response code ' + this.status);\n\t\t}\n\t}\n\t\n\txhr.open('POST', this.action, true); // Manually add the domain, as it's not properly handled in extensions\n\txhr.setRequestHeader('X-CSRF-Token', csrf);\n\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\txhr.send(queryString);\n\treturn false;\n}\n\n// Apply CSS as necessary\nif (notice = document.querySelector('#petition-bar-main > span')) notice.style.display = 'none'; // Hide the totally mistaken (even without this extension) anti-anti-JS warning\ndocument.querySelector('.script-dependent').style.display = 'block';\ndocument.querySelector('.button-wrapper').style.position = 'static'; // Stop the \"submit\" button obscuring the form\n\n\n\ncsrf = document.querySelector('meta[name=\"csrf-token\"]').content\nfor (var button of document.querySelectorAll('button[type=\"submit\"].button.action-form__submit-button')) button.form.onsubmit = submitFormItem;"}},{"phttps://actions.sumofus.org/a/*":{"components":["s","sumofus (sign petition)"]}}] \ No newline at end of file