From 80d7b66eef5495c13f8b67ffefc8d5f172f25a15 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Tue, 29 May 2012 09:16:58 +0000 Subject: Removed ajax rendering from TClientScript since it was a not-backward compatible change. Added a TActiveClientScript control instead --- framework/Web/UI/WebControls/TClientScript.php | 41 ++++---------------------- 1 file changed, 5 insertions(+), 36 deletions(-) (limited to 'framework/Web/UI/WebControls/TClientScript.php') diff --git a/framework/Web/UI/WebControls/TClientScript.php b/framework/Web/UI/WebControls/TClientScript.php index 0679aa74..9e2f247d 100644 --- a/framework/Web/UI/WebControls/TClientScript.php +++ b/framework/Web/UI/WebControls/TClientScript.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2011 PradoSoft + * @copyright Copyright © 2005-2011 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.UI.WebControls @@ -31,20 +31,6 @@ * Contents within TClientScript will be treated as javascript code and will be * rendered in place. * - * Since Prado 3.2, TClientScript gained the ability to render itself on ajax - * callbacks. This means that every variable or function declared in javascript - * code will be available to the page. - * - * Beware that when rendered on normal (postback) or ajax callbacks, some - * javascript code won't behave in the same way. - * When rendered as part of a normal/postback response, scripts will execute instantly - * where they are in the page and in a synchronous fashion. - * Instead, when they are rendered as part of a callback response, - * they will be executed when all DOM modifications are complete and any dynamic - * script file includes are loaded, out-of-band and practically all blocks at once, - * regardless of where they actually occour in the original template/markup code. - * This can potentially hurt compatibility and graceful fallback. - * * @author Wei Zhuo * @version $Id$ * @package System.Web.UI.WebControls @@ -125,17 +111,7 @@ class TClientScript extends TControl protected function renderCustomScriptFile($writer) { if(($scriptUrl = $this->getScriptUrl())!=='') - { - if($this->getPage()->getIsCallback()) - { - $cs = $this->getPage()->getClientScript(); - $uniqueid=$this->ClientID.'_custom'; - if(!$cs->isScriptFileRegistered($uniqueid)) - $cs->registerScriptFile($uniqueid, $scriptUrl); - } else { - $writer->write("\n"); - } - } + $writer->write("\n"); } /** @@ -146,16 +122,9 @@ class TClientScript extends TControl { if($this->getHasControls()) { - if($this->getPage()->getIsCallback()) - { - $extWriter= $this->getPage()->getResponse()->createHtmlWriter(); - $this->renderChildren($extWriter); - $this->getPage()->getCallbackClient()->appendScriptBlock($extWriter); - } else { - $writer->write("\n"); - } + $writer->write("\n"); } } } -- cgit v1.2.3