aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy1_5/www/javascript
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2015-03-08 16:19:14 +0100
committerPiBa-NL <pba_2k3@yahoo.com>2015-03-08 16:19:14 +0100
commitba815dbdf7d2acfcd9a6ba4d0c30ac744af6ef36 (patch)
tree51dc6a70187720ff0094a4f59d3d8878c683e2d9 /config/haproxy1_5/www/javascript
parent8ea139b506b56aa0dc35c74102f8cc561aedf8d7 (diff)
downloadpfsense-packages-ba815dbdf7d2acfcd9a6ba4d0c30ac744af6ef36.tar.gz
pfsense-packages-ba815dbdf7d2acfcd9a6ba4d0c30ac744af6ef36.tar.bz2
pfsense-packages-ba815dbdf7d2acfcd9a6ba4d0c30ac744af6ef36.zip
haproxy-1_5, create 'release' package from haproxy-devel base, to have a 'production' stable version
Diffstat (limited to 'config/haproxy1_5/www/javascript')
-rw-r--r--config/haproxy1_5/www/javascript/haproxy_geturl.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/config/haproxy1_5/www/javascript/haproxy_geturl.js b/config/haproxy1_5/www/javascript/haproxy_geturl.js
new file mode 100644
index 00000000..5df80646
--- /dev/null
+++ b/config/haproxy1_5/www/javascript/haproxy_geturl.js
@@ -0,0 +1,43 @@
+/**
+ * getURL is a proprietary Adobe function, but it's simplicity has made it very
+ * popular. If getURL is undefined we spin our own by wrapping XMLHttpRequest.
+ */
+if (typeof getURL == 'undefined') {
+ getURL = function(url, callback) {
+ if (!url)
+ throw 'No URL for getURL';
+
+ try {
+ if (typeof callback.operationComplete == 'function')
+ callback = callback.operationComplete;
+ } catch (e) {}
+ if (typeof callback != 'function')
+ throw 'No callback function for getURL "' + url + '"';
+
+ var http_request = null;
+ if (typeof XMLHttpRequest != 'undefined') {
+ http_request = new XMLHttpRequest();
+ }
+ else if (typeof ActiveXObject != 'undefined') {
+ try {
+ http_request = new ActiveXObject('Msxml2.XMLHTTP');
+ } catch (e) {
+ try {
+ http_request = new ActiveXObject('Microsoft.XMLHTTP');
+ } catch (e) {}
+ }
+ }
+ if (!http_request)
+ throw '<?=gettext("Both getURL and XMLHttpRequest are undefined"); ?>';
+
+ http_request.onreadystatechange = function() {
+ if (http_request.readyState == 4) {
+ callback( { success : true,
+ content : http_request.responseText,
+ contentType : http_request.getResponseHeader("Content-Type") } );
+ }
+ }
+ http_request.open('GET', url, true);
+ http_request.send(null);
+ }
+}