From 3819df8f62cc6893873954c80a0d42a06f8e3d16 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sat, 19 Oct 2013 19:16:51 +0200 Subject: Started work on ajax --- framework/Web/Javascripts/packages.php | 7 +- .../source/prado/activecontrols/activecontrols3.js | 63 +- .../source/prado/activecontrols/ajax3.js | 1751 ++++++++++---------- .../source/prado/activecontrols/json2.js | 479 ------ .../Javascripts/source/prado/controls/controls.js | 2 +- framework/Web/Javascripts/source/prado/prado.js | 205 ++- .../UI/ActiveControls/TCallbackClientScript.php | 200 +-- framework/Web/UI/TClientScriptManager.php | 3 - 8 files changed, 1124 insertions(+), 1586 deletions(-) delete mode 100644 framework/Web/Javascripts/source/prado/activecontrols/json2.js diff --git a/framework/Web/Javascripts/packages.php b/framework/Web/Javascripts/packages.php index ec918402..5ddb9301 100644 --- a/framework/Web/Javascripts/packages.php +++ b/framework/Web/Javascripts/packages.php @@ -39,8 +39,6 @@ $packages = array( ), 'ajax' => array( - SCRIPTACULOUS_DIR.'/controls.js', - 'prado/activecontrols/json2.js', 'prado/activecontrols/ajax3.js', 'prado/activecontrols/activecontrols3.js', ), @@ -109,16 +107,17 @@ $packages = array( //package names and their dependencies $dependencies = array( - 'prototype' => array('prototype'), + //'prototype' => array('prototype'), 'jquery' => array('jquery'), 'prado' => array('jquery', 'prado'), 'validator' => array('jquery', 'prado', 'validator'), 'tabpanel' => array('jquery', 'prado', 'tabpanel'), + 'ajax' => array('jquery', 'prado', 'ajax'), + 'effects' => array('prototype', 'prado', 'effects'), 'logger' => array('prototype', 'prado', 'logger'), 'datepicker' => array('prototype', 'prado', 'datepicker'), 'colorpicker' => array('prototype', 'prado', 'colorpicker'), - 'ajax' => array('prototype', 'prado', 'effects', 'ajax'), 'dragdrop' => array('prototype', 'prado', 'effects', 'ajax', 'dragdrop'), 'slider' => array('prototype', 'prado', 'slider'), 'keyboard' => array('prototype', 'prado', 'keyboard'), diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js index 1b94ef7c..a586c4d9 100644 --- a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js +++ b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js @@ -1,63 +1,63 @@ /** * Generic postback control. */ -Prado.WebUI.CallbackControl = Class.extend(Prado.WebUI.PostBackControl, +Prado.WebUI.CallbackControl = jQuery.klass(Prado.WebUI.PostBackControl, { - onPostBack : function(event, options) + onPostBack : function(options, event) { var request = new Prado.CallbackRequest(options.EventTarget, options); request.dispatch(); - Event.stop(event); + event.preventDefault(); } }); /** * TActiveButton control. */ -Prado.WebUI.TActiveButton = Class.extend(Prado.WebUI.CallbackControl); +Prado.WebUI.TActiveButton = jQuery.klass(Prado.WebUI.CallbackControl); /** * TActiveLinkButton control. */ -Prado.WebUI.TActiveLinkButton = Class.extend(Prado.WebUI.CallbackControl); +Prado.WebUI.TActiveLinkButton = jQuery.klass(Prado.WebUI.CallbackControl); -Prado.WebUI.TActiveImageButton = Class.extend(Prado.WebUI.TImageButton, +Prado.WebUI.TActiveImageButton = jQuery.klass(Prado.WebUI.TImageButton, { - onPostBack : function(event, options) + onPostBack : function(options, event) { this.addXYInput(event,options); var request = new Prado.CallbackRequest(options.EventTarget, options); request.dispatch(); - Event.stop(event); + event.stopPropagation(); this.removeXYInput(event,options); } }); /** * Active check box. */ -Prado.WebUI.TActiveCheckBox = Class.extend(Prado.WebUI.CallbackControl, +Prado.WebUI.TActiveCheckBox = jQuery.klass(Prado.WebUI.CallbackControl, { - onPostBack : function(event, options) + onPostBack : function(options, event) { var request = new Prado.CallbackRequest(options.EventTarget, options); if(request.dispatch()==false) - Event.stop(event); + event.stopPropagation(); } }); /** * TActiveRadioButton control. */ -Prado.WebUI.TActiveRadioButton = Class.extend(Prado.WebUI.TActiveCheckBox); +Prado.WebUI.TActiveRadioButton = jQuery.klass(Prado.WebUI.TActiveCheckBox); -Prado.WebUI.TActiveCheckBoxList = Base.extend( +Prado.WebUI.TActiveCheckBoxList = jQuery.extend( { constructor : function(options) { - Prado.Registry.set(options.ListID, this); + Prado.Registry[options.ListID] = this; for(var i = 0; i