From 1ebbcf85205f983531ef3b43dce4a98114714f0b Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 30 Mar 2007 00:27:34 +0000 Subject: Fixed #579, reverted the rating list js. --- framework/Web/Javascripts/js/compressed/prado.js | 15 +++++- framework/Web/Javascripts/js/debug/prado.js | 61 ++++++++++++++++++++++ framework/Web/Javascripts/prado/ratings/ratings.js | 24 ++++----- framework/Web/UI/WebControls/TRatingList.php | 10 ++-- 4 files changed, 92 insertions(+), 18 deletions(-) (limited to 'framework') diff --git a/framework/Web/Javascripts/js/compressed/prado.js b/framework/Web/Javascripts/js/compressed/prado.js index 083ddc56..5318d3aa 100644 --- a/framework/Web/Javascripts/js/compressed/prado.js +++ b/framework/Web/Javascripts/js/compressed/prado.js @@ -401,4 +401,17 @@ window.clipboardData.setData("Text",text);},hover:function(obj) {for(var i=0;i-1?this.radios[index].value:this.options.caption;}} \ No newline at end of file diff --git a/framework/Web/Javascripts/js/debug/prado.js b/framework/Web/Javascripts/js/debug/prado.js index e5e87616..12aa5ce5 100644 --- a/framework/Web/Javascripts/js/debug/prado.js +++ b/framework/Web/Javascripts/js/debug/prado.js @@ -3807,3 +3807,64 @@ Prado.WebUI.TRadioButtonList = Base.extend( } }); +Prado.WebUI.TRatingList = Class.create(); +Prado.WebUI.TRatingList.prototype = +{ + selectedIndex : -1, + + initialize : function(options) + { + this.options = options; + this.element = $(options['ID']); + Element.addClassName(this.element,options.cssClass); + this.radios = document.getElementsByName(options.field); + for(var i = 0; i -1 ? + this.radios[index].value : this.options.caption; + } +} + diff --git a/framework/Web/Javascripts/prado/ratings/ratings.js b/framework/Web/Javascripts/prado/ratings/ratings.js index e6fd97ba..cc9831e9 100644 --- a/framework/Web/Javascripts/prado/ratings/ratings.js +++ b/framework/Web/Javascripts/prado/ratings/ratings.js @@ -1,5 +1,5 @@ -Prado.WebUI.TRatingList = Class.create(); -Prado.WebUI.TRatingList.prototype = +Prado.WebUI.TRatingList = Class.create(); +Prado.WebUI.TRatingList.prototype = { selectedIndex : -1, @@ -14,47 +14,47 @@ Prado.WebUI.TRatingList.prototype = Event.observe(this.radios[i].parentNode, "mouseover", this.hover.bindEvent(this,i)); Event.observe(this.radios[i].parentNode, "mouseout", this.recover.bindEvent(this,i)); Event.observe(this.radios[i].parentNode, "click", this.click.bindEvent(this, i)); - } + } this.caption = CAPTION(); this.element.appendChild(this.caption); this.selectedIndex = options.selectedIndex; this.setRating(this.selectedIndex); }, - + hover : function(ev,index) { for(var i = 0; i -1 ? - this.radios[index].value : this.options.caption; + this.caption.innerHTML = index > -1 ? + this.radios[index].value : this.options.caption; } } \ No newline at end of file diff --git a/framework/Web/UI/WebControls/TRatingList.php b/framework/Web/UI/WebControls/TRatingList.php index d603a442..38e264b9 100644 --- a/framework/Web/UI/WebControls/TRatingList.php +++ b/framework/Web/UI/WebControls/TRatingList.php @@ -118,7 +118,7 @@ class TRatingList extends TRadioButtonList protected function publishRatingListStyle($style) { $cs = $this->getPage()->getClientScript(); - $stylesheet = 'System.Web.Javascripts.ratings.'.$style; + $stylesheet = 'System.Web.Javascripts.prado.ratings.'.$style; if(($cssFile=Prado::getPathOfNamespace($stylesheet,'.css'))===null) throw new TConfigurationException('ratinglist_stylesheet_not_found',$style); $url = $this->publishFilePath($cssFile); @@ -129,10 +129,10 @@ class TRatingList extends TRadioButtonList protected function publishRatingListImages($style, $fileExt='.gif') { - $images['blank'] = "System.Web.Javascripts.ratings.{$style}_blank"; - $images['hover'] = "System.Web.Javascripts.ratings.{$style}_hover"; - $images['selected'] = "System.Web.Javascripts.ratings.{$style}_selected"; - $images['half'] = "System.Web.Javascripts.ratings.{$style}_half"; + $images['blank'] = "System.Web.Javascripts.prado.ratings.{$style}_blank"; + $images['hover'] = "System.Web.Javascripts.prado.ratings.{$style}_hover"; + $images['selected'] = "System.Web.Javascripts.prado.ratings.{$style}_selected"; + $images['half'] = "System.Web.Javascripts.prado.ratings.{$style}_half"; $files = array(); foreach($images as $type => $image) { -- cgit v1.2.3