Browse Source

Basic First Commit

master
Evgeny Gagua 3 years ago
parent
commit
fd7116465a
  1. BIN
      android-chrome-144x144.png
  2. BIN
      android-chrome-192x192.png
  3. BIN
      android-chrome-256x256.png
  4. BIN
      android-chrome-36x36.png
  5. BIN
      android-chrome-48x48.png
  6. BIN
      android-chrome-72x72.png
  7. BIN
      android-chrome-96x96.png
  8. BIN
      apple-touch-icon-114x114-precomposed.png
  9. BIN
      apple-touch-icon-114x114.png
  10. BIN
      apple-touch-icon-120x120-precomposed.png
  11. BIN
      apple-touch-icon-120x120.png
  12. BIN
      apple-touch-icon-144x144-precomposed.png
  13. BIN
      apple-touch-icon-144x144.png
  14. BIN
      apple-touch-icon-152x152-precomposed.png
  15. BIN
      apple-touch-icon-152x152.png
  16. BIN
      apple-touch-icon-180x180-precomposed.png
  17. BIN
      apple-touch-icon-180x180.png
  18. BIN
      apple-touch-icon-57x57-precomposed.png
  19. BIN
      apple-touch-icon-57x57.png
  20. BIN
      apple-touch-icon-60x60-precomposed.png
  21. BIN
      apple-touch-icon-60x60.png
  22. BIN
      apple-touch-icon-72x72-precomposed.png
  23. BIN
      apple-touch-icon-72x72.png
  24. BIN
      apple-touch-icon-76x76-precomposed.png
  25. BIN
      apple-touch-icon-76x76.png
  26. BIN
      apple-touch-icon-precomposed.png
  27. BIN
      apple-touch-icon.png
  28. 12
      browserconfig.xml
  29. BIN
      favicon-16x16.png
  30. BIN
      favicon-32x32.png
  31. BIN
      favicon.ico
  32. 77
      index.php
  33. 1
      lib/1.json
  34. 1
      lib/2.json
  35. 1
      lib/3.json
  36. 1
      lib/4.json
  37. 1
      lib/5.json
  38. 1
      lib/6.json
  39. 1
      lib/7.json
  40. 44
      lib/ajax_asm.php
  41. 71
      lib/assembler.php
  42. 42
      lib/controller/updateUserSettings.php
  43. 22
      lib/controller/validateUserSession.php
  44. 47
      lib/defines.php
  45. 0
      lib/index.html
  46. 18
      lib/install.php
  47. 2886
      lib/javascript/extjs/adapter/ext/ext-base-debug.js
  48. 7
      lib/javascript/extjs/adapter/ext/ext-base.js
  49. 1797
      lib/javascript/extjs/adapter/jquery/ext-jquery-adapter-debug.js
  50. 7
      lib/javascript/extjs/adapter/jquery/ext-jquery-adapter.js
  51. 1826
      lib/javascript/extjs/adapter/prototype/ext-prototype-adapter-debug.js
  52. 7
      lib/javascript/extjs/adapter/prototype/ext-prototype-adapter.js
  53. 1592
      lib/javascript/extjs/adapter/yui/ext-yui-adapter-debug.js
  54. 7
      lib/javascript/extjs/adapter/yui/ext-yui-adapter.js
  55. 7
      lib/javascript/extjs/calendar-all.js
  56. 78773
      lib/javascript/extjs/ext-all-debug-w-comments.js
  57. 51256
      lib/javascript/extjs/ext-all-debug.js
  58. 11
      lib/javascript/extjs/ext-all.js
  59. 1640
      lib/javascript/extjs/ext.jsb2
  60. 7
      lib/javascript/extjs/extensible-all.js
  61. 674
      lib/javascript/extjs/gpl-3.0.txt
  62. 344
      lib/javascript/extjs/index.html
  63. 41
      lib/javascript/extjs/license.txt
  64. 7
      lib/javascript/extjs/pkgs/calendar.js
  65. 14754
      lib/javascript/extjs/pkgs/cmp-foundation-debug.js
  66. 7
      lib/javascript/extjs/pkgs/cmp-foundation.js
  67. 4804
      lib/javascript/extjs/pkgs/data-foundation-debug.js
  68. 7
      lib/javascript/extjs/pkgs/data-foundation.js
  69. 263
      lib/javascript/extjs/pkgs/data-grouping-debug.js
  70. 7
      lib/javascript/extjs/pkgs/data-grouping.js
  71. 649
      lib/javascript/extjs/pkgs/data-json-debug.js
  72. 7
      lib/javascript/extjs/pkgs/data-json.js
  73. 1539
      lib/javascript/extjs/pkgs/data-list-views-debug.js
  74. 7
      lib/javascript/extjs/pkgs/data-list-views.js
  75. 479
      lib/javascript/extjs/pkgs/data-xml-debug.js
  76. 7
      lib/javascript/extjs/pkgs/data-xml.js
  77. 1162
      lib/javascript/extjs/pkgs/direct-debug.js
  78. 7
      lib/javascript/extjs/pkgs/direct.js
  79. 7918
      lib/javascript/extjs/pkgs/ext-core-debug.js
  80. 7
      lib/javascript/extjs/pkgs/ext-core.js
  81. 4802
      lib/javascript/extjs/pkgs/ext-dd-debug.js
  82. 7
      lib/javascript/extjs/pkgs/ext-dd.js
  83. 8022
      lib/javascript/extjs/pkgs/ext-foundation-debug.js
  84. 7
      lib/javascript/extjs/pkgs/ext-foundation.js
  85. 7
      lib/javascript/extjs/pkgs/extensible-core.js
  86. 1146
      lib/javascript/extjs/pkgs/pkg-buttons-debug.js
  87. 7
      lib/javascript/extjs/pkgs/pkg-buttons.js
  88. 1927
      lib/javascript/extjs/pkgs/pkg-charts-debug.js
  89. 10
      lib/javascript/extjs/pkgs/pkg-charts.js
  90. 9220
      lib/javascript/extjs/pkgs/pkg-forms-debug.js
  91. 7
      lib/javascript/extjs/pkgs/pkg-forms.js
  92. 621
      lib/javascript/extjs/pkgs/pkg-grid-editor-debug.js
  93. 7
      lib/javascript/extjs/pkgs/pkg-grid-editor.js
  94. 7212
      lib/javascript/extjs/pkgs/pkg-grid-foundation-debug.js
  95. 7
      lib/javascript/extjs/pkgs/pkg-grid-foundation.js
  96. 609
      lib/javascript/extjs/pkgs/pkg-grid-grouping-debug.js
  97. 7
      lib/javascript/extjs/pkgs/pkg-grid-grouping.js
  98. 468
      lib/javascript/extjs/pkgs/pkg-grid-property-debug.js
  99. 7
      lib/javascript/extjs/pkgs/pkg-grid-property.js
  100. 216
      lib/javascript/extjs/pkgs/pkg-history-debug.js

BIN
android-chrome-144x144.png

Binary file not shown.

After

Width: 144  |  Height: 144  |  Size: 3.7 KiB

BIN
android-chrome-192x192.png

Binary file not shown.

After

Width: 192  |  Height: 192  |  Size: 4.8 KiB

BIN
android-chrome-256x256.png

Binary file not shown.

After

Width: 256  |  Height: 256  |  Size: 6.5 KiB

BIN
android-chrome-36x36.png

Binary file not shown.

After

Width: 36  |  Height: 36  |  Size: 1.3 KiB

BIN
android-chrome-48x48.png

Binary file not shown.

After

Width: 48  |  Height: 48  |  Size: 1.5 KiB

BIN
android-chrome-72x72.png

Binary file not shown.

After

Width: 72  |  Height: 72  |  Size: 2.0 KiB

BIN
android-chrome-96x96.png

Binary file not shown.

After

Width: 96  |  Height: 96  |  Size: 2.4 KiB

BIN
apple-touch-icon-114x114-precomposed.png

Binary file not shown.

After

Width: 114  |  Height: 114  |  Size: 2.3 KiB

BIN
apple-touch-icon-114x114.png

Binary file not shown.

After

Width: 114  |  Height: 114  |  Size: 2.0 KiB

BIN
apple-touch-icon-120x120-precomposed.png

Binary file not shown.

After

Width: 120  |  Height: 120  |  Size: 2.3 KiB

BIN
apple-touch-icon-120x120.png

Binary file not shown.

After

Width: 120  |  Height: 120  |  Size: 2.0 KiB

BIN
apple-touch-icon-144x144-precomposed.png

Binary file not shown.

After

Width: 144  |  Height: 144  |  Size: 2.7 KiB

BIN
apple-touch-icon-144x144.png

Binary file not shown.

After

Width: 144  |  Height: 144  |  Size: 2.3 KiB

BIN
apple-touch-icon-152x152-precomposed.png

Binary file not shown.

After

Width: 152  |  Height: 152  |  Size: 2.8 KiB

BIN
apple-touch-icon-152x152.png

Binary file not shown.

After

Width: 152  |  Height: 152  |  Size: 2.4 KiB

BIN
apple-touch-icon-180x180-precomposed.png

Binary file not shown.

After

Width: 180  |  Height: 180  |  Size: 3.3 KiB

BIN
apple-touch-icon-180x180.png

Binary file not shown.

After

Width: 180  |  Height: 180  |  Size: 2.7 KiB

BIN
apple-touch-icon-57x57-precomposed.png

Binary file not shown.

After

Width: 57  |  Height: 57  |  Size: 1.5 KiB

BIN
apple-touch-icon-57x57.png

Binary file not shown.

After

Width: 57  |  Height: 57  |  Size: 1.3 KiB

BIN
apple-touch-icon-60x60-precomposed.png

Binary file not shown.

After

Width: 60  |  Height: 60  |  Size: 1.6 KiB

BIN
apple-touch-icon-60x60.png

Binary file not shown.

After

Width: 60  |  Height: 60  |  Size: 1.4 KiB

BIN
apple-touch-icon-72x72-precomposed.png

Binary file not shown.

After

Width: 72  |  Height: 72  |  Size: 1.7 KiB

BIN
apple-touch-icon-72x72.png

Binary file not shown.

After

Width: 72  |  Height: 72  |  Size: 1.5 KiB

BIN
apple-touch-icon-76x76-precomposed.png

Binary file not shown.

After

Width: 76  |  Height: 76  |  Size: 1.8 KiB

BIN
apple-touch-icon-76x76.png

Binary file not shown.

After

Width: 76  |  Height: 76  |  Size: 1.6 KiB

BIN
apple-touch-icon-precomposed.png

Binary file not shown.

After

Width: 180  |  Height: 180  |  Size: 3.3 KiB

BIN
apple-touch-icon.png

Binary file not shown.

After

Width: 180  |  Height: 180  |  Size: 2.7 KiB

12
browserconfig.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/mstile-70x70.png"/>
<square150x150logo src="/mstile-150x150.png"/>
<square310x310logo src="/mstile-310x310.png"/>
<wide310x150logo src="/mstile-310x150.png"/>
<TileColor>#ffc40d</TileColor>
</tile>
</msapplication>
</browserconfig>

BIN
favicon-16x16.png

Binary file not shown.

After

Width: 16  |  Height: 16  |  Size: 847 B

BIN
favicon-32x32.png

Binary file not shown.

After

Width: 32  |  Height: 32  |  Size: 1.2 KiB

BIN
favicon.ico

Binary file not shown.

77
index.php

@ -0,0 +1,77 @@
<?php
require_once('lib/assembler.php');
if( $SSL_INSTALLLED || 1 ){
if( $CUser->Data['id'] > 1 ){
if( $CUser->Data['access'] > 5 ){
UI_PageHeaderExt(
'argus_general.js',
array(
'argus_global_vars.js',
'argus_settings.js',
'argus_main.js'
)
);
} else {
UI_PageHeaderExt(
'argus_general.js',
array(
'argus_global_vars.js',
'argus_settings.js',
'argus_main.js'
)
);
};
UI_PageBottomExt();
} else {
UI_PageHeader();
UI_LoginForm();
UI_PageBottom();
};
} else {
$UPLOAD = false;
$VALID = false;
if( isset( $_FILES ) ){
$UPLOAD = true;
$Z = '/srv/www/web/lib/tmp/'.basename($_FILES["fcert"]["name"]);
$JUJA = $_FILES["fcert"]["tmp_name"];
$CMD = 'openssl verify -verbose -CAfile /srv/www/web/style/assets/rootCA.crt ' . $_FILES["fcert"]["tmp_name"];
$DATA = `{$CMD}`;
if( stripos( $DATA, ': OK')!== false ){
$CMD = 'openssl x509 -ext subjectAltName -noout -in ' . $_FILES["fcert"]["tmp_name"];
$DATA = `{$CMD}`;
$TArr = explode( "\n", $DATA );
if( count( $TArr ) > 1 ){
$IPS = array();
foreach( $TArr as $T ){
$CL = explode( ',', trim( $T ) );
foreach( $CL as $C ){
$PArr = explode( ':', $C );
if( stripos( $PArr[0], 'IP Address' )!== false ) $IPS[] = $PArr[1];
};
};
if( count( $IPS ) ){
foreach( $IPS as $IP ) if ( $IP == $_SERVER['HTTP_HOST'] ) $VALID = true;
if( $VALID ){
// Setup SSL
@unlink($_FILES['fcert']['tmp_name']);
} else {
$ERR = $Labels->GetLabel('_SSL_CERT_IP_NO_');
};
} else {
// No IP defined in Cert
$ERR = $Labels->GetLabel('_SSL_NO_IP_CERT_');
};
} else {
// No Extension
$ERR = $Labels->GetLabel('_SSL_NO_EXT_CERT_');
};
} else {
// CERT is invalid
$ERR = $Labels->GetLabel('_SSL_CERT_INVALID__');
};
};
UI_PageHeader();
UI_SSLDialog();
UI_PageBottom();
};
?>

1
lib/1.json
File diff suppressed because it is too large
View File

1
lib/2.json
File diff suppressed because it is too large
View File

1
lib/3.json
File diff suppressed because it is too large
View File

1
lib/4.json
File diff suppressed because it is too large
View File

1
lib/5.json
File diff suppressed because it is too large
View File

1
lib/6.json
File diff suppressed because it is too large
View File

1
lib/7.json
File diff suppressed because it is too large
View File

44
lib/ajax_asm.php

@ -0,0 +1,44 @@
<?php
error_reporting( E_ALL );
require_once('settings.php');
require_once('defines.php');
// SET DATA CONNECTION AND GLOBAL USER VARIABLES
$TT_123 = explode( '.', PHP_VERSION );
if( $TT_123[0] == '4' ){
require_once( 'php/db/MySQL_class.php' );
$DATABASE = new MySQL_DB($DBHost, $DBName, $DBUser, $DBPassword);
} elseif( $TT_123[0] > '4' ){
require_once( 'php/db/MySQLi_class.php' );
$DATABASE = new MySQLi_DB($DBHost, $DBName, $DBUser, $DBPassword);
} else {
exit();
};
//require_once( 'php/db/SQLite_Class.php');
//$DATABASE = new SQLite_DB( '/srv/www/web/lib/controller/data/mysqlitedb.db');
//$DATABASE->SetCacheDir( $DBCacheDir );
session_start();
require_once('php/db/logio_class.php');
$LOG = new Logio( LOG_LVL_ALL );
require_once('php/db/user_class.php');
require_once('php/auth/web.php');
//require_once('php/db/language_class.php');
require_once('php/db/language_json_class.php');
//require_once('php/sys/r-goose_sys.php');
//require_once('php/argus/mojo.php');
$Labels=new Language_json( '/srv/www/web/lib/'.$UserLang.'.json');
if( $UserLang == 3 || $UserLang == 255 ){
$RTL_SITE = true;
} else {
$RTL_SITE = false;
};
?>

71
lib/assembler.php

@ -0,0 +1,71 @@
<?php
error_reporting( E_ALL );
require_once('settings.php');
require_once('defines.php');
// SET DATA CONNECTION AND GLOBAL USER VARIABLES
$TT_123 = explode( '.', PHP_VERSION );
if( $TT_123[0] == '4' ){
require_once( 'php/db/MySQL_class.php' );
$DATABASE = new MySQL_DB($DBHost, $DBName, $DBUser, $DBPassword);
} elseif( $TT_123[0] > '4' ){
require_once( 'php/db/MySQLi_class.php' );
$DATABASE = new MySQLi_DB($DBHost, $DBName, $DBUser, $DBPassword);
} else {
exit();
};
//require_once( 'php/db/SQLite_Class.php');
//$DATABASE = new SQLite_DB( 'lib/controller/data/mysqlitedb.db');
$str = @file_get_contents('/proc/uptime');
$num = floatval($str);
$secs = fmod($num, 60); $num = (int)($num / 60);
$mins = $num % 60; $num = (int)($num / 60);
$hours = $num % 24; $num = (int)($num / 24);
$days = $num;
if( !$DATABASE->isConnected && $secs > 120 ) {
header( 'location: /setup/');
exit();
};
//$DATABASE->SetCacheDir( $DBCacheDir );
session_start();
require_once('php/db/logio_class.php');
$LOG = new Logio( LOG_LVL_ALL );
require_once('php/db/user_class.php');
require_once('php/auth/web.php');
require_once('php/db/language_json_class.php');
require_once('php/ui/UI_functions.php');
$UserLang = 1;
if( isset($_GET['Lang']) ){
$UCL=intval( $_GET['Lang'] );
if( $UCL == 0 ) $UCL = 1;
if( ( $UserLang != $UCL ) && ( $UserID > 1 ) ){
$QS = "UPDATE `users` SET `language`={$UCL} WHERE `id`={$UserID}";
$DATABASE->Query( $QS );
};
header( 'location: /' );
exit();
};
$Labels=new Language_json( $SYSPath .'/lib/'.$UserLang.'.json');
if( $UserLang == 3 || $UserLang == 255 ){
$RTL_SITE = true;
} else {
$RTL_SITE = false;
};
?>

42
lib/controller/updateUserSettings.php

@ -0,0 +1,42 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['SSS'] ) ){
$SETTING_ID = intval($_POST['SSS']);
switch( $SETTING_ID ){
case 15:{
$WIDTH = intval($_POST['WID']);
$HEIGHT = intval($_POST['HEI']);
$QS="UPDATE `users` SET `width`={$WIDTH}, `height`={$HEIGHT} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
$LOG->ScreenChanges( $CUser->Data['width'], $CUser->Data['height'], $WIDTH, $HEIGHT );
break;
};
case 20:{
$VOL = intval($_POST['VOL']);
$QS="UPDATE `users` SET `sound_enable`={$VOL} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
case 21:{
$LAN = intval($_POST['LAN']);
$QS="UPDATE `users` SET `language`={$LAN} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
case 21:{
$SS = intval($_POST['SS']);
$QS="UPDATE `users` SET `ss_timeout`={$LAN} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
case 26:{
$CID = intval($_POST['CID']);
$QS="UPDATE `users` SET `last_content_view`={$CID} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS );
break;
};
};
};
};
?>

22
lib/controller/validateUserSession.php

@ -0,0 +1,22 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( $CUser->Data['access'] > 5 ){
//Check Time Sync
$MTS = time();
$CTS = intval( $_POST['CTS'] );
// If difference more then 2 minutes
if( abs( $MTS-$CTS ) > 120 ){
//Push Kernel Command -> Sync Time
$QS = "INSERT INTO `command_bus`(`target_id`,`cmd`,`status`,`parameter`) VALUES(1,252,0,'{$CTS}')";
$DATABASE->Query( $QS, false );
// Logout user to perform time sync
//echo "{'sessionIsValid': false }";
//exit();
};
};
echo "{'sessionIsValid': true }";
} else {
echo "{'sessionIsValid': false }";
};
?>

47
lib/defines.php

@ -0,0 +1,47 @@
<?php
$ARGUS_WEB_VERSION = trim( file_get_contents( '/srv/www/web/lib/version.var' ) );
$SSL_INSTALLLED = false;
if( $_SERVER['SERVER_PORT'] == 80 ){
$WEBPath='http://' . $_SERVER['HTTP_HOST'] . '/';//$_SERVER['SERVER_NAME'] . '/';
if( $SSL_INSTALLLED ){
header( 'location: https://'.$_SERVER['SERVER_ADDR'].'/'.$_SERVER['QUERY_STRING'] );
exit();
};
} else {
$WEBPath='https://' . $_SERVER['HTTP_HOST'] . '/';//$_SERVER['SERVER_NAME'] . '/';
};
$SYSPath = '/srv/www/web/';
$ShowImagesLocal=false;
$ShowThumbnailsLocal=true;
$ShowAdw=true;
$SaveLocal=false;
$MailAgent='SENDMAIL';
$CGP_SubmitPath='../Submitted/';
$DBCacheDir=$SYSPath . 'cache';
$MinimalSize=640000;
function microtime_float(){
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
};
$Script_Start_Time = microtime_float();
$Site_Languages = array(
//array( 'id'=>0, 'name'=>'Default', 'rtl'=>false ),
array( 'id'=>1, 'name'=>'English', 'rtl'=>false ),
array( 'id'=>2, 'name'=>'Русский', 'rtl'=>false ),
array( 'id'=>3, 'name'=>'עברית', 'rtl'=>true ),
array( 'id'=>4, 'name'=>'Français', 'rtl'=>false ),
array( 'id'=>5, 'name'=>'日本語', 'rtl'=>false ),
array( 'id'=>6, 'name'=>'中国人', 'rtl'=>false ),
array( 'id'=>7, 'name'=>'Română', 'rtl'=>false ),
);
?>

0
lib/index.html

18
lib/install.php

@ -0,0 +1,18 @@
<?php
error_reporting( E_ALL );
require_once('settings.php');
// SET DATA CONNECTION AND GLOBAL USER VARIABLES
$TT_123 = explode( '.', PHP_VERSION );
if( $TT_123[0] == '4' ){
require_once( 'php/db/MySQL_class.php' );
} elseif( $TT_123[0] > '4' ){
require_once( 'php/db/MySQLi_class.php' );
} else {
exit();
};
session_start();
require_once('php/ui/UI_functions.php');
?>

2886
lib/javascript/extjs/adapter/ext/ext-base-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/adapter/ext/ext-base.js
File diff suppressed because it is too large
View File

1797
lib/javascript/extjs/adapter/jquery/ext-jquery-adapter-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/adapter/jquery/ext-jquery-adapter.js
File diff suppressed because it is too large
View File

1826
lib/javascript/extjs/adapter/prototype/ext-prototype-adapter-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/adapter/prototype/ext-prototype-adapter.js
File diff suppressed because it is too large
View File

1592
lib/javascript/extjs/adapter/yui/ext-yui-adapter-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/adapter/yui/ext-yui-adapter.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/calendar-all.js
File diff suppressed because it is too large
View File

78773
lib/javascript/extjs/ext-all-debug-w-comments.js
File diff suppressed because it is too large
View File

51256
lib/javascript/extjs/ext-all-debug.js
File diff suppressed because it is too large
View File

11
lib/javascript/extjs/ext-all.js
File diff suppressed because it is too large
View File

1640
lib/javascript/extjs/ext.jsb2
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/extensible-all.js
File diff suppressed because it is too large
View File

674
lib/javascript/extjs/gpl-3.0.txt

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

344
lib/javascript/extjs/index.html

@ -0,0 +1,344 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>Welcome to Ext JS</title>
<link rel="shortcut icon" href="http://www.sencha.com/favicon.ico" />
<style type="text/css">
* {
margin: 0;
padding: 0;
}
body {
background: #fff;
color: #333;
font: normal 12px/1.3 Helvetica, sans-serif;
margin: 0 auto 0;
padding: 0;
width: 800px;
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
}
p {
margin: 0 0 1em;
}
a:link,
a:visited {
color: #0464BB;
text-decoration: none;
}
a:hover,
a:focus,
a:active {
color: #0464BB;
text-decoration: underline;
}
h1,h2,h3,h4,h5,h6 {
color: #222;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
line-height: 1.1;
margin-bottom: 0;
padding-bottom: 0;
}
a#logo {
background: url(welcome/images/logo-sencha-sm.png) no-repeat 0 100%;
display: block;
height: 58px;
margin: 0 0 24px;
overflow: hidden;
padding: 0px;
text-indent: 150%;
white-space: nowrap;
width: 134px;
}
#header {
background: url(welcome/images/ext-comp.png) no-repeat 100% 48px;
height: 320px;
}
#header h1 {
font-size: 32px;
margin: 45px 0 12px;
width: 350px;
}
#header p {
color: #555;
font-size: 16px;
line-height: 1.5;
width: 360px;
}
div.button-wrap {
padding: 0 0 1em;
}
.button:link,
.button:visited {
background: #2a64a6;
border: 1px solid;
border-color: transparent transparent rgba(0,0,0,0.4) transparent;
-webkit-border-radius: 13px;
-moz-border-radius: 13px;
border-radius: 13px;
color: #fff;
display: table-cell;
font-size: 13px;
font-weight: bold;
height: 13px;
padding: 2px 12px;
text-align: center;
text-decoration: none;
text-shadow: 0 1px 0 rgba(0,0,0,0.4);
width: 114px;
}
.button:hover,
.button:focus {
background: #265B98;
}
.button:active {
background: #1F4C7E;
border-color: rgba(0,0,0,0.4) transparent transparent transparent;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
}
h2 {
font-size: 18px;
}
#header {
display: block;
margin: 0 0 24px;
padding: 0;
}
div#container {
margin: 0 auto;
overflow: hidden;
width: 800px;
}
.section {
float: left;
margin-right: 50px;
width: 233px;
}
.section h2 {
line-height: 30px;
margin: 0;
padding: 0;
}
#engage ul li {
height: 16px;
line-height: 16px;
}
#engage ul#social li a {
color: #777;
display: block;
height: 16px;
line-height: 16px;
margin: 6px 0 0;
padding-left: 22px;
text-decoration: none;
}
#engage ul#social li a span {
color: #0464BB;
font-weight: bold;
text-decoration: none;
}
#engage ul#social li a:hover {
color: #777;
text-decoration: none;
}
#engage ul#social li a:hover span {
color: #0464BB;
text-decoration: underline;
}
#engage a#join_us.button {
width: 148px;
}
#engage a#twitter {
background: url(welcome/images/social_sprite.gif) no-repeat 0 0;
}
#engage a#twitter:hover {
background: url(welcome/images/social_sprite.gif) no-repeat 0 -16px;
}
#engage a#tumblr {
background: url(welcome/images/social_sprite.gif) no-repeat 0 -32px;
}
#engage a#tumblr:hover {
background: url(welcome/images/social_sprite.gif) no-repeat 0 -48px;
}
#engage a#facebook {
background: url(welcome/images/social_sprite.gif) no-repeat 0 -64px;
}
#engage a#facebook:hover {
background: url(welcome/images/social_sprite.gif) no-repeat 0 -80px;
}
#engage a#linkedin {
background: url(welcome/images/social_sprite.gif) no-repeat 0 -128px;
}
#engage a#linkedin:hover {
background: url(welcome/images/social_sprite.gif) no-repeat 0 -144px;
}
#engage a#blog {
background: url(welcome/images/social_sprite.gif) no-repeat 0 -96px;
}
#engage a#blog:hover {
background: url(welcome/images/social_sprite.gif) no-repeat 0 -112px;
}
#license {
margin-right: 0;
}
ul,
ul li {
list-style: none;
margin: 0;
padding: 0;
}
#learn ul li,
#license ul li {
background: url(welcome/images/li.png) no-repeat 1px 2px;
padding: 0 0 0.5em 10px;
margin-left: 0px;
}
div#communication {
border-top: 1px solid #dfdfdf;
font-size: 13px;
height: 16px;
line-height: 16px;
margin: 24px 0;
overflow: hidden;
overflow: visible;
padding: 24px 0 0;
}
div#communication form {
float: left;
width: 550px;
}
div#communication p {
color: #222;
margin: 0;
}
div#communication p strong {
color: #555;
}
div#communication input#MERGE0 {
padding: 2px;
}
div#communication p#jobs {
float: right;
text-align: right;
width: 220px;
}
</style>
</head>
<body>
<div id="page">
<div id="header">
<a href="http://www.sencha.com/" id="logo">Sencha - Ext JS - Amazing Web Apps Built on Web Standards</a>
<h1>Welcome to Ext JS</h1>
<p>Thank you for downloading Ext JS. With a community of over one million developers and our robust family of Sencha products, Ext JS is the leader in Javascript application development.</p>
<div class="button-wrap">
<a href="examples/" id="examples" class="button"><span>View Examples</span></a>
</div>
</div>
<div id="container">
<div id="learn" class="section">
<h2>Learn</h2>
<p>Use the included files to <a href="examples/index.html">view samples</a> and our <a href="docs/">API documentation</a>.</p>
<p>For advanced, hands-on support, please see our premium <a href="http://www.sencha.com/store">support subscriptions</a>. Larger organizations can use <a href="http://www.sencha.com/support/">our enterprise training and services</a>.</p>
<ul>
<li><a href="http://www.sencha.com/learn/Tutorial:Ext_StartUp_Guide">Getting Started Guide</a></li>
<li><a href="examples/">Examples</a></li>
<li><a href="release-notes.html">Release Notes</a></li>
</ul>
</div>
<div id="engage" class="section">
<h2>Engage</h2>
<p>Our <a href="http://www.sencha.com/forum/">community forums</a> have over 100,000 registered users and are a great place to ask questions and interact with other Ext JS developers.</p>
<div class="button-wrap">
<a href="http://www.sencha.com/forum/register.php" id="join_us" class="button"><span>Join Sencha Forum</span></a>
</div>
<ul id="social">
<li><a href="http://twitter.com/senchainc" id="twitter"><span>Follow @SenchaInc</span> on Twitter</a></li>
<li><a href="http://senchainc.tumblr.com/" id="tumblr"><span>Check out</span> our new Tumblelog</a></li>
<li><a href="http://www.facebook.com/senchainc" id="facebook"><span>Become a fan</span> on Facebook</a></li>
<li><a href="http://j.mp/sencha-in" id="linkedin"><span>Network with us</span> on LinkedIn</a></li>
<li><a href="http://www.sencha.com/blog/" id="blog"><span>Subscribe</span> to the official blog</a></li>
</ul>
</div>
<div id="license" class="section">
<h2>License</h2>
<p>Ext JS is <a href="http://www.sencha.com/company/dual.php">dual licensed</a>. This means:</p>
<ul>
<li>Free to use and test in your local development environment.</li>
<li>Free to use in your open source projects.</li>
<li>Purchase a developer license if you don&rsquo;t plan on releasing your website or application&rsquo;s code as open source.</li>
</ul>
<p>To purchase a commercial license, please see our <a href="http://www.sencha.com/store/extjs/">pricing page</a>.</p>
</div>
</div>
<div id="communication">
<form action="http://extjs.us1.list-manage.com/subscribe/post" method="post">
<p>
<label for="MERGE0"><strong>Sign up to stay in the loop:</strong></label>
<input name="u" type="hidden" value="fb30e9d0e8ab5e66a19398a14" />
<input name="id" type="hidden" value="879d2e6c9b" />
<input name="refurl" type="hidden" value="/extjs" />
<input name="interests" type="hidden" value="Company News, Ext JS" />
<input name="orig-lang" type="hidden" value="1" />
<input id="MERGE0" name="MERGE0" type="email" autofocus="true" placeholder="johndoe@example.com" size="25" />
<input id="submit" name="submit" type="submit" value="Subscribe" />
</p>
</form>
<p id="jobs">Check out our <a href="http://jobs.extjs.com/">Job Board &raquo;</a></p>
</div>
</div>
</body>
</html>

41
lib/javascript/extjs/license.txt

@ -0,0 +1,41 @@
Ext JS - JavaScript Library
Copyright (c) 2006-2010, Sencha Inc.
All rights reserved.
licensing@sencha.com
http://www.sencha.com/license
Open Source License
------------------------------------------------------------------------------------------
Ext JS is licensed under the terms of the Open Source GPL 3.0 license.
http://www.gnu.org/licenses/gpl.html
There are several FLOSS exceptions available for use with this release for
open source applications that are distributed under a license other than the GPL.
* Open Source License Exception for Applications
http://www.sencha.com/products/floss-exception.php
* Open Source License Exception for Development
http://www.sencha.com/products/ux-exception.php
Commercial License
------------------------------------------------------------------------------------------
This is the appropriate option if you are creating proprietary applications and you are
not prepared to distribute and share the source code of your application under the
GPL v3 license. Please visit http://www.sencha.com/license for more details.
OEM / Reseller License
------------------------------------------------------------------------------------------
For more details, please visit: http://www.sencha.com/license.
--
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD-PARTY INTELLECTUAL PROPERTY RIGHTS. See the GNU
General Public License for more details.

7
lib/javascript/extjs/pkgs/calendar.js
File diff suppressed because it is too large
View File

14754
lib/javascript/extjs/pkgs/cmp-foundation-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/cmp-foundation.js
File diff suppressed because it is too large
View File

4804
lib/javascript/extjs/pkgs/data-foundation-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/data-foundation.js
File diff suppressed because it is too large
View File

263
lib/javascript/extjs/pkgs/data-grouping-debug.js

@ -0,0 +1,263 @@
/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
/**
* @class Ext.data.GroupingStore
* @extends Ext.data.Store
* A specialized store implementation that provides for grouping records by one of the available fields. This
* is usually used in conjunction with an {@link Ext.grid.GroupingView} to provide the data model for
* a grouped GridPanel.
*
* Internally, GroupingStore is simply a normal Store with multi sorting enabled from the start. The grouping field
* and direction are always injected as the first sorter pair. GroupingView picks up on the configured groupField and
* builds grid rows appropriately.
*
* @constructor
* Creates a new GroupingStore.
* @param {Object} config A config object containing the objects needed for the Store to access data,
* and read the data into Records.
* @xtype groupingstore
*/
Ext.data.GroupingStore = Ext.extend(Ext.data.Store, {
//inherit docs
constructor: function(config) {
config = config || {};
//We do some preprocessing here to massage the grouping + sorting options into a single
//multi sort array. If grouping and sorting options are both presented to the constructor,
//the sorters array consists of the grouping sorter object followed by the sorting sorter object
//see Ext.data.Store's sorting functions for details about how multi sorting works
this.hasMultiSort = true;
this.multiSortInfo = this.multiSortInfo || {sorters: []};
var sorters = this.multiSortInfo.sorters,
groupField = config.groupField || this.groupField,
sortInfo = config.sortInfo || this.sortInfo,
groupDir = config.groupDir || this.groupDir;
//add the grouping sorter object first
if(groupField){
sorters.push({
field : groupField,
direction: groupDir
});
}
//add the sorting sorter object if it is present
if (sortInfo) {
sorters.push(sortInfo);
}
Ext.data.GroupingStore.superclass.constructor.call(this, config);
this.addEvents(
/**
* @event groupchange
* Fired whenever a call to store.groupBy successfully changes the grouping on the store
* @param {Ext.data.GroupingStore} store The grouping store
* @param {String} groupField The field that the store is now grouped by
*/
'groupchange'
);
this.applyGroupField();
},
/**
* @cfg {String} groupField
* The field name by which to sort the store's data (defaults to '').
*/
/**
* @cfg {Boolean} remoteGroup
* True if the grouping should apply on the server side, false if it is local only (defaults to false). If the
* grouping is local, it can be applied immediately to the data. If it is remote, then it will simply act as a
* helper, automatically sending the grouping field name as the 'groupBy' param with each XHR call.
*/
remoteGroup : false,
/**
* @cfg {Boolean} groupOnSort
* True to sort the data on the grouping field when a grouping operation occurs, false to sort based on the
* existing sort info (defaults to false).
*/
groupOnSort:false,
/**
* @cfg {String} groupDir
* The direction to sort the groups. Defaults to <tt>'ASC'</tt>.
*/
groupDir : 'ASC',
/**
* Clears any existing grouping and refreshes the data using the default sort.
*/
clearGrouping : function(){
this.groupField = false;
if(this.remoteGroup){
if(this.baseParams){
delete this.baseParams.groupBy;
delete this.baseParams.groupDir;
}
var lo = this.lastOptions;
if(lo && lo.params){
delete lo.params.groupBy;
delete lo.params.groupDir;
}
this.reload();
}else{
this.sort();
this.fireEvent('datachanged', this);
}
},
/**
* Groups the data by the specified field.
* @param {String} field The field name by which to sort the store's data
* @param {Boolean} forceRegroup (optional) True to force the group to be refreshed even if the field passed
* in is the same as the current grouping field, false to skip grouping on the same field (defaults to false)
*/
groupBy : function(field, forceRegroup, direction) {
direction = direction ? (String(direction).toUpperCase() == 'DESC' ? 'DESC' : 'ASC') : this.groupDir;
if (this.groupField == field && this.groupDir == direction && !forceRegroup) {
return; // already grouped by this field
}
//check the contents of the first sorter. If the field matches the CURRENT groupField (before it is set to the new one),
//remove the sorter as it is actually the grouper. The new grouper is added back in by this.sort
var sorters = this.multiSortInfo.sorters;
if (sorters.length > 0 && sorters[0].field == this.groupField) {
sorters.shift();
}
this.groupField = field;
this.groupDir = direction;
this.applyGroupField();
var fireGroupEvent = function() {
this.fireEvent('groupchange', this, this.getGroupState());
};
if (this.groupOnSort) {
this.sort(field, direction);
fireGroupEvent.call(this);
return;
}
if (this.remoteGroup) {
this.on('load', fireGroupEvent, this, {single: true});
this.reload();
} else {
this.sort(sorters);
fireGroupEvent.call(this);
}
},
//GroupingStore always uses multisorting so we intercept calls to sort here to make sure that our grouping sorter object
//is always injected first.
sort : function(fieldName, dir) {
if (this.remoteSort) {
return Ext.data.GroupingStore.superclass.sort.call(this, fieldName, dir);
}
var sorters = [];
//cater for any existing valid arguments to this.sort, massage them into an array of sorter objects
if (Ext.isArray(arguments[0])) {
sorters = arguments[0];
} else if (fieldName == undefined) {
//we preserve the existing sortInfo here because this.sort is called after
//clearGrouping and there may be existing sorting
sorters = this.sortInfo ? [this.sortInfo] : [];
} else {
//TODO: this is lifted straight from Ext.data.Store's singleSort function. It should instead be
//refactored into a common method if possible
var field = this.fields.get(fieldName);
if (!field) return false;
var name = field.name,
sortInfo = this.sortInfo || null,
sortToggle = this.sortToggle ? this.sortToggle[name] : null;
if (!dir) {
if (sortInfo && sortInfo.field == name) { // toggle sort dir
dir = (this.sortToggle[name] || 'ASC').toggle('ASC', 'DESC');
} else {
dir = field.sortDir;
}
}
this.sortToggle[name] = dir;
this.sortInfo = {field: name, direction: dir};
sorters = [this.sortInfo];
}
//add the grouping sorter object as the first multisort sorter
if (this.groupField) {
sorters.unshift({direction: this.groupDir, field: this.groupField});
}
return this.multiSort.call(this, sorters, dir);
},
/**
* @private
* Saves the current grouping field and direction to this.baseParams and this.lastOptions.params
* if we're using remote grouping. Does not actually perform any grouping - just stores values
*/
applyGroupField: function(){
if (this.remoteGroup) {
if(!this.baseParams){
this.baseParams = {};
}
Ext.apply(this.baseParams, {
groupBy : this.groupField,
groupDir: this.groupDir
});
var lo = this.lastOptions;
if (lo && lo.params) {
lo.params.groupDir = this.groupDir;
//this is deleted because of a bug reported at http://www.extjs.com/forum/showthread.php?t=82907
delete lo.params.groupBy;
}
}
},
/**
* @private
* TODO: This function is apparently never invoked anywhere in the framework. It has no documentation
* and should be considered for deletion
*/
applyGrouping : function(alwaysFireChange){
if(this.groupField !== false){
this.groupBy(this.groupField, true, this.groupDir);
return true;
}else{
if(alwaysFireChange === true){
this.fireEvent('datachanged', this);
}
return false;
}
},
/**
* @private
* Returns the grouping field that should be used. If groupOnSort is used this will be sortInfo's field,
* otherwise it will be this.groupField
* @return {String} The group field
*/
getGroupState : function(){
return this.groupOnSort && this.groupField !== false ?
(this.sortInfo ? this.sortInfo.field : undefined) : this.groupField;
}
});
Ext.reg('groupingstore', Ext.data.GroupingStore);

7
lib/javascript/extjs/pkgs/data-grouping.js

@ -0,0 +1,7 @@
/*
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
Ext.data.GroupingStore=Ext.extend(Ext.data.Store,{constructor:function(d){d=d||{};this.hasMultiSort=true;this.multiSortInfo=this.multiSortInfo||{sorters:[]};var e=this.multiSortInfo.sorters,c=d.groupField||this.groupField,b=d.sortInfo||this.sortInfo,a=d.groupDir||this.groupDir;if(c){e.push({field:c,direction:a})}if(b){e.push(b)}Ext.data.GroupingStore.superclass.constructor.call(this,d);this.addEvents("groupchange");this.applyGroupField()},remoteGroup:false,groupOnSort:false,groupDir:"ASC",clearGrouping:function(){this.groupField=false;if(this.remoteGroup){if(this.baseParams){delete this.baseParams.groupBy;delete this.baseParams.groupDir}var a=this.lastOptions;if(a&&a.params){delete a.params.groupBy;delete a.params.groupDir}this.reload()}else{this.sort();this.fireEvent("datachanged",this)}},groupBy:function(e,a,d){d=d?(String(d).toUpperCase()=="DESC"?"DESC":"ASC"):this.groupDir;if(this.groupField==e&&this.groupDir==d&&!a){return}var c=this.multiSortInfo.sorters;if(c.length>0&&c[0].field==this.groupField){c.shift()}this.groupField=e;this.groupDir=d;this.applyGroupField();var b=function(){this.fireEvent("groupchange",this,this.getGroupState())};if(this.groupOnSort){this.sort(e,d);b.call(this);return}if(this.remoteGroup){this.on("load",b,this,{single:true});this.reload()}else{this.sort(c);b.call(this)}},sort:function(g,c){if(this.remoteSort){return Ext.data.GroupingStore.superclass.sort.call(this,g,c)}var f=[];if(Ext.isArray(arguments[0])){f=arguments[0]}else{if(g==undefined){f=this.sortInfo?[this.sortInfo]:[]}else{var e=this.fields.get(g);if(!e){return false}var b=e.name,a=this.sortInfo||null,d=this.sortToggle?this.sortToggle[b]:null;if(!c){if(a&&a.field==b){c=(this.sortToggle[b]||"ASC").toggle("ASC","DESC")}else{c=e.sortDir}}this.sortToggle[b]=c;this.sortInfo={field:b,direction:c};f=[this.sortInfo]}}if(this.groupField){f.unshift({direction:this.groupDir,field:this.groupField})}return this.multiSort.call(this,f,c)},applyGroupField:function(){if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}Ext.apply(this.baseParams,{groupBy:this.groupField,groupDir:this.groupDir});var a=this.lastOptions;if(a&&a.params){a.params.groupDir=this.groupDir;delete a.params.groupBy}}},applyGrouping:function(a){if(this.groupField!==false){this.groupBy(this.groupField,true,this.groupDir);return true}else{if(a===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});Ext.reg("groupingstore",Ext.data.GroupingStore);

649
lib/javascript/extjs/pkgs/data-json-debug.js

@ -0,0 +1,649 @@
/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
/**
* @class Ext.data.JsonWriter
* @extends Ext.data.DataWriter
* DataWriter extension for writing an array or single {@link Ext.data.Record} object(s) in preparation for executing a remote CRUD action.
*/
Ext.data.JsonWriter = Ext.extend(Ext.data.DataWriter, {
/**
* @cfg {Boolean} encode <p><tt>true</tt> to {@link Ext.util.JSON#encode JSON encode} the
* {@link Ext.data.DataWriter#toHash hashed data} into a standard HTTP parameter named after this
* Reader's <code>meta.root</code> property which, by default is imported from the associated Reader. Defaults to <tt>true</tt>.</p>
* <p>If set to <code>false</code>, the hashed data is {@link Ext.util.JSON#encode JSON encoded}, along with
* the associated {@link Ext.data.Store}'s {@link Ext.data.Store#baseParams baseParams}, into the POST body.</p>
* <p>When using {@link Ext.data.DirectProxy}, set this to <tt>false</tt> since Ext.Direct.JsonProvider will perform
* its own json-encoding. In addition, if you're using {@link Ext.data.HttpProxy}, setting to <tt>false</tt>
* will cause HttpProxy to transmit data using the <b>jsonData</b> configuration-params of {@link Ext.Ajax#request}
* instead of <b>params</b>.</p>
* <p>When using a {@link Ext.data.Store#restful} Store, some serverside frameworks are
* tuned to expect data through the jsonData mechanism. In those cases, one will want to set <b>encode: <tt>false</tt></b>, as in
* let the lower-level connection object (eg: Ext.Ajax) do the encoding.</p>
*/
encode : true,
/**
* @cfg {Boolean} encodeDelete False to send only the id to the server on delete, true to encode it in an object
* literal, eg: <pre><code>
{id: 1}
* </code></pre> Defaults to <tt>false</tt>
*/
encodeDelete: false,
constructor : function(config){
Ext.data.JsonWriter.superclass.constructor.call(this, config);
},
/**
* <p>This method should not need to be called by application code, however it may be useful on occasion to
* override it, or augment it with an {@link Function#createInterceptor interceptor} or {@link Function#createSequence sequence}.</p>
* <p>The provided implementation encodes the serialized data representing the Store's modified Records into the Ajax request's
* <code>params</code> according to the <code>{@link #encode}</code> setting.</p>
* @param {Object} Ajax request params object to write into.
* @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}. The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}.
* @param {Object/Object[]} data Data object representing the serialized modified records from the Store. May be either a single object,
* or an Array of objects - user implementations must handle both cases.
*/
render : function(params, baseParams, data) {
if (this.encode === true) {
// Encode here now.
Ext.apply(params, baseParams);
params[this.meta.root] = Ext.encode(data);
} else {
// defer encoding for some other layer, probably in {@link Ext.Ajax#request}. Place everything into "jsonData" key.
var jdata = Ext.apply({}, baseParams);
jdata[this.meta.root] = data;
params.jsonData = jdata;
}
},
/**
* Implements abstract Ext.data.DataWriter#createRecord
* @protected
* @param {Ext.data.Record} rec
* @return {Object}
*/
createRecord : function(rec) {
return this.toHash(rec);
},
/**
* Implements abstract Ext.data.DataWriter#updateRecord
* @protected
* @param {Ext.data.Record} rec
* @return {Object}
*/
updateRecord : function(rec) {
return this.toHash(rec);
},
/**
* Implements abstract Ext.data.DataWriter#destroyRecord
* @protected
* @param {Ext.data.Record} rec
* @return {Object}
*/
destroyRecord : function(rec){
if(this.encodeDelete){
var data = {};
data[this.meta.idProperty] = rec.id;
return data;
}else{
return rec.id;
}
}
});/**
* @class Ext.data.JsonReader
* @extends Ext.data.DataReader
* <p>Data reader class to create an Array of {@link Ext.data.Record} objects
* from a JSON packet based on mappings in a provided {@link Ext.data.Record}
* constructor.</p>
* <p>Example code:</p>
* <pre><code>
var myReader = new Ext.data.JsonReader({
// metadata configuration options:
{@link #idProperty}: 'id'
{@link #root}: 'rows',
{@link #totalProperty}: 'results',
{@link Ext.data.DataReader#messageProperty}: "msg" // The element within the response that provides a user-feedback message (optional)
// the fields config option will internally create an {@link Ext.data.Record}
// constructor that provides mapping for reading the record data objects
{@link Ext.data.DataReader#fields fields}: [
// map Record&#39;s 'firstname' field to data object&#39;s key of same name
{name: 'name', mapping: 'firstname'},
// map Record&#39;s 'job' field to data object&#39;s 'occupation' key
{name: 'job', mapping: 'occupation'}
]
});
</code></pre>
* <p>This would consume a JSON data object of the form:</p><pre><code>
{
results: 2000, // Reader&#39;s configured {@link #totalProperty}
rows: [ // Reader&#39;s configured {@link #root}
// record data objects:
{ {@link #idProperty id}: 1, firstname: 'Bill', occupation: 'Gardener' },
{ {@link #idProperty id}: 2, firstname: 'Ben' , occupation: 'Horticulturalist' },
...
]
}
</code></pre>
* <p><b><u>Automatic configuration using metaData</u></b></p>
* <p>It is possible to change a JsonReader's metadata at any time by including
* a <b><tt>metaData</tt></b> property in the JSON data object. If the JSON data
* object has a <b><tt>metaData</tt></b> property, a {@link Ext.data.Store Store}
* object using this Reader will reconfigure itself to use the newly provided
* field definition and fire its {@link Ext.data.Store#metachange metachange}
* event. The metachange event handler may interrogate the <b><tt>metaData</tt></b>
* property to perform any configuration required.</p>
* <p>Note that reconfiguring a Store potentially invalidates objects which may
* refer to Fields or Records which no longer exist.</p>
* <p>To use this facility you would create the JsonReader like this:</p><pre><code>
var myReader = new Ext.data.JsonReader();
</code></pre>
* <p>The first data packet from the server would configure the reader by
* containing a <b><tt>metaData</tt></b> property <b>and</b> the data. For
* example, the JSON data object might take the form:</p><pre><code>
{
metaData: {
"{@link #idProperty}": "id",
"{@link #root}": "rows",
"{@link #totalProperty}": "results"
"{@link #successProperty}": "success",
"{@link Ext.data.DataReader#fields fields}": [
{"name": "name"},
{"name": "job", "mapping": "occupation"}
],
// used by store to set its sortInfo
"sortInfo":{
"field": "name",
"direction": "ASC"
},
// {@link Ext.PagingToolbar paging data} (if applicable)
"start": 0,
"limit": 2,
// custom property
"foo": "bar"
},
// Reader&#39;s configured {@link #successProperty}
"success": true,
// Reader&#39;s configured {@link #totalProperty}
"results": 2000,
// Reader&#39;s configured {@link #root}
// (this data simulates 2 results {@link Ext.PagingToolbar per page})
"rows": [ // <b>*Note:</b> this must be an Array
{ "id": 1, "name": "Bill", "occupation": "Gardener" },
{ "id": 2, "name": "Ben", "occupation": "Horticulturalist" }
]
}
* </code></pre>
* <p>The <b><tt>metaData</tt></b> property in the JSON data object should contain:</p>
* <div class="mdetail-params"><ul>
* <li>any of the configuration options for this class</li>
* <li>a <b><tt>{@link Ext.data.Record#fields fields}</tt></b> property which
* the JsonReader will use as an argument to the
* {@link Ext.data.Record#create data Record create method} in order to
* configure the layout of the Records it will produce.</li>
* <li>a <b><tt>{@link Ext.data.Store#sortInfo sortInfo}</tt></b> property
* which the JsonReader will use to set the {@link Ext.data.Store}'s
* {@link Ext.data.Store#sortInfo sortInfo} property</li>
* <li>any custom properties needed</li>
* </ul></div>
*
* @constructor
* Create a new JsonReader
* @param {Object} meta Metadata configuration options.
* @param {Array/Object} recordType
* <p>Either an Array of {@link Ext.data.Field Field} definition objects (which
* will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}
* constructor created from {@link Ext.data.Record#create}.</p>
*/
Ext.data.JsonReader = function(meta, recordType){
meta = meta || {};
/**
* @cfg {String} idProperty [id] Name of the property within a row object
* that contains a record identifier value. Defaults to <tt>id</tt>
*/
/**
* @cfg {String} successProperty [success] Name of the property from which to
* retrieve the success attribute. Defaults to <tt>success</tt>. See
* {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception}
* for additional information.
*/
/**
* @cfg {String} totalProperty [total] Name of the property from which to
* retrieve the total number of records in the dataset. This is only needed
* if the whole dataset is not passed in one go, but is being paged from
* the remote server. Defaults to <tt>total</tt>.
*/
/**
* @cfg {String} root [undefined] <b>Required</b>. The name of the property
* which contains the Array of row objects. Defaults to <tt>undefined</tt>.
* An exception will be thrown if the root property is undefined. The data
* packet value for this property should be an empty array to clear the data
* or show no data.
*/
Ext.applyIf(meta, {
idProperty: 'id',
successProperty: 'success',
totalProperty: 'total'
});
Ext.data.JsonReader.superclass.constructor.call(this, meta, recordType || meta.fields);
};
Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, {
/**
* This JsonReader's metadata as passed to the constructor, or as passed in
* the last data packet's <b><tt>metaData</tt></b> property.
* @type Mixed
* @property meta
*/
/**
* This method is only used by a DataProxy which has retrieved data from a remote server.
* @param {Object} response The XHR object which contains the JSON data in its responseText.
* @return {Object} data A data block which is used by an Ext.data.Store object as
* a cache of Ext.data.Records.
*/
read : function(response){
var json = response.responseText;
var o = Ext.decode(json);
if(!o) {
throw {message: 'JsonReader.read: Json object not found'};
}
return this.readRecords(o);
},
/*
* TODO: refactor code between JsonReader#readRecords, #readResponse into 1 method.
* there's ugly duplication going on due to maintaining backwards compat. with 2.0. It's time to do this.
*/
/**
* Decode a JSON response from server.
* @param {String} action [Ext.data.Api.actions.create|read|update|destroy]
* @param {Object} response The XHR object returned through an Ajax server request.
* @return {Response} A {@link Ext.data.Response Response} object containing the data response, and also status information.
*/
readResponse : function(action, response) {
var o = (response.responseText !== undefined) ? Ext.decode(response.responseText) : response;
if(!o) {
throw new Ext.data.JsonReader.Error('response');
}
var root = this.getRoot(o);
if (action === Ext.data.Api.actions.create) {
var def = Ext.isDefined(root);
if (def && Ext.isEmpty(root)) {
throw new Ext.data.JsonReader.Error('root-empty', this.meta.root);
}
else if (!def) {
throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root);
}
}
// instantiate response object
var res = new Ext.data.Response({
action: action,
success: this.getSuccess(o),
data: (root) ? this.extractData(root, false) : [],
message: this.getMessage(o),
raw: o
});
// blow up if no successProperty
if (Ext.isEmpty(res.success)) {
throw new Ext.data.JsonReader.Error('successProperty-response', this.meta.successProperty);
}
return res;
},
/**
* Create a data block containing Ext.data.Records from a JSON object.
* @param {Object} o An object which contains an Array of row objects in the property specified
* in the config as 'root, and optionally a property, specified in the config as 'totalProperty'
* which contains the total size of the dataset.
* @return {Object} data A data block which is used by an Ext.data.Store object as
* a cache of Ext.data.Records.
*/
readRecords : function(o){
/**
* After any data loads, the raw JSON data is available for further custom processing. If no data is
* loaded or there is a load exception this property will be undefined.
* @type Object
*/
this.jsonData = o;
if(o.metaData){
this.onMetaChange(o.metaData);
}
var s = this.meta, Record = this.recordType,
f = Record.prototype.fields, fi = f.items, fl = f.length, v;
var root = this.getRoot(o), c = root.length, totalRecords = c, success = true;
if(s.totalProperty){
v = parseInt(this.getTotal(o), 10);
if(!isNaN(v)){
totalRecords = v;
}
}
if(s.successProperty){
v = this.getSuccess(o);
if(v === false || v === 'false'){
success = false;
}
}
// TODO return Ext.data.Response instance instead. @see #readResponse
return {
success : success,
records : this.extractData(root, true), // <-- true to return [Ext.data.Record]
totalRecords : totalRecords
};
},
// private
buildExtractors : function() {
if(this.ef){
return;
}
var s = this.meta, Record = this.recordType,
f = Record.prototype.fields, fi = f.items, fl = f.length;
if(s.totalProperty) {
this.getTotal = this.createAccessor(s.totalProperty);
}
if(s.successProperty) {
this.getSuccess = this.createAccessor(s.successProperty);
}
if (s.messageProperty) {
this.getMessage = this.createAccessor(s.messageProperty);
}
this.getRoot = s.root ? this.createAccessor(s.root) : function(p){return p;};
if (s.id || s.idProperty) {
var g = this.createAccessor(s.id || s.idProperty);
this.getId = function(rec) {
var r = g(rec);
return (r === undefined || r === '') ? null : r;
};
} else {
this.getId = function(){return null;};
}
var ef = [];
for(var i = 0; i < fl; i++){
f = fi[i];
var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name;
ef.push(this.createAccessor(map));
}
this.ef = ef;
},
/**
* @ignore
* TODO This isn't used anywhere?? Don't we want to use this where possible instead of complex #createAccessor?
*/
simpleAccess : function(obj, subsc) {
return obj[subsc];
},
/**
* @ignore
*/
createAccessor : function(){
var re = /[\[\.]/;
return function(expr) {
if(Ext.isEmpty(expr)){
return Ext.emptyFn;
}
if(Ext.isFunction(expr)){
return expr;
}
var i = String(expr).search(re);
if(i >= 0){
return new Function('obj', 'return obj' + (i > 0 ? '.' : '') + expr);
}
return function(obj){
return obj[expr];
};
};
}(),
/**
* type-casts a single row of raw-data from server
* @param {Object} data
* @param {Array} items
* @param {Integer} len
* @private
*/
extractValues : function(data, items, len) {
var f, values = {};
for(var j = 0; j < len; j++){
f = items[j];
var v = this.ef[j](data);
values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, data);
}
return values;
}
});
/**
* @class Ext.data.JsonReader.Error
* Error class for JsonReader
*/
Ext.data.JsonReader.Error = Ext.extend(Ext.Error, {
constructor : function(message, arg) {
this.arg = arg;
Ext.Error.call(this, message);
},
name : 'Ext.data.JsonReader'
});
Ext.apply(Ext.data.JsonReader.Error.prototype, {
lang: {
'response': 'An error occurred while json-decoding your server response',
'successProperty-response': 'Could not locate your "successProperty" in your server response. Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response. See the JsonReader docs.',
'root-undefined-config': 'Your JsonReader was configured without a "root" property. Please review your JsonReader config and make sure to define the root property. See the JsonReader docs.',
'idProperty-undefined' : 'Your JsonReader was configured without an "idProperty" Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id"). See the JsonReader docs.',
'root-empty': 'Data was expected to be returned by the server in the "root" property of the response. Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response. See JsonReader docs.'
}
});
/**
* @class Ext.data.ArrayReader
* @extends Ext.data.JsonReader
* <p>Data reader class to create an Array of {@link Ext.data.Record} objects from an Array.
* Each element of that Array represents a row of data fields. The
* fields are pulled into a Record object using as a subscript, the <code>mapping</code> property
* of the field definition if it exists, or the field's ordinal position in the definition.</p>
* <p>Example code:</p>
* <pre><code>
var Employee = Ext.data.Record.create([
{name: 'name', mapping: 1}, // "mapping" only needed if an "id" field is present which
{name: 'occupation', mapping: 2} // precludes using the ordinal position as the index.
]);
var myReader = new Ext.data.ArrayReader({
{@link #idIndex}: 0
}, Employee);
</code></pre>
* <p>This would consume an Array like this:</p>
* <pre><code>
[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
* </code></pre>
* @constructor
* Create a new ArrayReader
* @param {Object} meta Metadata configuration options.
* @param {Array/Object} recordType
* <p>Either an Array of {@link Ext.data.Field Field} definition objects (which
* will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}
* constructor created from {@link Ext.data.Record#create}.</p>
*/
Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, {
/**
* @cfg {String} successProperty
* @hide
*/
/**
* @cfg {Number} id (optional) The subscript within row Array that provides an ID for the Record.
* Deprecated. Use {@link #idIndex} instead.
*/
/**
* @cfg {Number} idIndex (optional) The subscript within row Array that provides an ID for the Record.
*/
/**
* Create a data block containing Ext.data.Records from an Array.
* @param {Object} o An Array of row objects which represents the dataset.
* @return {Object} data A data block which is used by an Ext.data.Store object as
* a cache of Ext.data.Records.
*/
readRecords : function(o){
this.arrayData = o;
var s = this.meta,
sid = s ? Ext.num(s.idIndex, s.id) : null,
recordType = this.recordType,
fields = recordType.prototype.fields,
records = [],
success = true,
v;
var root = this.getRoot(o);
for(var i = 0, len = root.length; i < len; i++) {
var n = root[i],
values = {},
id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null);
for(var j = 0, jlen = fields.length; j < jlen; j++) {
var f = fields.items[j],
k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j;
v = n[k] !== undefined ? n[k] : f.defaultValue;
v = f.convert(v, n);
values[f.name] = v;
}
var record = new recordType(values, id);
record.json = n;
records[records.length] = record;
}
var totalRecords = records.length;
if(s.totalProperty) {
v = parseInt(this.getTotal(o), 10);
if(!isNaN(v)) {
totalRecords = v;
}
}
if(s.successProperty){
v = this.getSuccess(o);
if(v === false || v === 'false'){
success = false;
}
}
return {
success : success,
records : records,
totalRecords : totalRecords
};
}
});/**
* @class Ext.data.ArrayStore
* @extends Ext.data.Store
* <p>Formerly known as "SimpleStore".</p>
* <p>Small helper class to make creating {@link Ext.data.Store}s from Array data easier.
* An ArrayStore will be automatically configured with a {@link Ext.data.ArrayReader}.</p>
* <p>A store configuration would be something like:<pre><code>
var store = new Ext.data.ArrayStore({
// store configs
autoDestroy: true,
storeId: 'myStore',
// reader configs
idIndex: 0,
fields: [
'company',
{name: 'price', type: 'float'},
{name: 'change', type: 'float'},
{name: 'pctChange', type: 'float'},
{name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
]
});
* </code></pre></p>
* <p>This store is configured to consume a returned object of the form:<pre><code>
var myData = [
['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
];
* </code></pre>
* An object literal of this form could also be used as the {@link #data} config option.</p>
* <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of
* <b>{@link Ext.data.ArrayReader ArrayReader}</b>.</p>
* @constructor
* @param {Object} config
* @xtype arraystore
*/
Ext.data.ArrayStore = Ext.extend(Ext.data.Store, {
/**
* @cfg {Ext.data.DataReader} reader @hide
*/
constructor: function(config){
Ext.data.ArrayStore.superclass.constructor.call(this, Ext.apply(config, {
reader: new Ext.data.ArrayReader(config)
}));
},
loadData : function(data, append){
if(this.expandData === true){
var r = [];
for(var i = 0, len = data.length; i < len; i++){
r[r.length] = [data[i]];
}
data = r;
}
Ext.data.ArrayStore.superclass.loadData.call(this, data, append);
}
});
Ext.reg('arraystore', Ext.data.ArrayStore);
// backwards compat
Ext.data.SimpleStore = Ext.data.ArrayStore;
Ext.reg('simplestore', Ext.data.SimpleStore);/**
* @class Ext.data.JsonStore
* @extends Ext.data.Store
* <p>Small helper class to make creating {@link Ext.data.Store}s from JSON data easier.
* A JsonStore will be automatically configured with a {@link Ext.data.JsonReader}.</p>
* <p>A store configuration would be something like:<pre><code>
var store = new Ext.data.JsonStore({
// store configs
autoDestroy: true,
url: 'get-images.php',
storeId: 'myStore',
// reader configs
root: 'images',
idProperty: 'name',
fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
});
* </code></pre></p>
* <p>This store is configured to consume a returned object of the form:<pre><code>
{
images: [
{name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)},
{name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)}
]
}
* </code></pre>
* An object literal of this form could also be used as the {@link #data} config option.</p>
* <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of
* <b>{@link Ext.data.JsonReader JsonReader}</b>.</p>
* @constructor
* @param {Object} config
* @xtype jsonstore
*/
Ext.data.JsonStore = Ext.extend(Ext.data.Store, {
/**
* @cfg {Ext.data.DataReader} reader @hide
*/
constructor: function(config){
Ext.data.JsonStore.superclass.constructor.call(this, Ext.apply(config, {
reader: new Ext.data.JsonReader(config)
}));
}
});
Ext.reg('jsonstore', Ext.data.JsonStore);

7
lib/javascript/extjs/pkgs/data-json.js
File diff suppressed because it is too large
View File

1539
lib/javascript/extjs/pkgs/data-list-views-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/data-list-views.js
File diff suppressed because it is too large
View File

479
lib/javascript/extjs/pkgs/data-xml-debug.js

@ -0,0 +1,479 @@
/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
/**
* @class Ext.data.XmlWriter
* @extends Ext.data.DataWriter
* DataWriter extension for writing an array or single {@link Ext.data.Record} object(s) in preparation for executing a remote CRUD action via XML.
* XmlWriter uses an instance of {@link Ext.XTemplate} for maximum flexibility in defining your own custom XML schema if the default schema is not appropriate for your needs.
* See the {@link #tpl} configuration-property.
*/
Ext.data.XmlWriter = function(params) {
Ext.data.XmlWriter.superclass.constructor.apply(this, arguments);
// compile the XTemplate for rendering XML documents.
this.tpl = (typeof(this.tpl) === 'string') ? new Ext.XTemplate(this.tpl).compile() : this.tpl.compile();
};
Ext.extend(Ext.data.XmlWriter, Ext.data.DataWriter, {
/**
* @cfg {String} documentRoot [xrequest] (Optional) The name of the XML document root-node. <b>Note:</b>
* this parameter is required </b>only when</b> sending extra {@link Ext.data.Store#baseParams baseParams} to the server
* during a write-request -- if no baseParams are set, the {@link Ext.data.XmlReader#record} meta-property can
* suffice as the XML document root-node for write-actions involving just a <b>single record</b>. For requests
* involving <b>multiple</b> records and <b>NO</b> baseParams, the {@link Ext.data.XmlWriter#root} property can
* act as the XML document root.
*/
documentRoot: 'xrequest',
/**
* @cfg {Boolean} forceDocumentRoot [false] Set to <tt>true</tt> to force XML documents having a root-node as defined
* by {@link #documentRoot}, even with no baseParams defined.
*/
forceDocumentRoot: false,
/**
* @cfg {String} root [records] The name of the containing element which will contain the nodes of an write-action involving <b>multiple</b> records. Each
* xml-record written to the server will be wrapped in an element named after {@link Ext.data.XmlReader#record} property.
* eg:
<code><pre>
&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;user>&lt;first>Barney&lt;/first>&lt;/user>
</code></pre>
* However, when <b>multiple</b> records are written in a batch-operation, these records must be wrapped in a containing
* Element.
* eg:
<code><pre>
&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;records>
&lt;first>Barney&lt;/first>&lt;/user>
&lt;records>&lt;first>Barney&lt;/first>&lt;/user>
&lt;/records>
</code></pre>
* Defaults to <tt>records</tt>. Do not confuse the nature of this property with that of {@link #documentRoot}
*/
root: 'records',
/**
* @cfg {String} xmlVersion [1.0] The <tt>version</tt> written to header of xml documents.
<code><pre>&lt;?xml version="1.0" encoding="ISO-8859-15"?></pre></code>
*/
xmlVersion : '1.0',
/**
* @cfg {String} xmlEncoding [ISO-8859-15] The <tt>encoding</tt> written to header of xml documents.
<code><pre>&lt;?xml version="1.0" encoding="ISO-8859-15"?></pre></code>
*/
xmlEncoding: 'ISO-8859-15',
/**
* @cfg {String/Ext.XTemplate} tpl The XML template used to render {@link Ext.data.Api#actions write-actions} to your server.
* <p>One can easily provide his/her own custom {@link Ext.XTemplate#constructor template-definition} if the default does not suffice.</p>
* <p>Defaults to:</p>
<code><pre>
&lt;?xml version="{version}" encoding="{encoding}"?>
&lt;tpl if="documentRoot">&lt;{documentRoot}>
&lt;tpl for="baseParams">
&lt;tpl for=".">
&lt;{name}>{value}&lt;/{name}>
&lt;/tpl>
&lt;/tpl>
&lt;tpl if="records.length &gt; 1">&lt;{root}>',
&lt;tpl for="records">
&lt;{parent.record}>
&lt;tpl for=".">
&lt;{name}>{value}&lt;/{name}>
&lt;/tpl>
&lt;/{parent.record}>
&lt;/tpl>
&lt;tpl if="records.length &gt; 1">&lt;/{root}>&lt;/tpl>
&lt;tpl if="documentRoot">&lt;/{documentRoot}>&lt;/tpl>
</pre></code>
* <p>Templates will be called with the following API</p>
* <ul>
* <li>{String} version [1.0] The xml version.</li>
* <li>{String} encoding [ISO-8859-15] The xml encoding.</li>
* <li>{String/false} documentRoot The XML document root-node name or <tt>false</tt> if not required. See {@link #documentRoot} and {@link #forceDocumentRoot}.</li>
* <li>{String} record The meta-data parameter defined on your {@link Ext.data.XmlReader#record} configuration represents the name of the xml-tag containing each record.</li>
* <li>{String} root The meta-data parameter defined by {@link Ext.data.XmlWriter#root} configuration-parameter. Represents the name of the xml root-tag when sending <b>multiple</b> records to the server.</li>
* <li>{Array} records The records being sent to the server, ie: the subject of the write-action being performed. The records parameter will be always be an array, even when only a single record is being acted upon.
* Each item within the records array will contain an array of field objects having the following properties:
* <ul>
* <li>{String} name The field-name of the record as defined by your {@link Ext.data.Record#create Ext.data.Record definition}. The "mapping" property will be used, otherwise it will match the "name" property. Use this parameter to define the XML tag-name of the property.</li>
* <li>{Mixed} value The record value of the field enclosed within XML tags specified by name property above.</li>
* </ul></li>
* <li>{Array} baseParams. The baseParams as defined upon {@link Ext.data.Store#baseParams}. Note that the baseParams have been converted into an array of [{name : "foo", value: "bar"}, ...] pairs in the same manner as the <b>records</b> parameter above. See {@link #documentRoot} and {@link #forceDocumentRoot}.</li>
* </ul>
*/
// Encoding the ? here in case it's being included by some kind of page that will parse it (eg. PHP)
tpl: '<tpl for="."><\u003fxml version="{version}" encoding="{encoding}"\u003f><tpl if="documentRoot"><{documentRoot}><tpl for="baseParams"><tpl for="."><{name}>{value}</{name}></tpl></tpl></tpl><tpl if="records.length&gt;1"><{root}></tpl><tpl for="records"><{parent.record}><tpl for="."><{name}>{value}</{name}></tpl></{parent.record}></tpl><tpl if="records.length&gt;1"></{root}></tpl><tpl if="documentRoot"></{documentRoot}></tpl></tpl>',
/**
* XmlWriter implementation of the final stage of a write action.
* @param {Object} params Transport-proxy's (eg: {@link Ext.Ajax#request}) params-object to write-to.
* @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}. The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}.
* @param {Object/Object[]} data Data-object representing the compiled Store-recordset.
*/
render : function(params, baseParams, data) {
baseParams = this.toArray(baseParams);
params.xmlData = this.tpl.applyTemplate({
version: this.xmlVersion,
encoding: this.xmlEncoding,
documentRoot: (baseParams.length > 0 || this.forceDocumentRoot === true) ? this.documentRoot : false,
record: this.meta.record,
root: this.root,
baseParams: baseParams,
records: (Ext.isArray(data[0])) ? data : [data]
});
},
/**
* createRecord
* @protected
* @param {Ext.data.Record} rec
* @return {Array} Array of <tt>name:value</tt> pairs for attributes of the {@link Ext.data.Record}. See {@link Ext.data.DataWriter#toHash}.
*/
createRecord : function(rec) {
return this.toArray(this.toHash(rec));
},
/**
* updateRecord
* @protected
* @param {Ext.data.Record} rec
* @return {Array} Array of {name:value} pairs for attributes of the {@link Ext.data.Record}. See {@link Ext.data.DataWriter#toHash}.
*/
updateRecord : function(rec) {
return this.toArray(this.toHash(rec));
},
/**
* destroyRecord
* @protected
* @param {Ext.data.Record} rec
* @return {Array} Array containing a attribute-object (name/value pair) representing the {@link Ext.data.DataReader#idProperty idProperty}.
*/
destroyRecord : function(rec) {
var data = {};
data[this.meta.idProperty] = rec.id;
return this.toArray(data);
}
});
/**
* @class Ext.data.XmlReader
* @extends Ext.data.DataReader
* <p>Data reader class to create an Array of {@link Ext.data.Record} objects from an XML document
* based on mappings in a provided {@link Ext.data.Record} constructor.</p>
* <p><b>Note</b>: that in order for the browser to parse a returned XML document, the Content-Type
* header in the HTTP response must be set to "text/xml" or "application/xml".</p>
* <p>Example code:</p>
* <pre><code>
var Employee = Ext.data.Record.create([
{name: 'name', mapping: 'name'}, // "mapping" property not needed if it is the same as "name"
{name: 'occupation'} // This field will use "occupation" as the mapping.
]);
var myReader = new Ext.data.XmlReader({
totalProperty: "results", // The element which contains the total dataset size (optional)
record: "row", // The repeated element which contains row information
idProperty: "id" // The element within the row that provides an ID for the record (optional)
messageProperty: "msg" // The element within the response that provides a user-feedback message (optional)
}, Employee);
</code></pre>
* <p>
* This would consume an XML file like this:
* <pre><code>
&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;dataset>
&lt;results>2&lt;/results>
&lt;row>
&lt;id>1&lt;/id>
&lt;name>Bill&lt;/name>
&lt;occupation>Gardener&lt;/occupation>
&lt;/row>
&lt;row>
&lt;id>2&lt;/id>
&lt;name>Ben&lt;/name>
&lt;occupation>Horticulturalist&lt;/occupation>
&lt;/row>
&lt;/dataset>
</code></pre>
* @cfg {String} totalProperty The DomQuery path from which to retrieve the total number of records
* in the dataset. This is only needed if the whole dataset is not passed in one go, but is being
* paged from the remote server.
* @cfg {String} record The DomQuery path to the repeated element which contains record information.
* @cfg {String} record The DomQuery path to the repeated element which contains record information.
* @cfg {String} successProperty The DomQuery path to the success attribute used by forms.
* @cfg {String} idPath The DomQuery path relative from the record element to the element that contains
* a record identifier value.
* @constructor
* Create a new XmlReader.
* @param {Object} meta Metadata configuration options
* @param {Object} recordType Either an Array of field definition objects as passed to
* {@link Ext.data.Record#create}, or a Record constructor object created using {@link Ext.data.Record#create}.
*/
Ext.data.XmlReader = function(meta, recordType){
meta = meta || {};
// backwards compat, convert idPath or id / success
Ext.applyIf(meta, {
idProperty: meta.idProperty || meta.idPath || meta.id,
successProperty: meta.successProperty || meta.success
});
Ext.data.XmlReader.superclass.constructor.call(this, meta, recordType || meta.fields);
};
Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, {
/**
* This method is only used by a DataProxy which has retrieved data from a remote server.
* @param {Object} response The XHR object which contains the parsed XML document. The response is expected
* to contain a property called <tt>responseXML</tt> which refers to an XML document object.
* @return {Object} records A data block which is used by an {@link Ext.data.Store} as
* a cache of Ext.data.Records.
*/
read : function(response){
var doc = response.responseXML;
if(!doc) {
throw {message: "XmlReader.read: XML Document not available"};
}
return this.readRecords(doc);
},
/**
* Create a data block containing Ext.data.Records from an XML document.
* @param {Object} doc A parsed XML document.
* @return {Object} records A data block which is used by an {@link Ext.data.Store} as
* a cache of Ext.data.Records.
*/
readRecords : function(doc){
/**
* After any data loads/reads, the raw XML Document is available for further custom processing.
* @type XMLDocument
*/
this.xmlData = doc;
var root = doc.documentElement || doc,
q = Ext.DomQuery,
totalRecords = 0,
success = true;
if(this.meta.totalProperty){
totalRecords = this.getTotal(root, 0);
}
if(this.meta.successProperty){
success = this.getSuccess(root);
}
var records = this.extractData(q.select(this.meta.record, root), true); // <-- true to return Ext.data.Record[]
// TODO return Ext.data.Response instance. @see #readResponse
return {
success : success,
records : records,
totalRecords : totalRecords || records.length
};
},
/**
* Decode an XML response from server.
* @param {String} action [{@link Ext.data.Api#actions} create|read|update|destroy]
* @param {Object} response HTTP Response object from browser.
* @return {Ext.data.Response} An instance of {@link Ext.data.Response}
*/
readResponse : function(action, response) {
var q = Ext.DomQuery,
doc = response.responseXML,
root = doc.documentElement || doc;
// create general Response instance.
var res = new Ext.data.Response({
action: action,
success : this.getSuccess(root),
message: this.getMessage(root),
data: this.extractData(q.select(this.meta.record, root) || q.select(this.meta.root, root), false),
raw: doc
});
if (Ext.isEmpty(res.success)) {
throw new Ext.data.DataReader.Error('successProperty-response', this.meta.successProperty);
}
// Create actions from a response having status 200 must return pk
if (action === Ext.data.Api.actions.create) {
var def = Ext.isDefined(res.data);
if (def && Ext.isEmpty(res.data)) {
throw new Ext.data.JsonReader.Error('root-empty', this.meta.root);
}
else if (!def) {
throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root);
}
}
return res;
},
getSuccess : function() {
return true;
},
/**
* build response-data extractor functions.
* @private
* @ignore
*/
buildExtractors : function() {
if(this.ef){
return;
}
var s = this.meta,
Record = this.recordType,
f = Record.prototype.fields,
fi = f.items,
fl = f.length;
if(s.totalProperty) {
this.getTotal = this.createAccessor(s.totalProperty);
}
if(s.successProperty) {
this.getSuccess = this.createAccessor(s.successProperty);
}
if (s.messageProperty) {
this.getMessage = this.createAccessor(s.messageProperty);
}
this.getRoot = function(res) {
return (!Ext.isEmpty(res[this.meta.record])) ? res[this.meta.record] : res[this.meta.root];
};
if (s.idPath || s.idProperty) {
var g = this.createAccessor(s.idPath || s.idProperty);
this.getId = function(rec) {
var id = g(rec) || rec.id;
return (id === undefined || id === '') ? null : id;
};
} else {
this.getId = function(){return null;};
}
var ef = [];
for(var i = 0; i < fl; i++){
f = fi[i];
var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name;
ef.push(this.createAccessor(map));
}
this.ef = ef;
},
/**
* Creates a function to return some particular key of data from a response.
* @param {String} key
* @return {Function}
* @private
* @ignore
*/
createAccessor : function(){
var q = Ext.DomQuery;
return function(key) {
if (Ext.isFunction(key)) {
return key;
}
switch(key) {
case this.meta.totalProperty:
return function(root, def){
return q.selectNumber(key, root, def);
};
break;
case this.meta.successProperty:
return function(root, def) {
var sv = q.selectValue(key, root, true);
var success = sv !== false && sv !== 'false';
return success;
};
break;
default:
return function(root, def) {
return q.selectValue(key, root, def);
};
break;
}
};
}(),
/**
* extracts values and type-casts a row of data from server, extracted by #extractData
* @param {Hash} data
* @param {Ext.data.Field[]} items
* @param {Number} len
* @private
* @ignore
*/
extractValues : function(data, items, len) {
var f, values = {};
for(var j = 0; j < len; j++){
f = items[j];
var v = this.ef[j](data);
values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, data);
}
return values;
}
});/**
* @class Ext.data.XmlStore
* @extends Ext.data.Store
* <p>Small helper class to make creating {@link Ext.data.Store}s from XML data easier.
* A XmlStore will be automatically configured with a {@link Ext.data.XmlReader}.</p>
* <p>A store configuration would be something like:<pre><code>
var store = new Ext.data.XmlStore({
// store configs
autoDestroy: true,
storeId: 'myStore',
url: 'sheldon.xml', // automatically configures a HttpProxy
// reader configs
record: 'Item', // records will have an "Item" tag
idPath: 'ASIN',
totalRecords: '@TotalResults'
fields: [
// set up the fields mapping into the xml doc
// The first needs mapping, the others are very basic
{name: 'Author', mapping: 'ItemAttributes > Author'},
'Title', 'Manufacturer', 'ProductGroup'
]
});
* </code></pre></p>
* <p>This store is configured to consume a returned object of the form:<pre><code>
&#60?xml version="1.0" encoding="UTF-8"?>
&#60ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2009-05-15">
&#60Items>
&#60Request>
&#60IsValid>True&#60/IsValid>
&#60ItemSearchRequest>
&#60Author>Sidney Sheldon&#60/Author>
&#60SearchIndex>Books&#60/SearchIndex>
&#60/ItemSearchRequest>
&#60/Request>
&#60TotalResults>203&#60/TotalResults>
&#60TotalPages>21&#60/TotalPages>
&#60Item>
&#60ASIN>0446355453&#60/ASIN>
&#60DetailPageURL>
http://www.amazon.com/
&#60/DetailPageURL>
&#60ItemAttributes>
&#60Author>Sidney Sheldon&#60/Author>
&#60Manufacturer>Warner Books&#60/Manufacturer>
&#60ProductGroup>Book&#60/ProductGroup>
&#60Title>Master of the Game&#60/Title>
&#60/ItemAttributes>
&#60/Item>
&#60/Items>
&#60/ItemSearchResponse>
* </code></pre>
* An object literal of this form could also be used as the {@link #data} config option.</p>
* <p><b>Note:</b> Although not listed here, this class accepts all of the configuration options of
* <b>{@link Ext.data.XmlReader XmlReader}</b>.</p>
* @constructor
* @param {Object} config
* @xtype xmlstore
*/
Ext.data.XmlStore = Ext.extend(Ext.data.Store, {
/**
* @cfg {Ext.data.DataReader} reader @hide
*/
constructor: function(config){
Ext.data.XmlStore.superclass.constructor.call(this, Ext.apply(config, {
reader: new Ext.data.XmlReader(config)
}));
}
});
Ext.reg('xmlstore', Ext.data.XmlStore);

7
lib/javascript/extjs/pkgs/data-xml.js

@ -0,0 +1,7 @@
/*
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
Ext.data.XmlWriter=function(a){Ext.data.XmlWriter.superclass.constructor.apply(this,arguments);this.tpl=(typeof(this.tpl)==="string")?new Ext.XTemplate(this.tpl).compile():this.tpl.compile()};Ext.extend(Ext.data.XmlWriter,Ext.data.DataWriter,{documentRoot:"xrequest",forceDocumentRoot:false,root:"records",xmlVersion:"1.0",xmlEncoding:"ISO-8859-15",tpl:'<tpl for="."><\u003fxml version="{version}" encoding="{encoding}"\u003f><tpl if="documentRoot"><{documentRoot}><tpl for="baseParams"><tpl for="."><{name}>{value}</{name}></tpl></tpl></tpl><tpl if="records.length&gt;1"><{root}></tpl><tpl for="records"><{parent.record}><tpl for="."><{name}>{value}</{name}></tpl></{parent.record}></tpl><tpl if="records.length&gt;1"></{root}></tpl><tpl if="documentRoot"></{documentRoot}></tpl></tpl>',render:function(b,c,a){c=this.toArray(c);b.xmlData=this.tpl.applyTemplate({version:this.xmlVersion,encoding:this.xmlEncoding,documentRoot:(c.length>0||this.forceDocumentRoot===true)?this.documentRoot:false,record:this.meta.record,root:this.root,baseParams:c,records:(Ext.isArray(a[0]))?a:[a]})},createRecord:function(a){return this.toArray(this.toHash(a))},updateRecord:function(a){return this.toArray(this.toHash(a))},destroyRecord:function(b){var a={};a[this.meta.idProperty]=b.id;return this.toArray(a)}});Ext.data.XmlReader=function(a,b){a=a||{};Ext.applyIf(a,{idProperty:a.idProperty||a.idPath||a.id,successProperty:a.successProperty||a.success});Ext.data.XmlReader.superclass.constructor.call(this,a,b||a.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(a){var b=a.responseXML;if(!b){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(b)},readRecords:function(d){this.xmlData=d;var a=d.documentElement||d,c=Ext.DomQuery,f=0,e=true;if(this.meta.totalProperty){f=this.getTotal(a,0)}if(this.meta.successProperty){e=this.getSuccess(a)}var b=this.extractData(c.select(this.meta.record,a),true);return{success:e,records:b,totalRecords:f||b.length}},readResponse:function(f,b){var e=Ext.DomQuery,g=b.responseXML,a=g.documentElement||g;var c=new Ext.data.Response({action:f,success:this.getSuccess(a),message:this.getMessage(a),data:this.extractData(e.select(this.meta.record,a)||e.select(this.meta.root,a),false),raw:g});if(Ext.isEmpty(c.success)){throw new Ext.data.DataReader.Error("successProperty-response",this.meta.successProperty)}if(f===Ext.data.Api.actions.create){var d=Ext.isDefined(c.data);if(d&&Ext.isEmpty(c.data)){throw new Ext.data.JsonReader.Error("root-empty",this.meta.root)}else{if(!d){throw new Ext.data.JsonReader.Error("root-undefined-response",this.meta.root)}}}return c},getSuccess:function(){return true},buildExtractors:function(){if(this.ef){return}var l=this.meta,h=this.recordType,e=h.prototype.fields,k=e.items,j=e.length;if(l.totalProperty){this.getTotal=this.createAccessor(l.totalProperty)}if(l.successProperty){this.getSuccess=this.createAccessor(l.successProperty)}if(l.messageProperty){this.getMessage=this.createAccessor(l.messageProperty)}this.getRoot=function(f){return(!Ext.isEmpty(f[this.meta.record]))?f[this.meta.record]:f[this.meta.root]};if(l.idPath||l.idProperty){var d=this.createAccessor(l.idPath||l.idProperty);this.getId=function(f){var g=d(f)||f.id;return(g===undefined||g==="")?null:g}}else{this.getId=function(){return null}}var c=[];for(var b=0;b<j;b++){e=k[b];var a=(e.mapping!==undefined&&e.mapping!==null)?e.mapping:e.name;c.push(this.createAccessor(a))}this.ef=c},createAccessor:function(){var a=Ext.DomQuery;return function(b){if(Ext.isFunction(b)){return b}switch(b){case this.meta.totalProperty:return function(c,d){return a.selectNumber(b,c,d)};break;case this.meta.successProperty:return function(d,e){var c=a.selectValue(b,d,true);var f=c!==false&&c!=="false";return f};break;default:return function(c,d){return a.selectValue(b,c,d)};break}}}(),extractValues:function(h,d,a){var g,c={};for(var e=0;e<a;e++){g=d[e];var b=this.ef[e](h);c[g.name]=g.convert((b!==undefined)?b:g.defaultValue,h)}return c}});Ext.data.XmlStore=Ext.extend(Ext.data.Store,{constructor:function(a){Ext.data.XmlStore.superclass.constructor.call(this,Ext.apply(a,{reader:new Ext.data.XmlReader(a)}))}});Ext.reg("xmlstore",Ext.data.XmlStore);

1162
lib/javascript/extjs/pkgs/direct-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/direct.js
File diff suppressed because it is too large
View File

7918
lib/javascript/extjs/pkgs/ext-core-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/ext-core.js
File diff suppressed because it is too large
View File

4802
lib/javascript/extjs/pkgs/ext-dd-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/ext-dd.js
File diff suppressed because it is too large
View File

8022
lib/javascript/extjs/pkgs/ext-foundation-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/ext-foundation.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/extensible-core.js

@ -0,0 +1,7 @@
/*
* Extensible 1.0-beta2
* Copyright(c) 2010-2011 Extensible, LLC
* licensing@ext.ensible.com
* http://ext.ensible.com
*/
(function(){Ext.ns("Ext.ensible.ux","Ext.ensible.sample","Ext.ensible.plugins","Ext.ensible.cal");Ext.apply(Ext.ensible,{version:"1.0-beta-2",versionDetails:{major:1,minor:0,patch:0},hasBorderRadius:!(Ext.isIE||Ext.isOpera),log:function(a){},Date:{use24HourTime:false,diff:function(e,a,c){var b=1,d=a.getTime()-e.getTime();if(c=="s"){b=1000}else{if(c=="m"){b=1000*60}else{if(c=="h"){b=1000*60*60}}}return Math.round(d/b)},diffDays:function(b,a){day=1000*60*60*24;diff=a.clearTime(true).getTime()-b.clearTime(true).getTime();return Math.ceil(diff/day)},copyTime:function(c,b){var a=b.clone();a.setHours(c.getHours(),c.getMinutes(),c.getSeconds(),c.getMilliseconds());return a},compare:function(c,b,a){var e=c,d=b;if(a!==true){e=c.clone();e.setMilliseconds(0);d=b.clone();d.setMilliseconds(0)}return d.getTime()-e.getTime()},maxOrMin:function(a){var e=(a?0:Number.MAX_VALUE),c=0,b=arguments[1],d=b.length;for(;c<d;c++){e=Math[a?"max":"min"](e,b[c].getTime())}return new Date(e)},max:function(){return this.maxOrMin.apply(this,[true,arguments])},min:function(){return this.maxOrMin.apply(this,[false,arguments])},isInRange:function(a,c,b){return(a>=c&&a<=b)},rangesOverlap:function(f,b,e,a){var c=(f>=e&&f<=a),d=(b>=e&&b<=a),g=(f<=e&&b>=a);return(c||d||g)}}})})();Ext.override(Ext.XTemplate,{applySubTemplate:function(a,h,g,d,c){var f=this,e,j=f.tpls[a],i,b=[];if((j.test&&!j.test.call(f,h,g,d,c))||(j.exec&&j.exec.call(f,h,g,d,c))){return""}i=j.target?j.target.call(f,h,g):h;e=i.length;g=j.target?h:g;if(j.target&&Ext.isArray(i)){Ext.each(i,function(k,l){b[b.length]=j.compiled.call(f,k,g,l+1,e)});return b.join("")}return j.compiled.call(f,i,g,d,c)}});Ext.override(Ext.form.DateField,{altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d|n-j|n/j",safeParse:function(b,c){if(/[gGhH]/.test(c.replace(/(\\.)/g,""))){return Date.parseDate(b,c)}else{var a=Date.parseDate(b+" "+this.initTime,c+" "+this.initTimeFormat);if(a){return a.clearTime()}}}});Ext.override(Ext.data.Store,{afterEdit:function(a){if(!a.phantom){if(this.modified.indexOf(a)==-1){this.modified.push(a)}this.fireEvent("update",this,a,Ext.data.Record.EDIT)}},add:function(b){var d,a,c;b=[].concat(b);if(b.length<1){return}for(d=0,len=b.length;d<len;d++){a=b[d];a.join(this);if((a.dirty||a.phantom)&&this.modified.indexOf(a)==-1){this.modified.push(a)}}c=this.data.length;this.data.addAll(b);if(this.snapshot){this.snapshot.addAll(b)}this.fireEvent("add",this,b,c)},insert:function(c,b){var d,a;b=[].concat(b);for(d=0,len=b.length;d<len;d++){a=b[d];this.data.insert(c+d,a);a.join(this);if((a.dirty||a.phantom)&&this.modified.indexOf(a)==-1){this.modified.push(a)}}if(this.snapshot){this.snapshot.addAll(b)}this.fireEvent("add",this,b,c)},createRecords:function(c,b,e){var d=this.modified,g=b.length,a,f;for(f=0;f<g;f++){a=b[f];if(a.phantom&&a.isValid()){a.markDirty();if(d.indexOf(a)==-1){d.push(a)}}}if(this.autoSave===true){this.save()}}});Ext.data.MemoryProxy=function(b){var a={};a[Ext.data.Api.actions.read]=true;a[Ext.data.Api.actions.create]=true;a[Ext.data.Api.actions.update]=true;a[Ext.data.Api.actions.destroy]=true;Ext.data.MemoryProxy.superclass.constructor.call(this,{api:a});this.data=b};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{doRequest:function(b,c,a,d,g,h,i){if(b===Ext.data.Api.actions.read){a=a||{};var j;try{j=d.readRecords(this.data)}catch(f){this.fireEvent("loadexception",this,null,i,f);this.fireEvent("exception",this,"response",b,i,null,f);g.call(h,null,i,false);return}g.call(h,j,i,true)}}});

1146
lib/javascript/extjs/pkgs/pkg-buttons-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/pkg-buttons.js
File diff suppressed because it is too large
View File

1927
lib/javascript/extjs/pkgs/pkg-charts-debug.js
File diff suppressed because it is too large
View File

10
lib/javascript/extjs/pkgs/pkg-charts.js
File diff suppressed because it is too large
View File

9220
lib/javascript/extjs/pkgs/pkg-forms-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/pkg-forms.js
File diff suppressed because it is too large
View File

621
lib/javascript/extjs/pkgs/pkg-grid-editor-debug.js

@ -0,0 +1,621 @@
/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
/**
* @class Ext.grid.CellSelectionModel
* @extends Ext.grid.AbstractSelectionModel
* This class provides the basic implementation for <i>single</i> <b>cell</b> selection in a grid.
* The object stored as the selection contains the following properties:
* <div class="mdetail-params"><ul>
* <li><b>cell</b> : see {@link #getSelectedCell}
* <li><b>record</b> : Ext.data.record The {@link Ext.data.Record Record}
* which provides the data for the row containing the selection</li>
* </ul></div>
* @constructor
* @param {Object} config The object containing the configuration of this model.
*/
Ext.grid.CellSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, {
constructor : function(config){
Ext.apply(this, config);
this.selection = null;
this.addEvents(
/**
* @event beforecellselect
* Fires before a cell is selected, return false to cancel the selection.
* @param {SelectionModel} this
* @param {Number} rowIndex The selected row index
* @param {Number} colIndex The selected cell index
*/
"beforecellselect",
/**
* @event cellselect
* Fires when a cell is selected.
* @param {SelectionModel} this
* @param {Number} rowIndex The selected row index
* @param {Number} colIndex The selected cell index
*/
"cellselect",
/**
* @event selectionchange
* Fires when the active selection changes.
* @param {SelectionModel} this
* @param {Object} selection null for no selection or an object with two properties
* <div class="mdetail-params"><ul>
* <li><b>cell</b> : see {@link #getSelectedCell}
* <li><b>record</b> : Ext.data.record<p class="sub-desc">The {@link Ext.data.Record Record}
* which provides the data for the row containing the selection</p></li>
* </ul></div>
*/
"selectionchange"
);
Ext.grid.CellSelectionModel.superclass.constructor.call(this);
},
/** @ignore */
initEvents : function(){
this.grid.on('cellmousedown', this.handleMouseDown, this);
this.grid.on(Ext.EventManager.getKeyEvent(), this.handleKeyDown, this);
this.grid.getView().on({
scope: this,
refresh: this.onViewChange,
rowupdated: this.onRowUpdated,
beforerowremoved: this.clearSelections,
beforerowsinserted: this.clearSelections
});
if(this.grid.isEditor){
this.grid.on('beforeedit', this.beforeEdit, this);
}
},
//private
beforeEdit : function(e){
this.select(e.row, e.column, false, true, e.record);
},
//private
onRowUpdated : function(v, index, r){
if(this.selection && this.selection.record == r){
v.onCellSelect(index, this.selection.cell[1]);
}
},
//private
onViewChange : function(){
this.clearSelections(true);
},
/**
* Returns an array containing the row and column indexes of the currently selected cell
* (e.g., [0, 0]), or null if none selected. The array has elements:
* <div class="mdetail-params"><ul>
* <li><b>rowIndex</b> : Number<p class="sub-desc">The index of the selected row</p></li>
* <li><b>cellIndex</b> : Number<p class="sub-desc">The index of the selected cell.
* Due to possible column reordering, the cellIndex should <b>not</b> be used as an
* index into the Record's data. Instead, use the cellIndex to determine the <i>name</i>
* of the selected cell and use the field name to retrieve the data value from the record:<pre><code>
// get name
var fieldName = grid.getColumnModel().getDataIndex(cellIndex);
// get data value based on name
var data = record.get(fieldName);
* </code></pre></p></li>
* </ul></div>
* @return {Array} An array containing the row and column indexes of the selected cell, or null if none selected.
*/
getSelectedCell : function(){
return this.selection ? this.selection.cell : null;
},
/**
* If anything is selected, clears all selections and fires the selectionchange event.
* @param {Boolean} preventNotify <tt>true</tt> to prevent the gridview from
* being notified about the change.
*/
clearSelections : function(preventNotify){
var s = this.selection;
if(s){
if(preventNotify !== true){
this.grid.view.onCellDeselect(s.cell[0], s.cell[1]);
}
this.selection = null;
this.fireEvent("selectionchange", this, null);
}
},
/**
* Returns <tt>true</tt> if there is a selection.
* @return {Boolean}
*/
hasSelection : function(){
return this.selection ? true : false;
},
/** @ignore */
handleMouseDown : function(g, row, cell, e){
if(e.button !== 0 || this.isLocked()){
return;
}
this.select(row, cell);
},
/**
* Selects a cell. Before selecting a cell, fires the
* {@link #beforecellselect} event. If this check is satisfied the cell
* will be selected and followed up by firing the {@link #cellselect} and
* {@link #selectionchange} events.
* @param {Number} rowIndex The index of the row to select
* @param {Number} colIndex The index of the column to select
* @param {Boolean} preventViewNotify (optional) Specify <tt>true</tt> to
* prevent notifying the view (disables updating the selected appearance)
* @param {Boolean} preventFocus (optional) Whether to prevent the cell at
* the specified rowIndex / colIndex from being focused.
* @param {Ext.data.Record} r (optional) The record to select
*/
select : function(rowIndex, colIndex, preventViewNotify, preventFocus, /*internal*/ r){
if(this.fireEvent("beforecellselect", this, rowIndex, colIndex) !== false){
this.clearSelections();
r = r || this.grid.store.getAt(rowIndex);
this.selection = {
record : r,
cell : [rowIndex, colIndex]
};
if(!preventViewNotify){
var v = this.grid.getView();
v.onCellSelect(rowIndex, colIndex);
if(preventFocus !== true){
v.focusCell(rowIndex, colIndex);
}
}
this.fireEvent("cellselect", this, rowIndex, colIndex);
this.fireEvent("selectionchange", this, this.selection);
}
},
//private
isSelectable : function(rowIndex, colIndex, cm){
return !cm.isHidden(colIndex);
},
// private
onEditorKey: function(field, e){
if(e.getKey() == e.TAB){
this.handleKeyDown(e);
}
},
/** @ignore */
handleKeyDown : function(e){
if(!e.isNavKeyPress()){
return;
}
var k = e.getKey(),
g = this.grid,
s = this.selection,
sm = this,
walk = function(row, col, step){
return g.walkCells(
row,
col,
step,
g.isEditor && g.editing ? sm.acceptsNav : sm.isSelectable, // *** handle tabbing while editorgrid is in edit mode
sm
);
},
cell, newCell, r, c, ae;
switch(k){
case e.ESC:
case e.PAGE_UP:
case e.PAGE_DOWN:
// do nothing
break;
default:
// *** call e.stopEvent() only for non ESC, PAGE UP/DOWN KEYS
e.stopEvent();
break;
}
if(!s){
cell = walk(0, 0, 1); // *** use private walk() function defined above
if(cell){
this.select(cell[0], cell[1]);
}
return;
}
cell = s.cell; // currently selected cell
r = cell[0]; // current row
c = cell[1]; // current column
switch(k){
case e.TAB:
if(e.shiftKey){
newCell = walk(r, c - 1, -1);
}else{
newCell = walk(r, c + 1, 1);
}
break;
case e.DOWN:
newCell = walk(r + 1, c, 1);
break;
case e.UP:
newCell = walk(r - 1, c, -1);
break;
case e.RIGHT:
newCell = walk(r, c + 1, 1);
break;
case e.LEFT:
newCell = walk(r, c - 1, -1);
break;
case e.ENTER:
if (g.isEditor && !g.editing) {
g.startEditing(r, c);
return;
}
break;
}
if(newCell){
// *** reassign r & c variables to newly-selected cell's row and column
r = newCell[0];
c = newCell[1];
this.select(r, c); // *** highlight newly-selected cell and update selection
if(g.isEditor && g.editing){ // *** handle tabbing while editorgrid is in edit mode
ae = g.activeEditor;
if(ae && ae.field.triggerBlur){
// *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method
ae.field.triggerBlur();
}
g.startEditing(r, c);
}
}
},
acceptsNav : function(row, col, cm){
return !cm.isHidden(col) && cm.isCellEditable(col, row);
}
});/**
* @class Ext.grid.EditorGridPanel
* @extends Ext.grid.GridPanel
* <p>This class extends the {@link Ext.grid.GridPanel GridPanel Class} to provide cell editing
* on selected {@link Ext.grid.Column columns}. The editable columns are specified by providing
* an {@link Ext.grid.ColumnModel#editor editor} in the {@link Ext.grid.Column column configuration}.</p>
* <p>Editability of columns may be controlled programatically by inserting an implementation
* of {@link Ext.grid.ColumnModel#isCellEditable isCellEditable} into the
* {@link Ext.grid.ColumnModel ColumnModel}.</p>
* <p>Editing is performed on the value of the <i>field</i> specified by the column's
* <tt>{@link Ext.grid.ColumnModel#dataIndex dataIndex}</tt> in the backing {@link Ext.data.Store Store}
* (so if you are using a {@link Ext.grid.ColumnModel#setRenderer renderer} in order to display
* transformed data, this must be accounted for).</p>
* <p>If a value-to-description mapping is used to render a column, then a {@link Ext.form.Field#ComboBox ComboBox}
* which uses the same {@link Ext.form.Field#valueField value}-to-{@link Ext.form.Field#displayFieldField description}
* mapping would be an appropriate editor.</p>
* If there is a more complex mismatch between the visible data in the grid, and the editable data in
* the {@link Edt.data.Store Store}, then code to transform the data both before and after editing can be
* injected using the {@link #beforeedit} and {@link #afteredit} events.
* @constructor
* @param {Object} config The config object
* @xtype editorgrid
*/
Ext.grid.EditorGridPanel = Ext.extend(Ext.grid.GridPanel, {
/**
* @cfg {Number} clicksToEdit
* <p>The number of clicks on a cell required to display the cell's editor (defaults to 2).</p>
* <p>Setting this option to 'auto' means that mousedown <i>on the selected cell</i> starts
* editing that cell.</p>
*/
clicksToEdit: 2,
/**
* @cfg {Boolean} forceValidation
* True to force validation even if the value is unmodified (defaults to false)
*/
forceValidation: false,
// private
isEditor : true,
// private
detectEdit: false,
/**
* @cfg {Boolean} autoEncode
* True to automatically HTML encode and decode values pre and post edit (defaults to false)
*/
autoEncode : false,
/**
* @cfg {Boolean} trackMouseOver @hide
*/
// private
trackMouseOver: false, // causes very odd FF errors
// private
initComponent : function(){
Ext.grid.EditorGridPanel.superclass.initComponent.call(this);
if(!this.selModel){
/**
* @cfg {Object} selModel Any subclass of AbstractSelectionModel that will provide the selection model for
* the grid (defaults to {@link Ext.grid.CellSelectionModel} if not specified).
*/
this.selModel = new Ext.grid.CellSelectionModel();
}
this.activeEditor = null;
this.addEvents(
/**
* @event beforeedit
* Fires before cell editing is triggered. The edit event object has the following properties <br />
* <ul style="padding:5px;padding-left:16px;">
* <li>grid - This grid</li>
* <li>record - The record being edited</li>
* <li>field - The field name being edited</li>
* <li>value - The value for the field being edited.</li>
* <li>row - The grid row index</li>
* <li>column - The grid column index</li>
* <li>cancel - Set this to true to cancel the edit or return false from your handler.</li>
* </ul>
* @param {Object} e An edit event (see above for description)
*/
"beforeedit",
/**
* @event afteredit
* Fires after a cell is edited. The edit event object has the following properties <br />
* <ul style="padding:5px;padding-left:16px;">
* <li>grid - This grid</li>
* <li>record - The record being edited</li>
* <li>field - The field name being edited</li>
* <li>value - The value being set</li>
* <li>originalValue - The original value for the field, before the edit.</li>
* <li>row - The grid row index</li>
* <li>column - The grid column index</li>
* </ul>
*
* <pre><code>
grid.on('afteredit', afterEdit, this );
function afterEdit(e) {
// execute an XHR to send/commit data to the server, in callback do (if successful):
e.record.commit();
};
* </code></pre>
* @param {Object} e An edit event (see above for description)
*/
"afteredit",
/**
* @event validateedit
* Fires after a cell is edited, but before the value is set in the record. Return false
* to cancel the change. The edit event object has the following properties <br />
* <ul style="padding:5px;padding-left:16px;">
* <li>grid - This grid</li>
* <li>record - The record being edited</li>
* <li>field - The field name being edited</li>
* <li>value - The value being set</li>
* <li>originalValue - The original value for the field, before the edit.</li>
* <li>row - The grid row index</li>
* <li>column - The grid column index</li>
* <li>cancel - Set this to true to cancel the edit or return false from your handler.</li>
* </ul>
* Usage example showing how to remove the red triangle (dirty record indicator) from some
* records (not all). By observing the grid's validateedit event, it can be cancelled if
* the edit occurs on a targeted row (for example) and then setting the field's new value
* in the Record directly:
* <pre><code>
grid.on('validateedit', function(e) {
var myTargetRow = 6;
if (e.row == myTargetRow) {
e.cancel = true;
e.record.data[e.field] = e.value;
}
});
* </code></pre>
* @param {Object} e An edit event (see above for description)
*/
"validateedit"
);
},
// private
initEvents : function(){
Ext.grid.EditorGridPanel.superclass.initEvents.call(this);
this.getGridEl().on('mousewheel', this.stopEditing.createDelegate(this, [true]), this);
this.on('columnresize', this.stopEditing, this, [true]);
if(this.clicksToEdit == 1){
this.on("cellclick", this.onCellDblClick, this);
}else {
var view = this.getView();
if(this.clicksToEdit == 'auto' && view.mainBody){
view.mainBody.on('mousedown', this.onAutoEditClick, this);
}
this.on('celldblclick', this.onCellDblClick, this);
}
},
onResize : function(){
Ext.grid.EditorGridPanel.superclass.onResize.apply(this, arguments);
var ae = this.activeEditor;
if(this.editing && ae){
ae.realign(true);
}
},
// private
onCellDblClick : function(g, row, col){
this.startEditing(row, col);
},
// private
onAutoEditClick : function(e, t){
if(e.button !== 0){
return;
}
var row = this.view.findRowIndex(t),
col = this.view.findCellIndex(t);
if(row !== false && col !== false){
this.stopEditing();
if(this.selModel.getSelectedCell){ // cell sm
var sc = this.selModel.getSelectedCell();
if(sc && sc[0] === row && sc[1] === col){
this.startEditing(row, col);
}
}else{
if(this.selModel.isSelected(row)){
this.startEditing(row, col);
}
}
}
},
// private
onEditComplete : function(ed, value, startValue){
this.editing = false;
this.lastActiveEditor = this.activeEditor;
this.activeEditor = null;
var r = ed.record,
field = this.colModel.getDataIndex(ed.col);
value = this.postEditValue(value, startValue, r, field);
if(this.forceValidation === true || String(value) !== String(startValue)){
var e = {
grid: this,
record: r,
field: field,
originalValue: startValue,
value: value,
row: ed.row,
column: ed.col,
cancel:false
};
if(this.fireEvent("validateedit", e) !== false && !e.cancel && String(value) !== String(startValue)){
r.set(field, e.value);
delete e.cancel;
this.fireEvent("afteredit", e);
}
}
this.view.focusCell(ed.row, ed.col);
},
/**
* Starts editing the specified for the specified row/column
* @param {Number} rowIndex
* @param {Number} colIndex
*/
startEditing : function(row, col){
this.stopEditing();
if(this.colModel.isCellEditable(col, row)){
this.view.ensureVisible(row, col, true);
var r = this.store.getAt(row),
field = this.colModel.getDataIndex(col),
e = {
grid: this,
record: r,
field: field,
value: r.data[field],
row: row,
column: col,
cancel:false
};
if(this.fireEvent("beforeedit", e) !== false && !e.cancel){
this.editing = true;
var ed = this.colModel.getCellEditor(col, row);
if(!ed){
return;
}
if(!ed.rendered){
ed.parentEl = this.view.getEditorParent(ed);
ed.on({
scope: this,
render: {
fn: function(c){
c.field.focus(false, true);
},
single: true,
scope: this
},
specialkey: function(field, e){
this.getSelectionModel().onEditorKey(field, e);
},
complete: this.onEditComplete,
canceledit: this.stopEditing.createDelegate(this, [true])
});
}
Ext.apply(ed, {
row : row,
col : col,
record : r
});
this.lastEdit = {
row: row,
col: col
};
this.activeEditor = ed;
// Set the selectSameEditor flag if we are reusing the same editor again and
// need to prevent the editor from firing onBlur on itself.
ed.selectSameEditor = (this.activeEditor == this.lastActiveEditor);
var v = this.preEditValue(r, field);
ed.startEdit(this.view.getCell(row, col).firstChild, Ext.isDefined(v) ? v : '');
// Clear the selectSameEditor flag
(function(){
delete ed.selectSameEditor;
}).defer(50);
}
}
},
// private
preEditValue : function(r, field){
var value = r.data[field];
return this.autoEncode && Ext.isString(value) ? Ext.util.Format.htmlDecode(value) : value;
},
// private
postEditValue : function(value, originalValue, r, field){
return this.autoEncode && Ext.isString(value) ? Ext.util.Format.htmlEncode(value) : value;
},
/**
* Stops any active editing
* @param {Boolean} cancel (optional) True to cancel any changes
*/
stopEditing : function(cancel){
if(this.editing){
// Store the lastActiveEditor to check if it is changing
var ae = this.lastActiveEditor = this.activeEditor;
if(ae){
ae[cancel === true ? 'cancelEdit' : 'completeEdit']();
this.view.focusCell(ae.row, ae.col);
}
this.activeEditor = null;
}
this.editing = false;
}
});
Ext.reg('editorgrid', Ext.grid.EditorGridPanel);// private
// This is a support class used internally by the Grid components
Ext.grid.GridEditor = function(field, config){
Ext.grid.GridEditor.superclass.constructor.call(this, field, config);
field.monitorTab = false;
};
Ext.extend(Ext.grid.GridEditor, Ext.Editor, {
alignment: "tl-tl",
autoSize: "width",
hideEl : false,
cls: "x-small-editor x-grid-editor",
shim:false,
shadow:false
});

7
lib/javascript/extjs/pkgs/pkg-grid-editor.js
File diff suppressed because it is too large
View File

7212
lib/javascript/extjs/pkgs/pkg-grid-foundation-debug.js
File diff suppressed because it is too large
View File

7
lib/javascript/extjs/pkgs/pkg-grid-foundation.js
File diff suppressed because it is too large
View File

609
lib/javascript/extjs/pkgs/pkg-grid-grouping-debug.js

@ -0,0 +1,609 @@
/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
/**
* @class Ext.grid.GroupingView
* @extends Ext.grid.GridView
* Adds the ability for single level grouping to the grid. A {@link Ext.data.GroupingStore GroupingStore}
* must be used to enable grouping. Some grouping characteristics may also be configured at the
* {@link Ext.grid.Column Column level}<div class="mdetail-params"><ul>
* <li><code>{@link Ext.grid.Column#emptyGroupText emptyGroupText}</code></li>
* <li><code>{@link Ext.grid.Column#groupable groupable}</code></li>
* <li><code>{@link Ext.grid.Column#groupName groupName}</code></li>
* <li><code>{@link Ext.grid.Column#groupRender groupRender}</code></li>
* </ul></div>
* <p>Sample usage:</p>
* <pre><code>
var grid = new Ext.grid.GridPanel({
// A groupingStore is required for a GroupingView
store: new {@link Ext.data.GroupingStore}({
autoDestroy: true,
reader: reader,
data: xg.dummyData,
sortInfo: {field: 'company', direction: 'ASC'},
{@link Ext.data.GroupingStore#groupOnSort groupOnSort}: true,
{@link Ext.data.GroupingStore#remoteGroup remoteGroup}: true,
{@link Ext.data.GroupingStore#groupField groupField}: 'industry'
}),
colModel: new {@link Ext.grid.ColumnModel}({
columns:[
{id:'company',header: 'Company', width: 60, dataIndex: 'company'},
// {@link Ext.grid.Column#groupable groupable}, {@link Ext.grid.Column#groupName groupName}, {@link Ext.grid.Column#groupRender groupRender} are also configurable at column level
{header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price', {@link Ext.grid.Column#groupable groupable}: false},
{header: 'Change', dataIndex: 'change', renderer: Ext.util.Format.usMoney},
{header: 'Industry', dataIndex: 'industry'},
{header: 'Last Updated', renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
],
defaults: {
sortable: true,
menuDisabled: false,
width: 20
}
}),
view: new Ext.grid.GroupingView({
{@link Ext.grid.GridView#forceFit forceFit}: true,
// custom grouping text template to display the number of items per group
{@link #groupTextTpl}: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
}),
frame:true,
width: 700,
height: 450,
collapsible: true,
animCollapse: false,
title: 'Grouping Example',
iconCls: 'icon-grid',
renderTo: document.body
});
* </code></pre>
* @constructor
* @param {Object} config
*/
Ext.grid.GroupingView = Ext.extend(Ext.grid.GridView, {
/**
* @cfg {String} groupByText Text displayed in the grid header menu for grouping by a column
* (defaults to 'Group By This Field').
*/
groupByText : 'Group By This Field',
/**
* @cfg {String} showGroupsText Text displayed in the grid header for enabling/disabling grouping
* (defaults to 'Show in Groups').
*/
showGroupsText : 'Show in Groups',
/**
* @cfg {Boolean} hideGroupedColumn <tt>true</tt> to hide the column that is currently grouped (defaults to <tt>false</tt>)
*/
hideGroupedColumn : false,
/**
* @cfg {Boolean} showGroupName If <tt>true</tt> will display a prefix plus a ': ' before the group field value
* in the group header line. The prefix will consist of the <tt><b>{@link Ext.grid.Column#groupName groupName}</b></tt>
* (or the configured <tt><b>{@link Ext.grid.Column#header header}</b></tt> if not provided) configured in the
* {@link Ext.grid.Column} for each set of grouped rows (defaults to <tt>true</tt>).
*/
showGroupName : true,
/**
* @cfg {Boolean} startCollapsed <tt>true</tt> to start all groups collapsed (defaults to <tt>false</tt>)
*/
startCollapsed : false,
/**
* @cfg {Boolean} enableGrouping <tt>false</tt> to disable grouping functionality (defaults to <tt>true</tt>)
*/
enableGrouping : true,
/**
* @cfg {Boolean} enableGroupingMenu <tt>true</tt> to enable the grouping control in the column menu (defaults to <tt>true</tt>)
*/
enableGroupingMenu : true,
/**
* @cfg {Boolean} enableNoGroups <tt>true</tt> to allow the user to turn off grouping (defaults to <tt>true</tt>)
*/
enableNoGroups : true,
/**
* @cfg {String} emptyGroupText The text to display when there is an empty group value (defaults to <tt>'(None)'</tt>).
* May also be specified per column, see {@link Ext.grid.Column}.{@link Ext.grid.Column#emptyGroupText emptyGroupText}.
*/
emptyGroupText : '(None)',
/**
* @cfg {Boolean} ignoreAdd <tt>true</tt> to skip refreshing the view when new rows are added (defaults to <tt>false</tt>)
*/
ignoreAdd : false,
/**
* @cfg {String} groupTextTpl The template used to render the group header (defaults to <tt>'{text}'</tt>).
* This is used to format an object which contains the following properties:
* <div class="mdetail-params"><ul>
* <li><b>group</b> : String<p class="sub-desc">The <i>rendered</i> value of the group field.
* By default this is the unchanged value of the group field. If a <tt><b>{@link Ext.grid.Column#groupRenderer groupRenderer}</b></tt>
* is specified, it is the result of a call to that function.</p></li>
* <li><b>gvalue</b> : Object<p class="sub-desc">The <i>raw</i> value of the group field.</p></li>
* <li><b>text</b> : String<p class="sub-desc">The configured header (as described in <tt>{@link #showGroupName})</tt>
* if <tt>{@link #showGroupName}</tt> is <tt>true</tt>) plus the <i>rendered</i> group field value.</p></li>
* <li><b>groupId</b> : String<p class="sub-desc">A unique, generated ID which is applied to the
* View Element which contains the group.</p></li>
* <li><b>startRow</b> : Number<p class="sub-desc">The row index of the Record which caused group change.</p></li>
* <li><b>rs</b> : Array<p class="sub-desc">Contains a single element: The Record providing the data
* for the row which caused group change.</p></li>
* <li><b>cls</b> : String<p class="sub-desc">The generated class name string to apply to the group header Element.</p></li>
* <li><b>style</b> : String<p class="sub-desc">The inline style rules to apply to the group header Element.</p></li>
* </ul></div></p>
* See {@link Ext.XTemplate} for information on how to format data using a template. Possible usage:<pre><code>
var grid = new Ext.grid.GridPanel({
...
view: new Ext.grid.GroupingView({
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
}),
});
* </code></pre>
*/
groupTextTpl : '{text}',
/**
* @cfg {String} groupMode Indicates how to construct the group identifier. <tt>'value'</tt> constructs the id using
* raw value, <tt>'display'</tt> constructs the id using the rendered value. Defaults to <tt>'value'</tt>.
*/
groupMode: 'value',
/**
* @cfg {Function} groupRenderer This property must be configured in the {@link Ext.grid.Column} for
* each column.
*/
/**
* @cfg {Boolean} cancelEditOnToggle True to cancel any editing when the group header is toggled. Defaults to <tt>true</tt>.
*/
cancelEditOnToggle: true,
// private
initTemplates : function(){
Ext.grid.GroupingView.superclass.initTemplates.call(this);
this.state = {};
var sm = this.grid.getSelectionModel();
sm.on(sm.selectRow ? 'beforerowselect' : 'beforecellselect',
this.onBeforeRowSelect, this);
if(!this.startGroup){
this.startGroup = new Ext.XTemplate(
'<div id="{groupId}" class="x-grid-group {cls}">',
'<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div class="x-grid-group-title">', this.groupTextTpl ,'</div></div>',
'<div id="{groupId}-bd" class="x-grid-group-body">'
);
}
this.startGroup.compile();
if (!this.endGroup) {
this.endGroup = '</div></div>';
}
},
// private
findGroup : function(el){
return Ext.fly(el).up('.x-grid-group', this.mainBody.dom);
},
// private
getGroups : function(){
return this.hasRows() ? this.mainBody.dom.childNodes : [];
},
// private
onAdd : function(ds, records, index) {
if (this.canGroup() && !this.ignoreAdd) {
var ss = this.getScrollState();
this.fireEvent('beforerowsinserted', ds, index, index + (records.length-1));
this.refresh();
this.restoreScroll(ss);
this.fireEvent('rowsinserted', ds, index, index + (records.length-1));
} else if (!this.canGroup()) {
Ext.grid.GroupingView.superclass.onAdd.apply(this, arguments);
}
},
// private
onRemove : function(ds, record, index, isUpdate){
Ext.grid.GroupingView.superclass.onRemove.apply(this, arguments);
var g = document.getElementById(record._groupId);
if(g && g.childNodes[1].childNodes.length < 1){
Ext.removeNode(g);
}
this.applyEmptyText();
},
// private
refreshRow : function(record){
if(this.ds.getCount()==1){
this.refresh();
}else{
this.isUpdating = true;
Ext.grid.GroupingView.superclass.refreshRow.apply(this, arguments);
this.isUpdating = false;
}
},
// private
beforeMenuShow : function(){
var item, items = this.hmenu.items, disabled = this.cm.config[this.hdCtxIndex].groupable === false;
if((item = items.get('groupBy'))){
item.setDisabled(disabled);
}
if((item = items.get('showGroups'))){
item.setDisabled(disabled);
item.setChecked(this.canGroup(), true);
}
},
// private
renderUI : function(){
var markup = Ext.grid.GroupingView.superclass.renderUI.call(this);
if(this.enableGroupingMenu && this.hmenu){
this.hmenu.add('-',{
itemId:'groupBy',
text: this.groupByText,
handler: this.onGroupByClick,
scope: this,
iconCls:'x-group-by-icon'
});
if(this.enableNoGroups){
this.hmenu.add({
itemId:'showGroups',
text: this.showGroupsText,
checked: true,
checkHandler: this.onShowGroupsClick,
scope: this
});
}
this.hmenu.on('beforeshow', this.beforeMenuShow, this);
}
return markup;
},
processEvent: function(name, e){
Ext.grid.GroupingView.superclass.processEvent.call(this, name, e);
var hd = e.getTarget('.x-grid-group-hd', this.mainBody);
if(hd){
// group value is at the end of the string
var field = this.getGroupField(),
prefix = this.getPrefix(field),
groupValue = hd.id.substring(prefix.length),
emptyRe = new RegExp('gp-' + Ext.escapeRe(field) + '--hd');
// remove trailing '-hd'
groupValue = groupValue.substr(0, groupValue.length - 3);
// also need to check for empty groups
if(groupValue || emptyRe.test(hd.id)){
this.grid.fireEvent('group' + name, this.grid, field, groupValue, e);
}
if(name == 'mousedown' && e.button == 0){
this.toggleGroup(hd.parentNode);
}
}
},
// private
onGroupByClick : function(){
var grid = this.grid;
this.enableGrouping = true;
grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));
grid.fireEvent('groupchange', grid, grid.store.getGroupState());
this.beforeMenuShow(); // Make sure the checkboxes get properly set when changing groups
this.refresh();
},
// private
onShowGroupsClick : function(mi, checked){
this.enableGrouping = checked;
if(checked){
this.onGroupByClick();
}else{
this.grid.store.clearGrouping();
this.grid.fireEvent('groupchange', this, null);
}
},
/**
* Toggle the group that contains the specific row.
* @param {Number} rowIndex The row inside the group
* @param {Boolean} expanded (optional)
*/
toggleRowIndex : function(rowIndex, expanded){
if(!this.canGroup()){
return;
}
var row = this.getRow(rowIndex);
if(row){
this.toggleGroup(this.findGroup(row), expanded);
}
},
/**
* Toggles the specified group if no value is passed, otherwise sets the expanded state of the group to the value passed.
* @param {String} groupId The groupId assigned to the group (see getGroupId)
* @param {Boolean} expanded (optional)
*/
toggleGroup : function(group, expanded){
var gel = Ext.get(group);
expanded = Ext.isDefined(expanded) ? expanded : gel.hasClass('x-grid-group-collapsed');
if(this.state[gel.id] !== expanded){
if (this.cancelEditOnToggle !== false) {
this.grid.stopEditing(true);
}
this.state[gel.id] = expanded;
gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed');
}
},
/**
* Toggles all groups if no value is passed, otherwise sets the expanded state of all groups to the value passed.
* @param {Boolean} expanded (optional)
*/
toggleAllGroups : function(expanded){
var groups = this.getGroups();
for(var i = 0, len = groups.length; i < len; i++){
this.toggleGroup(groups[i], expanded);
}
},
/**
* Expands all grouped rows.
*/
expandAllGroups : function(){
this.toggleAllGroups(true);
},
/**
* Collapses all grouped rows.
*/
collapseAllGroups : function(){
this.toggleAllGroups(false);
},
// private
getGroup : function(v, r, groupRenderer, rowIndex, colIndex, ds){
var column = this.cm.config[colIndex],
g = groupRenderer ? groupRenderer.call(column.scope, v, {}, r, rowIndex, colIndex, ds) : String(v);
if(g === '' || g === '&#160;'){
g = column.emptyGroupText || this.emptyGroupText;
}
return g;
},
// private
getGroupField : function(){
return this.grid.store.getGroupState();
},
// private
afterRender : function(){
if(!this.ds || !this.cm){
return;
}
Ext.grid.GroupingView.superclass.afterRender.call(this);
if(this.grid.deferRowRender){
this.updateGroupWidths();
}
},
afterRenderUI: function () {
Ext.grid.GroupingView.superclass.afterRenderUI.call(this);
if (this.enableGroupingMenu && this.hmenu) {
this.hmenu.add('-',{
itemId:'groupBy',
text: this.groupByText,
handler: this.onGroupByClick,
scope: this,
iconCls:'x-group-by-icon'
});
if (this.enableNoGroups) {
this.hmenu.add({
itemId:'showGroups',
text: this.showGroupsText,
checked: true,
checkHandler: this.onShowGroupsClick,
scope: this
});
}
this.hmenu.on('beforeshow', this.beforeMenuShow, this);
}
},
// private
renderRows : function(){
var groupField = this.getGroupField();
var eg = !!groupField;
// if they turned off grouping and the last grouped field is hidden
if(this.hideGroupedColumn) {
var colIndex = this.cm.findColumnIndex(groupField),
hasLastGroupField = Ext.isDefined(this.lastGroupField);
if(!eg && hasLastGroupField){
this.mainBody.update('');
this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField), false);
delete this.lastGroupField;
}else if (eg && !hasLastGroupField){
this.lastGroupField = groupField;
this.cm.setHidden(colIndex, true);
}else if (eg && hasLastGroupField && groupField !== this.lastGroupField) {
this.mainBody.update('');
var oldIndex = this.cm.findColumnIndex(this.lastGroupField);
this.cm.setHidden(oldIndex, false);
this.lastGroupField = groupField;
this.cm.setHidden(colIndex, true);
}
}
return Ext.grid.GroupingView.superclass.renderRows.apply(
this, arguments);
},
// private
doRender : function(cs, rs, ds, startRow, colCount, stripe){
if(rs.length < 1){
return '';
}
if(!this.canGroup() || this.isUpdating){
return Ext.grid.GroupingView.superclass.doRender.apply(this, arguments);
}
var groupField = this.getGroupField(),
colIndex = this.cm.findColumnIndex(groupField),
g,
gstyle = 'width:' + this.getTotalWidth() + ';',
cfg = this.cm.config[colIndex],
groupRenderer = cfg.groupRenderer || cfg.renderer,
prefix = this.showGroupName ? (cfg.groupName || cfg.header)+': ' : '',
groups = [],
curGroup, i, len, gid;
for(i = 0, len = rs.length; i < len; i++){
var rowIndex = startRow + i,
r = rs[i],
gvalue = r.data[groupField];
g = this.getGroup(gvalue, r, groupRenderer, rowIndex, colIndex, ds);
if(!curGroup || curGroup.group != g){
gid = this.constructId(gvalue, groupField, colIndex);
// if state is defined use it, however state is in terms of expanded
// so negate it, otherwise use the default.
this.state[gid] = !(Ext.isDefined(this.state[gid]) ? !this.state[gid] : this.startCollapsed);
curGroup = {
group: g,
gvalue: gvalue,
text: prefix + g,
groupId: gid,
startRow: rowIndex,
rs: [r],
cls: this.state[gid] ? '' : 'x-grid-group-collapsed',
style: gstyle
};
groups.push(curGroup);
}else{
curGroup.rs.push(r);
}
r._groupId = gid;
}
var buf = [];
for(i = 0, len = groups.length; i < len; i++){
g = groups[i];
this.doGroupStart(buf, g, cs, ds, colCount);
buf[buf.length] = Ext.grid.GroupingView.superclass.doRender.call(
this, cs, g.rs, ds, g.startRow, colCount, stripe);
this.doGroupEnd(buf, g, cs, ds, colCount);
}
return buf.join('');
},
/**
* Dynamically tries to determine the groupId of a specific value
* @param {String} value
* @return {String} The group id
*/
getGroupId : function(value){
var field = this.getGroupField();
return this.constructId(value, field, this.cm.findColumnIndex(field));
},
// private
constructId : function(value, field, idx){
var cfg = this.cm.config[idx],
groupRenderer = cfg.groupRenderer || cfg.renderer,
val = (this.groupMode == 'value') ? value : this.getGroup(value, {data:{}}, groupRenderer, 0, idx, this.ds);
return this.getPrefix(field) + Ext.util.Format.htmlEncode(val);
},
// private
canGroup : function(){
return this.enableGrouping && !!this.getGroupField();
},
// private
getPrefix: function(field){
return this.grid.getGridEl().id + '-gp-' + field + '-';
},
// private
doGroupStart : function(buf, g, cs, ds, colCount){
buf[buf.length] = this.startGroup.apply(g);
},
// private
doGroupEnd : function(buf, g, cs, ds, colCount){
buf[buf.length] = this.endGroup;
},
// private
getRows : function(){
if(!this.canGroup()){
return Ext.grid.GroupingView.superclass.getRows.call(this);
}
var r = [],
gs = this.getGroups(),
g,
i = 0,
len = gs.length,
j,
jlen;
for(; i < len; ++i){
g = gs[i].childNodes[1];
if(g){
g = g.childNodes;
for(j = 0, jlen = g.length; j < jlen; ++j){
r[r.length] = g[j];
}
}
}
return r;
},
// private
updateGroupWidths : function(){
if(!this.canGroup() || !this.hasRows()){
return;
}
var tw = Math.max(this.cm.getTotalWidth(), this.el.dom.offsetWidth-this.getScrollOffset()) +'px';
var gs = this.getGroups();
for(var i = 0, len = gs.length; i < len; i++){
gs[i].firstChild.style.width = tw;
}
},
// private
onColumnWidthUpdated : function(col, w, tw){
Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this, col, w, tw);
this.updateGroupWidths();
},
// private
onAllColumnWidthsUpdated : function(ws, tw){
Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this, ws, tw);
this.updateGroupWidths();
},
// private
onColumnHiddenUpdated : function(col, hidden, tw){
Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this, col, hidden, tw);
this.updateGroupWidths();
},
// private
onLayout : function(){
this.updateGroupWidths();
},
// private
onBeforeRowSelect : function(sm, rowIndex){
this.toggleRowIndex(rowIndex, true);
}
});
// private
Ext.grid.GroupingView.GROUP_ID = 1000;

7
lib/javascript/extjs/pkgs/pkg-grid-grouping.js
File diff suppressed because it is too large
View File

468
lib/javascript/extjs/pkgs/pkg-grid-property-debug.js

@ -0,0 +1,468 @@
/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
/**
* @class Ext.grid.PropertyRecord
* A specific {@link Ext.data.Record} type that represents a name/value pair and is made to work with the
* {@link Ext.grid.PropertyGrid}. Typically, PropertyRecords do not need to be created directly as they can be
* created implicitly by simply using the appropriate data configs either via the {@link Ext.grid.PropertyGrid#source}
* config property or by calling {@link Ext.grid.PropertyGrid#setSource}. However, if the need arises, these records
* can also be created explicitly as shwon below. Example usage:
* <pre><code>
var rec = new Ext.grid.PropertyRecord({
name: 'Birthday',
value: new Date(Date.parse('05/26/1972'))
});
// Add record to an already populated grid
grid.store.addSorted(rec);
</code></pre>
* @constructor
* @param {Object} config A data object in the format: {name: [name], value: [value]}. The specified value's type
* will be read automatically by the grid to determine the type of editor to use when displaying it.
*/
Ext.grid.PropertyRecord = Ext.data.Record.create([
{name:'name',type:'string'}, 'value'
]);
/**
* @class Ext.grid.PropertyStore
* @extends Ext.util.Observable
* A custom wrapper for the {@link Ext.grid.PropertyGrid}'s {@link Ext.data.Store}. This class handles the mapping
* between the custom data source objects supported by the grid and the {@link Ext.grid.PropertyRecord} format
* required for compatibility with the underlying store. Generally this class should not need to be used directly --
* the grid's data should be accessed from the underlying store via the {@link #store} property.
* @constructor
* @param {Ext.grid.Grid} grid The grid this store will be bound to
* @param {Object} source The source data config object
*/
Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, {
constructor : function(grid, source){
this.grid = grid;
this.store = new Ext.data.Store({
recordType : Ext.grid.PropertyRecord
});
this.store.on('update', this.onUpdate, this);
if(source){
this.setSource(source);
}
Ext.grid.PropertyStore.superclass.constructor.call(this);
},
// protected - should only be called by the grid. Use grid.setSource instead.
setSource : function(o){
this.source = o;
this.store.removeAll();
var data = [];
for(var k in o){
if(this.isEditableValue(o[k])){
data.push(new Ext.grid.PropertyRecord({name: k, value: o[k]}, k));
}
}
this.store.loadRecords({records: data}, {}, true);
},
// private
onUpdate : function(ds, record, type){
if(type == Ext.data.Record.EDIT){
var v = record.data.value;
var oldValue = record.modified.value;
if(this.grid.fireEvent('beforepropertychange', this.source, record.id, v, oldValue) !== false){
this.source[record.id] = v;
record.commit();
this.grid.fireEvent('propertychange', this.source, record.id, v, oldValue);
}else{
record.reject();
}
}
},
// private
getProperty : function(row){
return this.store.getAt(row);
},
// private
isEditableValue: function(val){
return Ext.isPrimitive(val) || Ext.isDate(val);
},
// private
setValue : function(prop, value, create){
var r = this.getRec(prop);
if(r){
r.set('value', value);
this.source[prop] = value;
}else if(create){
// only create if specified.
this.source[prop] = value;
r = new Ext.grid.PropertyRecord({name: prop, value: value}, prop);
this.store.add(r);
}
},
// private
remove : function(prop){
var r = this.getRec(prop);
if(r){
this.store.remove(r);
delete this.source[prop];
}
},
// private
getRec : function(prop){
return this.store.getById(prop);
},
// protected - should only be called by the grid. Use grid.getSource instead.
getSource : function(){
return this.source;
}
});
/**
* @class Ext.grid.PropertyColumnModel
* @extends Ext.grid.ColumnModel
* A custom column model for the {@link Ext.grid.PropertyGrid}. Generally it should not need to be used directly.
* @constructor
* @param {Ext.grid.Grid} grid The grid this store will be bound to
* @param {Object} source The source data config object
*/
Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, {
// private - strings used for locale support
nameText : 'Name',
valueText : 'Value',
dateFormat : 'm/j/Y',
trueText: 'true',
falseText: 'false',
constructor : function(grid, store){
var g = Ext.grid,
f = Ext.form;
this.grid = grid;
g.PropertyColumnModel.superclass.constructor.call(this, [
{header: this.nameText, width:50, sortable: true, dataIndex:'name', id: 'name', menuDisabled:true},
{header: this.valueText, width:50, resizable:false, dataIndex: 'value', id: 'value', menuDisabled:true}
]);
this.store = store;
var bfield = new f.Field({
autoCreate: {tag: 'select', children: [
{tag: 'option', value: 'true', html: this.trueText},
{tag: 'option', value: 'false', html: this.falseText}
]},
getValue : function(){
return this.el.dom.value == 'true';
}
});
this.editors = {
'date' : new g.GridEditor(new f.DateField({selectOnFocus:true})),
'string' : new g.GridEditor(new f.TextField({selectOnFocus:true})),
'number' : new g.GridEditor(new f.NumberField({selectOnFocus:true, style:'text-align:left;'})),
'boolean' : new g.GridEditor(bfield, {
autoSize: 'both'
})
};
this.renderCellDelegate = this.renderCell.createDelegate(this);
this.renderPropDelegate = this.renderProp.createDelegate(this);
},
// private
renderDate : function(dateVal){
return dateVal.dateFormat(this.dateFormat);
},
// private
renderBool : function(bVal){
return this[bVal ? 'trueText' : 'falseText'];
},
// private
isCellEditable : function(colIndex, rowIndex){
return colIndex == 1;
},
// private
getRenderer : function(col){
return col == 1 ?
this.renderCellDelegate : this.renderPropDelegate;
},
// private
renderProp : function(v){
return this.getPropertyName(v);
},
// private
renderCell : function(val, meta, rec){
var renderer = this.grid.customRenderers[rec.get('name')];
if(renderer){
return renderer.apply(this, arguments);
}
var rv = val;
if(Ext.isDate(val)){
rv = this.renderDate(val);
}else if(typeof val == 'boolean'){
rv = this.renderBool(val);
}
return Ext.util.Format.htmlEncode(rv);
},
// private
getPropertyName : function(name){
var pn = this.grid.propertyNames;
return pn && pn[name] ? pn[name] : name;
},
// private
getCellEditor : function(colIndex, rowIndex){
var p = this.store.getProperty(rowIndex),
n = p.data.name,
val = p.data.value;
if(this.grid.customEditors[n]){
return this.grid.customEditors[n];
}
if(Ext.isDate(val)){
return this.editors.date;
}else if(typeof val == 'number'){
return this.editors.number;
}else if(typeof val == 'boolean'){
return this.editors['boolean'];
}else{
return this.editors.string;
}
},
// inherit docs
destroy : function(){
Ext.grid.PropertyColumnModel.superclass.destroy.call(this);
this.destroyEditors(this.editors);
this.destroyEditors(this.grid.customEditors);
},
destroyEditors: function(editors){
for(var ed in editors){
Ext.destroy(editors[ed]);
}
}
});
/**
* @class Ext.grid.PropertyGrid
* @extends Ext.grid.EditorGridPanel
* A specialized grid implementation intended to mimic the traditional property grid as typically seen in
* development IDEs. Each row in the grid represents a property of some object, and the data is stored
* as a set of name/value pairs in {@link Ext.grid.PropertyRecord}s. Example usage:
* <pre><code>
var grid = new Ext.grid.PropertyGrid({
title: 'Properties Grid',
autoHeight: true,
width: 300,
renderTo: 'grid-ct',
source: {
"(name)": "My Object",
"Created": new Date(Date.parse('10/15/2006')),
"Available": false,
"Version": .01,
"Description": "A test object"
}
});
</code></pre>
* @constructor
* @param {Object} config The grid config object
*/
Ext.grid.PropertyGrid = Ext.extend(Ext.grid.EditorGridPanel, {
/**
* @cfg {Object} propertyNames An object containing property name/display name pairs.
* If specified, the display name will be shown in the name column instead of the property name.
*/
/**
* @cfg {Object} source A data object to use as the data source of the grid (see {@link #setSource} for details).
*/
/**
* @cfg {Object} customEditors An object containing name/value pairs of custom editor type definitions that allow
* the grid to support additional types of editable fields. By default, the grid supports strongly-typed editing
* of strings, dates, numbers and booleans using built-in form editors, but any custom type can be supported and
* associated with a custom input control by specifying a custom editor. The name of the editor
* type should correspond with the name of the property that will use the editor. Example usage:
* <pre><code>
var grid = new Ext.grid.PropertyGrid({
...
customEditors: {
'Start Time': new Ext.grid.GridEditor(new Ext.form.TimeField({selectOnFocus:true}))
},
source: {
'Start Time': '10:00 AM'
}
});
</code></pre>
*/
/**
* @cfg {Object} source A data object to use as the data source of the grid (see {@link #setSource} for details).
*/
/**
* @cfg {Object} customRenderers An object containing name/value pairs of custom renderer type definitions that allow
* the grid to support custom rendering of fields. By default, the grid supports strongly-typed rendering
* of strings, dates, numbers and booleans using built-in form editors, but any custom type can be supported and
* associated with the type of the value. The name of the renderer type should correspond with the name of the property
* that it will render. Example usage:
* <pre><code>
var grid = new Ext.grid.PropertyGrid({
...
customRenderers: {
Available: function(v){
if(v){
return '<span style="color: green;">Yes</span>';
}else{
return '<span style="color: red;">No</span>';
}
}
},
source: {
Available: true
}
});
</code></pre>
*/
// private config overrides
enableColumnMove:false,
stripeRows:false,
trackMouseOver: false,
clicksToEdit:1,
enableHdMenu : false,
viewConfig : {
forceFit:true
},
// private
initComponent : function(){
this.customRenderers = this.customRenderers || {};
this.customEditors = this.customEditors || {};
this.lastEditRow = null;
var store = new Ext.grid.PropertyStore(this);
this.propStore = store;
var cm = new Ext.grid.PropertyColumnModel(this, store);
store.store.sort('name', 'ASC');
this.addEvents(
/**
* @event beforepropertychange
* Fires before a property value changes. Handlers can return false to cancel the property change
* (this will internally call {@link Ext.data.Record#reject} on the property's record).
* @param {Object} source The source data object for the grid (corresponds to the same object passed in
* as the {@link #source} config property).
* @param {String} recordId The record's id in the data store
* @param {Mixed} value The current edited property value
* @param {Mixed} oldValue The original property value prior to editing
*/
'beforepropertychange',
/**
* @event propertychange
* Fires after a property value has changed.
* @param {Object} source The source data object for the grid (corresponds to the same object passed in
* as the {@link #source} config property).
* @param {String} recordId The record's id in the data store
* @param {Mixed} value The current edited property value
* @param {Mixed} oldValue The original property value prior to editing
*/
'propertychange'
);
this.cm = cm;
this.ds = store.store;
Ext.grid.PropertyGrid.superclass.initComponent.call(this);
this.mon(this.selModel, 'beforecellselect', function(sm, rowIndex, colIndex){
if(colIndex === 0){
this.startEditing.defer(200, this, [rowIndex, 1]);
return false;
}
}, this);
},
// private
onRender : function(){
Ext.grid.PropertyGrid.superclass.onRender.apply(this, arguments);
this.getGridEl().addClass('x-props-grid');
},
// private
afterRender: function(){
Ext.grid.PropertyGrid.superclass.afterRender.apply(this, arguments);
if(this.source){
this.setSource(this.source);
}
},
/**
* Sets the source data object containing the property data. The data object can contain one or more name/value
* pairs representing all of the properties of an object to display in the grid, and this data will automatically
* be loaded into the grid's {@link #store}. The values should be supplied in the proper data type if needed,
* otherwise string type will be assumed. If the grid already contains data, this method will replace any
* existing data. See also the {@link #source} config value. Example usage:
* <pre><code>
grid.setSource({
"(name)": "My Object",
"Created": new Date(Date.parse('10/15/2006')), // date type
"Available": false, // boolean type
"Version": .01, // decimal type
"Description": "A test object"
});
</code></pre>
* @param {Object} source The data object
*/
setSource : function(source){
this.propStore.setSource(source);
},
/**
* Gets the source data object containing the property data. See {@link #setSource} for details regarding the
* format of the data object.
* @return {Object} The data object
*/
getSource : function(){
return this.propStore.getSource();
},
/**
* Sets the value of a property.
* @param {String} prop The name of the property to set
* @param {Mixed} value The value to test
* @param {Boolean} create (Optional) True to create the property if it doesn't already exist. Defaults to <tt>false</tt>.
*/
setProperty : function(prop, value, create){
this.propStore.setValue(prop, value, create);
},
/**
* Removes a property from the grid.
* @param {String} prop The name of the property to remove
*/
removeProperty : function(prop){
this.propStore.remove(prop);
}
/**
* @cfg store
* @hide
*/
/**
* @cfg colModel
* @hide
*/
/**
* @cfg cm
* @hide
*/
/**
* @cfg columns
* @hide
*/
});
Ext.reg("propertygrid", Ext.grid.PropertyGrid);

7
lib/javascript/extjs/pkgs/pkg-grid-property.js

@ -0,0 +1,7 @@
/*
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);Ext.grid.PropertyStore=Ext.extend(Ext.util.Observable,{constructor:function(a,b){this.grid=a;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);if(b){this.setSource(b)}Ext.grid.PropertyStore.superclass.constructor.call(this)},setSource:function(c){this.source=c;this.store.removeAll();var b=[];for(var a in c){if(this.isEditableValue(c[a])){b.push(new Ext.grid.PropertyRecord({name:a,value:c[a]},a))}}this.store.loadRecords({records:b},{},true)},onUpdate:function(e,a,d){if(d==Ext.data.Record.EDIT){var b=a.data.value;var c=a.modified.value;if(this.grid.fireEvent("beforepropertychange",this.source,a.id,b,c)!==false){this.source[a.id]=b;a.commit();this.grid.fireEvent("propertychange",this.source,a.id,b,c)}else{a.reject()}}},getProperty:function(a){return this.store.getAt(a)},isEditableValue:function(a){return Ext.isPrimitive(a)||Ext.isDate(a)},setValue:function(d,c,a){var b=this.getRec(d);if(b){b.set("value",c);this.source[d]=c}else{if(a){this.source[d]=c;b=new Ext.grid.PropertyRecord({name:d,value:c},d);this.store.add(b)}}},remove:function(b){var a=this.getRec(b);if(a){this.store.remove(a);delete this.source[b]}},getRec:function(a){return this.store.getById(a)},getSource:function(){return this.source}});Ext.grid.PropertyColumnModel=Ext.extend(Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",trueText:"true",falseText:"false",constructor:function(c,b){var d=Ext.grid,e=Ext.form;this.grid=c;d.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:"name",id:"name",menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:"value",id:"value",menuDisabled:true}]);this.store=b;var a=new e.Field({autoCreate:{tag:"select",children:[{tag:"option",value:"true",html:this.trueText},{tag:"option",value:"false",html:this.falseText}]},getValue:function(){return this.el.dom.value=="true"}});this.editors={date:new d.GridEditor(new e.DateField({selectOnFocus:true})),string:new d.GridEditor(new e.TextField({selectOnFocus:true})),number:new d.GridEditor(new e.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new d.GridEditor(a,{autoSize:"both"})};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)},renderDate:function(a){return a.dateFormat(this.dateFormat)},renderBool:function(a){return this[a?"trueText":"falseText"]},isCellEditable:function(a,b){return a==1},getRenderer:function(a){return a==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(a){return this.getPropertyName(a)},renderCell:function(d,b,c){var a=this.grid.customRenderers[c.get("name")];if(a){return a.apply(this,arguments)}var e=d;if(Ext.isDate(d)){e=this.renderDate(d)}else{if(typeof d=="boolean"){e=this.renderBool(d)}}return Ext.util.Format.htmlEncode(e)},getPropertyName:function(b){var a=this.grid.propertyNames;return a&&a[b]?a[b]:b},getCellEditor:function(a,e){var b=this.store.getProperty(e),d=b.data.name,c=b.data.value;if(this.grid.customEditors[d]){return this.grid.customEditors[d]}if(Ext.isDate(c)){return this.editors.date}else{if(typeof c=="number"){return this.editors.number}else{if(typeof c=="boolean"){return this.editors["boolean"]}else{return this.editors.string}}}},destroy:function(){Ext.grid.PropertyColumnModel.superclass.destroy.call(this);this.destroyEditors(this.editors);this.destroyEditors(this.grid.customEditors)},destroyEditors:function(b){for(var a in b){Ext.destroy(b[a])}}});Ext.grid.PropertyGrid=Ext.extend(Ext.grid.EditorGridPanel,{enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1,enableHdMenu:false,viewConfig:{forceFit:true},initComponent:function(){this.customRenderers=this.customRenderers||{};this.customEditors=this.customEditors||{};this.lastEditRow=null;var b=new Ext.grid.PropertyStore(this);this.propStore=b;var a=new Ext.grid.PropertyColumnModel(this,b);b.store.sort("name","ASC");this.addEvents("beforepropertychange","propertychange");this.cm=a;this.ds=b.store;Ext.grid.PropertyGrid.superclass.initComponent.call(this);this.mon(this.selModel,"beforecellselect",function(e,d,c){if(c===0){this.startEditing.defer(200,this,[d,1]);return false}},this)},onRender:function(){Ext.grid.PropertyGrid.superclass.onRender.apply(this,arguments);this.getGridEl().addClass("x-props-grid")},afterRender:function(){Ext.grid.PropertyGrid.superclass.afterRender.apply(this,arguments);if(this.source){this.setSource(this.source)}},setSource:function(a){this.propStore.setSource(a)},getSource:function(){return this.propStore.getSource()},setProperty:function(c,b,a){this.propStore.setValue(c,b,a)},removeProperty:function(a){this.propStore.remove(a)}});Ext.reg("propertygrid",Ext.grid.PropertyGrid);

216
lib/javascript/extjs/pkgs/pkg-history-debug.js

@ -0,0 +1,216 @@
/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
/**
* @class Ext.History
* @extends Ext.util.Observable
* History management component that allows you to register arbitrary tokens that signify application
* history state on navigation actions. You can then handle the history {@link #change} event in order
* to reset your application UI to the appropriate state when the user navigates forward or backward through
* the browser history stack.
* @singleton
*/
Ext.History = (function () {
var iframe, hiddenField;
var ready = false;
var currentToken;
function getHash() {
var href = location.href, i = href.indexOf("#");
return i >= 0 ? href.substr(i + 1) : null;
}
function doSave() {
hiddenField.value = currentToken;
}
function handleStateChange(token) {
currentToken = token;
Ext.History.fireEvent('change', token);
}
function updateIFrame (token) {
var html = ['<html><body><div id="state">',Ext.util.Format.htmlEncode(token),'</div></body></html>'].join('');
try {
var doc = iframe.contentWindow.document;
doc.open();
doc.write(html);
doc.close();
return true;
} catch (e) {
return false;
}
}
function checkIFrame() {
if (!iframe.contentWindow || !iframe.contentWindow.document) {
setTimeout(checkIFrame, 10);
return;
}
var doc = iframe.contentWindow.document;
var elem = doc.getElementById("state");
var token = elem ? elem.innerText : null;
var hash = getHash();
setInterval(function () {
doc = iframe.contentWindow.document;
elem = doc.getElementById("state");
var newtoken = elem ? elem.innerText : null;
var newHash = getHash();
if (newtoken !== token) {
token = newtoken;
handleStateChange(token);
top.location.hash = token;
hash = token;
doSave();
} else if (newHash !== hash) {
hash = newHash;
updateIFrame(newHash);
}
}, 50);
ready = true;
Ext.History.fireEvent('ready', Ext.History);
}
function startUp() {
currentToken = hiddenField.value ? hiddenField.value : getHash();
if (Ext.isIE) {
checkIFrame();
} else {
var hash = getHash();
setInterval(function () {
var newHash = getHash();
if (newHash !== hash) {
hash = newHash;
handleStateChange(hash);
doSave();
}
}, 50);
ready = true;
Ext.History.fireEvent('ready', Ext.History);
}
}
return {
/**
* The id of the hidden field required for storing the current history token.
* @type String
* @property
*/
fieldId: 'x-history-field',
/**
* The id of the iframe required by IE to manage the history stack.
* @type String
* @property
*/
iframeId: 'x-history-frame',
events:{},
/**
* Initialize the global History instance.
* @param {Boolean} onReady (optional) A callback function that will be called once the history
* component is fully initialized.
* @param {Object} scope (optional) The scope (<code>this</code> reference) in which the callback is executed. Defaults to the browser window.
*/
init: function (onReady, scope) {
if(ready) {
Ext.callback(onReady, scope, [this]);
return;
}
if(!Ext.isReady){
Ext.onReady(function(){
Ext.History.init(onReady, scope);
});
return;
}
hiddenField = Ext.getDom(Ext.History.fieldId);
if (Ext.isIE) {
iframe = Ext.getDom(Ext.History.iframeId);
}
this.addEvents(
/**
* @event ready
* Fires when the Ext.History singleton has been initialized and is ready for use.
* @param {Ext.History} The Ext.History singleton.
*/
'ready',
/**
* @event change
* Fires when navigation back or forwards within the local page's history occurs.
* @param {String} token An identifier associated with the page state at that point in its history.
*/
'change'
);
if(onReady){
this.on('ready', onReady, scope, {single:true});
}
startUp();
},
/**
* Add a new token to the history stack. This can be any arbitrary value, although it would
* commonly be the concatenation of a component id and another id marking the specifc history
* state of that component. Example usage:
* <pre><code>
// Handle tab changes on a TabPanel
tabPanel.on('tabchange', function(tabPanel, tab){
Ext.History.add(tabPanel.id + ':' + tab.id);
});
</code></pre>
* @param {String} token The value that defines a particular application-specific history state
* @param {Boolean} preventDuplicates When true, if the passed token matches the current token
* it will not save a new history step. Set to false if the same state can be saved more than once
* at the same history stack location (defaults to true).
*/
add: function (token, preventDup) {
if(preventDup !== false){
if(this.getToken() == token){
return true;
}
}
if (Ext.isIE) {
return updateIFrame(token);
} else {
top.location.hash = token;
return true;
}
},
/**
* Programmatically steps back one step in browser history (equivalent to the user pressing the Back button).
*/
back: function(){
history.go(-1);
},
/**
* Programmatically steps forward one step in browser history (equivalent to the user pressing the Forward button).
*/
forward: function(){
history.go(1);
},
/**
* Retrieves the currently-active history token.
* @return {String} The token
*/
getToken: function() {
return ready ? currentToken : getHash();
}
};
})();
Ext.apply(Ext.History, new Ext.util.Observable());

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save