summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/ratings
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/ratings')
-rw-r--r--framework/Web/Javascripts/ratings/blocks.css11
-rw-r--r--framework/Web/Javascripts/ratings/blocks.pngbin28159 -> 27953 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_blank.gifbin0 -> 72 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_blank.pngbin227 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_combined.gifbin0 -> 237 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_combined.pngbin453 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_half.gifbin0 -> 94 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_half.pngbin247 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_selected.gifbin0 -> 75 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_selected.pngbin245 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default.css12
-rw-r--r--framework/Web/Javascripts/ratings/default.pngbin64293 -> 52075 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_blank.gifbin0 -> 158 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_blank.pngbin841 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_combined.gifbin0 -> 1001 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_combined.pngbin2672 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_half.gifbin0 -> 610 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_half.pngbin857 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_selected.gifbin0 -> 603 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_selected.pngbin831 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/ratings.js32
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
index 923cda09..0da75b19 100644
--- a/framework/Web/Javascripts/ratings/blocks.png
+++ b/framework/Web/Javascripts/ratings/blocks.png
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_blank.gif b/framework/Web/Javascripts/ratings/blocks_blank.gif
new file mode 100644
index 00000000..c0db17c2
--- /dev/null
+++ b/framework/Web/Javascripts/ratings/blocks_blank.gif
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_blank.png b/framework/Web/Javascripts/ratings/blocks_blank.png
deleted file mode 100644
index d5004d2d..00000000
--- a/framework/Web/Javascripts/ratings/blocks_blank.png
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_combined.gif b/framework/Web/Javascripts/ratings/blocks_combined.gif
new file mode 100644
index 00000000..04e8f7b8
--- /dev/null
+++ b/framework/Web/Javascripts/ratings/blocks_combined.gif
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_combined.png b/framework/Web/Javascripts/ratings/blocks_combined.png
deleted file mode 100644
index 57c07672..00000000
--- a/framework/Web/Javascripts/ratings/blocks_combined.png
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_half.gif b/framework/Web/Javascripts/ratings/blocks_half.gif
new file mode 100644
index 00000000..a9e23d7c
--- /dev/null
+++ b/framework/Web/Javascripts/ratings/blocks_half.gif
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_half.png b/framework/Web/Javascripts/ratings/blocks_half.png
deleted file mode 100644
index 344aa207..00000000
--- a/framework/Web/Javascripts/ratings/blocks_half.png
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_selected.gif b/framework/Web/Javascripts/ratings/blocks_selected.gif
new file mode 100644
index 00000000..f743d27e
--- /dev/null
+++ b/framework/Web/Javascripts/ratings/blocks_selected.gif
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_selected.png b/framework/Web/Javascripts/ratings/blocks_selected.png
deleted file mode 100644
index dfdb6889..00000000
--- a/framework/Web/Javascripts/ratings/blocks_selected.png
+++ /dev/null
Binary files differ
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
index f9f380a9..17bc39a1 100644
--- a/framework/Web/Javascripts/ratings/default.png
+++ b/framework/Web/Javascripts/ratings/default.png
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_blank.gif b/framework/Web/Javascripts/ratings/default_blank.gif
new file mode 100644
index 00000000..0337ad16
--- /dev/null
+++ b/framework/Web/Javascripts/ratings/default_blank.gif
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_blank.png b/framework/Web/Javascripts/ratings/default_blank.png
deleted file mode 100644
index f857ff17..00000000
--- a/framework/Web/Javascripts/ratings/default_blank.png
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_combined.gif b/framework/Web/Javascripts/ratings/default_combined.gif
new file mode 100644
index 00000000..fe02b446
--- /dev/null
+++ b/framework/Web/Javascripts/ratings/default_combined.gif
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_combined.png b/framework/Web/Javascripts/ratings/default_combined.png
deleted file mode 100644
index 1756f912..00000000
--- a/framework/Web/Javascripts/ratings/default_combined.png
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_half.gif b/framework/Web/Javascripts/ratings/default_half.gif
new file mode 100644
index 00000000..ed214acd
--- /dev/null
+++ b/framework/Web/Javascripts/ratings/default_half.gif
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_half.png b/framework/Web/Javascripts/ratings/default_half.png
deleted file mode 100644
index 6c826054..00000000
--- a/framework/Web/Javascripts/ratings/default_half.png
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_selected.gif b/framework/Web/Javascripts/ratings/default_selected.gif
new file mode 100644
index 00000000..98704fad
--- /dev/null
+++ b/framework/Web/Javascripts/ratings/default_selected.gif
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_selected.png b/framework/Web/Javascripts/ratings/default_selected.png
deleted file mode 100644
index e40d6b04..00000000
--- a/framework/Web/Javascripts/ratings/default_selected.png
+++ /dev/null
Binary files differ
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");
}
}
},