summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/TApplication.php2
-rw-r--r--framework/Web/Javascripts/js/compressed/prado.js11
-rw-r--r--framework/Web/Javascripts/js/compressed/validator.js4
-rw-r--r--framework/Web/Javascripts/js/debug/prado.js46
-rw-r--r--framework/Web/Javascripts/js/debug/validator.js4
5 files changed, 40 insertions, 27 deletions
diff --git a/framework/TApplication.php b/framework/TApplication.php
index c06bd080..a9d907f5 100644
--- a/framework/TApplication.php
+++ b/framework/TApplication.php
@@ -1120,7 +1120,7 @@ class TApplication extends TComponent
* In particular, the following modes are defined
* - Off: the application is not running. Any request to the application will obtain an error.
* - Debug: the application is running in debug mode.
- * - Debug: the application is running in normal production mode.
+ * - Normal: the application is running in normal production mode.
* - Performance: the application is running in performance mode.
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Id$
diff --git a/framework/Web/Javascripts/js/compressed/prado.js b/framework/Web/Javascripts/js/compressed/prado.js
index 7c2c3ea6..4f93a23e 100644
--- a/framework/Web/Javascripts/js/compressed/prado.js
+++ b/framework/Web/Javascripts/js/compressed/prado.js
@@ -316,8 +316,9 @@ if(typeof(element)=="string")
method.toFunction().apply(this,[element,""+content]);}
else
{method.toFunction().apply(this,[""+content]);}},extractContent:function(text,boundary)
-{var f=RegExp('(<!--'+boundary+'-->)([\\s\\S\\w\\W]*)(<!--//'+boundary+'-->)',"m");var result=text.match(f);if(result&&result.length>=2)
-return result[2];else
+{var tagStart='<!--'+boundary+'-->';var tagEnd='<!--//'+boundary+'-->';var start=text.indexOf(tagStart);if(start>-1)
+{start+=tagStart.length;var end=text.indexOf(tagEnd,start);if(end>-1)
+return text.substring(start,end);}
return null;},evaluateScript:function(content)
{content.evalScripts();}}
Prado.Element.Selection={isSelectable:function(el)
@@ -462,7 +463,7 @@ var newdate=new Date(year,month-1,date,0,0,0);return newdate;}});Prado.WebUI=Cla
{if(this.onInit)
this.onInit(options);}},onInit:function(options)
{if(typeof(this.element.onclick)=="function")
-{this._elementOnClick=this.element.onclick.bind(this.element);;this.element.onclick=null;}
+{this._elementOnClick=this.element.onclick.bind(this.element);this.element.onclick=null;}
Event.observe(this.element,"click",this.elementClicked.bindEvent(this,options));},elementClicked:function(event,options)
{var src=Event.element(event);var doPostBack=true;var onclicked=null;if(this._elementOnClick)
{var onclicked=this._elementOnClick(event);if(typeof(onclicked)=="boolean")
@@ -523,8 +524,8 @@ this.radios[i].parentNode.className=(i<=index)?"rating_hover":"";this.setCaption
{for(var i=0;i<=index;i++)
Element.removeClassName(this.radios[i].parentNode,"rating_hover");this.setRating(this.selectedIndex);},click:function(ev,index)
{for(var i=0;i<this.radios.length;i++)
-this.radios[i].checked=(i==index);this.selectedIndex=index;this.setRating(index);if(isFunction(this.options.onChange))
+this.radios[i].checked=(i==index);this.selectedIndex=index;this.setRating(index);if(typeof(this.options.onChange)=="function")
this.options.onChange(this,index);},setRating:function(index)
{for(var i=0;i<=index;i++)
this.radios[i].parentNode.className="rating_selected";this.setCaption(index);},setCaption:function(index)
-{this.caption.innerHTML=index>-1?this.radios[index].value:this.options.caption;}} \ No newline at end of file
+{this.caption.innerHTML=index>-1?this.radios[index].value:this.options.caption;}}; \ No newline at end of file
diff --git a/framework/Web/Javascripts/js/compressed/validator.js b/framework/Web/Javascripts/js/compressed/validator.js
index 0571b27b..1073fd7c 100644
--- a/framework/Web/Javascripts/js/compressed/validator.js
+++ b/framework/Web/Javascripts/js/compressed/validator.js
@@ -195,8 +195,8 @@ else
{var min=this.options.MinValue||0;var max=this.options.MaxValue||Number.POSITIVE_INFINITY;value=value.length;}
if(value==null)
return false;var valid=true;if(min!=null)
-valid=valid&&value>=min;if(max!=null)
-valid=valid&&value<=max;return valid;}});Prado.WebUI.TRegularExpressionValidator=Class.extend(Prado.WebUI.TBaseValidator,{evaluateIsValid:function()
+valid=valid&&(this.options.StrictComparison?value>min:value>=min);if(max!=null)
+valid=valid&&(this.options.StrictComparison?value<max:value<=max);return valid;}});Prado.WebUI.TRegularExpressionValidator=Class.extend(Prado.WebUI.TBaseValidator,{evaluateIsValid:function()
{var value=this.getValidationValue();if(value.length<=0)
return true;var rx=new RegExp(this.options.ValidationExpression);var matches=rx.exec(value);return(matches!=null&&value==matches[0]);}});Prado.WebUI.TEmailAddressValidator=Prado.WebUI.TRegularExpressionValidator;Prado.WebUI.TListControlValidator=Class.extend(Prado.WebUI.TBaseValidator,{evaluateIsValid:function()
{var elements=this.getListElements();if(elements&&elements.length<=0)
diff --git a/framework/Web/Javascripts/js/debug/prado.js b/framework/Web/Javascripts/js/debug/prado.js
index 03c271af..2d6ac3ec 100644
--- a/framework/Web/Javascripts/js/debug/prado.js
+++ b/framework/Web/Javascripts/js/debug/prado.js
@@ -3735,12 +3735,23 @@ Prado.Element =
extractContent : function(text, boundary)
{
- var f = RegExp('(<!--'+boundary+'-->)([\\s\\S\\w\\W]*)(<!--//'+boundary+'-->)',"m");
+ var tagStart = '<!--'+boundary+'-->';
+ var tagEnd = '<!--//'+boundary+'-->';
+ var start = text.indexOf(tagStart);
+ if(start > -1)
+ {
+ start += tagStart.length;
+ var end = text.indexOf(tagEnd,start);
+ if(end > -1)
+ return text.substring(start,end);
+ }
+ return null;
+ /*var f = RegExp('(?:<!--'+boundary+'-->)((?:.|\n|\r)+?)(?:<!--//'+boundary+'-->)',"m");
var result = text.match(f);
if(result && result.length >= 2)
- return result[2];
+ return result[1];
else
- return null;
+ return null;*/
},
evaluateScript : function(content)
@@ -4447,7 +4458,7 @@ Prado.WebUI.PostBackControl.prototype =
{
if(typeof(this.element.onclick)=="function")
{
- this._elementOnClick = this.element.onclick.bind(this.element);;
+ this._elementOnClick = this.element.onclick.bind(this.element);
this.element.onclick = null;
}
Event.observe(this.element, "click", this.elementClicked.bindEvent(this,options));
@@ -4716,8 +4727,8 @@ Prado.WebUI.TRadioButtonList = Base.extend(
}
});
-Prado.WebUI.TRatingList = Class.create();
-Prado.WebUI.TRatingList.prototype =
+Prado.WebUI.TRatingList = Class.create();
+Prado.WebUI.TRatingList.prototype =
{
selectedIndex : -1,
@@ -4732,48 +4743,49 @@ Prado.WebUI.TRatingList.prototype =
Event.observe(this.radios[i].parentNode, "mouseover", this.hover.bindEvent(this,i));
Event.observe(this.radios[i].parentNode, "mouseout", this.recover.bindEvent(this,i));
Event.observe(this.radios[i].parentNode, "click", this.click.bindEvent(this, i));
- }
+ }
this.caption = CAPTION();
this.element.appendChild(this.caption);
this.selectedIndex = options.selectedIndex;
this.setRating(this.selectedIndex);
},
-
+
hover : function(ev,index)
{
for(var i = 0; i<this.radios.length; i++)
this.radios[i].parentNode.className = (i<=index) ? "rating_hover" : "";
this.setCaption(index);
},
-
+
recover : function(ev,index)
{
for(var i = 0; i<=index; i++)
Element.removeClassName(this.radios[i].parentNode, "rating_hover");
this.setRating(this.selectedIndex);
},
-
+
click : function(ev, index)
{
for(var i = 0; i<this.radios.length; i++)
this.radios[i].checked = (i == index);
this.selectedIndex = index;
this.setRating(index);
- if(isFunction(this.options.onChange))
- this.options.onChange(this,index);
+ if(typeof(this.options.onChange)=="function")
+ this.options.onChange(this,index);
},
-
+
setRating: function(index)
{
for(var i = 0; i<=index; i++)
this.radios[i].parentNode.className = "rating_selected";
this.setCaption(index);
},
-
+
setCaption : function(index)
{
- this.caption.innerHTML = index > -1 ?
- this.radios[index].value : this.options.caption;
+ this.caption.innerHTML = index > -1 ?
+ this.radios[index].value : this.options.caption;
}
-}
+};
+
diff --git a/framework/Web/Javascripts/js/debug/validator.js b/framework/Web/Javascripts/js/debug/validator.js
index 7d17eeda..6fc06903 100644
--- a/framework/Web/Javascripts/js/debug/validator.js
+++ b/framework/Web/Javascripts/js/debug/validator.js
@@ -1223,9 +1223,9 @@ Prado.WebUI.TRangeValidator = Class.extend(Prado.WebUI.TBaseValidator,
var valid = true;
if(min != null)
- valid = valid && value >= min;
+ valid = valid && (this.options.StrictComparison ? value > min : value >= min);
if(max != null)
- valid = valid && value <= max;
+ valid = valid && (this.options.StrictComparison ? value < max : value <= max);
return valid;
}
});