summaryrefslogtreecommitdiff
path: root/lib/prado/framework/Web/Javascripts
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-04-07 16:09:16 +0200
committeremkael <emkael@tlen.pl>2016-04-07 16:09:16 +0200
commitd42b25cbf6d3f1e51cb2a3149f1ff54cc5474bc9 (patch)
tree96b734357392d6094cfc5f8284ad8f2578b96b7f /lib/prado/framework/Web/Javascripts
parentac6c2b9c4f787dfdfa00547f764c77d80dad14c0 (diff)
* Prado upgrade (to 3.3.r6b8e6601752b21a8a96c385a5529bbec7bb2b408)
Diffstat (limited to 'lib/prado/framework/Web/Javascripts')
-rw-r--r--lib/prado/framework/Web/Javascripts/TJavaScript.php2
-rw-r--r--lib/prado/framework/Web/Javascripts/css-packages.php93
-rw-r--r--lib/prado/framework/Web/Javascripts/packages.php2
-rw-r--r--lib/prado/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js4
-rwxr-xr-xlib/prado/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js2
-rw-r--r--lib/prado/framework/Web/Javascripts/source/prado/prado.js6
-rw-r--r--lib/prado/framework/Web/Javascripts/source/prado/validator/validation3.js84
7 files changed, 187 insertions, 6 deletions
diff --git a/lib/prado/framework/Web/Javascripts/TJavaScript.php b/lib/prado/framework/Web/Javascripts/TJavaScript.php
index b92b0c3..bd0f2be 100644
--- a/lib/prado/framework/Web/Javascripts/TJavaScript.php
+++ b/lib/prado/framework/Web/Javascripts/TJavaScript.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @link https://github.com/pradosoft/prado
- * @copyright Copyright &copy; 2005-2015 The PRADO Group
+ * @copyright Copyright &copy; 2005-2016 The PRADO Group
* @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
* @package System.Web.Javascripts
*/
diff --git a/lib/prado/framework/Web/Javascripts/css-packages.php b/lib/prado/framework/Web/Javascripts/css-packages.php
new file mode 100644
index 0000000..8bc5fe5
--- /dev/null
+++ b/lib/prado/framework/Web/Javascripts/css-packages.php
@@ -0,0 +1,93 @@
+<?php
+
+//$Id: packages.php 3319 2013-09-08 20:59:44Z ctrlaltca $
+
+// To make future upgrades easier
+if (!defined('JQUERY_DIR')) define ('JQUERY_DIR', 'jquery');
+if (!defined('BOOTSTRAP_DIR')) define ('BOOTSTRAP_DIR', 'bootstrap3');
+
+//package names and its contents (files relative to the current directory)
+$packages = array(
+ 'jquery-ui' => array(
+ JQUERY_DIR.'/css/base/jquery-ui.css',
+ ),
+ 'jquery.ui.accordion' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.accordion.css',
+ ),
+ 'jquery.ui.autocomplete' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.autocomplete.css',
+ ),
+ 'jquery.ui.button' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.button.css',
+ ),
+ 'jquery.ui.core' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.core.css',
+ ),
+ 'jquery.ui.datepicker' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.datepicker.css',
+ ),
+ 'jquery.ui.dialog' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.dialog.css',
+ ),
+ 'jquery.ui.menu' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.menu.css',
+ ),
+ 'jquery.ui.progressbar' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.progressbar.css',
+ ),
+ 'jquery.ui.resizable' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.resizable.css',
+ ),
+ 'jquery.ui.selectable' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.selectable.css',
+ ),
+ 'jquery.ui.slider' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.slider.css',
+ ),
+ 'jquery.ui.spinner' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.spinner.css',
+ ),
+ 'jquery.ui.tabs' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.tabs.css',
+ ),
+ 'jquery.ui.theme' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.theme.css',
+ ),
+ 'jquery.ui.tooltip' => array(
+ JQUERY_DIR.'/css/base/jquery.ui.tooltip.css',
+ ),
+
+ // bootstrap
+ 'bootstrap' => array(
+ BOOTSTRAP_DIR.'/css/bootstrap.css',
+ ),
+ 'bootstrap-theme' => array(
+ BOOTSTRAP_DIR.'/css/bootstrap-theme.css',
+ ),
+);
+
+
+//package names and their dependencies
+$dependencies = array(
+ 'jquery-ui' => array('jquery-ui'),
+ 'jquery.ui.accordion' => array('jquery.ui.core', 'jquery.ui.accordion'),
+ 'jquery.ui.autocomplete' => array('jquery.ui.core', 'jquery.ui.autocomplete'),
+ 'jquery.ui.button' => array('jquery.ui.core', 'jquery.ui.button'),
+ 'jquery.ui.core' => array('jquery.ui.core'),
+ 'jquery.ui.datepicker' => array('jquery.ui.core', 'jquery.ui.datepicker'),
+ 'jquery.ui.dialog' => array('jquery.ui.core', 'jquery.ui.dialog'),
+ 'jquery.ui.menu' => array('jquery.ui.core', 'jquery.ui.menu'),
+ 'jquery.ui.progressbar' => array('jquery.ui.core', 'jquery.ui.progressbar'),
+ 'jquery.ui.resizable' => array('jquery.ui.core', 'jquery.ui.resizable'),
+ 'jquery.ui.selectable' => array('jquery.ui.core', 'jquery.ui.selectable'),
+ 'jquery.ui.slider' => array('jquery.ui.core', 'jquery.ui.slider'),
+ 'jquery.ui.spinner' => array('jquery.ui.core', 'jquery.ui.spinner'),
+ 'jquery.ui.tabs' => array('jquery.ui.core', 'jquery.ui.tabs'),
+ 'jquery.ui.theme' => array('jquery.ui.core', 'jquery.ui.theme'),
+ 'jquery.ui.tooltip' => array('jquery.ui.core', 'jquery.ui.tooltip'),
+ 'bootstrap' => array('bootstrap'),
+ 'bootstrap-theme' => array('bootstrap', 'bootstrap-theme'),
+);
+
+return array($packages, $dependencies);
+
diff --git a/lib/prado/framework/Web/Javascripts/packages.php b/lib/prado/framework/Web/Javascripts/packages.php
index fe16d97..68b4822 100644
--- a/lib/prado/framework/Web/Javascripts/packages.php
+++ b/lib/prado/framework/Web/Javascripts/packages.php
@@ -95,7 +95,7 @@ $packages = array(
//bootstrap
'bootstrap' => array(
- BOOTSTRAP_DIR.'/js/bootstrap.js',
+ BOOTSTRAP_DIR.'/js/bootstrap.js',
),
'dragdrop'=>array(
diff --git a/lib/prado/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js b/lib/prado/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
index e0e67ce..1115c3b 100644
--- a/lib/prado/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
+++ b/lib/prado/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
@@ -270,6 +270,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack,
// go!
this.options.data = this.getParameters();
this.options.url = this.getCallbackUrl();
+ this.options.timeout = this.getRequestTimeOut();
this.request = Prado.CallbackRequestManager.ajax(this.options);
},
@@ -449,8 +450,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack,
},
/**
- * Updates the page state. It will update only if EnablePageStateUpdate and
- * HasPriority options are both true.
+ * Updates the page state. It will update only if EnablePageStateUpdate is true.
*/
updatePageState : function(request, datain)
{
diff --git a/lib/prado/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/lib/prado/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
index 1599827..04c02ac 100755
--- a/lib/prado/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
+++ b/lib/prado/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
@@ -20,6 +20,8 @@ Prado.WebUI.TActiveFileUpload = jQuery.klass(Prado.WebUI.Control,
},
fileChanged : function(){
+ // ie11 fix
+ if(this.input.value=='') return;
// show the upload indicator, and hide the complete and error indicators (if they areSn't already).
this.flag.value = '1';
this.complete.style.display = 'none';
diff --git a/lib/prado/framework/Web/Javascripts/source/prado/prado.js b/lib/prado/framework/Web/Javascripts/source/prado/prado.js
index e100dc7..0a1c485 100644
--- a/lib/prado/framework/Web/Javascripts/source/prado/prado.js
+++ b/lib/prado/framework/Web/Javascripts/source/prado/prado.js
@@ -446,7 +446,11 @@ Prado.Element =
focus : function(element)
{
- jQuery("#"+element).focus();
+ jQuery(document).ajaxStop(function () {
+ setTimeout(function(){
+ jQuery("#"+element).focus();
+ }, 100);
+ });
},
/**
diff --git a/lib/prado/framework/Web/Javascripts/source/prado/validator/validation3.js b/lib/prado/framework/Web/Javascripts/source/prado/validator/validation3.js
index 98be95d..6dcf02e 100644
--- a/lib/prado/framework/Web/Javascripts/source/prado/validator/validation3.js
+++ b/lib/prado/framework/Web/Javascripts/source/prado/validator/validation3.js
@@ -1239,6 +1239,8 @@ Prado.WebUI.TBaseValidator = jQuery.klass(Prado.WebUI.Control,
case 'TActiveCheckBox':
case 'TActiveRadioButton':
return value;
+ case 'TReCaptcha2':
+ return document.getElementById(this.options.ResponseFieldName).value;
default:
if(this.isListControlType())
return value;
@@ -1603,7 +1605,7 @@ Prado.WebUI.TActiveCustomValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
this.options.OnValidate(this, invoker);
}
- return this.isValid;
+ return true;
},
/**
@@ -1994,3 +1996,83 @@ Prado.WebUI.TReCaptchaValidator = jQuery.klass(Prado.WebUI.TBaseValidator,
}
});
+/**
+ * Registry for TReCaptcha2 components
+ */
+Prado.WebUI.TReCaptcha2Instances = {};
+/**
+ * Render callback; called by google's js when loaded
+ */
+TReCaptcha2_onloadCallback = function()
+{
+ jQuery.each(Prado.WebUI.TReCaptcha2Instances, function(index, item) {
+ item.build();
+ });
+}
+
+/**
+ * TReCaptcha2 client-side control.
+ *
+ * @class Prado.WebUI.TReCaptcha2
+ * @extends Prado.WebUI.Control
+ */
+Prado.WebUI.TReCaptcha2 = jQuery.klass(Prado.WebUI.Control,
+{
+ onInit: function(options)
+ {
+ for (key in options) { this[key] = options[key]; }
+ this.options['callback'] = jQuery.proxy(this.callback,this);
+ this.options['expired-callback'] = jQuery.proxy(this.callbackExpired,this);
+
+ Prado.WebUI.TReCaptcha2Instances[this.element.id] = this;
+ },
+ build: function()
+ {
+ if (grecaptcha !== undefined) this.widgetId = grecaptcha.render(this.element, this.options);
+ },
+ callback: function(response)
+ {
+ var responseField = jQuery('#' + this.ID + ' textarea').attr('id');
+ var params = {
+ widgetId: this.widgetId,
+ response: response,
+ responseField: responseField,
+ onCallback: this.onCallback
+ };
+ var request = new Prado.CallbackRequest(this.EventTarget,this);
+ request.setCallbackParameter(params);
+ request.dispatch();
+ },
+ callbackExpired: function()
+ {
+ var responseField = jQuery('#' + this.ID + ' textarea').attr('id');
+ var params = {
+ responseField: responseField,
+ onCallbackExpired: this.onCallbackExpired
+ };
+ var request = new Prado.CallbackRequest(this.EventTarget,this);
+ request.setCallbackParameter(params);
+ request.dispatch();
+ }
+});
+
+/**
+ * TReCaptcha2Validator client-side control.
+ *
+ * @class Prado.WebUI.TReCaptcha2Validator
+ * @extends Prado.WebUI.TBaseValidator
+ */
+Prado.WebUI.TReCaptcha2Validator = jQuery.klass(Prado.WebUI.TBaseValidator,
+{
+ /**
+ * Evaluate validation state
+ * @function {boolean} ?
+ * @return True if the captcha has validate, False otherwise.
+ */
+ evaluateIsValid : function()
+ {
+ var a = this.getValidationValue();
+ var b = this.trim(this.options.InitialValue);
+ return(a != b);
+ }
+}); \ No newline at end of file