diff options
author | wei <> | 2006-04-30 23:59:58 +0000 |
---|---|---|
committer | wei <> | 2006-04-30 23:59:58 +0000 |
commit | 54de98bd61c3d2847ad2e9c73bbc6b93064d6fd4 (patch) | |
tree | 140eeda32daa7de3d466aafc3dc082b519f3a87c | |
parent | 3209b22c5555e865eb2c42bcef0aa143bc6418bf (diff) |
Changed ClientValidation to ClientSide (same property name will be used in ActiveControls)
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | buildscripts/jsbuilder/build.php | 10 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TBaseValidator.php | 11 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TValidationSummary.php | 6 | ||||
-rw-r--r-- | tests/FunctionalTests/features/protected/pages/ValidatorEffects.page | 18 |
5 files changed, 18 insertions, 29 deletions
@@ -18,7 +18,7 @@ ENH: TLiteral will display body content if Text is empty (Qiang) ENH: Format string in classes extending TDataGridColumn can now evaluate an expression (Qiang)
ENH: Format string in classes extending TListControl can now evaluate an expression (Qiang)
ENH: Added THttpResponse::reload() (Qiang)
-ENH: Custom visual effects can be added to client-side validators. (Wei)
+ENH: Custom visual effects can be added to client-side validators via ClientSide property in validators. (Wei)
ENH: TJavascript::encode() allows raw javascript code when string begins with "javascript:" (Wei)
ENH: Update TinyMCE to 2.0.5.1
CHG: Rewrote client-side javascript validators, check your client-side validation behaviour (Wei)
diff --git a/buildscripts/jsbuilder/build.php b/buildscripts/jsbuilder/build.php index d7e5925c..68bbe427 100644 --- a/buildscripts/jsbuilder/build.php +++ b/buildscripts/jsbuilder/build.php @@ -188,14 +188,4 @@ else if($builds > 0) else
echo "No files to build.";
-//remove comments from javascript files.
-function compress_js($string)
-{
- $string = preg_replace('/\/\/[^\n\r]*[\n\r]/', ' ', $string);
- $string = preg_replace('/\/\*[^*]*\*+([^\/][^*]*\*+)*\//', ' ', $string);
- $string = preg_replace('/ |\t|\r/', '', $string);
- $string = preg_replace('/(\n[ \t]*){2,}/', "\n", $string);
- return $string;
-}
-
?>
\ No newline at end of file diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index a63941db..ea1a5836 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -42,7 +42,7 @@ * be displayed. Error display is controlled by {@link setDisplay Display} property. * * You can also customized the client-side behaviour by adding javascript - * code to the subproperties of the {@link getClientValidation ClientValidation} + * code to the subproperties of the {@link getClientSide ClientSide} * property. See quickstart documentation for further details. * * You can also place a {@link TValidationSummary} control on a page to display error messages @@ -176,7 +176,7 @@ abstract class TBaseValidator extends TLabel implements IValidator * * @return TValidatorClientScript javascript validator event options. */ - public function getClientValidation() + public function getClientSide() { if(is_null($this->_clientScript)) $this->_clientScript = $this->createClientScript(); @@ -494,10 +494,9 @@ abstract class TBaseValidator extends TLabel implements IValidator * TValidatorClientScript class. * * Client-side validator events can be modified through the {@link - * TBaseValidator::getClientValidation ClientValidation} property of a - * validator. The subproperties of ClientValidation are those of the - * TValidatorClientScript properties. The client-side validator supports the - * following events. + * TBaseValidator::getClientSide ClientSide} property of a validator. The + * subproperties of ClientSide are those of the TValidatorClientScript + * properties. The client-side validator supports the following events. * * The <tt>OnValidate</tt> event is raise before the validator validation * functions are called. diff --git a/framework/Web/UI/WebControls/TValidationSummary.php b/framework/Web/UI/WebControls/TValidationSummary.php index aa46142b..87821292 100644 --- a/framework/Web/UI/WebControls/TValidationSummary.php +++ b/framework/Web/UI/WebControls/TValidationSummary.php @@ -258,7 +258,7 @@ class TValidationSummary extends TWebControl * @return TValidationSummaryClientScript client-side validation summary
* event options.
*/
- public function getClientValidation()
+ public function getClientSide()
{
if(is_null($this->_clientScript))
$this->_clientScript = $this->createClientScript();
@@ -376,8 +376,8 @@ class TValidationSummary extends TWebControl *
* Client-side validation summary events such as {@link setOnHideSummary
* OnHideSummary} and {@link setOnShowSummary OnShowSummary} can be modified
- * through the {@link TBaseValidator:: getClientValidation ClientValidation}
- * property of a validation summary.
+ * through the {@link TBaseValidator:: getClientSide ClientSide} property of a
+ * validation summary.
*
* The <tt>OnHideSummary</tt> event is raise when the validation summary
* requests to hide the messages.
diff --git a/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page b/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page index da03f9b8..1a97a249 100644 --- a/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page +++ b/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page @@ -16,13 +16,13 @@ ControlCssClass="required"
Display="Dynamic"
ErrorMessage="a username is required.">
- <prop:ClientValidation.OnError>
+ <prop:ClientSide.OnError>
Effect.Shake(validator.control);
Effect.Appear(validator.message);
- </prop:ClientValidation.OnError>
- <prop:ClientValidation.OnSuccess>
+ </prop:ClientSide.OnError>
+ <prop:ClientSide.OnSuccess>
Effect.Fade(validator.message);
- </prop:ClientValidation.OnSuccess>
+ </prop:ClientSide.OnSuccess>
</com:TRequiredFieldValidator>
</div>
<div class="password">
@@ -37,8 +37,8 @@ ValidationGroup="registration"
ControlCssClass="required"
Display="Dynamic"
- ClientValidation.OnError="validator.message.visualEffect('appear')"
- ClientValidation.OnSuccess="validator.message.visualEffect('fade')"
+ ClientSide.OnError="validator.message.visualEffect('appear')"
+ ClientSide.OnSuccess="validator.message.visualEffect('fade')"
ErrorMessage="a password is required." />
</div>
<div class="create">
@@ -82,12 +82,12 @@ ID="summary2"
ValidationGroup="signin"
Display="Dynamic"
- ClientValidation.OnHideSummary="Effect.Squish(summary.messages)"
+ ClientSide.OnHideSummary="Effect.Squish(summary.messages)"
HeaderText="<p>You could not login because</p>">
- <prop:ClientValidation.OnShowSummary>
+ <prop:ClientSide.OnShowSummary>
Effect.Appear(summary.messages)
Effect.Shake(summary.messages,{ queue: 'end'})
- </prop:ClientValidation.OnShowSummary>
+ </prop:ClientSide.OnShowSummary>
</com:TValidationSummary>
</div>
|