From fe60cc221f922ea362826e2d00431c5df28fe85f Mon Sep 17 00:00:00 2001
From: wei <>
Date: Fri, 6 Oct 2006 03:46:05 +0000
Subject: fixed #410 #412
---
.gitattributes | 16 +--
.../pages/ActiveControls/ActiveButton.page | 9 +-
.../protected/pages/ActiveControls/Home.page | 2 +-
framework/TComponent.php | 4 +-
framework/Web/Javascripts/extra/logger.js | 17 ++-
framework/Web/Javascripts/js/compressed/ajax.js | 20 ++--
framework/Web/Javascripts/js/compressed/logger.js | 14 ++-
framework/Web/Javascripts/js/compressed/prado.js | 4 +-
framework/Web/Javascripts/js/debug/ajax.js | 32 +++---
framework/Web/Javascripts/js/debug/logger.js | 17 ++-
framework/Web/Javascripts/js/debug/prado.js | 4 +-
framework/Web/Javascripts/prado/controls.js | 4 +-
framework/Web/Javascripts/ratings/blocks.css | 11 +-
framework/Web/Javascripts/ratings/blocks.png | Bin 28159 -> 27953 bytes
framework/Web/Javascripts/ratings/blocks_blank.gif | Bin 0 -> 72 bytes
framework/Web/Javascripts/ratings/blocks_blank.png | Bin 227 -> 0 bytes
.../Web/Javascripts/ratings/blocks_combined.gif | Bin 0 -> 237 bytes
.../Web/Javascripts/ratings/blocks_combined.png | Bin 453 -> 0 bytes
framework/Web/Javascripts/ratings/blocks_half.gif | Bin 0 -> 94 bytes
framework/Web/Javascripts/ratings/blocks_half.png | Bin 247 -> 0 bytes
.../Web/Javascripts/ratings/blocks_selected.gif | Bin 0 -> 75 bytes
.../Web/Javascripts/ratings/blocks_selected.png | Bin 245 -> 0 bytes
framework/Web/Javascripts/ratings/default.css | 12 +-
framework/Web/Javascripts/ratings/default.png | Bin 64293 -> 52075 bytes
.../Web/Javascripts/ratings/default_blank.gif | Bin 0 -> 158 bytes
.../Web/Javascripts/ratings/default_blank.png | Bin 841 -> 0 bytes
.../Web/Javascripts/ratings/default_combined.gif | Bin 0 -> 1001 bytes
.../Web/Javascripts/ratings/default_combined.png | Bin 2672 -> 0 bytes
framework/Web/Javascripts/ratings/default_half.gif | Bin 0 -> 610 bytes
framework/Web/Javascripts/ratings/default_half.png | Bin 857 -> 0 bytes
.../Web/Javascripts/ratings/default_selected.gif | Bin 0 -> 603 bytes
.../Web/Javascripts/ratings/default_selected.png | Bin 831 -> 0 bytes
framework/Web/Javascripts/ratings/ratings.js | 32 +++---
framework/Web/UI/ActiveControls/TActiveButton.php | 8 ++
.../Web/UI/ActiveControls/TActiveCheckBox.php | 8 ++
.../Web/UI/ActiveControls/TActiveCheckBoxList.php | 8 ++
.../UI/ActiveControls/TActiveCustomValidator.php | 74 ++++++++++++
.../Web/UI/ActiveControls/TActiveDropDownList.php | 8 ++
.../Web/UI/ActiveControls/TActiveImageButton.php | 8 ++
.../Web/UI/ActiveControls/TActiveLinkButton.php | 8 ++
framework/Web/UI/ActiveControls/TActiveListBox.php | 8 ++
.../Web/UI/ActiveControls/TActiveRadioButton.php | 8 ++
.../UI/ActiveControls/TActiveRadioButtonList.php | 8 ++
.../Web/UI/ActiveControls/TActiveRatingList.php | 125 ++++++++++++++++++---
framework/Web/UI/ActiveControls/TActiveTextBox.php | 8 ++
framework/Web/UI/ActiveControls/TCallback.php | 8 ++
framework/Web/UI/WebControls/TBaseValidator.php | 12 --
framework/Web/UI/WebControls/TJavascriptLogger.php | 5 +-
.../protected/pages/ActiveCheckBoxTest.page | 12 +-
.../protected/pages/ActiveRadioButtonTest.page | 2 +-
.../protected/pages/AutoCompleteTest.page | 21 ++--
.../protected/pages/AutoCompleteTest.php | 2 +-
.../pages/CallbackCustomValidatorTest.page | 7 +-
.../protected/pages/CallbackOptionsTest.page | 16 +--
.../protected/pages/RatingList.page | 79 +++++++------
.../active-controls/protected/pages/RatingList.php | 7 +-
.../protected/pages/TInPlaceTextBoxTest.page | 6 +-
.../protected/pages/TimeTriggeredCallbackTest.page | 2 +-
.../active-controls/tests/AutoCompleteTestCase.php | 31 ++++-
59 files changed, 494 insertions(+), 193 deletions(-)
create mode 100644 framework/Web/Javascripts/ratings/blocks_blank.gif
delete mode 100644 framework/Web/Javascripts/ratings/blocks_blank.png
create mode 100644 framework/Web/Javascripts/ratings/blocks_combined.gif
delete mode 100644 framework/Web/Javascripts/ratings/blocks_combined.png
create mode 100644 framework/Web/Javascripts/ratings/blocks_half.gif
delete mode 100644 framework/Web/Javascripts/ratings/blocks_half.png
create mode 100644 framework/Web/Javascripts/ratings/blocks_selected.gif
delete mode 100644 framework/Web/Javascripts/ratings/blocks_selected.png
create mode 100644 framework/Web/Javascripts/ratings/default_blank.gif
delete mode 100644 framework/Web/Javascripts/ratings/default_blank.png
create mode 100644 framework/Web/Javascripts/ratings/default_combined.gif
delete mode 100644 framework/Web/Javascripts/ratings/default_combined.png
create mode 100644 framework/Web/Javascripts/ratings/default_half.gif
delete mode 100644 framework/Web/Javascripts/ratings/default_half.png
create mode 100644 framework/Web/Javascripts/ratings/default_selected.gif
delete mode 100644 framework/Web/Javascripts/ratings/default_selected.png
diff --git a/.gitattributes b/.gitattributes
index 5b131e88..072669b8 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1769,16 +1769,16 @@ framework/Web/Javascripts/prototype/selector.js -text
framework/Web/Javascripts/prototype/string.js -text
framework/Web/Javascripts/ratings/blocks.css -text
framework/Web/Javascripts/ratings/blocks.png -text
-framework/Web/Javascripts/ratings/blocks_blank.png -text
-framework/Web/Javascripts/ratings/blocks_combined.png -text
-framework/Web/Javascripts/ratings/blocks_half.png -text
-framework/Web/Javascripts/ratings/blocks_selected.png -text
+framework/Web/Javascripts/ratings/blocks_blank.gif -text
+framework/Web/Javascripts/ratings/blocks_combined.gif -text
+framework/Web/Javascripts/ratings/blocks_half.gif -text
+framework/Web/Javascripts/ratings/blocks_selected.gif -text
framework/Web/Javascripts/ratings/default.css -text
framework/Web/Javascripts/ratings/default.png -text
-framework/Web/Javascripts/ratings/default_blank.png -text
-framework/Web/Javascripts/ratings/default_combined.png -text
-framework/Web/Javascripts/ratings/default_half.png -text
-framework/Web/Javascripts/ratings/default_selected.png -text
+framework/Web/Javascripts/ratings/default_blank.gif -text
+framework/Web/Javascripts/ratings/default_combined.gif -text
+framework/Web/Javascripts/ratings/default_half.gif -text
+framework/Web/Javascripts/ratings/default_selected.gif -text
framework/Web/Javascripts/ratings/ratings.js -text
framework/Web/Javascripts/rico/colors.js -text
framework/Web/Javascripts/rico/extension.js -text
diff --git a/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page b/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page
index 7bbe05ea..adf50d22 100644
--- a/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page
+++ b/demos/quickstart/protected/pages/ActiveControls/ActiveButton.page
@@ -60,8 +60,7 @@ public function button_callback($sender, $param)
With in the ActiveControl property is an instance of
TCallbackClientSide available
-as a property ClientSide of ActiveControl or similarly
-as a sub-property ActiveControl.ClientSide of TActiveButton.
+as a property ClientSide of TActiveButton.
The ClientSide property contains sub-properties, such as RequestTimeOut,
and client-side javascript event handler, such as OnLoading,
that are used by the client-side when making a callback request.
@@ -77,7 +76,7 @@ when the client-side is making a callback request.
Text="Click Me"
OnCallback="button_callback"
ActiveControl.CallbackParameter="value" >
- <prop:ActiveControl.ClientSide
+ <prop:ClientSide
OnLoading="Element.show('callback_status')"
OnComplete="Element.hide('callback_status')" />
</com:TActiveButton>
@@ -85,9 +84,9 @@ when the client-side is making a callback request.
The example loads the "effects" javascript library using the
TClientScript component.
-The ActiveControl.ClientSide.OnLoading property value contains
+The ClientSide.OnLoading property value contains
javascript statement that uses the "effects" library to show the "Loading..."
-span tag. Similarly, ActiveControl.ClientSide.OnComplete property
+span tag. Similarly, ClientSide.OnComplete property
value contains the javascript statement that hides the "Loading..." span tag.
See TCallbackClientSide for
further details on client-side property details.
diff --git a/demos/quickstart/protected/pages/ActiveControls/Home.page b/demos/quickstart/protected/pages/ActiveControls/Home.page
index 38fee25d..bef855c9 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Home.page
@@ -5,7 +5,7 @@
for a quick overview of the concept behind active controls (AJAX enabled controls).
Most active controls have a property of
ActiveControl and
-a sub-property ActiveControl.ClientSide
+a sub-property ClientSide
that provides many properties to customize the controls. The
CallbackClient property of the
TPage class provides many methods to update and alter the client-side content
diff --git a/framework/TComponent.php b/framework/TComponent.php
index 95186800..54fe7ec7 100644
--- a/framework/TComponent.php
+++ b/framework/TComponent.php
@@ -618,7 +618,9 @@ class TPropertyValue
if($types[$enums]->hasConstant($value))
return $value;
else
- throw new TInvalidDataValueException('propertyvalue_enumvalue_invalid',$value,$enums);
+ throw new TInvalidDataValueException(
+ 'propertyvalue_enumvalue_invalid',$value,
+ implode(' | ',$types[$enums]->getConstants()));
}
else if(!is_array($enums))
{
diff --git a/framework/Web/Javascripts/extra/logger.js b/framework/Web/Javascripts/extra/logger.js
index d1434361..5771f2f4 100644
--- a/framework/Web/Javascripts/extra/logger.js
+++ b/framework/Web/Javascripts/extra/logger.js
@@ -195,6 +195,8 @@ LogConsole.prototype = {
commandHistory : [],
commandIndex : 0,
+ hidden : true,
+
// Methods
// -------
@@ -207,7 +209,7 @@ LogConsole.prototype = {
document.body.appendChild(this.logElement)
Element.hide(this.logElement)
- this.logElement.style.position = "absolute"
+ this.logElement.style.position = "absolute"
this.logElement.style.left = '0px'
this.logElement.style.width = '100%'
@@ -272,8 +274,15 @@ LogConsole.prototype = {
Event.observe(this.inputElement, 'keyup', this.handleInput.bind(this))
Event.observe(this.inputElement, 'click', function() {this.inputElement.select()}.bind(this))
+ if(document.all && !window.opera)
+ {
window.setInterval(this.repositionWindow.bind(this), 500)
- this.repositionWindow()
+ }
+ else
+ {
+ this.logElement.style.position="fixed";
+ this.logElement.style.bottom="0px";
+ }
// Listen to the logger....
Logger.onupdate.addListener(this.logUpdate.bind(this))
@@ -310,11 +319,15 @@ LogConsole.prototype = {
show : function() {
Element.show(this.logElement)
this.outputElement.scrollTop = this.outputElement.scrollHeight // Scroll to bottom when toggled
+ if(document.all && !window.opera)
+ this.repositionWindow();
Cookie.set('ConsoleVisible', 'true')
this.inputElement.select()
+ this.hidden = false;
},
hide : function() {
+ this.hidden = true;
Element.hide(this.logElement)
Cookie.set('ConsoleVisible', 'false')
},
diff --git a/framework/Web/Javascripts/js/compressed/ajax.js b/framework/Web/Javascripts/js/compressed/ajax.js
index 4c3a8146..696968c7 100644
--- a/framework/Web/Javascripts/js/compressed/ajax.js
+++ b/framework/Web/Javascripts/js/compressed/ajax.js
@@ -302,28 +302,28 @@ this.showLabel();}},onTextChanged:function(text)
{this.isSaving=false;this.isEditing=false;this.showLabel();},onTextChangedSuccess:function(sender,parameter)
{this.isSaving=false;this.isEditing=false;if(this.options.AutoHide)
this.showLabel();this.element.innerHTML=parameter==null?this.editField.value:parameter;this.editField.disabled=false;},onTextChangedFailure:function(sender,parameter)
-{this.editField.disabled=false;this.isSaving=false;this.isEditing=false;}});Prado.WebUI.TRatingList=Base.extend({selectedIndex:-1,enabled:true,constructor:function(options)
+{this.editField.disabled=false;this.isSaving=false;this.isEditing=false;}});Prado.WebUI.TRatingList=Base.extend({selectedIndex:-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.setRating(this.selectedIndex);},_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;iindex?'removeClassName':'addClassName'
Element[action](this.radios[i].parentNode,"rating_selected");}
this.setCaption(index);},setCaption:function(index)
-{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;},setEnabled:function(value)
+{var value=index>-1?this.radios[index].value:this.options.caption;var caption=$(this.options.CaptionID);if(caption)caption.innerHTML=value;$(this.options.ListID).title=value;},setEnabled:function(value)
{this.enabled=value;for(var i=0;i=this.outputElement.scrollHeight
this.outputCount++
style=(style?style+=';':'')
diff --git a/framework/Web/Javascripts/js/compressed/prado.js b/framework/Web/Javascripts/js/compressed/prado.js
index 376e3a7b..9f8cdb19 100644
--- a/framework/Web/Javascripts/js/compressed/prado.js
+++ b/framework/Web/Javascripts/js/compressed/prado.js
@@ -392,6 +392,6 @@ window.clipboardData.setData("Text",text);},hover:function(obj)
{obj.parentNode.className="copycode copycode_hover";},out:function(obj)
{obj.parentNode.className="copycode";}});Prado.WebUI.TCheckBoxList=Base.extend({constructor:function(options)
{for(var i=0;i index ? 'removeClassName' : 'addClassName'
Element[action](this.radios[i].parentNode, "rating_selected");
}
this.setCaption(index);
@@ -2701,7 +2704,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)
@@ -2711,7 +2714,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");
}
}
},
diff --git a/framework/Web/Javascripts/js/debug/logger.js b/framework/Web/Javascripts/js/debug/logger.js
index 2a376904..5d465d56 100644
--- a/framework/Web/Javascripts/js/debug/logger.js
+++ b/framework/Web/Javascripts/js/debug/logger.js
@@ -195,6 +195,8 @@ LogConsole.prototype = {
commandHistory : [],
commandIndex : 0,
+ hidden : true,
+
// Methods
// -------
@@ -207,7 +209,7 @@ LogConsole.prototype = {
document.body.appendChild(this.logElement)
Element.hide(this.logElement)
- this.logElement.style.position = "absolute"
+ this.logElement.style.position = "absolute"
this.logElement.style.left = '0px'
this.logElement.style.width = '100%'
@@ -272,8 +274,15 @@ LogConsole.prototype = {
Event.observe(this.inputElement, 'keyup', this.handleInput.bind(this))
Event.observe(this.inputElement, 'click', function() {this.inputElement.select()}.bind(this))
+ if(document.all && !window.opera)
+ {
window.setInterval(this.repositionWindow.bind(this), 500)
- this.repositionWindow()
+ }
+ else
+ {
+ this.logElement.style.position="fixed";
+ this.logElement.style.bottom="0px";
+ }
// Listen to the logger....
Logger.onupdate.addListener(this.logUpdate.bind(this))
@@ -310,11 +319,15 @@ LogConsole.prototype = {
show : function() {
Element.show(this.logElement)
this.outputElement.scrollTop = this.outputElement.scrollHeight // Scroll to bottom when toggled
+ if(document.all && !window.opera)
+ this.repositionWindow();
Cookie.set('ConsoleVisible', 'true')
this.inputElement.select()
+ this.hidden = false;
},
hide : function() {
+ this.hidden = true;
Element.hide(this.logElement)
Cookie.set('ConsoleVisible', 'false')
},
diff --git a/framework/Web/Javascripts/js/debug/prado.js b/framework/Web/Javascripts/js/debug/prado.js
index 920c2150..aaae6bad 100644
--- a/framework/Web/Javascripts/js/debug/prado.js
+++ b/framework/Web/Javascripts/js/debug/prado.js
@@ -3504,7 +3504,7 @@ Prado.WebUI.TCheckBoxList = Base.extend(
var checkBoxOptions = Object.extend(
{
ID : options.ListID+"_c"+i,
- EventTarget : options.ListName+"$c"+i
+ EventTarget : options.ListID+"$c"+i
}, options);
new Prado.WebUI.TCheckBox(checkBoxOptions);
}
@@ -3520,7 +3520,7 @@ Prado.WebUI.TRadioButtonList = Base.extend(
var radioButtonOptions = Object.extend(
{
ID : options.ListID+"_c"+i,
- EventTarget : options.ListName+"$c"+i
+ EventTarget : options.ListID+"$c"+i
}, options);
new Prado.WebUI.TRadioButton(radioButtonOptions);
}
diff --git a/framework/Web/Javascripts/prado/controls.js b/framework/Web/Javascripts/prado/controls.js
index 0f1bb4d4..c26026ae 100644
--- a/framework/Web/Javascripts/prado/controls.js
+++ b/framework/Web/Javascripts/prado/controls.js
@@ -252,7 +252,7 @@ Prado.WebUI.TCheckBoxList = Base.extend(
var checkBoxOptions = Object.extend(
{
ID : options.ListID+"_c"+i,
- EventTarget : options.ListName+"$c"+i
+ EventTarget : options.ListID+"$c"+i
}, options);
new Prado.WebUI.TCheckBox(checkBoxOptions);
}
@@ -268,7 +268,7 @@ Prado.WebUI.TRadioButtonList = Base.extend(
var radioButtonOptions = Object.extend(
{
ID : options.ListID+"_c"+i,
- EventTarget : options.ListName+"$c"+i
+ EventTarget : options.ListID+"$c"+i
}, options);
new Prado.WebUI.TRadioButton(radioButtonOptions);
}
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
Binary files a/framework/Web/Javascripts/ratings/blocks.png and b/framework/Web/Javascripts/ratings/blocks.png 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
Binary files /dev/null and b/framework/Web/Javascripts/ratings/blocks_blank.gif 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
Binary files a/framework/Web/Javascripts/ratings/blocks_blank.png and /dev/null 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
Binary files /dev/null and b/framework/Web/Javascripts/ratings/blocks_combined.gif 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
Binary files a/framework/Web/Javascripts/ratings/blocks_combined.png and /dev/null 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
Binary files /dev/null and b/framework/Web/Javascripts/ratings/blocks_half.gif 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
Binary files a/framework/Web/Javascripts/ratings/blocks_half.png and /dev/null 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
Binary files /dev/null and b/framework/Web/Javascripts/ratings/blocks_selected.gif 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
Binary files a/framework/Web/Javascripts/ratings/blocks_selected.png and /dev/null 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
Binary files a/framework/Web/Javascripts/ratings/default.png and b/framework/Web/Javascripts/ratings/default.png 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
Binary files /dev/null and b/framework/Web/Javascripts/ratings/default_blank.gif 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
Binary files a/framework/Web/Javascripts/ratings/default_blank.png and /dev/null 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
Binary files /dev/null and b/framework/Web/Javascripts/ratings/default_combined.gif 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
Binary files a/framework/Web/Javascripts/ratings/default_combined.png and /dev/null 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
Binary files /dev/null and b/framework/Web/Javascripts/ratings/default_half.gif 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
Binary files a/framework/Web/Javascripts/ratings/default_half.png and /dev/null 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
Binary files /dev/null and b/framework/Web/Javascripts/ratings/default_selected.gif 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
Binary files a/framework/Web/Javascripts/ratings/default_selected.png and /dev/null 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 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");
}
}
},
diff --git a/framework/Web/UI/ActiveControls/TActiveButton.php b/framework/Web/UI/ActiveControls/TActiveButton.php
index 030361fb..62027264 100644
--- a/framework/Web/UI/ActiveControls/TActiveButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveButton.php
@@ -54,6 +54,14 @@ class TActiveButton extends TButton implements ICallbackEventHandler, IActiveCon
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* Raises the callback event. This method is required by {@link
* ICallbackEventHandler} interface. If {@link getCausesValidation
diff --git a/framework/Web/UI/ActiveControls/TActiveCheckBox.php b/framework/Web/UI/ActiveControls/TActiveCheckBox.php
index 7cf5c005..2f60d9fb 100644
--- a/framework/Web/UI/ActiveControls/TActiveCheckBox.php
+++ b/framework/Web/UI/ActiveControls/TActiveCheckBox.php
@@ -52,6 +52,14 @@ class TActiveCheckBox extends TCheckBox implements ICallbackEventHandler, IActiv
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* Raises the callback event. This method is required by {@link
* ICallbackEventHandler} interface.
diff --git a/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php b/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php
index b18d0d0d..09ad9236 100644
--- a/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php
+++ b/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php
@@ -56,6 +56,14 @@ class TActiveCheckBoxList extends TCheckBoxList implements IActiveControl, ICall
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* @return string javascript client-side control class name.
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
index 686149eb..0a6b7b84 100644
--- a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
+++ b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
@@ -10,6 +10,8 @@
* @package System.Web.UI.ActiveControls
*/
+Prado::using('System.Web.UI.ActiveControls.TCallbackClientSide');
+
/**
* TActiveCustomValidator Class
*
@@ -55,6 +57,7 @@ class TActiveCustomValidator extends TCustomValidator
{
parent::__construct();
$this->setAdapter(new TActiveControlAdapter($this));
+ $this->getActiveControl()->setClientSide(new TActiveCustomValidatorClientSide);
}
/**
@@ -65,6 +68,14 @@ class TActiveCustomValidator extends TCustomValidator
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* Client validation function is NOT supported.
*/
@@ -131,4 +142,67 @@ class TActiveCustomValidator extends TCustomValidator
}
}
+/**
+ * Custom Validator callback client side options class.
+ *
+ * @author Wei Zhuo
+ * @version $Id$
+ * @package System.Web.UI.ActiveControls
+ * @since 3.1
+ */
+class TActiveCustomValidatorClientSide extends TCallbackClientSide
+{
+ /**
+ * @return string javascript code for client-side OnValidate event.
+ */
+ public function getOnValidate()
+ {
+ return $this->getOption('OnValidate');
+ }
+
+ /**
+ * Client-side OnValidate validator event is raise before the validators
+ * validation functions are called.
+ * @param string javascript code for client-side OnValidate event.
+ */
+ public function setOnValidate($javascript)
+ {
+ $this->setFunction('OnValidate', $javascript);
+ }
+
+ /**
+ * Client-side OnError event is raised after validation failure.
+ * This will override the default client-side validator behaviour.
+ * @param string javascript code for client-side OnError event.
+ */
+ public function setOnError($javascript)
+ {
+ $this->setFunction('OnError', $javascript);
+ }
+
+ /**
+ * @return string javascript code for client-side OnError event.
+ */
+ public function getOnError()
+ {
+ return $this->getOption('OnError');
+ }
+
+ /**
+ * @param boolean true to revalidate when the control to validate changes value.
+ */
+ public function setObserveChanges($value)
+ {
+ $this->setOption('ObserveChanges', TPropertyValue::ensureBoolean($value));
+ }
+
+ /**
+ * @return boolean true to observe changes.
+ */
+ public function getObserveChanges()
+ {
+ $changes = $this->getOption('ObserveChanges');
+ return is_null($changes) ? true : $changes;
+ }
+}
?>
\ No newline at end of file
diff --git a/framework/Web/UI/ActiveControls/TActiveDropDownList.php b/framework/Web/UI/ActiveControls/TActiveDropDownList.php
index c628e98c..215b1e5a 100644
--- a/framework/Web/UI/ActiveControls/TActiveDropDownList.php
+++ b/framework/Web/UI/ActiveControls/TActiveDropDownList.php
@@ -58,6 +58,14 @@ class TActiveDropDownList extends TDropDownList implements ICallbackEventHandler
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* No client class for this control.
* This method overrides the parent implementation.
diff --git a/framework/Web/UI/ActiveControls/TActiveImageButton.php b/framework/Web/UI/ActiveControls/TActiveImageButton.php
index fe4cb385..bb20793e 100644
--- a/framework/Web/UI/ActiveControls/TActiveImageButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveImageButton.php
@@ -46,6 +46,14 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* Sets the alternative text to be displayed in the TImage when the image is unavailable.
* @param string the alternative text
diff --git a/framework/Web/UI/ActiveControls/TActiveLinkButton.php b/framework/Web/UI/ActiveControls/TActiveLinkButton.php
index 30c62723..8b86d11a 100644
--- a/framework/Web/UI/ActiveControls/TActiveLinkButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveLinkButton.php
@@ -49,6 +49,14 @@ class TActiveLinkButton extends TLinkButton implements IActiveControl, ICallback
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* Raises the callback event. This method is required by {@link
* ICallbackEventHandler} interface. If {@link getCausesValidation
diff --git a/framework/Web/UI/ActiveControls/TActiveListBox.php b/framework/Web/UI/ActiveControls/TActiveListBox.php
index e433fa09..21816961 100644
--- a/framework/Web/UI/ActiveControls/TActiveListBox.php
+++ b/framework/Web/UI/ActiveControls/TActiveListBox.php
@@ -42,6 +42,14 @@ class TActiveListBox extends TListBox implements IActiveControl, ICallbackEventH
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* Creates a collection object to hold list items. A specialized
* TActiveListItemCollection is created to allow the drop down list options
diff --git a/framework/Web/UI/ActiveControls/TActiveRadioButton.php b/framework/Web/UI/ActiveControls/TActiveRadioButton.php
index fe26165c..425cf1c7 100644
--- a/framework/Web/UI/ActiveControls/TActiveRadioButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveRadioButton.php
@@ -51,6 +51,14 @@ class TActiveRadioButton extends TRadioButton implements IActiveControl, ICallba
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* Raises the callback event. This method is required by {@link
* ICallbackEventHandler} interface.
diff --git a/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php b/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
index f971228f..0eb3f83a 100644
--- a/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
+++ b/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
@@ -51,6 +51,14 @@ class TActiveRadioButtonList extends TRadioButtonList implements IActiveControl,
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* @return string javascript client-side control class name.
*/
diff --git a/framework/Web/UI/ActiveControls/TActiveRatingList.php b/framework/Web/UI/ActiveControls/TActiveRatingList.php
index 1ce49a0c..ec8eee46 100644
--- a/framework/Web/UI/ActiveControls/TActiveRatingList.php
+++ b/framework/Web/UI/ActiveControls/TActiveRatingList.php
@@ -1,9 +1,35 @@
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2006 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @package System.Web.UI.ActiveControls
+ */
+/**
+ * TActiveRatingList Class
+ *
+ * Displays clickable images that represent a TActiveRadioButtonList
+ *
+ * @author Wei Zhuo
+ * @version $Id$
+ * @package System.Web.UI.ActiveControls
+ * @since 3.1
+ */
class TActiveRatingList extends TActiveRadioButtonList
{
+ /**
+ * @var array list of published rating images.
+ */
private $_ratingImages = array();
+ /**
+ * Sets the default repeat direction to horizontal.
+ */
public function __construct()
{
parent::__construct();
@@ -18,6 +44,19 @@ class TActiveRatingList extends TActiveRadioButtonList
return $this->getViewState('ReadOnly',false);
}
+ /**
+ * @param boolean whether the items in the column can be edited
+ */
+ public function setReadOnly($value)
+ {
+ $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false);
+ }
+
+ /**
+ * The repeat layout must be Table.
+ * @param string repeat layout type
+ * @throws TInvaliddataValueException when repeat layout is not Table.
+ */
public function setRepeatLayout($value)
{
if($value!==TRepeatLayout::Table)
@@ -27,23 +66,24 @@ class TActiveRatingList extends TActiveRadioButtonList
}
/**
- * @param boolean whether the items in the column can be edited
+ * @return float rating value for read-only display.
*/
- public function setReadOnly($value)
- {
- $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false);
- }
-
public function getRating()
{
return $this->getViewState('Rating',0);
}
+ /**
+ * @param float rating value for read-only display.
+ */
public function setRating($value)
{
$this->setViewState('Rating', TPropertyValue::ensureFloat($value),0);
}
+ /**
+ * @param int change the rating selection index
+ */
public function setSelectedIndex($value)
{
$canUpdate = $this->getActiveControl()->getEnableUpdate();
@@ -54,6 +94,11 @@ class TActiveRatingList extends TActiveRadioButtonList
$this->callClientFunction('setRating',$value);
}
+ /**
+ * Calls the client-side static method for this control class.
+ * @param string static method name
+ * @param mixed method parmaeter
+ */
protected function callClientFunction($func,$value)
{
$client = $this->getPage()->getCallbackClient();
@@ -62,7 +107,7 @@ class TActiveRatingList extends TActiveRadioButtonList
}
/**
- * @return string caption text.
+ * @return string control or html element ID for displaying a caption.
*/
public function getCaptionID()
{
@@ -70,13 +115,16 @@ class TActiveRatingList extends TActiveRadioButtonList
}
/**
- * @param string caption text
+ * @param string control or html element ID for displaying a caption.
*/
public function setCaptionID($value)
{
$this->setViewState('CaptionID', $value, '');
}
+ /**
+ * @param boolean true to enable the rating to be changed.
+ */
public function setEnabled($value)
{
parent::setEnabled($value);
@@ -85,7 +133,7 @@ class TActiveRatingList extends TActiveRadioButtonList
}
/**
- * @param string set the rating style
+ * @param string set the rating style, default is "default"
*/
public function setRatingStyle($value)
{
@@ -100,22 +148,36 @@ class TActiveRatingList extends TActiveRadioButtonList
return $this->getViewState('RatingStyle', 'default');
}
- public function setHalfRatingLimit($value)
+ /**
+ * Sets the interval such that those rating values within the interval
+ * will be considered as a half star rating.
+ * @param array rating display half value interval, default is array(0.3, 0.7);
+ */
+ public function setHalfRatingInterval($value)
{
$this->setViewState('HalfRating',
TPropertyValue::ensureArray($value), array(0.3, 0.7));
}
- public function getHalfRatingLimit()
+ /**
+ * @return array rating display half value interval, default is array(0.3, 0.7);
+ */
+ public function getHalfRatingInterval()
{
return $this->getViewState('HalfRating', array(0.3, 0.7));
}
+ /**
+ * @return string rating style css class name.
+ */
protected function getRatingStyleCssClass()
{
return 'TRatingList_'.$this->getRatingStyle();
}
+ /**
+ * @return array list of post back options.
+ */
protected function getPostBackOptions()
{
$options = parent::getPostBackOptions();
@@ -126,7 +188,8 @@ class TActiveRatingList extends TActiveRadioButtonList
}
/**
- * Registers the javascript code for initializing the active control.
+ * Registers the javascript code for initializing the active control
+ * only if {@link setReadOnly ReadOnly} property is false.
*/
protected function renderClientControlScript($writer)
{
@@ -134,6 +197,9 @@ class TActiveRatingList extends TActiveRadioButtonList
parent::renderClientControlScript($writer);
}
+ /**
+ * @return string find the client ID of the caption control.
+ */
protected function getCaptionControl()
{
if(($id=$this->getCaptionID())!=='')
@@ -149,6 +215,10 @@ class TActiveRatingList extends TActiveRadioButtonList
return '';
}
+ /**
+ * @param string rating style name
+ * @return string URL of the css style file
+ */
protected function publishRatingListStyle($style)
{
$cs = $this->getPage()->getClientScript();
@@ -161,7 +231,12 @@ class TActiveRatingList extends TActiveRadioButtonList
return $url;
}
- protected function publishRatingListImages($style, $fileExt='.png')
+ /**
+ * @param string rating style name
+ * @param string rating image file extension, default is '.gif'
+ * @return array URL of publish the rating images
+ */
+ protected function publishRatingListImages($style, $fileExt='.gif')
{
$images['blank'] = "System.Web.Javascripts.ratings.{$style}_blank";
$images['selected'] = "System.Web.Javascripts.ratings.{$style}_selected";
@@ -177,18 +252,21 @@ class TActiveRatingList extends TActiveRadioButtonList
return $files;
}
+ /**
+ * Add rating style class name to the class attribute
+ * when {@link setReadOnly ReadOnly} property is true and when the
+ * {@link setCssClass CssClass} property is empty.
+ * @param THtmlWriter renderer
+ */
public function render($writer)
{
if($this->getReadOnly())
- {
$writer->addAttribute('class', $this->getRatingStyleCssClass());
- $writer->addAttribute('title', $this->getRating());
- }
parent::render($writer);
}
/**
- * @param THtmlWriter writer
+ * Publish the the rating style css file and rating image files.
*/
public function onPreRender($param)
{
@@ -198,6 +276,10 @@ class TActiveRatingList extends TActiveRadioButtonList
$this->_ratingImages = $this->publishRatingListImages($this->getRatingStyle());
}
+ /**
+ * Renders the rating images if {@link setReadOnly ReadOnly} is true
+ * otherwise render the radio buttons.
+ */
public function renderItem($writer,$repeatInfo,$itemType,$index)
{
if($this->getReadOnly())
@@ -206,6 +288,9 @@ class TActiveRatingList extends TActiveRadioButtonList
parent::renderItem($writer, $repeatInfo, $itemType, $index);
}
+ /**
+ * Renders the static rating images.
+ */
protected function renderStaticRating($writer, $repeatInfo, $itemType, $index)
{
$image = new TImage;
@@ -214,11 +299,15 @@ class TActiveRatingList extends TActiveRadioButtonList
$image->render($writer);
}
+ /**
+ * @param integer rating image index
+ * @return string the rating image corresponding to current index to be rendered.
+ */
protected function getRatingImageType($index)
{
$rating = floatval($this->getRating());
$int = intval($rating);
- $limit = $this->getHalfRatingLimit();
+ $limit = $this->getHalfRatingInterval();
if($index < $int || ($rating < $index+1 && $rating > $index+$limit[1]))
return 'selected';
if($rating >= $index+$limit[0] && $rating <= $index+$limit[1])
diff --git a/framework/Web/UI/ActiveControls/TActiveTextBox.php b/framework/Web/UI/ActiveControls/TActiveTextBox.php
index bee97dbb..8e6c86dd 100644
--- a/framework/Web/UI/ActiveControls/TActiveTextBox.php
+++ b/framework/Web/UI/ActiveControls/TActiveTextBox.php
@@ -50,6 +50,14 @@ class TActiveTextBox extends TTextBox implements ICallbackEventHandler, IActiveC
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* Client-side Text property can only be updated after the OnLoad stage.
* @param string text content for the textbox
diff --git a/framework/Web/UI/ActiveControls/TCallback.php b/framework/Web/UI/ActiveControls/TCallback.php
index b7444127..60bdaf10 100644
--- a/framework/Web/UI/ActiveControls/TCallback.php
+++ b/framework/Web/UI/ActiveControls/TCallback.php
@@ -61,6 +61,14 @@ class TCallback extends TControl implements ICallbackEventHandler, IActiveContro
return $this->getAdapter()->getBaseActiveControl();
}
+ /**
+ * @return TCallbackClientSide client side request options.
+ */
+ public function getClientSide()
+ {
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
+ }
+
/**
* Raises the callback event. This method is required by {@link
* ICallbackEventHandler} interface. If {@link getCausesValidation
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index 77abdd9a..ad901e17 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -661,18 +661,6 @@ class TValidatorClientSide extends TClientSideOptions
$changes = $this->getOption('ObserveChanges');
return is_null($changes) ? true : $changes;
}
-
- /**
- * Ensure the string is a valid javascript function. If the string begins
- * with "javascript:" valid javascript function is assumed, otherwise the
- * code block is enclosed with "function(validator, sender){ }" block.
- * @param string javascript code.
- * @return string javascript function code.
- */
- protected function ensureFunction($javascript)
- {
- return "function(validator, sender){ {$javascript} }";
- }
}
diff --git a/framework/Web/UI/WebControls/TJavascriptLogger.php b/framework/Web/UI/WebControls/TJavascriptLogger.php
index 3a294b6b..a873d8d8 100644
--- a/framework/Web/UI/WebControls/TJavascriptLogger.php
+++ b/framework/Web/UI/WebControls/TJavascriptLogger.php
@@ -57,8 +57,9 @@ class TJavascriptLogger extends TWebControl
public function renderContents($writer)
{
$info = '(more info).';
- $usage = 'Press ALT-D (Or CTRL-D on OS X) to toggle the javascript log console';
- $writer->write("{$usage} {$info}");
+ $link = 'toggle the javascript log console.';
+ $usage = 'Press ALT-D (Or CTRL-D on OS X) to';
+ $writer->write("{$usage} {$link} {$info}");
}
}
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page
index 9ff09bb6..431d42f2 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveCheckBoxTest.page
@@ -2,25 +2,25 @@
Active CheckBox Test
-
+
-
-
-
Loading...
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page
index c5c40c44..2bb4c9de 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page
@@ -6,7 +6,7 @@
-
+
-
+
-
+
TAutoComplete Test
Manual Testing Required
-
+
-
+
+ ResultPanel.CssClass="autocomplete" />
diff --git a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php
index 997e9bdd..dbce7531 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php
@@ -15,7 +15,7 @@ class AutoCompleteTest extends TPage
public function callback_requested($sender, $param)
{
- $this->label1->Text = "Label 1: ".$this->textbox3->Text;
+ $this->label1->Text = "Label 1: ".$sender->Text;
}
protected function matchCountries($token)
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page b/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page
index 2af4b3c8..ae1fe3d2 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/CallbackCustomValidatorTest.page
@@ -24,10 +24,9 @@
ErrorMessage="*"
ControlCssClass="required"
OnServerValidate="validate_text1">
-
-
diff --git a/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page b/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page
index 6e8b8a1e..3cecbade 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/CallbackOptionsTest.page
@@ -1,6 +1,6 @@
TCallbackOptions Test
-
+
$("status").show();
@@ -12,23 +12,23 @@
Element.update("label1", "Button 1 has returned");
-
+
-
+
Element.update("label2", "Button 2 has returned");
-
+
-
+
Element.update("label3", "Button 3 has returned");
-
+
-
+
Label 1
Label 2
Label 3
- Loading...
+ Loading...
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page
index 190e6020..a615363b 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page
@@ -1,57 +1,69 @@
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
+
+
+
+
@@ -64,8 +76,9 @@
Loading...
-
-
+
+
+
diff --git a/tests/FunctionalTests/active-controls/protected/pages/RatingList.php b/tests/FunctionalTests/active-controls/protected/pages/RatingList.php
index d31b6166..c6661182 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/RatingList.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/RatingList.php
@@ -4,7 +4,6 @@ class RatingList extends TPage
{
function list1_oncallback($sender, $param)
{
- $sender->Enabled=false;
}
function button1_clicked($sender, $param)
@@ -14,9 +13,13 @@ class RatingList extends TPage
function button2_clicked($sender, $param)
{
- $this->list1->SelectedIndex=3;
$this->list1->Enabled=false;
}
+
+ function button5_clicked($sender, $param)
+ {
+ $this->list1->SelectedIndex=3;
+ }
}
?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page b/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page
index 7010ca0f..cf43dea6 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page
@@ -43,9 +43,9 @@
EditTriggerControlID="link1"
CssClass="textbox"
Text="Label 1">
-
+
-
diff --git a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
index cb1a6604..96c0fb4b 100644
--- a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
@@ -9,12 +9,37 @@ class AutoCompleteTestCase extends SeleniumTestCase
$this->assertText("label1", "Label 1");
- $this->type("textbox3", "Australia");
- $this->pause(800);
+ $this->keyPress("textbox3", 'a');
+ $this->pause(1000);
+ $this->verifyTextPresent('Andorra');
+ $this->keyPress("textbox3", 'u');
+ $this->pause(1000);
+ $this->verifyTextPresent('Australia');
$this->click("heading"); //click somewhere else.
+ $this->waitForText("label1", "suggestion for au");
+ $this->assertText("label1", "suggestion for au");
+ $this->click("css=#textbox3_result ul li");
+ $this->pause(800);
+ $this->assertText("label1", "Label 1: Austria");
+
+ $this->keyPress("textbox2", "c");
+ $this->pause(800);
+ $this->keyPress("textbox2", "u");
+ $this->pause(800);
+ $this->click('css=#textbox2_result ul li');
$this->pause(800);
- $this->assertText("label1", "Label 1: Australia");
+ $this->assertText("label1", "Label 1: Cuba");
+ $this->keyPress("textbox2", ",");
+
+ $this->keyPress("textbox2", "m");
+ $this->pause(800);
+
+ $this->keyPress("textbox2", "e");
+ $this->pause(800);
+ $this->click('css=#textbox2_result ul li');
+ $this->pause(800);
+ $this->assertText("label1", "Label 1: Cuba,Mexico");
}
}
--
cgit v1.2.3