aboutsummaryrefslogtreecommitdiff
path: root/src/js/Botleagues.js
diff options
context:
space:
mode:
authorCamil Staps2015-05-07 12:00:54 +0300
committerCamil Staps2015-05-07 12:00:54 +0300
commitf0218468f76a01e7644bc727ea9502015a5047c3 (patch)
tree4f28b4bb1b1e8651f6e875877caad6159746581b /src/js/Botleagues.js
parentWorking jsonp (diff)
Register page & more
Diffstat (limited to 'src/js/Botleagues.js')
-rw-r--r--src/js/Botleagues.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/js/Botleagues.js b/src/js/Botleagues.js
new file mode 100644
index 0000000..fd8ed21
--- /dev/null
+++ b/src/js/Botleagues.js
@@ -0,0 +1,22 @@
+function Botleagues(){}
+
+Botleagues.url = 'https://api.local.botleagues.camilstaps.nl';
+
+Botleagues.request = function(user_options, callback) {
+ var options = {
+ endpoint: null,
+ method: 'GET',
+ dataType: 'json',
+ done: function(data) {
+ callback(data);
+ }
+ };
+ for (var name in user_options) {
+ options[name] = user_options[name];
+ }
+
+ var url = Botleagues.url + '/' + options['endpoint'];
+ delete options['endpoint'];
+
+ jQuery.ajax(url, options);
+}; \ No newline at end of file