From 3fb25eec92c0c72760c4bf8040efd4b86c446bc6 Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 30 Mar 2007 00:38:41 +0000 Subject: Fixed #579 --- framework/Web/Javascripts/js/debug/ajax.js | 179 ++++++++++++++++++++++++++++ framework/Web/Javascripts/js/debug/prado.js | 61 ++++++++++ 2 files changed, 240 insertions(+) (limited to 'framework/Web/Javascripts/js/debug') diff --git a/framework/Web/Javascripts/js/debug/ajax.js b/framework/Web/Javascripts/js/debug/ajax.js index 60956194..6ae0ab40 100644 --- a/framework/Web/Javascripts/js/debug/ajax.js +++ b/framework/Web/Javascripts/js/debug/ajax.js @@ -2472,3 +2472,182 @@ Prado.WebUI.TInPlaceTextBox = Base.extend( } }); +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 -1 ? + this.radios[index].value : this.options.caption; + } +} + -- cgit v1.2.3