diff options
Diffstat (limited to 'framework/Web/Javascripts/ratings')
21 files changed, 20 insertions, 35 deletions
diff --git a/framework/Web/Javascripts/ratings/blocks.css b/framework/Web/Javascripts/ratings/blocks.css index 63cb7c2b..5d13a859 100644 --- a/framework/Web/Javascripts/ratings/blocks.css +++ b/framework/Web/Javascripts/ratings/blocks.css @@ -16,7 +16,7 @@ .TRatingList_blocks td.rating
{
- background-image: url(blocks_combined.png);
+ background-image: url(blocks_combined.gif);
background-repeat: no-repeat;
cursor: pointer;
background-position: 1px 0px;
@@ -26,15 +26,6 @@ background-position: 1px -100px;
}
-.TRatingList_blocks td.rating_hover
-{
- background-position: 1px -200px;
-}
-.TRatingList_blocks td.rating_half
-{
- background-position: 1px -300px;
-}
-
.TRatingList_blocks td.rating_disabled
{
cursor: default !important;
diff --git a/framework/Web/Javascripts/ratings/blocks.png b/framework/Web/Javascripts/ratings/blocks.png Binary files differindex 923cda09..0da75b19 100644 --- a/framework/Web/Javascripts/ratings/blocks.png +++ b/framework/Web/Javascripts/ratings/blocks.png diff --git a/framework/Web/Javascripts/ratings/blocks_blank.gif b/framework/Web/Javascripts/ratings/blocks_blank.gif Binary files differnew file mode 100644 index 00000000..c0db17c2 --- /dev/null +++ b/framework/Web/Javascripts/ratings/blocks_blank.gif diff --git a/framework/Web/Javascripts/ratings/blocks_blank.png b/framework/Web/Javascripts/ratings/blocks_blank.png Binary files differdeleted file mode 100644 index d5004d2d..00000000 --- a/framework/Web/Javascripts/ratings/blocks_blank.png +++ /dev/null diff --git a/framework/Web/Javascripts/ratings/blocks_combined.gif b/framework/Web/Javascripts/ratings/blocks_combined.gif Binary files differnew file mode 100644 index 00000000..04e8f7b8 --- /dev/null +++ b/framework/Web/Javascripts/ratings/blocks_combined.gif diff --git a/framework/Web/Javascripts/ratings/blocks_combined.png b/framework/Web/Javascripts/ratings/blocks_combined.png Binary files differdeleted file mode 100644 index 57c07672..00000000 --- a/framework/Web/Javascripts/ratings/blocks_combined.png +++ /dev/null diff --git a/framework/Web/Javascripts/ratings/blocks_half.gif b/framework/Web/Javascripts/ratings/blocks_half.gif Binary files differnew file mode 100644 index 00000000..a9e23d7c --- /dev/null +++ b/framework/Web/Javascripts/ratings/blocks_half.gif diff --git a/framework/Web/Javascripts/ratings/blocks_half.png b/framework/Web/Javascripts/ratings/blocks_half.png Binary files differdeleted file mode 100644 index 344aa207..00000000 --- a/framework/Web/Javascripts/ratings/blocks_half.png +++ /dev/null diff --git a/framework/Web/Javascripts/ratings/blocks_selected.gif b/framework/Web/Javascripts/ratings/blocks_selected.gif Binary files differnew file mode 100644 index 00000000..f743d27e --- /dev/null +++ b/framework/Web/Javascripts/ratings/blocks_selected.gif diff --git a/framework/Web/Javascripts/ratings/blocks_selected.png b/framework/Web/Javascripts/ratings/blocks_selected.png Binary files differdeleted file mode 100644 index dfdb6889..00000000 --- a/framework/Web/Javascripts/ratings/blocks_selected.png +++ /dev/null diff --git a/framework/Web/Javascripts/ratings/default.css b/framework/Web/Javascripts/ratings/default.css index cf8f7558..aa7913bf 100644 --- a/framework/Web/Javascripts/ratings/default.css +++ b/framework/Web/Javascripts/ratings/default.css @@ -16,25 +16,17 @@ .TRatingList_default td.rating
{
- background-image: url(default_combined.png);
+ background-image: url(default_combined.gif);
background-repeat: no-repeat;
cursor: pointer;
background-position: 0px 0px;
}
+
.TRatingList_default td.rating_selected
{
background-position: 0px -100px;
}
-.TRatingList_default td.rating_hover
-{
- background-position: 0px -200px;
-}
-.TRatingList_default td.rating_half
-{
- background-position: 0px -300px;
-}
-
.TRatingList_default td.rating_disabled
{
cursor: default !important;
diff --git a/framework/Web/Javascripts/ratings/default.png b/framework/Web/Javascripts/ratings/default.png Binary files differindex f9f380a9..17bc39a1 100644 --- a/framework/Web/Javascripts/ratings/default.png +++ b/framework/Web/Javascripts/ratings/default.png diff --git a/framework/Web/Javascripts/ratings/default_blank.gif b/framework/Web/Javascripts/ratings/default_blank.gif Binary files differnew file mode 100644 index 00000000..0337ad16 --- /dev/null +++ b/framework/Web/Javascripts/ratings/default_blank.gif diff --git a/framework/Web/Javascripts/ratings/default_blank.png b/framework/Web/Javascripts/ratings/default_blank.png Binary files differdeleted file mode 100644 index f857ff17..00000000 --- a/framework/Web/Javascripts/ratings/default_blank.png +++ /dev/null diff --git a/framework/Web/Javascripts/ratings/default_combined.gif b/framework/Web/Javascripts/ratings/default_combined.gif Binary files differnew file mode 100644 index 00000000..fe02b446 --- /dev/null +++ b/framework/Web/Javascripts/ratings/default_combined.gif diff --git a/framework/Web/Javascripts/ratings/default_combined.png b/framework/Web/Javascripts/ratings/default_combined.png Binary files differdeleted file mode 100644 index 1756f912..00000000 --- a/framework/Web/Javascripts/ratings/default_combined.png +++ /dev/null diff --git a/framework/Web/Javascripts/ratings/default_half.gif b/framework/Web/Javascripts/ratings/default_half.gif Binary files differnew file mode 100644 index 00000000..ed214acd --- /dev/null +++ b/framework/Web/Javascripts/ratings/default_half.gif diff --git a/framework/Web/Javascripts/ratings/default_half.png b/framework/Web/Javascripts/ratings/default_half.png Binary files differdeleted file mode 100644 index 6c826054..00000000 --- a/framework/Web/Javascripts/ratings/default_half.png +++ /dev/null diff --git a/framework/Web/Javascripts/ratings/default_selected.gif b/framework/Web/Javascripts/ratings/default_selected.gif Binary files differnew file mode 100644 index 00000000..98704fad --- /dev/null +++ b/framework/Web/Javascripts/ratings/default_selected.gif diff --git a/framework/Web/Javascripts/ratings/default_selected.png b/framework/Web/Javascripts/ratings/default_selected.png Binary files differdeleted file mode 100644 index e40d6b04..00000000 --- a/framework/Web/Javascripts/ratings/default_selected.png +++ /dev/null diff --git a/framework/Web/Javascripts/ratings/ratings.js b/framework/Web/Javascripts/ratings/ratings.js index 04ebd31d..9299d8d8 100644 --- a/framework/Web/Javascripts/ratings/ratings.js +++ b/framework/Web/Javascripts/ratings/ratings.js @@ -2,6 +2,7 @@ Prado.WebUI.TRatingList = Base.extend( {
selectedIndex : -1,
enabled : true,
+ readOnly : false,
constructor : function(options)
{
@@ -20,20 +21,20 @@ Prado.WebUI.TRatingList = Base.extend( _init: function(options)
{
Element.addClassName($(this.options.ListID),this.options.Style);
- var radios = document.getElementsByName(this.options.ListName);
this.radios = new Array();
var index=0;
- for(var i = 0; i<radios.length; i++)
+ for(var i = 0; i<this.options.ItemCount; i++)
{
- var node = radios[i].parentNode;
- if(node.tagName.toLowerCase()=='td')
+ var radio = $(this.options.ListID+'_c'+i);
+ var td = radio.parentNode;
+ if(radio && td.tagName.toLowerCase()=='td')
{
- this.radios.push(radios[i]);
- Event.observe(node, "mouseover", this.hover.bindEvent(this,index));
- Event.observe(node, "mouseout", this.recover.bindEvent(this,index));
- Event.observe(node, "click", this.click.bindEvent(this, index));
+ this.radios.push(radio);
+ Event.observe(td, "mouseover", this.hover.bindEvent(this,index));
+ Event.observe(td, "mouseout", this.recover.bindEvent(this,index));
+ Event.observe(td, "click", this.click.bindEvent(this, index));
index++;
- Element.addClassName(node,"rating");
+ Element.addClassName(td,"rating");
}
}
},
@@ -44,7 +45,7 @@ Prado.WebUI.TRatingList = Base.extend( for(var i = 0; i<this.radios.length; i++)
{
var action = i <= index ? 'addClassName' : 'removeClassName'
- Element[action](this.radios[i].parentNode,"rating_hover");
+ Element[action](this.radios[i].parentNode,"rating_selected");
}
this.setCaption(index);
},
@@ -53,7 +54,7 @@ Prado.WebUI.TRatingList = Base.extend( {
if(this.enabled==false) return;
for(var i = 0; i<=index; i++)
- Element.removeClassName(this.radios[i].parentNode, "rating_hover");
+ Element.removeClassName(this.radios[i].parentNode, "rating_selected");
this.setRating(this.selectedIndex);
},
@@ -67,7 +68,7 @@ Prado.WebUI.TRatingList = Base.extend( var requestOptions = Object.extend(
{
ID : this.options.ListID+"_c"+index,
- EventTarget : this.options.ListName+"$c"+index
+ EventTarget : this.options.ListID+"$c"+index
},this.options);
var request = new Prado.CallbackRequest(requestOptions.EventTarget, requestOptions);
if(request.dispatch()==false)
@@ -76,9 +77,11 @@ Prado.WebUI.TRatingList = Base.extend( setRating: function(index)
{
+
for(var i = 0; i<this.radios.length; i++)
{
- var action = i <= index ? 'addClassName' : 'removeClassName'
+ var node = this.radios[i].parentNode;
+ var action = i > index ? 'removeClassName' : 'addClassName'
Element[action](this.radios[i].parentNode, "rating_selected");
}
this.setCaption(index);
@@ -89,7 +92,7 @@ Prado.WebUI.TRatingList = Base.extend( var value = index > -1 ? this.radios[index].value : this.options.caption;
var caption = $(this.options.CaptionID);
if(caption) caption.innerHTML = value;
- $(this.options.ListName).title = value;
+ $(this.options.ListID).title = value;
},
setEnabled : function(value)
@@ -99,7 +102,6 @@ Prado.WebUI.TRatingList = Base.extend( {
var action = value ? 'removeClassName' : 'addClassName'
Element[action](this.radios[i].parentNode, "rating_disabled");
- Element.removeClassName(this.radios[i].parentNode, "rating_hover");
}
}
},
|