summaryrefslogtreecommitdiffstats
path: root/pyload/webui/themes/Next/lib/MooTools/MooDialog/MooDialog.Request.js
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/webui/themes/Next/lib/MooTools/MooDialog/MooDialog.Request.js')
-rw-r--r--pyload/webui/themes/Next/lib/MooTools/MooDialog/MooDialog.Request.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/pyload/webui/themes/Next/lib/MooTools/MooDialog/MooDialog.Request.js b/pyload/webui/themes/Next/lib/MooTools/MooDialog/MooDialog.Request.js
new file mode 100644
index 000000000..7b8eb23c4
--- /dev/null
+++ b/pyload/webui/themes/Next/lib/MooTools/MooDialog/MooDialog.Request.js
@@ -0,0 +1,37 @@
+/*
+---
+name: MooDialog.Request
+description: Loads Data into a Dialog with Request
+authors: Arian Stolwijk
+license: MIT-style license
+requires: [MooDialog, Core/Request.HTML]
+provides: MooDialog.Request
+...
+*/
+
+MooDialog.Request = new Class({
+
+ Extends: MooDialog,
+
+ initialize: function(url, requestOptions, options){
+ this.parent(options);
+ this.requestOptions = requestOptions || {};
+
+ this.addEvent('open', function(){
+ var request = new Request.HTML(this.requestOptions).addEvent('success', function(text){
+ this.setContent(text);
+ }.bind(this)).send({
+ url: url
+ });
+ }.bind(this));
+
+ if (this.options.autoOpen) this.open();
+
+ },
+
+ setRequestOptions: function(options){
+ this.requestOptions = Object.merge(this.requestOptions, options);
+ return this;
+ }
+
+});