From 255db529c49ae00f5e8defb14c77461582edfd39 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Tue, 24 Jul 2012 16:13:10 +0000 Subject: removed TClientScriptLoader documentation since it doesn't exists anymore in prado 3.2 --- .../pages/Controls/ClientScriptLoader.page | 122 --------------------- .../protected/pages/Controls/Standard.page | 4 - .../pages/Controls/id/ClientScriptLoader.page | 93 ---------------- .../protected/pages/Controls/id/Standard.page | 4 - 4 files changed, 223 deletions(-) delete mode 100644 demos/quickstart/protected/pages/Controls/ClientScriptLoader.page delete mode 100644 demos/quickstart/protected/pages/Controls/id/ClientScriptLoader.page (limited to 'demos') diff --git a/demos/quickstart/protected/pages/Controls/ClientScriptLoader.page b/demos/quickstart/protected/pages/Controls/ClientScriptLoader.page deleted file mode 100644 index bad47959..00000000 --- a/demos/quickstart/protected/pages/Controls/ClientScriptLoader.page +++ /dev/null @@ -1,122 +0,0 @@ - - -

TClientScriptLoader

- - - - - -

-The TClientScriptLoader publish a collection of javascript files as assets. -For example, suppose we have a directory name "mylib" in -the protected/pages directory of our application.

- -assets/ -protected/ - pages/ - mylib/ - file1.js - file2.js - file3.js - file4.js - packages.php - - -

The PackagePath property can be an existing asset directory -or a namespace path to the directory containing javascript files. -For example, to publish the javascript files in the mylib -directory, we can specify the PackagePath as follows. -The first tag TClientScriptLoader relies on the asset template tag and -assumes that the page template containing the TClientScriptLoader tag instance -is in the protected/pages directory. -The second TClientScriptLoader tag uses the namespace notation to -specify the path. -

- - -<com:TClientScriptLoader PackagePath=<%~ mylib %> /> -<com:TClientScriptLoader PackagePath="Application.pages.mylib" /> - - -

-When the files in the PackagePath are published as assets, a script loader - php file "clientscripts.php" is automatically copied - to that asset directory. - The script loader, combines multiple javascript files and serve up as gzip if possible. -

-

Grouping Javascript Files

-

-Allowable scripts and script dependencies can be grouped by using a "packages.php" file -with the following format. This "packages.php" is optional, if absent the file names -without ".js" extension are used. The "packages.php" must be in the directory given by -PackagePath. -

- - -<?php - $packages = array( - 'package1' => array('file1.js', 'file2.js'), - 'package2' => array('file3.js', 'file4.js')); - - $deps = array( - 'package1' => array('package1'), - 'package2' => array('package1', 'package2')); //package2 requires package1 first. - - return array($packages,$deps); //must return $packages and $deps in an array -?> - - -

The first element of the array returned by the packages.php should -contain an array of javascripts files relative to the packages.php -that corresponds to a particular grouping. For example, in the above packages.php, -the grouping 'package1' combines two javascript files, namely, 'file1.js' -and 'file2.js'. -

- -

The second element of the array returned by the packages.php should -contain an array of grouping dependencies ordered in the way that the groups should be combined. -For example, grouping 'package1' only depends on the 'package1' grouping files -(i.e. 'file1.js' and 'file2.js'). While 'package2' depends -on both 'package1' and 'package2' groupings. That is, 'package2' -will combine, in order, 'file1.js', 'file2.js', 'file3.js', and 'file4.js'. -

- -

Loading Javascript Packages

- -

To load a particular javascript file or package, set the PackageScripts -property with value 'package1' to load the 'package1' scripts. -A maximum of 25 packages separated by commas is allowed. -Dependencies of the packages are automatically resolved by the script loader php file. -

- - -<com:TClientScriptLoader PackagePath=<%~ mylib %> PackageScripts="package2" /> -<script type="text/javascript"> - //javascript code utilizing javascript code loaded in 'package2' above -</script> - - -

Each <com:TClientScriptLoader> generates an HTML <script> -element to load the required javascript files.

- -

Removing Javascript Comments

-

The DebugMode property when false -removes comments and white spaces from the published javascript files. If -the DebugMode property is not set, the debug mode is determined from the -application mode. -

-
Note: -If the DebugMode is false either explicitly or when the application mode is non-debug, -then cache headers are also sent to inform the browser and proxies to cache the file. -Moreover, the post-processed (comments removed and zipped) are saved in the assets -directory for the next requests. That is, in non-debug mode the scripts are cached -in the assets directory until they are deleted. -
- -

Compressing Javascript with GZip

-

-The EnableGzip property (default is true) enables the -published javascripts to be served as zipped if the browser and php server allows it. -

- -
diff --git a/demos/quickstart/protected/pages/Controls/Standard.page b/demos/quickstart/protected/pages/Controls/Standard.page index 9c805188..188cdd19 100644 --- a/demos/quickstart/protected/pages/Controls/Standard.page +++ b/demos/quickstart/protected/pages/Controls/Standard.page @@ -23,10 +23,6 @@ TClientScript adds javascript code to the page. -
  • - TClientScriptLoader loads custom javascript libraries. -
  • -
  • TColorPicker represents an input field taking color values via a color dialog.
  • diff --git a/demos/quickstart/protected/pages/Controls/id/ClientScriptLoader.page b/demos/quickstart/protected/pages/Controls/id/ClientScriptLoader.page deleted file mode 100644 index e722e66d..00000000 --- a/demos/quickstart/protected/pages/Controls/id/ClientScriptLoader.page +++ /dev/null @@ -1,93 +0,0 @@ - - -

    TClientScriptLoader

    - - - - - -

    -TClientScriptLoader mempublikasikan koleksi file javascript sebagai assets. Contohnya, anggap kita mempunyai direktori bernama "mylib" dalam direktori protected/pages pada aplikasi kita.

    - -assets/ -protected/ - pages/ - mylib/ - file1.js - file2.js - file3.js - file4.js - packages.php - - -

    Properti PackagePath bisa berupa direktori asset yang sudah ada atau path namespace ke direktori yang berisi file javascript. Sebagai contoh, untuk mempublikasikan file javascript dalam direktori mylib, kita dapat menetapkan PackagePath sebagai berikut. -Tag pertama TClientScriptLoader tergantung pada tag template asset dan menganggap bahwa template halaman berisi turunan tag TClientScriptLoader ada dalam direktori protected/pages. -Tag kedua TClientScriptLoader menggunakan notasi namespace ke untuk menetapkan path. -

    - - -<com:TClientScriptLoader PackagePath=<%~ mylib %> /> -<com:TClientScriptLoader PackagePath="Application.pages.mylib" /> - - -

    -Ketika file dalam PackagePath dipublikasikan sebagai asset, pengambil naskah file php "clientscripts.php" secara otomatis di-copiy ke direktori asset tersebut. Pengambil naskah, menggabungkan file javascript dan bertindak sebagai gzip jika memungkinkan. -

    -

    Mengelompokan File Javascript

    -

    -Naskah yang dibolehkan dan naskah ketergantungan bisa dikelompokan dengan menggunakan file "packages.php" dengan format berikut. "packages.php" ini adalah opsional, jika tidak ada nama file tanpa ekstensi ".js" yang dipakai. "packages.php" harus berada dalam direktori yang diberikan oleh PackagePath. -

    - - -<?php - $packages = array( - 'package1' => array('file1.js', 'file2.js'), - 'package2' => array('file3.js', 'file4.js')); - - $deps = array( - 'package1' => array('package1'), - 'package2' => array('package1', 'package2')); //package2 memerlukan package1 pertama. - - return array($packages,$deps); //harus mengembalikan $packages dan $deps dalam array ?> - - -

    Elemen pertama dari array yang dihasilkan oleh packages.php harus berisi sebuah array file javascripts relatif ke packages.php yang mengaitkan pengelompokan tertentu. Sebagai contoh, dalam packages.php di atas, pengelompokan 'package1' menggabungkan dua file javascript, yaitu 'file1.js' -dan 'file2.js'. -

    - -

    Elemen kedua dari array yang dihasilkan oleh packages.php harus berisi array pengelompokan ketergantungan yang diurut dalam cara di mana grup harus digabungkan. Sebagai contoh, mengelompokan -'package1' hanya bergantung pada file pengelompokan'package1' -(misalnya 'file1.js' dan 'file2.js'). Sementara package2' tergantung pada pepngelompokan 'package1' dam 'package2'. Yakni 'package2' akan menggabung dengan urutan -'file1.js', 'file2.js', 'file3.js', dan 'file4.js'. -

    - -

    Mengambil Paket Javascript

    - -

    Untuk mengambil file javascript atau paket tertentu, setel properti PackageScripts dengan nilai 'package1' guna mengambil naskah 'package1'. Maksimum 25 paket dipisahkan dengan koma yang dibolehkan. Ketergantungan paket secara otomatis dipecahkan oleh file php pengambil naskah. -

    - - -<com:TClientScriptLoader PackagePath=<%~ mylib %> PackageScripts="package2" /> -<script type="text/javascript"> - //kode javascript memanfaatkan kode javascript yg diambil ke dalam 'package2' di atas </script> - - -

    Setiap <com:TClientScriptLoader> membuat elemen HTML <script> untuk mengambil file javascript yang diperlukan.

    - -

    Menghapus Komentar Javascript

    -

    Properti DebugMode bila false menghapus komentar dan spasi dari file javascript yang dipublikasikan. Jika properti -DebugMode tidak disetel, mode debug ditentukan dari -mode aplikasi. -

    -
    Catatan: -Jika DebugMode adalah false baik secara eksplisit ataupun ketika mode aplikasi adalah non-debug, maka header cache juga dikirimkan untuk memberitahu -browser dan proxy untuk melakukan cache file. -Lebih lanjut, pasca proses (komentar dihapus dan di-zip) disimpan dalam direktori asset untuk permintaan berikutnya. Yaitu mode non-debug, naskah di-cache dalam direktori asset sampai ia dihapus. -
    - -

    Memadatkan Javascript dengan GZip

    -

    -Properti EnableGzip (standarnya true) membolehkan javascripts yang dipublikasikan untuk dilayani sebagai zipped jika browser dan server php mengijinkannya. -

    - -
    diff --git a/demos/quickstart/protected/pages/Controls/id/Standard.page b/demos/quickstart/protected/pages/Controls/id/Standard.page index 9069b5a1..5e9f76d8 100644 --- a/demos/quickstart/protected/pages/Controls/id/Standard.page +++ b/demos/quickstart/protected/pages/Controls/id/Standard.page @@ -19,10 +19,6 @@ TClientScript menambahkan kode javascript ke halaman. -
  • - TClientScriptLoader mengambil pustaka javascript kustom. -
  • -
  • * TColorPicker mewakili field input yang mengambil nilai warna via dialog warna.
  • -- cgit v1.2.3