From 615c15d9a2001c58b2030c23b44f655b57dd21d0 Mon Sep 17 00:00:00 2001
From: "ctrlaltca@gmail.com" <>
Date: Fri, 21 Oct 2011 14:00:46 +0000
Subject: removed TClientScriptLoader missed in r3039. Updated documentation
---
.../protected/pages/Advanced/Scripts3.page | 66 ++++------------------
.../protected/pages/Advanced/es/Scripts3.page | 52 -----------------
.../protected/pages/Advanced/id/Scripts3.page | 49 ----------------
3 files changed, 11 insertions(+), 156 deletions(-)
(limited to 'demos/quickstart')
diff --git a/demos/quickstart/protected/pages/Advanced/Scripts3.page b/demos/quickstart/protected/pages/Advanced/Scripts3.page
index 416df4f8..3f41abe1 100644
--- a/demos/quickstart/protected/pages/Advanced/Scripts3.page
+++ b/demos/quickstart/protected/pages/Advanced/Scripts3.page
@@ -24,8 +24,17 @@ The available packaged libraries included in Prado are
ajax : ajax and callback related based on Prototype
validator : validation
logger : javascript logger and object browser
- datepicker : datepicker
- colorpicker : colorpicker
+ datepicker : datepicker control
+ colorpicker : colorpicker control
+ dragdrop : basic support for "drag and drop" control
+ dragdropextra : extra support for "drag and drop" controls
+ slider : slider control
+ keyboard : software keyboard control
+ tabpanel : tabpanel control
+ activedatepicker : ajax version of the datepicker control
+ activefileupload : ajax version of the fileupload control
+ accordion : accordion control
+ htmlarea : tinymce control
The dependencies for each library are automatically resolved. Components
@@ -35,57 +44,4 @@ and its dependencies will be automatically included on the page.
See TClientScript for options of adding
your custom Javascript code to the page.
-
-Publishing Javascript Libraries as Assets
-
-Use TClientScriptLoader to publish and combine multiple existing javascript files (e.g. javascript libraries distributed with Prado or otherwise)
-as packages.
For greater control on what and when to publish, use the
-registerJavascriptPackages($base, $packages, $debug=null, $gzip=true)
-method in the TClientScriptManager class, which an instance can be obtained
-using $this->getPage()->getClientScript() or its equivalents.
-For example, if multiple controls will use the same set of javascript libraries,
-write a class to handle the registration of packages required by those controls.
-
-
-class MyJavascriptLib extends TComponent
-{
- private $_packages=array(); //keep track of all registrations
-
- private $_manager;
-
- protected function __construct(TPage $owner)
- {
- $this->_manager = $owner->getClientScript();
- $owner->onPreRenderComplete = array($this, 'registerScriptLoader');
- }
-
- public static function registerPackage(TControl $control, $name)
- {
- static $instance;
- if($instance===null)
- $instance=new self($control->getPage());
- $instance->_packages[$name]=true;
- }
-
- protected function registerScriptLoader()
- {
- $dir = dirname(__FILE__).'/myscripts'; //contains my javascript files
- $scripts = array_keys($this->_packages);
- $url = $this->_manager->registerJavascriptPackages($dir, $scripts);
- $this->_manager->registerScriptFile($url,$url);
- }
-}
-
-// example control class using the javascript packages
-class TestComp extends TControl
-{
- public function onPreRender($param)
- {
- parent::onPreRender($param);
- MyJavascriptLib::registerPackage($this,'package1');
- }
-}
-
-
-
diff --git a/demos/quickstart/protected/pages/Advanced/es/Scripts3.page b/demos/quickstart/protected/pages/Advanced/es/Scripts3.page
index 416df4f8..37885abb 100644
--- a/demos/quickstart/protected/pages/Advanced/es/Scripts3.page
+++ b/demos/quickstart/protected/pages/Advanced/es/Scripts3.page
@@ -36,56 +36,4 @@ and its dependencies will be automatically included on the page.
See TClientScript for options of adding
your custom Javascript code to the page.
-Publishing Javascript Libraries as Assets
-
-Use TClientScriptLoader to publish and combine multiple existing javascript files (e.g. javascript libraries distributed with Prado or otherwise)
-as packages.
For greater control on what and when to publish, use the
-registerJavascriptPackages($base, $packages, $debug=null, $gzip=true)
-method in the TClientScriptManager class, which an instance can be obtained
-using $this->getPage()->getClientScript() or its equivalents.
-For example, if multiple controls will use the same set of javascript libraries,
-write a class to handle the registration of packages required by those controls.
-
-
-class MyJavascriptLib extends TComponent
-{
- private $_packages=array(); //keep track of all registrations
-
- private $_manager;
-
- protected function __construct(TPage $owner)
- {
- $this->_manager = $owner->getClientScript();
- $owner->onPreRenderComplete = array($this, 'registerScriptLoader');
- }
-
- public static function registerPackage(TControl $control, $name)
- {
- static $instance;
- if($instance===null)
- $instance=new self($control->getPage());
- $instance->_packages[$name]=true;
- }
-
- protected function registerScriptLoader()
- {
- $dir = dirname(__FILE__).'/myscripts'; //contains my javascript files
- $scripts = array_keys($this->_packages);
- $url = $this->_manager->registerJavascriptPackages($dir, $scripts);
- $this->_manager->registerScriptFile($url,$url);
- }
-}
-
-// example control class using the javascript packages
-class TestComp extends TControl
-{
- public function onPreRender($param)
- {
- parent::onPreRender($param);
- MyJavascriptLib::registerPackage($this,'package1');
- }
-}
-
-
-
diff --git a/demos/quickstart/protected/pages/Advanced/id/Scripts3.page b/demos/quickstart/protected/pages/Advanced/id/Scripts3.page
index d2ce269b..b313e7fc 100644
--- a/demos/quickstart/protected/pages/Advanced/id/Scripts3.page
+++ b/demos/quickstart/protected/pages/Advanced/id/Scripts3.page
@@ -32,53 +32,4 @@ Sebagai contoh, jika Anda menambah komponen TDatePicker pada halaman, <
Lihat TClientScript untuk opsi penambahan kode Javascript kustom Anda ke halaman.
-Menerbitkan Librari Javascript sebagai Assets
-
-Gunakan TClientScriptLoader untuk menerbitkan dan menggabung file javascript yang sudah ada (misalnya librari javascript yang didistribusikan dengan Prado atau sebaliknya) sebagai paket.
Untuk kontrol yang lebih besar pada apa dan kapan untuk menerbitkan, gunakan metode
-registerJavascriptPackages($base, $packages, $debug=null, $gzip=true)
-dalam kelas TClientScriptManager, yang turunannya bisa diperoleh dengan $this->getPage()->getClientScript() atau persamaannya.
-Sebagai contoh, jika multipel kontrol akan memakai set librari javascript yang sama, tulis sebuah kelas untuk menangani registrasi paket yang diperlukan oleh kontrol tersebut.
-
-
-class MyJavascriptLib extends TComponent
-{
- private $_packages=array(); //perlihara seluruh registrasi
-
- private $_manager;
-
- protected function __construct(TPage $owner)
- {
- $this->_manager = $owner->getClientScript();
- $owner->onPreRenderComplete = array($this, 'registerScriptLoader');
- }
-
- public static function registerPackage(TControl $control, $name)
- {
- static $instance;
- if($instance===null)
- $instance=new self($control->getPage());
- $instance->_packages[$name]=true;
- }
-
- protected function registerScriptLoader()
- {
- $dir = dirname(__FILE__).'/myscripts'; //berisi file javascript
- $scripts = array_keys($this->_packages);
- $url = $this->_manager->registerJavascriptPackages($dir, $scripts);
- $this->_manager->registerScriptFile($url,$url);
- }
-}
-
-// contoh kelas kontrol menggunakan paket javascript
-class TestComp extends TControl
-{
- public function onPreRender($param)
- {
- parent::onPreRender($param);
- MyJavascriptLib::registerPackage($this,'package1');
- }
-}
-
-
-
--
cgit v1.2.3