From 3ba962794dcc3918b86c329161233ca1d513dc13 Mon Sep 17 00:00:00 2001 From: Ayushya Amitabh Date: Mon, 11 May 2020 23:24:04 -0400 Subject: [PATCH] v1.1.0-beta/Google Form Styler --- website/GoogleFormStyler.js | 23 +++++++++++++++++++++++ website/beta.html | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 website/GoogleFormStyler.js diff --git a/website/GoogleFormStyler.js b/website/GoogleFormStyler.js new file mode 100644 index 0000000..de407f8 --- /dev/null +++ b/website/GoogleFormStyler.js @@ -0,0 +1,23 @@ +// CREATED BY http://googleformrestyler.apixml.net/ +(function (XHR) { + var open = XHR.prototype.open; + XHR.prototype.open = function (method, url, async, user, pass) { + this._url = url; + if (url.indexOf('gstatic.com') !== -1 || url.indexOf('docs.google.com') !== -1) { + url = 'http://googleformrestyler.apixml.net/corsProxy.aspx?base64Url=' + btoa(url); + } + open.call(this, method, url, async, user, pass); + }; +})(XMLHttpRequest); +(function () { + var script = + document.currentScript || + /*Polyfill*/ Array.prototype.slice.call(document.getElementsByTagName('script')).pop(); + var URL = script.getAttribute('form'); + var xhr = new XMLHttpRequest(); + xhr.open('GET', URL); + xhr.onload = function () { + document.write(xhr.response); + }; + xhr.send(); +})(); diff --git a/website/beta.html b/website/beta.html index 25d04d4..956ec23 100644 --- a/website/beta.html +++ b/website/beta.html @@ -61,7 +61,7 @@