From 6228873cf9d6471463d2413e7dfd7447f759baf2 Mon Sep 17 00:00:00 2001 From: "christophe.boulain" <> Date: Wed, 3 Dec 2008 14:22:03 +0000 Subject: Merge from trunk --- framework/Web/Javascripts/source/packages.php | 36 +- .../source/prado/activecontrols/activecontrols3.js | 749 +++++++++++---------- .../prado/activecontrols/activedatepicker.js | 79 +++ .../source/prado/activecontrols/dragdrop.js | 24 + .../source/prado/activecontrols/inlineeditor.js | 2 +- .../activefileupload/ActiveFileUploadBlank.html | 1 + .../activefileupload/ActiveFileUploadComplete.png | Bin 0 -> 663 bytes .../activefileupload/ActiveFileUploadError.png | Bin 0 -> 589 bytes .../activefileupload/ActiveFileUploadIndicator.gif | Bin 0 -> 1553 bytes .../prado/activefileupload/activefileupload.js | 63 ++ .../source/prado/activeratings/blocks.css | 42 -- .../source/prado/activeratings/default.css | 43 -- .../source/prado/activeratings/ratings.js | 178 ----- .../Javascripts/source/prado/controls/controls.js | 19 +- .../source/prado/datepicker/datepicker.js | 21 +- .../Javascripts/source/prado/ratings/ratings.js | 207 +++++- .../source/prado/validator/validation3.js | 13 +- .../source/scriptaculous-1.8.1/dragdrop.js | 2 +- 18 files changed, 794 insertions(+), 685 deletions(-) create mode 100755 framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js create mode 100755 framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js create mode 100755 framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html create mode 100755 framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.png create mode 100755 framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.png create mode 100755 framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gif create mode 100755 framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js delete mode 100644 framework/Web/Javascripts/source/prado/activeratings/blocks.css delete mode 100644 framework/Web/Javascripts/source/prado/activeratings/default.css delete mode 100644 framework/Web/Javascripts/source/prado/activeratings/ratings.js (limited to 'framework/Web/Javascripts/source') diff --git a/framework/Web/Javascripts/source/packages.php b/framework/Web/Javascripts/source/packages.php index 1cca7b7c..d6c04e7f 100644 --- a/framework/Web/Javascripts/source/packages.php +++ b/framework/Web/Javascripts/source/packages.php @@ -47,7 +47,8 @@ $packages = array( ), 'dragdrop'=>array( - SCRIPTACULOUS_DIR.'/dragdrop.js' + SCRIPTACULOUS_DIR.'/dragdrop.js', + 'prado/activecontrols/dragdrop.js' ), 'slider'=>array( @@ -60,6 +61,14 @@ $packages = array( 'tabpanel'=>array( 'prado/controls/tabpanel.js' + ), + + 'activedatepicker' => array( + 'prado/activecontrols/activedatepicker.js' + ), + + 'activefileupload' => array( + 'prado/activefileupload/activefileupload.js' ), ); @@ -67,19 +76,20 @@ $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', 'dragdrop'), - 'slider' => array('prado', 'slider'), - 'keyboard' => array('prado', 'keyboard'), - 'tabpanel' => array('prado', 'tabpanel'), + '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/activecontrols/activecontrols3.js b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js index 7ee4c0e6..d5cae7b8 100644 --- a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js @@ -1,362 +1,387 @@ -/** - * Generic postback control. - */ -Prado.WebUI.CallbackControl = Class.extend(Prado.WebUI.PostBackControl, -{ - onPostBack : function(event, options) - { - var request = new Prado.CallbackRequest(options.EventTarget, options); - request.dispatch(); - Event.stop(event); - } -}); - -/** - * TActiveButton control. - */ -Prado.WebUI.TActiveButton = Class.extend(Prado.WebUI.CallbackControl); -/** - * TActiveLinkButton control. - */ -Prado.WebUI.TActiveLinkButton = Class.extend(Prado.WebUI.CallbackControl); - -Prado.WebUI.TActiveImageButton = Class.extend(Prado.WebUI.TImageButton, -{ - onPostBack : function(event, options) - { - this.addXYInput(event,options); - var request = new Prado.CallbackRequest(options.EventTarget, options); - request.dispatch(); - Event.stop(event); - } -}); -/** - * Active check box. - */ -Prado.WebUI.TActiveCheckBox = Class.extend(Prado.WebUI.CallbackControl, -{ - onPostBack : function(event, options) - { - var request = new Prado.CallbackRequest(options.EventTarget, options); - if(request.dispatch()==false) - Event.stop(event); - } -}); - -/** - * TActiveRadioButton control. - */ -Prado.WebUI.TActiveRadioButton = Class.extend(Prado.WebUI.TActiveCheckBox); - - -Prado.WebUI.TActiveCheckBoxList = Base.extend( -{ - constructor : function(options) - { - for(var i = 0; i 0) - { - this.hasResults = true; - this.updateChoices(result); - } - else - { - this.active = false; - this.hasResults = false; - this.hide(); - } - } - } -}); - -/** - * Time Triggered Callback class. - */ -Prado.WebUI.TTimeTriggeredCallback = Base.extend( -{ - constructor : function(options) - { - this.options = Object.extend({ Interval : 1 }, options || {}); - Prado.WebUI.TTimeTriggeredCallback.register(this); - }, - - startTimer : function() - { - setTimeout(this.onTimerEvent.bind(this), 100); - if(typeof(this.timer) == 'undefined' || this.timer == null) - this.timer = setInterval(this.onTimerEvent.bind(this),this.options.Interval*1000); - }, - - stopTimer : function() - { - if(typeof(this.timer) != 'undefined') - { - clearInterval(this.timer); - this.timer = null; - } - }, - - onTimerEvent : function() - { - var request = new Prado.CallbackRequest(this.options.EventTarget, this.options); - request.dispatch(); - } -}, -//class methods -{ - timers : {}, - - register : function(timer) - { - Prado.WebUI.TTimeTriggeredCallback.timers[timer.options.ID] = timer; - }, - - start : function(id) - { - if(Prado.WebUI.TTimeTriggeredCallback.timers[id]) - Prado.WebUI.TTimeTriggeredCallback.timers[id].startTimer(); - }, - - stop : function(id) - { - if(Prado.WebUI.TTimeTriggeredCallback.timers[id]) - Prado.WebUI.TTimeTriggeredCallback.timers[id].stopTimer(); - } -}); - -Prado.WebUI.ActiveListControl = Base.extend( -{ - constructor : function(options) - { - this.element = $(options.ID); - if(this.element) - { - this.options = options; - Event.observe(this.element, "change", this.doCallback.bind(this)); - } - }, - - doCallback : function(event) - { - var request = new Prado.CallbackRequest(this.options.EventTarget, this.options); - request.dispatch(); - Event.stop(event); - } -}); - -Prado.WebUI.TActiveDropDownList = Prado.WebUI.ActiveListControl; -Prado.WebUI.TActiveListBox = Prado.WebUI.ActiveListControl; - -/** - * Observe event of a particular control to trigger a callback request. - */ -Prado.WebUI.TEventTriggeredCallback = Base.extend( -{ - constructor : function(options) - { - this.options = options; - var element = $(options['ControlID']); - if(element) - Event.observe(element, this.getEventName(element), this.doCallback.bind(this)); - }, - - getEventName : function(element) - { - var name = this.options.EventName; - if(typeof(name) == "undefined" && element.type) - { - switch (element.type.toLowerCase()) - { - case 'password': - case 'text': - case 'textarea': - case 'select-one': - case 'select-multiple': - return 'change'; - } - } - return typeof(name) == "undefined" || name == "undefined" ? 'click' : name; - }, - - doCallback : function(event) - { - var request = new Prado.CallbackRequest(this.options.EventTarget, this.options); - request.dispatch(); - if(this.options.StopEvent == true) - Event.stop(event); - } -}); - -/** - * Observe changes to a property of a particular control to trigger a callback. - */ -Prado.WebUI.TValueTriggeredCallback = Base.extend( -{ - count : 1, - - observing : true, - - constructor : function(options) - { - this.options = options; - this.options.PropertyName = this.options.PropertyName || 'value'; - var element = $(options['ControlID']); - this.value = element ? element[this.options.PropertyName] : undefined; - Prado.WebUI.TValueTriggeredCallback.register(this); - this.startObserving(); - }, - - stopObserving : function() - { - clearTimeout(this.timer); - this.observing = false; - }, - - startObserving : function() - { - this.timer = setTimeout(this.checkChanges.bind(this), this.options.Interval*1000); - }, - - checkChanges : function() - { - var element = $(this.options.ControlID); - if(element) - { - var value = element[this.options.PropertyName]; - if(this.value != value) - { - this.doCallback(this.value, value); - this.value = value; - this.count=1; - } - else - this.count = this.count + this.options.Decay; - if(this.observing) - this.time = setTimeout(this.checkChanges.bind(this), - parseInt(this.options.Interval*1000*this.count)); - } - }, - - doCallback : function(oldValue, newValue) - { - var request = new Prado.CallbackRequest(this.options.EventTarget, this.options); - var param = {'OldValue' : oldValue, 'NewValue' : newValue}; - request.setCallbackParameter(param); - request.dispatch(); - } -}, -//class methods -{ - timers : {}, - - register : function(timer) - { - Prado.WebUI.TValueTriggeredCallback.timers[timer.options.ID] = timer; - }, - - stop : function(id) - { - Prado.WebUI.TValueTriggeredCallback.timers[id].stopObserving(); - } -}); +/** + * Generic postback control. + */ +Prado.WebUI.CallbackControl = Class.extend(Prado.WebUI.PostBackControl, +{ + onPostBack : function(event, options) + { + var request = new Prado.CallbackRequest(options.EventTarget, options); + request.dispatch(); + Event.stop(event); + } +}); + +/** + * TActiveButton control. + */ +Prado.WebUI.TActiveButton = Class.extend(Prado.WebUI.CallbackControl); +/** + * TActiveLinkButton control. + */ +Prado.WebUI.TActiveLinkButton = Class.extend(Prado.WebUI.CallbackControl); + +Prado.WebUI.TActiveImageButton = Class.extend(Prado.WebUI.TImageButton, +{ + onPostBack : function(event, options) + { + this.addXYInput(event,options); + var request = new Prado.CallbackRequest(options.EventTarget, options); + request.dispatch(); + Event.stop(event); + this.removeXYInput(event,options); + } +}); +/** + * Active check box. + */ +Prado.WebUI.TActiveCheckBox = Class.extend(Prado.WebUI.CallbackControl, +{ + onPostBack : function(event, options) + { + var request = new Prado.CallbackRequest(options.EventTarget, options); + if(request.dispatch()==false) + Event.stop(event); + } +}); + +/** + * TActiveRadioButton control. + */ +Prado.WebUI.TActiveRadioButton = Class.extend(Prado.WebUI.TActiveCheckBox); + + +Prado.WebUI.TActiveCheckBoxList = Base.extend( +{ + constructor : function(options) + { + for(var i = 0; i 0) + { + this.hasResults = true; + this.updateChoices(result); + } + else + { + this.active = false; + this.hasResults = false; + this.hide(); + } + } + } +}); + +/** + * Time Triggered Callback class. + */ +Prado.WebUI.TTimeTriggeredCallback = Base.extend( +{ + constructor : function(options) + { + this.options = Object.extend({ Interval : 1 }, options || {}); + Prado.WebUI.TTimeTriggeredCallback.register(this); + }, + + startTimer : function() + { + setTimeout(this.onTimerEvent.bind(this), 100); + if(typeof(this.timer) == 'undefined' || this.timer == null) + this.timer = setInterval(this.onTimerEvent.bind(this),this.options.Interval*1000); + }, + + stopTimer : function() + { + if(typeof(this.timer) != 'undefined') + { + clearInterval(this.timer); + this.timer = null; + } + }, + + resetTimer : function() + { + if(typeof(this.timer) != 'undefined') + { + clearInterval(this.timer); + this.timer = null; + this.timer = setInterval(this.onTimerEvent.bind(this),this.options.Interval*1000); + } + }, + + onTimerEvent : function() + { + var request = new Prado.CallbackRequest(this.options.EventTarget, this.options); + request.dispatch(); + }, + + setInterval : function(value) + { + if (this.options.Interval != value){ + this.options.Interval = value; + this.resetTimer(); + } + } +}, +//class methods +{ + timers : {}, + + register : function(timer) + { + Prado.WebUI.TTimeTriggeredCallback.timers[timer.options.ID] = timer; + }, + + start : function(id) + { + if(Prado.WebUI.TTimeTriggeredCallback.timers[id]) + Prado.WebUI.TTimeTriggeredCallback.timers[id].startTimer(); + }, + + stop : function(id) + { + if(Prado.WebUI.TTimeTriggeredCallback.timers[id]) + Prado.WebUI.TTimeTriggeredCallback.timers[id].stopTimer(); + }, + + setInterval : function (id,value) + { + if(Prado.WebUI.TTimeTriggeredCallback.timers[id]) + Prado.WebUI.TTimeTriggeredCallback.timers[id].setInterval(value); + } +}); + +Prado.WebUI.ActiveListControl = Base.extend( +{ + constructor : function(options) + { + this.element = $(options.ID); + if(this.element) + { + this.options = options; + Event.observe(this.element, "change", this.doCallback.bind(this)); + } + }, + + doCallback : function(event) + { + var request = new Prado.CallbackRequest(this.options.EventTarget, this.options); + request.dispatch(); + Event.stop(event); + } +}); + +Prado.WebUI.TActiveDropDownList = Prado.WebUI.ActiveListControl; +Prado.WebUI.TActiveListBox = Prado.WebUI.ActiveListControl; + +/** + * Observe event of a particular control to trigger a callback request. + */ +Prado.WebUI.TEventTriggeredCallback = Base.extend( +{ + constructor : function(options) + { + this.options = options; + var element = $(options['ControlID']); + if(element) + Event.observe(element, this.getEventName(element), this.doCallback.bind(this)); + }, + + getEventName : function(element) + { + var name = this.options.EventName; + if(typeof(name) == "undefined" && element.type) + { + switch (element.type.toLowerCase()) + { + case 'password': + case 'text': + case 'textarea': + case 'select-one': + case 'select-multiple': + return 'change'; + } + } + return typeof(name) == "undefined" || name == "undefined" ? 'click' : name; + }, + + doCallback : function(event) + { + var request = new Prado.CallbackRequest(this.options.EventTarget, this.options); + request.dispatch(); + if(this.options.StopEvent == true) + Event.stop(event); + } +}); + +/** + * Observe changes to a property of a particular control to trigger a callback. + */ +Prado.WebUI.TValueTriggeredCallback = Base.extend( +{ + count : 1, + + observing : true, + + constructor : function(options) + { + this.options = options; + this.options.PropertyName = this.options.PropertyName || 'value'; + var element = $(options['ControlID']); + this.value = element ? element[this.options.PropertyName] : undefined; + Prado.WebUI.TValueTriggeredCallback.register(this); + this.startObserving(); + }, + + stopObserving : function() + { + clearTimeout(this.timer); + this.observing = false; + }, + + startObserving : function() + { + this.timer = setTimeout(this.checkChanges.bind(this), this.options.Interval*1000); + }, + + checkChanges : function() + { + var element = $(this.options.ControlID); + if(element) + { + var value = element[this.options.PropertyName]; + if(this.value != value) + { + this.doCallback(this.value, value); + this.value = value; + this.count=1; + } + else + this.count = this.count + this.options.Decay; + if(this.observing) + this.time = setTimeout(this.checkChanges.bind(this), + parseInt(this.options.Interval*1000*this.count)); + } + }, + + doCallback : function(oldValue, newValue) + { + var request = new Prado.CallbackRequest(this.options.EventTarget, this.options); + var param = {'OldValue' : oldValue, 'NewValue' : newValue}; + request.setCallbackParameter(param); + request.dispatch(); + } +}, +//class methods +{ + timers : {}, + + register : function(timer) + { + Prado.WebUI.TValueTriggeredCallback.timers[timer.options.ID] = timer; + }, + + stop : function(id) + { + Prado.WebUI.TValueTriggeredCallback.timers[id].stopObserving(); + } +}); diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js new file mode 100755 index 00000000..87b48bf3 --- /dev/null +++ b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js @@ -0,0 +1,79 @@ +/** + * TActiveDatePicker control + */ +Prado.WebUI.TActiveDatePicker = Class.extend(Prado.WebUI.TDatePicker, +{ + initialize : function(options) + { + this.options = options || []; + this.control = $(options.ID); + this.dateSlot = new Array(42); + this.weekSlot = new Array(6); + this.minimalDaysInFirstWeek = 4; + this.selectedDate = this.newDate(); + this.positionMode = 'Bottom'; + + //which element to trigger to show the calendar + if(this.options.Trigger) + { + this.trigger = $(this.options.Trigger) ; + var triggerEvent = this.options.TriggerEvent || "click"; + } + else + { + this.trigger = this.control; + var triggerEvent = this.options.TriggerEvent || "focus"; + } + + // Popup position + if(this.options.PositionMode == 'Top') + { + this.positionMode = this.options.PositionMode; + } + + Object.extend(this,options); + + Event.observe(this.trigger, triggerEvent, this.show.bindEvent(this)); + + // Listen to change event + if(this.options.InputMode == "TextBox") + { + Event.observe(this.control, "change", this.onDateChanged.bindEvent(this)); + } + else + { + var day = Prado.WebUI.TDatePicker.getDayListControl(this.control); + var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control); + var year = Prado.WebUI.TDatePicker.getYearListControl(this.control); + Event.observe (day, "change", this.onDateChanged.bindEvent(this)); + Event.observe (month, "change", this.onDateChanged.bindEvent(this)); + Event.observe (year, "change", this.onDateChanged.bindEvent(this)); + + } + + }, + + // Respond to change event on the textbox or dropdown list + // This method raises OnDateChanged event on client side if it has been defined, + // and raise the callback request + onDateChanged : function () + { + var date; + if (this.options.InputMode == "TextBox") + { + date=this.control.value; + } + else + { + var day = Prado.WebUI.TDatePicker.getDayListControl(this.control).selectedIndex+1; + var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control).selectedIndex; + var year = Prado.WebUI.TDatePicker.getYearListControl(this.control).value; + date=new Date(year, month, day, 0,0,0).SimpleFormat(this.Format, this); + } + if (typeof(this.options.OnDateChanged) == "function") this.options.OnDateChanged(this, date); + + // Make callback request + var request = new Prado.CallbackRequest(this.options.EventTarget,this.options); + request.dispatch(); + } +}); diff --git a/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js new file mode 100755 index 00000000..0b42afd5 --- /dev/null +++ b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js @@ -0,0 +1,24 @@ +/** + * DropContainer control + */ + +Prado.WebUI.DropContainer = Class.extend(Prado.WebUI.CallbackControl); + +Object.extend(Prado.WebUI.DropContainer.prototype, +{ + initialize: function(options) + { + this.options = options; + Object.extend (this.options, + { + onDrop: this.onDrop.bind(this) + }); + + Droppables.add (options.ID, this.options); + }, + + onDrop: function(dragElement, dropElement) + { + Prado.Callback(this.options.EventTarget, dragElement.id, null, this.options); + } +}); diff --git a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js index 87b8ddde..51e3f489 100644 --- a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js @@ -188,7 +188,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( if(this.options.AutoHide) this.showLabel(); } - else if (Event.keyCode(e) == Event.KEY_RETURN) + else if (Event.keyCode(e) == Event.KEY_RETURN && this.options.TextMode != 'MultiLine') Event.stop(e); }, 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 @@ + \ 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 Binary files /dev/null and b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.png 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 Binary files /dev/null and b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.png 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 Binary files /dev/null and b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gif 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 diff --git a/framework/Web/Javascripts/source/prado/activeratings/blocks.css b/framework/Web/Javascripts/source/prado/activeratings/blocks.css deleted file mode 100644 index bb846094..00000000 --- a/framework/Web/Javascripts/source/prado/activeratings/blocks.css +++ /dev/null @@ -1,42 +0,0 @@ -.TActiveRatingList_blocks -{ - border-collapse: collapse; -} -.TActiveRatingList_blocks input, .TActiveRatingList_blocks label -{ - display: none; -} - -.TActiveRatingList_blocks td -{ - width: 18px; - height: 9px; - padding: 1px; -} - -.TActiveRatingList_blocks td.rating -{ - background-image: url(blocks_combined.gif); - background-repeat: no-repeat; - cursor: pointer; - background-position: 1px 0px; -} -.TActiveRatingList_blocks td.rating_selected -{ - background-position: 1px -100px; -} - -.TActiveRatingList_blocks td.rating_half -{ - background-position: 1px -200px; -} - -.TActiveRatingList_blocks td.rating_hover -{ - background-position: 1px -300px; -} - -.TActiveRatingList_blocks td.rating_disabled -{ - cursor: default !important; -} diff --git a/framework/Web/Javascripts/source/prado/activeratings/default.css b/framework/Web/Javascripts/source/prado/activeratings/default.css deleted file mode 100644 index ba90eb27..00000000 --- a/framework/Web/Javascripts/source/prado/activeratings/default.css +++ /dev/null @@ -1,43 +0,0 @@ -.TActiveRatingList_default -{ - border-collapse: collapse; -} -.TActiveRatingList_default input, .TActiveRatingList_default label -{ - display: none; -} - -.TActiveRatingList_default td -{ - width: 18px; - height: 18px; - padding: 0; -} - -.TActiveRatingList_default td.rating -{ - background-image: url(default_combined.gif); - background-repeat: no-repeat; - cursor: pointer; - background-position: 0px 0px; -} - -.TActiveRatingList_default td.rating_selected -{ - background-position: 0px -100px; -} - -.TActiveRatingList_default td.rating_half -{ - background-position: 0px -200px; -} - -.TActiveRatingList_default td.rating_hover -{ - background-position: 0px -300px; -} - -.TActiveRatingList_default td.rating_disabled -{ - cursor: default !important; -} \ No newline at end of file diff --git a/framework/Web/Javascripts/source/prado/activeratings/ratings.js b/framework/Web/Javascripts/source/prado/activeratings/ratings.js deleted file mode 100644 index 4eeddbd8..00000000 --- a/framework/Web/Javascripts/source/prado/activeratings/ratings.js +++ /dev/null @@ -1,178 +0,0 @@ -Prado.WebUI.TActiveRatingList = Base.extend( -{ - selectedIndex : -1, - rating: -1, - enabled : true, - readOnly : false, - - constructor : function(options) - { - var cap = $(options.CaptionID); - this.options = Object.extend( - { - caption : cap ? cap.innerHTML : '' - }, options || {}); - - Prado.WebUI.TActiveRatingList.register(this); - this._init(); - this.selectedIndex = options.SelectedIndex; - this.rating = options.Rating; - if(options.Rating <= 0 && options.SelectedIndex >= 0) - this.rating = options.SelectedIndex+1; - this.showRating(this.rating); - }, - - _init: function(options) - { - Element.addClassName($(this.options.ListID),this.options.Style); - this.radios = new Array(); - var index=0; - for(var i = 0; i halfMax ? base+1 : base; - for(var i = 0; i halfMax ? base+1 : base; - var hasHalf = remainder >= halfMin && remainder <= halfMax; - for(var i = 0; i index ? 'removeClassName' : 'addClassName'; - Element[action](node, "rating_selected"); - if(i==index+1 && hasHalf) - Element.addClassName(node, "rating_half"); - else - Element.removeClassName(node, "rating_half"); - Element.removeClassName(node,"rating_hover"); - } - }, - - getIndexCaption : function(index) - { - return index > -1 ? this.radios[index].value : this.options.caption; - }, - - showCaption : function(value) - { - var caption = $(this.options.CaptionID); - if(caption) caption.innerHTML = value; - $(this.options.ListID).title = value; - }, - - setCaption : function(value) - { - this.options.caption = value; - this.showCaption(value); - }, - - setEnabled : function(value) - { - this.enabled = value; - for(var i = 0; i