summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/ratings
diff options
context:
space:
mode:
authorxue <>2007-03-27 00:47:38 +0000
committerxue <>2007-03-27 00:47:38 +0000
commitc5d0cd2824e3c3bb2f6f3834177a71c1d7b78519 (patch)
tree3f8b2ced94b30277c62b4d8d31f09e7eda09f1ea /framework/Web/Javascripts/ratings
parentfb29e39241b47fee99a17fab73447b9e23eabd83 (diff)
merge from 3.0 branch till 1779.
Diffstat (limited to 'framework/Web/Javascripts/ratings')
-rw-r--r--framework/Web/Javascripts/ratings/blocks.css42
-rw-r--r--framework/Web/Javascripts/ratings/blocks.pngbin28700 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_blank.gifbin72 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_combined.gifbin289 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_half.gifbin94 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/blocks_selected.gifbin75 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default.css43
-rw-r--r--framework/Web/Javascripts/ratings/default.pngbin51492 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_blank.gifbin158 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_combined.gifbin1201 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_half.gifbin610 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/default_selected.gifbin603 -> 0 bytes
-rw-r--r--framework/Web/Javascripts/ratings/ratings.js178
13 files changed, 0 insertions, 263 deletions
diff --git a/framework/Web/Javascripts/ratings/blocks.css b/framework/Web/Javascripts/ratings/blocks.css
deleted file mode 100644
index b05d9eb6..00000000
--- a/framework/Web/Javascripts/ratings/blocks.css
+++ /dev/null
@@ -1,42 +0,0 @@
-.TRatingList_blocks
-{
- border-collapse: collapse;
-}
-.TRatingList_blocks input, .TRatingList_blocks label
-{
- display: none;
-}
-
-.TRatingList_blocks td
-{
- width: 18px;
- height: 9px;
- padding: 1px;
-}
-
-.TRatingList_blocks td.rating
-{
- background-image: url(blocks_combined.gif);
- background-repeat: no-repeat;
- cursor: pointer;
- background-position: 1px 0px;
-}
-.TRatingList_blocks td.rating_selected
-{
- background-position: 1px -100px;
-}
-
-.TRatingList_blocks td.rating_half
-{
- background-position: 1px -200px;
-}
-
-.TRatingList_blocks td.rating_hover
-{
- 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
deleted file mode 100644
index 93a5333e..00000000
--- a/framework/Web/Javascripts/ratings/blocks.png
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_blank.gif b/framework/Web/Javascripts/ratings/blocks_blank.gif
deleted file mode 100644
index c0db17c2..00000000
--- a/framework/Web/Javascripts/ratings/blocks_blank.gif
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_combined.gif b/framework/Web/Javascripts/ratings/blocks_combined.gif
deleted file mode 100644
index dfe9da8d..00000000
--- a/framework/Web/Javascripts/ratings/blocks_combined.gif
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_half.gif b/framework/Web/Javascripts/ratings/blocks_half.gif
deleted file mode 100644
index a9e23d7c..00000000
--- a/framework/Web/Javascripts/ratings/blocks_half.gif
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/blocks_selected.gif b/framework/Web/Javascripts/ratings/blocks_selected.gif
deleted file mode 100644
index f743d27e..00000000
--- a/framework/Web/Javascripts/ratings/blocks_selected.gif
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default.css b/framework/Web/Javascripts/ratings/default.css
deleted file mode 100644
index d404f843..00000000
--- a/framework/Web/Javascripts/ratings/default.css
+++ /dev/null
@@ -1,43 +0,0 @@
-.TRatingList_default
-{
- border-collapse: collapse;
-}
-.TRatingList_default input, .TRatingList_default label
-{
- display: none;
-}
-
-.TRatingList_default td
-{
- width: 18px;
- height: 18px;
- padding: 0;
-}
-
-.TRatingList_default td.rating
-{
- 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_half
-{
- background-position: 0px -200px;
-}
-
-.TRatingList_default td.rating_hover
-{
- background-position: 0px -300px;
-}
-
-.TRatingList_default td.rating_disabled
-{
- cursor: default !important;
-} \ No newline at end of file
diff --git a/framework/Web/Javascripts/ratings/default.png b/framework/Web/Javascripts/ratings/default.png
deleted file mode 100644
index a3148ff4..00000000
--- a/framework/Web/Javascripts/ratings/default.png
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_blank.gif b/framework/Web/Javascripts/ratings/default_blank.gif
deleted file mode 100644
index 0337ad16..00000000
--- a/framework/Web/Javascripts/ratings/default_blank.gif
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_combined.gif b/framework/Web/Javascripts/ratings/default_combined.gif
deleted file mode 100644
index ddab2e8b..00000000
--- a/framework/Web/Javascripts/ratings/default_combined.gif
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_half.gif b/framework/Web/Javascripts/ratings/default_half.gif
deleted file mode 100644
index ed214acd..00000000
--- a/framework/Web/Javascripts/ratings/default_half.gif
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/default_selected.gif b/framework/Web/Javascripts/ratings/default_selected.gif
deleted file mode 100644
index 98704fad..00000000
--- a/framework/Web/Javascripts/ratings/default_selected.gif
+++ /dev/null
Binary files differ
diff --git a/framework/Web/Javascripts/ratings/ratings.js b/framework/Web/Javascripts/ratings/ratings.js
deleted file mode 100644
index c8b19511..00000000
--- a/framework/Web/Javascripts/ratings/ratings.js
+++ /dev/null
@@ -1,178 +0,0 @@
-Prado.WebUI.TRatingList = 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.TRatingList.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<this.options.ItemCount; i++)
- {
- var radio = $(this.options.ListID+'_c'+i);
- var td = radio.parentNode;
- if(radio && td.tagName.toLowerCase()=='td')
- {
- 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(td,"rating");
- }
- }
- },
-
- hover : function(ev,index)
- {
- if(this.enabled==false) return;
- for(var i = 0; i<this.radios.length; i++)
- {
- var node = this.radios[i].parentNode;
- var action = i <= index ? 'addClassName' : 'removeClassName'
- Element[action](node,"rating_hover");
- Element.removeClassName(node,"rating_selected");
- Element.removeClassName(node,"rating_half");
- }
- this.showCaption(this.getIndexCaption(index));
- },
-
- recover : function(ev,index)
- {
- if(this.enabled==false) return;
- this.showRating(this.rating);
- this.showCaption(this.options.caption);
- },
-
- click : function(ev, index)
- {
- if(this.enabled==false) return;
- for(var i = 0; i<this.radios.length; i++)
- this.radios[i].checked = (i == index);
-
- this.selectedIndex = index;
- this.setRating(index+1);
-
- this.dispatchRequest(ev);
- },
-
- dispatchRequest : function(ev)
- {
- var requestOptions = Object.extend(
- {
- ID : this.options.ListID+"_c"+this.selectedIndex,
- EventTarget : this.options.ListName+"$c"+this.selectedIndex
- },this.options);
- var request = new Prado.CallbackRequest(requestOptions.EventTarget, requestOptions);
- if(request.dispatch()==false)
- Event.stop(ev);
- },
-
- setRating : function(value)
- {
- this.rating = value;
- var base = Math.floor(value-1);
- var remainder = value - base-1;
- var halfMax = this.options.HalfRating["1"];
- var index = remainder > halfMax ? base+1 : base;
- for(var i = 0; i<this.radios.length; i++)
- this.radios[i].checked = (i == index);
-
- var caption = this.getIndexCaption(index);
- this.setCaption(caption);
- this.showCaption(caption);
-
- this.showRating(value);
- },
-
- showRating: function(value)
- {
- var base = Math.floor(value-1);
- var remainder = value - base-1;
- var halfMin = this.options.HalfRating["0"];
- var halfMax = this.options.HalfRating["1"];
- var index = remainder > halfMax ? base+1 : base;
- var hasHalf = remainder >= halfMin && remainder <= halfMax;
- for(var i = 0; i<this.radios.length; i++)
- {
- var node = this.radios[i].parentNode;
- var action = 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<this.radios.length; i++)
- {
- var action = value ? 'removeClassName' : 'addClassName'
- Element[action](this.radios[i].parentNode, "rating_disabled");
- }
- }
-},
-{
-ratings : {},
-register : function(rating)
-{
- Prado.WebUI.TRatingList.ratings[rating.options.ListID] = rating;
-},
-
-setEnabled : function(id,value)
-{
- Prado.WebUI.TRatingList.ratings[id].setEnabled(value);
-},
-
-setRating : function(id,value)
-{
- Prado.WebUI.TRatingList.ratings[id].setRating(value);
-},
-
-setCaption : function(id,value)
-{
- Prado.WebUI.TRatingList.ratings[id].setCaption(value);
-}
-}); \ No newline at end of file