summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
diff options
context:
space:
mode:
authorChristophe.Boulain <>2008-10-24 07:54:52 +0000
committerChristophe.Boulain <>2008-10-24 07:54:52 +0000
commit713f7ea1d16673bbcfce6a1a59cbc247632bd682 (patch)
tree8f64879be692a92b427cd7a5a6f08a2dc5b108d6 /framework/Web/Javascripts
parentcf0d0b7e78003d02435337f79a99da056ca0f683 (diff)
Added TActiveFileUpload
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/source/packages.php29
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html1
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.pngbin0 -> 663 bytes
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.pngbin0 -> 589 bytes
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gifbin0 -> 1553 bytes
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/activefileupload.js63
6 files changed, 81 insertions, 12 deletions
diff --git a/framework/Web/Javascripts/source/packages.php b/framework/Web/Javascripts/source/packages.php
index ab687e86..d6c04e7f 100644
--- a/framework/Web/Javascripts/source/packages.php
+++ b/framework/Web/Javascripts/source/packages.php
@@ -65,6 +65,10 @@ $packages = array(
'activedatepicker' => array(
'prado/activecontrols/activedatepicker.js'
+ ),
+
+ 'activefileupload' => array(
+ 'prado/activefileupload/activefileupload.js'
),
);
@@ -72,18 +76,19 @@ $packages = array(
//package names and their dependencies
$dependencies = array(
- 'prado' => array('prado'),
- 'effects' => array('prado', 'effects'),
- 'validator' => array('prado', 'validator'),
- 'logger' => array('prado', 'logger'),
- 'datepicker' => array('prado', 'datepicker'),
- 'colorpicker' => array('prado', 'colorpicker'),
- 'ajax' => array('prado', 'effects', 'ajax'),
- 'dragdrop' => array('prado', 'effects', 'ajax', 'dragdrop'),
- 'slider' => array('prado', 'slider'),
- 'keyboard' => array('prado', 'keyboard'),
- 'tabpanel' => array('prado', 'tabpanel'),
- 'activedatepicker' => array ('datepicker', 'ajax', 'activedatepicker'),
+ 'prado' => array('prado'),
+ 'effects' => array('prado', 'effects'),
+ 'validator' => array('prado', 'validator'),
+ 'logger' => array('prado', 'logger'),
+ 'datepicker' => array('prado', 'datepicker'),
+ 'colorpicker' => array('prado', 'colorpicker'),
+ 'ajax' => array('prado', 'effects', 'ajax'),
+ 'dragdrop' => array('prado', 'effects', 'ajax', 'dragdrop'),
+ 'slider' => array('prado', 'slider'),
+ 'keyboard' => array('prado', 'keyboard'),
+ 'tabpanel' => array('prado', 'tabpanel'),
+ 'activedatepicker' => array('datepicker', 'ajax', 'activedatepicker'),
+ 'activefileupload' => array('prado', 'ajax', 'activefileupload'),
);
return array($packages, $dependencies);
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html
new file mode 100755
index 00000000..44f50ce4
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html
@@ -0,0 +1 @@
+<!-- Nothing here to see, move right along. --> \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.png b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.png
new file mode 100755
index 00000000..98badd7f
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.png b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.png
new file mode 100755
index 00000000..26c529fc
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gif b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gif
new file mode 100755
index 00000000..085ccaec
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gif
Binary files differ
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
new file mode 100755
index 00000000..9f57f912
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
@@ -0,0 +1,63 @@
+Prado.WebUI.TActiveFileUpload = Base.extend(
+{
+ constructor : function(options)
+ {
+ this.options = options || {};
+ Prado.WebUI.TActiveFileUpload.register(this);
+
+ this.input = $(options.inputID);
+ this.flag = $(options.flagID);
+ this.form = $(options.formID);
+
+ this.indicator = $(options.indicatorID);
+ this.complete = $(options.completeID);
+ this.error = $(options.errorID);
+
+ // set up events
+ Event.observe(this.input,"change",this.fileChanged.bind(this));
+ },
+
+ fileChanged:function(){
+ // show the upload indicator, and hide the complete and error indicators (if they areSn't already).
+ this.flag.value = '1';
+ this.complete.style.display = 'none';
+ this.error.style.display = 'none';
+ this.indicator.style.display = '';
+
+ // set the form to submit in the iframe, submit it, and then reset it.
+ this.oldtargetID = this.form.target;
+ this.form.target = this.options.targetID;
+ this.form.submit();
+ this.form.target = this.oldtargetID;
+ },
+
+ finishUpload:function(options){
+ // hide the display indicator.
+ this.flag.value = '';
+ this.indicator.style.display = 'none';
+ if (this.options.targetID == options.targetID){
+ // show the complete indicator.
+ if (options.errorCode == 0){
+ this.complete.style.display = '';
+ this.input.value = '';
+ } else {
+ this.error.style.display = '';
+ }
+ Prado.Callback(this.options.EventTarget, options, null, this.options);
+ }
+ }
+},
+{
+// class methods
+ controls : {},
+
+ register : function(control)
+ {
+ Prado.WebUI.TActiveFileUpload.controls[control.options.ID] = control;
+ },
+
+ onFileUpload: function(options)
+ {
+ Prado.WebUI.TActiveFileUpload.controls[options.clientID].finishUpload(options);
+ }
+}); \ No newline at end of file